-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
308 lines (279 loc) · 10.7 KB
/
flake.nix
File metadata and controls
308 lines (279 loc) · 10.7 KB
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
{
description = "vai's nix configuration flake";
inputs = {
# nix
## nix packages
nixpkgs.url = "github:nixos/nixpkgs/release-25.11";
## nix user package repository
nur = {
url = "github:nix-community/nur";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-parts.follows = "flake-parts";
};
};
## apple silicon support
nixos-apple-silicon = {
url = "github:nix-community/nixos-apple-silicon/release-25.11";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-compat.follows = "flake-compat";
};
};
## nix for macos
nix-darwin = {
url = "github:nix-darwin/nix-darwin/nix-darwin-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
## home manager
home-manager = {
url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
## nix helper
nh = {
url = "github:nix-community/nh/v4.2.0";
inputs.nixpkgs.follows = "nixpkgs";
};
## stylix themeing
stylix = {
url = "github:nix-community/stylix/release-25.11";
inputs = {
nixpkgs.follows = "nixpkgs";
nur.follows = "nur";
# flake follows
systems.follows = "systems";
flake-parts.follows = "flake-parts";
};
};
# common flake inputs
## generic for supported systems
systems.url = "github:nix-systems/default";
## flake compatibilty for versions of nix
flake-compat = {
url = "github:nixos/flake-compat";
flake = false;
};
## modular (opinionated) nix flakes
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
# flake tools (thanks numtide)
## flake blueprint
blueprint = {
url = "github:numtide/blueprint";
inputs = {
nixpkgs.follows = "nixpkgs";
# flake follows
systems.follows = "systems";
};
};
## nix-shell configuration
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
## declarative formatter
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# custom packages
## nvf nix+neovim module
nvf = {
url = "github:notashelf/nvf";
inputs = {
nixpkgs.follows = "nixpkgs";
# flake follows
systems.follows = "systems";
flake-parts.follows = "flake-parts";
flake-compat.follows = "flake-compat";
};
};
## neovim config (using nvf)
nvf-config = {
url = "github:vaisriv/nvf-config";
inputs = {
nixpkgs.follows = "nixpkgs";
# flake follows
systems.follows = "systems";
# numtide follows
blueprint.follows = "blueprint";
devshell.follows = "devshell";
treefmt-nix.follows = "treefmt-nix";
# nvf
nvf.follows = "nvf";
};
};
};
outputs =
inputs@{ self, nixpkgs, ... }:
let
forEachSystem = f: nixpkgs.lib.genAttrs (import inputs.systems) (system: f (pkgsFor system));
pkgsFor = system: import nixpkgs (import ./nixpkgs.nix { inherit inputs system; });
username = "vai";
fullname = "Vai Srivastava";
email = "vaisriv@icloud.com";
specialArgs = {
inherit
self
inputs
username
fullname
email
;
};
in
{
overlays = import ./nix/overlays;
nixosModules = import ./nix/nixosModules;
darwinModules = import ./nix/darwinModules;
homeModules = import ./nix/homeModules;
formatter = forEachSystem (
pkgs:
import ./nix/formatter.nix {
inherit pkgs;
inherit inputs;
}
);
devShells = forEachSystem (pkgs: {
default = import ./nix/devshell.nix {
inherit pkgs;
inherit inputs;
};
});
nixosConfigurations = {
# FIXME: disabled both nixosSystems, as i have not built/used them in over a year
# olorin = let
# system = "aarch64-linux";
# in
# inputs.nixpkgs.lib.nixosSystem {
# pkgs = pkgsFor system;
#
# inherit specialArgs;
#
# modules = [
# ./nixos/hosts/olorin
#
# inputs.home-manager.nixosModules.home-manager
# {
# home-manager = {
# extraSpecialArgs = specialArgs;
# backupFileExtension = "bak";
#
# useUserPackages = true;
# users.${username} = import ./home/hosts/olorin;
#
# sharedModules = [
# inputs.nur.modules.homeManager.default
# inputs.stylix.homeModules.stylix
#
# {
# nixpkgs = import ./nixpkgs.nix {
# inherit inputs;
# inherit system;
# };
# }
# ];
# };
# }
#
# inputs.nur.modules.nixos.default
# inputs.nixos-apple-silicon.nixosModules.default
# ];
# };
# tarindor = let
# system = "x86_64-linux";
# in
# inputs.nixpkgs.lib.nixosSystem {
# pkgs = pkgsFor system;
#
# inherit specialArgs;
#
# modules = [
# ./nixos/hosts/tarindor
#
# inputs.home-manager.nixosModules.home-manager
# {
# home-manager = {
# extraSpecialArgs = specialArgs;
# backupFileExtension = "bak";
#
# useUserPackages = true;
# users.${username} = import ./home/hosts/tarindor;
#
# sharedModules = [
# inputs.nur.modules.homeManager.default
# inputs.stylix.homeModules.stylix
#
# {
# nixpkgs = import ./nixpkgs.nix {
# inherit inputs;
# inherit system;
# };
# }
# ];
# };
# }
#
# inputs.nur.modules.nixos.default
# ];
# };
};
darwinConfigurations = {
olorin-mbp =
let
system = "aarch64-darwin";
in
inputs.nix-darwin.lib.darwinSystem {
pkgs = pkgsFor system;
inherit specialArgs;
modules = [
./darwin/hosts/olorin-mbp
inputs.home-manager.darwinModules.home-manager
{
home-manager = {
extraSpecialArgs = specialArgs;
backupFileExtension = "bak";
useUserPackages = true;
users.${username} = import ./home/hosts/olorin-mbp;
sharedModules = [
inputs.nur.modules.homeManager.default
inputs.stylix.homeModules.stylix
{
nixpkgs = import ./nixpkgs.nix {
inherit inputs;
inherit system;
};
}
];
};
}
inputs.nur.modules.darwin.default
];
};
};
homeConfigurations = {
ubuntu =
let
system = "aarch64-linux";
in
inputs.home-manager.lib.homeManagerConfiguration {
pkgs = pkgsFor system;
extraSpecialArgs = specialArgs;
modules = [
./home/hosts/dev
inputs.nur.modules.homeManager.default
inputs.stylix.homeModules.stylix
{
nixpkgs = import ./nixpkgs.nix {
inherit inputs;
inherit system;
};
}
];
};
};
};
}