-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
flake.nix
executable file
Β·319 lines (282 loc) Β· 9.27 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
{
description = "Dr460nixed NixOS flake βοΈ";
nixConfig = {
extra-substituters = [
"https://cache.garnix.io"
];
extra-trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
};
inputs = {
# Ayugram
ayugram-desktop.url = "github:/ayugram-port/ayugram-desktop/release";
# Chaotic Nyx!
chaotic-nyx = {
url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
inputs.home-manager.follows = "home-manager";
};
# Devshell to set up a development environment
devshell = {
url = "github:numtide/devshell";
flake = false;
};
# Disko for Nix-managed partition management
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
# Required by some other flakes
flake-compat.url = "github:edolstra/flake-compat";
# Required by some other flakes
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
# Another thing required by other flakes
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
# Garuda Linux flake - most of my system settings are here
garuda-nix = {
# url = "/home/nico/Documents/misc/garuda-nix-subsystem";
url = "gitlab:garuda-linux/garuda-nix-subsystem/main";
inputs.chaotic-nyx.follows = "chaotic-nyx";
inputs.flake-parts.follows = "flake-parts";
inputs.home-manager.follows = "home-manager";
inputs.nix-index-database.follows = "nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
inputs.pre-commit-hooks.follows = "pre-commit-hooks";
};
# Gitignore common input
gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# Home-manager for managing my home directory
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# Ad and malware blocking hosts file
hosts = {
url = "github:StevenBlack/hosts";
inputs.nixpkgs.follows = "nixpkgs";
};
# Reset rootfs every reboot
impermanence.url = "github:nix-community/impermanence";
# My SSH keys
keys_nico = {
url = "https://github.com/dr460nf1r3.keys";
flake = false;
};
# Kwin effects for blur
kwin-effects-forceblur = {
url = "github:taj-ny/kwin-effects-forceblur";
inputs.nixpkgs.follows = "nixpkgs";
};
# Lanzaboote for secure boot support
lanzaboote = {
url = "github:nix-community/lanzaboote/master";
inputs.flake-compat.follows = "flake-compat";
inputs.flake-parts.follows = "flake-parts";
inputs.nixpkgs.follows = "nixpkgs";
inputs.pre-commit-hooks-nix.follows = "pre-commit-hooks";
};
# Lets give Lix another try
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
# Nix gaming-related packages and modules
nix-gaming = {
url = "github:fufexan/nix-gaming";
inputs.flake-parts.follows = "flake-parts";
inputs.nixpkgs.follows = "nixpkgs";
inputs.umu.follows = "";
};
# Have a local index of nixpkgs for fast launching of apps
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
# Declarative Minecraft server management
nix-minecraft = {
url = "github:Infinidoge/nix-minecraft";
inputs.flake-compat.follows = "flake-compat";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
# Convenient system hardening
nix-mineral = {
url = "github:cynicsketch/nix-mineral";
flake = false;
};
# NixOS generators to build system images
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
# NixOS hardware database
nixos-hardware.url = "github:NixOS/nixos-hardware";
# NixOS WSL
nixos-wsl = {
url = "github:nix-community/nixos-wsl";
inputs.flake-compat.follows = "flake-compat";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
# The source of all truth!
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
# Easy linting of the flake and all kind of other stuff
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.flake-compat.follows = "flake-compat";
inputs.gitignore.follows = "gitignore";
inputs.nixpkgs-stable.follows = "nixpkgs";
inputs.nixpkgs.follows = "nixpkgs";
};
# Proxmox on NixOS - this one needs its own Nixpkgs instance
proxmox-nixos = {
url = "github:SaumonNet/proxmox-nixos";
inputs.flake-compat.follows = "flake-compat";
inputs.utils.follows = "flake-utils";
};
# Secrets management
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs";
};
# Spicetify
spicetify-nix = {
url = "github:Gerg-L/spicetify-nix";
inputs.flake-compat.follows = "flake-compat";
inputs.nixpkgs.follows = "nixpkgs";
};
# Fresh ucode packages
ucodenix.url = "github:e-tho/ucodenix";
# Systems flake
systems.url = "github:nix-systems/x86_64-linux";
};
outputs = {
flake-parts,
nixpkgs,
pre-commit-hooks,
self,
...
} @ inp: let
inputs = inp;
perSystem = {
pkgs,
system,
...
}: {
# This basically allows using the devshell as flake app
apps.default = self.outputs.devShells.${system}.default.flakeApp;
# Pre-commit hooks are set up automatically via nix-shell / nix develop
checks.pre-commit-check = pre-commit-hooks.lib.${system}.run {
hooks = {
actionlint.enable = true;
alejandra-quiet = {
description = "Run Alejandra in quiet mode";
enable = true;
entry = ''
${pkgs.alejandra}/bin/alejandra --quiet
'';
files = "\\.nix$";
name = "alejandra";
};
commitizen.enable = true;
check-json.enable = true;
check-yaml.enable = true;
detect-private-keys.enable = true;
deadnix.enable = true;
flake-checker.enable = true;
nil.enable = true;
prettier.enable = true;
pre-commit-hook-ensure-sops.enable = true;
yamllint.enable = true;
statix.enable = true;
typos.enable = true;
};
src = ./.;
};
# Handy devshell for working with this flake
devShells = let
# Import the devshell module as module rather than a flake input
makeDevshell = import "${inp.devshell}/modules" pkgs;
mkShell = config:
(makeDevshell {
configuration = {
inherit config;
imports = [];
};
})
.shell;
in rec {
default = dr460nixed-shell;
dr460nixed-shell = mkShell {
devshell.name = "dr460nixed-devshell";
commands = [
{
category = "dr460nixed";
command = "${self.packages.${system}.repl}/bin/dr460nixed-repl";
help = "Start a repl shell with all flake outputs available";
name = "repl";
}
{
category = "dr460nixed";
command = "nix build .#iso";
help = "Builds a NixOS ISO with all most important configurations";
name = "buildiso";
}
{
category = "dr460nixed";
command = "${self.packages.${system}.installer}/bin/dr460nixed-installer";
help = "Allows installing a basic dr460nixed installation";
name = "installer";
}
{package = "age";}
{package = "commitizen";}
{package = "gnupg";}
{package = "manix";}
{package = "mdbook";}
# {package = "nix-melt";} - currently broken due to Rust 1.80
{package = "nixos-anywhere";}
{package = "nixos-install-tools";}
{package = "pre-commit";}
{package = "rsync";}
{package = "sops";}
{package = "yamlfix";}
];
devshell.startup.preCommitHooks.text = self.checks.${system}.pre-commit-check.shellHook;
env = [
{
name = "NIX_PATH";
value = "${nixpkgs}";
}
];
};
};
# By default, alejandra is WAY to verbose
formatter = pkgs.writeShellScriptBin "alejandra" ''
exec ${pkgs.alejandra}/bin/alejandra --quiet "$@"
'';
};
in
flake-parts.lib.mkFlake {inherit inputs;} {
# Imports flake-modules
imports = [
./nixos/flake-module.nix
./packages/flake-module.nix
inputs.pre-commit-hooks.flakeModule
];
# The systems currently available
systems = ["x86_64-linux" "aarch64-linux"];
# This applies to all systems
inherit perSystem;
};
}