-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
248 lines (219 loc) · 6.97 KB
/
Copy pathflake.nix
File metadata and controls
248 lines (219 loc) · 6.97 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
{
description = "My NixOS configs";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nixos-hardware = {
url = "github:nixos/nixos-hardware";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts.url = "github:hercules-ci/flake-parts";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
vaultix = {
url = "github:milieuim/vaultix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
};
nixos-raspberrypi = {
url = "github:nvmd/nixos-raspberrypi/main";
};
};
outputs =
inputs@{
self,
nixpkgs,
nixos-hardware,
disko,
flake-parts,
vaultix,
home-manager,
nixos-raspberrypi,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } (
{ withSystem, ... }:
{
imports = [
# renc need this
vaultix.flakeModules.default
home-manager.flakeModules.default
flake-parts.flakeModules.easyOverlay
];
flake = {
vaultix = {
# vaultix configs
# we only decrypt on nyx and vultr
nodes = nixpkgs.lib.filterAttrs (
name: _:
builtins.elem name [
"nyx"
"vultr"
]
) self.nixosConfigurations;
identity = "./secrets/key.txt";
};
templates = {
rust = {
path = ./templates/rust;
description = "Rust template, using Naersk";
};
bevy = {
path = ./templates/bevy;
description = "Bevy template";
};
python = {
path = ./templates/python;
description = "Python template";
};
cpp = {
path = ./templates/cpp;
description = "C++ template with CMake";
};
typst = {
path = ./templates/typst;
description = "typst template";
};
};
nixosConfigurations = {
# my main laptop x1 carbon 8th gen
nyx = withSystem "x86_64-linux" (
{ system, ... }:
nixpkgs.lib.nixosSystem {
inherit system;
# vaultix & home-manager need this
specialArgs = {
inherit inputs;
};
modules = [
# we are actually 8th gen, but it should be ok?
nixos-hardware.nixosModules.lenovo-thinkpad-x1-7th-gen
disko.nixosModules.disko
./hosts/nyx
# home manager
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.flr = import ./home/users/flr.nix;
}
];
}
);
# my high end desktop machine
desktop = withSystem "x86_64-linux" (
{ system, ... }:
nixpkgs.lib.nixosSystem {
inherit system;
# vaultix & home-manager need this
specialArgs = {
inherit inputs;
};
modules = [
nixos-hardware.nixosModules.common-cpu-amd
nixos-hardware.nixosModules.common-gpu-nvidia-nonprime
nixos-hardware.nixosModules.common-pc-ssd
disko.nixosModules.disko
./hosts/desktop
# home manager
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.flr = import ./home/users/minimal.nix;
}
];
}
);
# my old laptop
x1c = withSystem "x86_64-linux" (
{ system, ... }:
nixpkgs.lib.nixosSystem {
inherit system;
# vaultix & home-manager need this
specialArgs = {
inherit inputs;
};
modules = [
nixos-hardware.nixosModules.common-cpu-intel
nixos-hardware.nixosModules.common-pc-laptop-ssd
disko.nixosModules.disko
./hosts/x1c
# home manager
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.flr = import ./home/users/x11.nix;
}
];
}
);
vultr = withSystem "x86_64-linux" (
{ system, ... }:
nixpkgs.lib.nixosSystem {
inherit system;
# vaultix & home-manager need this
specialArgs = {
inherit inputs;
};
modules = [
disko.nixosModules.disko
./hosts/vultr
# home manager
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.flr = import ./home/users/minimal.nix;
}
];
}
);
# raspberry pi 4b
rpi = withSystem "aarch64-linux" (
{ system, ... }:
nixos-raspberrypi.lib.nixosSystem {
inherit system;
# vaultix & home-manager need this
specialArgs = {
inherit inputs nixos-raspberrypi;
};
modules = [
disko.nixosModules.disko
./hosts/rpi
# home manager
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.flr = import ./home/users/minimal.nix;
}
];
}
);
};
};
systems = [
"x86_64-linux"
"aarch64-linux"
];
perSystem =
{ pkgs, ... }:
{
formatter = pkgs.nixfmt-rfc-style;
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.nil
pkgs.nixd
pkgs.nixfmt-rfc-style
];
};
};
}
);
}