-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
151 lines (123 loc) · 4.37 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
naersk.url = "github:nix-community/naersk";
naersk.inputs.nixpkgs.follows = "nixpkgs";
crane.url = "github:ipetkov/crane";
crane.inputs.nixpkgs.follows = "nixpkgs";
hyprland.url = "github:hyprwm/Hyprland";
hyprland-contrib.url = "github:hyprwm/contrib";
hyprland-contrib.inputs.nixpkgs.follows = "nixpkgs";
hyprland-plugins.url = "github:hyprwm/hyprland-plugins";
hyprland-plugins.inputs.hyprland.follows = "hyprland";
hyprspace.url = "github:KZDKM/Hyprspace";
hyprspace.inputs.hyprland.follows = "hyprland";
hyprpicker.url = "github:hyprwm/hyprpicker";
hyprpicker.inputs.nixpkgs.follows = "nixpkgs";
nix-darwin.url = "github:LnL7/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
catppuccinifier.url = "github:lighttigerXIV/catppuccinifier";
catppuccinifier.inputs.nixpkgs.follows = "nixpkgs";
wgsl-analyzer.url = "github:wgsl-analyzer/wgsl-analyzer";
wgsl-analyzer.inputs.nixpkgs.follows = "nixpkgs";
catppuccin.url = "github:catppuccin/nix";
};
outputs = {
nixpkgs,
home-manager,
nix-darwin,
naersk,
crane,
...
} @ inputs: let
overlays = [];
macArgs = import ./platform/mac.nix {inherit inputs overlays;};
linuxArgs = import ./platform/linux.nix {inherit inputs overlays;};
allSpecialArgs = import ./configuration/args {inherit macArgs linuxArgs;};
sharedModules = [
./configuration
];
makeLinux = {args}:
nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = args // {inherit inputs;};
modules =
sharedModules
++ [
home-manager.nixosModules.home-manager
inputs.catppuccin.nixosModules.catppuccin
./tools
{
nixpkgs.overlays = overlays;
home-manager.extraSpecialArgs = specialArgs;
home-manager.useGlobalPkgs = true;
home-manager.users.${allSpecialArgs.shared.username} = {
home.stateVersion = "22.05";
imports = [
./modules/home
inputs.catppuccin.homeManagerModules.catppuccin
];
};
}
];
};
miniSystem = makeLinux {args = allSpecialArgs.mini;};
thinkpadSystem = makeLinux {args = allSpecialArgs.thinkpad;};
thinkpad2System = makeLinux {args = allSpecialArgs.thinkpad2;};
macosSystem = nix-darwin.lib.darwinSystem rec {
specialArgs = allSpecialArgs.macos // {inherit inputs;};
modules =
sharedModules
++ [
home-manager.darwinModules.home-manager
{
nixpkgs.overlays = overlays;
home-manager.extraSpecialArgs = specialArgs;
home-manager.useGlobalPkgs = true;
home-manager.users.${allSpecialArgs.shared.username} = {
home.stateVersion = "22.05";
imports = [
./modules/home
inputs.catppuccin.homeManagerModules.catppuccin
];
};
}
];
};
in {
nixpkgs.config.allowUnfree = true;
nixosConfigurations.mini = miniSystem;
nixosConfigurations.thinkpad = thinkpadSystem;
nixosConfigurations.thinkpad2 = thinkpad2System;
darwinConfigurations."DGQ204V94P" = macosSystem;
homeConfigurations."cameron" = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = allSpecialArgs.server // {inherit inputs;};
pkgs = linuxArgs.pkgs;
modules = [
{home.stateVersion = "23.11";}
./modules/home
];
};
devShells."x86_64-linux".default = with linuxArgs;
pkgs.mkShell {
packages = [
(pkgs.writeShellScriptBin "s" ''
git add -A
eval $(device-manager switch)
'')
];
};
devShells."aarch64-darwin".default = with macArgs;
pkgs.mkShell {
packages = [
(pkgs.writeShellScriptBin "s" ''
git add -A
export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1
nix run nix-darwin --extra-experimental-features flakes --extra-experimental-features nix-command --impure -- switch --flake .
'')
];
};
};
}