-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
330 lines (281 loc) · 9.23 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
{
description = "My NixOs Configuration using home-manager with flakes";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nur.url = "github:nix-community/NUR";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
codestats-nvim = {
url = "github:YannickFricke/codestats.nvim";
flake = false;
};
wakatime-cli = {
url = "github:wakatime/wakatime-cli";
flake = false;
};
zsh-wakatime = {
url = "github:wbingli/zsh-wakatime";
flake = false;
};
secrets.url = "git+ssh://[email protected]/iliayar/dotfiles-secrets.git";
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
libxft-bgra = {
url = "github:uditkarode/libxft-bgra";
flake = false;
};
org-roam-ui = {
url = "github:org-roam/org-roam-ui";
flake = false;
};
lean4-mode = {
url = "github:leanprover-community/lean4-mode";
flake = false;
};
picom-jonaburg = {
url = "github:jonaburg/picom";
flake = false;
};
tlpui-src = {
url = "github:d4nj1/TLPUI";
flake = false;
};
rust-blocks = {
url = "github:iliayar/rust-blocks";
inputs.nixpkgs.follows = "nixpkgs";
};
uci = {
url = "git+ssh://[email protected]/iliayar/uci.git";
# url = "path:/home/iliayar/Repos/microci";
# inputs.nixpkgs.follows = "nixpkgs";
};
pyprland-newest = {
url = "github:hyprland-community/pyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
pyprland-my = {
url = "github:iliayar/pyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
anyrun = {
url = "github:Kirottu/anyrun";
inputs.nixpkgs.follows = "nixpkgs";
};
nwg-displays = {
url = "github:nwg-piotr/nwg-displays";
inputs.nixpkgs.follows = "nixpkgs";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
denv = {
url = "github:iliayar/env.nix";
# url = "path:/home/iliayar/Repos/env.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
wezterm-newest = {
url = "github:wez/wezterm?dir=nix";
flake = true;
# NOTE: This is vital. To match GL versions,
# because wezterm links to its own libGL, but
inputs.nixpkgs.follows = "nixpkgs";
};
obsidian-nvim = {
url = "github:epwalsh/obsidian.nvim";
flake = false;
};
remote-nvim = {
url = "github:amitds1997/remote-nvim.nvim";
# url = "path:/home/iliayar/Repos/remote-nvim.nvim";
flake = false;
};
coq-lsp-nvim = {
url = "github:tomtomjhj/coq-lsp.nvim";
flake = false;
};
deploy-rs.url = "github:serokell/deploy-rs";
};
outputs = { self, home-manager, nixpkgs, codestats-nvim, secrets
, emacs-overlay, libxft-bgra, org-roam-ui, picom-jonaburg, wakatime-cli
, zsh-wakatime, tlpui-src, rust-blocks, nur, uci, anyrun, nwg-displays
, rust-overlay, denv, wezterm-newest, pyprland-newest, obsidian-nvim
, lean4-mode, pyprland-my, remote-nvim, coq-lsp-nvim, deploy-rs, ... }@inputs:
let
config = system:
let
overlays = [ emacs-overlay.overlay rust-overlay.overlays.default ]
++ (import ./modules/overlays (inputs // { inherit system; }));
nixpkgs-config = {
inherit system overlays;
config.allowUnfree = true;
config.permittedInsecurePackages = [ "electron-25.9.0" ];
};
pkgs = import nixpkgs nixpkgs-config;
mylib = import ./modules/lib.nix { inherit pkgs; };
themes = import ./modules/themes { inherit mylib; };
specialArgs = {
inherit home-manager libxft-bgra org-roam-ui
picom-jonaburg wakatime-cli zsh-wakatime mylib tlpui-src system
anyrun wezterm-newest pyprland-newest obsidian-nvim lean4-mode
pyprland-my codestats-nvim remote-nvim coq-lsp-nvim;
secrets = import secrets;
themes = themes;
};
makeHomeProfileImpl = profile:
home-manager.lib.homeManagerConfiguration rec {
inherit pkgs;
extraSpecialArgs = specialArgs // { inherit pkgs system; };
modules = [
denv.homeManagerModules.default
anyrun.homeManagerModules.default
./modules
profile
];
};
makeHomeProfile = name: makeHomeProfileImpl ./profiles/${name}.nix;
makeProfiles = pkgs.lib.foldl
(acc: name: acc // { ${name} = makeHomeProfile name; }) { };
dellLaptop = let
modules = [
nur.nixosModules.nur
./hosts/dellLaptop/configuration.nix
./cachix.nix
{
nixpkgs = nixpkgs-config;
nix = {
gc = {
automatic = true;
options = "--delete-older-than 3d";
};
};
}
];
in nixpkgs.lib.nixosSystem { inherit system modules specialArgs; };
pc = let
modules = [
# nur.nixosModules.nur
./hosts/pc/configuration.nix
./cachix.nix
{
nixpkgs = nixpkgs-config;
nix = {
gc = {
automatic = true;
options = "--delete-older-than 3d";
};
};
}
];
in nixpkgs.lib.nixosSystem { inherit system modules specialArgs; };
lenovoLaptop = let
modules = [
./hosts/lenovoLaptop/configuration.nix
./cachix.nix
{
nixpkgs = nixpkgs-config;
nix = {
gc = {
automatic = true;
options = "--delete-older-than 3d";
};
};
}
];
in nixpkgs.lib.nixosSystem { inherit system modules specialArgs; };
homeSrv = let
modules = [
./hosts/homeSrv/configuration.nix
./cachix.nix
{
nixpkgs = nixpkgs-config;
nix = {
gc = {
automatic = true;
options = "--delete-older-than 3d";
};
};
}
];
in nixpkgs.lib.nixosSystem { inherit system modules specialArgs; };
homeConfigurations = (makeProfiles [
"heavy"
"ubuntu-virt"
"work"
"work-linux"
"home-server-ci"
"home-server"
]) // {
wsl = home-manager.lib.homeManagerConfiguration rec {
inherit pkgs;
extraSpecialArgs = specialArgs // { inherit pkgs system; };
modules = [ ./hosts/wsl/home.nix ];
};
};
nixosConfigurations = {
NixLaptop = dellLaptop;
NixLenovo = lenovoLaptop;
NixServer = homeSrv;
NixPC = pc;
};
deployPkgs = import nixpkgs {
inherit system;
overlays = [
deploy-rs.overlay # or deploy-rs.overlays.default
(self: super: {
deploy-rs = {
inherit (pkgs) deploy-rs;
lib = super.deploy-rs.lib;
};
})
];
};
deploySystemPaths = {
homeServer = deployPkgs.deploy-rs.lib.activate.nixos
nixosConfigurations.NixServer;
homeServerCi = deployPkgs.deploy-rs.lib.activate.home-manager
homeConfigurations.home-server-ci;
homeServerDev = deployPkgs.deploy-rs.lib.activate.home-manager
homeConfigurations.home-server;
};
in {
inherit homeConfigurations nixosConfigurations deploySystemPaths;
makeHomeConfiguration = makeHomeProfileImpl;
};
in {
makeHomeConfiguration."x86_64-linux" =
(config "x86_64-linux").makeHomeConfiguration;
nixosConfigurations = {
NixLaptop = (config "x86_64-linux").nixosConfigurations.NixLaptop;
NixPC = (config "x86_64-linux").nixosConfigurations.NixPC;
};
homeConfigurations = {
heavy = (config "x86_64-linux").homeConfigurations.heavy;
};
deploy.nodes = {
homeServer = {
hostname = "home.iliayar.net";
profilesOrder = [ "system" "ci" "iliayar" ];
profiles.system = {
user = "root";
sshUser = "root";
path = (config "x86_64-linux").deploySystemPaths.homeServer;
};
profiles.ci = {
user = "ci";
sshUser = "ci";
path = (config "x86_64-linux").deploySystemPaths.homeServerCi;
};
profiles.dev = {
user = "iliayar";
sshUser = "iliayar";
path = (config "x86_64-linux").deploySystemPaths.homeServerDev;
};
};
};
};
}