summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix108
1 files changed, 81 insertions, 27 deletions
diff --git a/flake.nix b/flake.nix
index 816fd499..8a230dd2 100644
--- a/flake.nix
+++ b/flake.nix
@@ -29,13 +29,13 @@
29 type = "github"; 29 type = "github";
30 owner = "NixOS"; 30 owner = "NixOS";
31 repo = "nixpkgs"; 31 repo = "nixpkgs";
32 ref = "24.05"; 32 ref = "25.05";
33 }; 33 };
34 nixpkgs-eostre = { 34 nixpkgs-eostre = {
35 type = "github"; 35 type = "github";
36 owner = "NixOS"; 36 owner = "NixOS";
37 repo = "nixpkgs"; 37 repo = "nixpkgs";
38 ref = "23.11"; 38 ref = "25.05";
39 }; 39 };
40 home-manager = { 40 home-manager = {
41 type = "github"; 41 type = "github";
@@ -53,7 +53,7 @@
53 type = "github"; 53 type = "github";
54 owner = "gkleen"; 54 owner = "gkleen";
55 repo = "home-manager"; 55 repo = "home-manager";
56 ref = "nixos-late-start-23.11"; 56 ref = "nixos-late-start-25.05";
57 inputs = { 57 inputs = {
58 nixpkgs.follows = "nixpkgs-eostre"; 58 nixpkgs.follows = "nixpkgs-eostre";
59 }; 59 };
@@ -108,7 +108,7 @@
108 }; 108 };
109 nix-index-database = { 109 nix-index-database = {
110 type = "github"; 110 type = "github";
111 owner = "Mic92"; 111 owner = "nix-community";
112 repo = "nix-index-database"; 112 repo = "nix-index-database";
113 ref = "main"; 113 ref = "main";
114 inputs = { 114 inputs = {
@@ -125,35 +125,62 @@
125 nixpkgs.follows = "nixpkgs"; 125 nixpkgs.follows = "nixpkgs";
126 }; 126 };
127 }; 127 };
128 pyproject-nix = {
129 url = "github:pyproject-nix/pyproject.nix";
130 inputs.nixpkgs.follows = "nixpkgs";
131 };
132 uv2nix = {
133 url = "github:pyproject-nix/uv2nix";
134 inputs.pyproject-nix.follows = "pyproject-nix";
135 inputs.nixpkgs.follows = "nixpkgs";
136 };
137 pyproject-build-systems = {
138 url = "github:pyproject-nix/build-system-pkgs";
139 inputs.pyproject-nix.follows = "pyproject-nix";
140 inputs.uv2nix.follows = "uv2nix";
141 inputs.nixpkgs.follows = "nixpkgs";
142 };
143 gitignore = {
144 type = "github";
145 owner = "hercules-ci";
146 repo = "gitignore.nix";
147 inputs.nixpkgs.follows = "nixpkgs";
148 };
128 149
129 ca-util = { 150 ca-util = {
130 type = "gitlab"; 151 type = "gitlab";
131 owner = "gkleen"; 152 owner = "gkleen";
132 repo = "ca"; 153 repo = "ca";
133 ref = "v3.1.3"; 154 ref = "v3.1.5";
134 inputs = { 155 inputs = {
156 pyproject-nix.follows = "pyproject-nix";
157 uv2nix.follows = "uv2nix";
135 nixpkgs.follows = "nixpkgs"; 158 nixpkgs.follows = "nixpkgs";
136 poetry2nix.follows = "poetry2nix";
137 }; 159 };
138 }; 160 };
139 backup-utils = { 161 backup-utils = {
140 type = "gitlab"; 162 type = "gitlab";
141 owner = "gkleen"; 163 owner = "gkleen";
142 repo = "backup-utils"; 164 repo = "backup-utils";
143 ref = "v0.1.6"; 165 ref = "v0.1.7";
144 inputs = { 166 inputs = {
145 nixpkgs.follows = "nixpkgs"; 167 nixpkgs.follows = "nixpkgs";
146 poetry2nix.follows = "poetry2nix"; 168 pyproject-nix.follows = "pyproject-nix";
169 uv2nix.follows = "uv2nix";
170 pyproject-build-systems.follows = "pyproject-build-systems";
147 }; 171 };
148 }; 172 };
149 prometheus-borg-exporter = { 173 prometheus-borg-exporter = {
150 type = "gitlab"; 174 type = "gitlab";
151 owner = "gkleen"; 175 owner = "gkleen";
152 repo = "prometheus-borg-exporter"; 176 repo = "prometheus-borg-exporter";
153 ref = "main"; 177 ref = "v1.1.1";
154 inputs = { 178 inputs = {
155 nixpkgs.follows = "nixpkgs"; 179 nixpkgs.follows = "nixpkgs";
156 poetry2nix.follows = "poetry2nix"; 180 pyproject-nix.follows = "pyproject-nix";
181 uv2nix.follows = "uv2nix";
182 pyproject-build-systems.follows = "pyproject-build-systems";
183 gitignore.follows = "gitignore";
157 }; 184 };
158 }; 185 };
159 nixos-hardware = { 186 nixos-hardware = {
@@ -168,16 +195,6 @@
168 repo = "impermanence"; 195 repo = "impermanence";
169 ref = "master"; 196 ref = "master";
170 }; 197 };
171 waybar = {
172 type = "github";
173 owner = "gkleen";
174 repo = "Waybar";
175 ref = "feat/privacy-ignore";
176 inputs = {
177 nixpkgs.follows = "nixpkgs";
178 flake-compat.follows = "flake-compat";
179 };
180 };
181 nixVirt = { 198 nixVirt = {
182 type = "github"; 199 type = "github";
183 owner = "AshleyYakeley"; 200 owner = "AshleyYakeley";
@@ -189,6 +206,37 @@
189 owner = "sodiboo"; 206 owner = "sodiboo";
190 repo = "niri-flake"; 207 repo = "niri-flake";
191 ref = "main"; 208 ref = "main";
209 inputs = {
210 nixpkgs.follows = "nixpkgs";
211 niri-unstable = {
212 type = "github";
213 owner = "gkleen";
214 repo = "niri";
215 ref = "fix/locked-monitor-control";
216 };
217 };
218 };
219 nix-monitored = {
220 type = "github";
221 owner = "ners";
222 repo = "nix-monitored";
223 ref = "master";
224 inputs = {
225 nixpkgs.follows = "nixpkgs";
226 };
227 };
228 lanzaboote = {
229 type = "github";
230 owner = "nix-community";
231 repo = "lanzaboote";
232 ref = "v0.4.3";
233
234 inputs.nixpkgs.follows = "nixpkgs";
235 };
236 niri-autoselect-portal = {
237 url = "git+https://codeberg.org/debugloop/niri-autoselect-portal.git";
238
239 inputs.nixpkgs.follows = "nixpkgs";
192 }; 240 };
193 }; 241 };
194 242
@@ -275,9 +323,10 @@
275 mkAccountModule = dir: path: accountName: 323 mkAccountModule = dir: path: accountName:
276 let 324 let
277 userName = accountUserName accountName; 325 userName = accountUserName accountName;
326 hostName = accountHostName accountName;
278 in overrideModule 327 in overrideModule
279 (import (dir + "/${path}")) 328 (import (dir + "/${path}"))
280 (inputs: inputs // { inherit userName; }) 329 (inputs: inputs // { inherit userName hostName; })
281 (outputs: { _file = dir + "/${path}"; } 330 (outputs: { _file = dir + "/${path}"; }
282 // outputs 331 // outputs
283 // { imports = [self.nixosModules.users.${userName} or ({...}: { imports = defaultUserProfiles userName; })] ++ (outputs.imports or []); }); 332 // { imports = [self.nixosModules.users.${userName} or ({...}: { imports = defaultUserProfiles userName; })] ++ (outputs.imports or []); });
@@ -293,7 +342,7 @@
293 forAllUsers = genAttrs (unique (map accountUserName (attrNames self.nixosModules.accounts))); 342 forAllUsers = genAttrs (unique (map accountUserName (attrNames self.nixosModules.accounts)));
294 343
295 activateNixosConfigurations = forAllSystems (system: _pkgs: filterAttrs (_n: v: v != null) (mapAttrs' (hostName: nixosConfig: nameValuePair "${hostName}-activate" (if system == nixosConfig.config.nixpkgs.system then { type = "app"; program = "${nixosConfig.config.system.build.toplevel}/bin/switch-to-configuration"; } else null)) self.nixosConfigurations)); 344 activateNixosConfigurations = forAllSystems (system: _pkgs: filterAttrs (_n: v: v != null) (mapAttrs' (hostName: nixosConfig: nameValuePair "${hostName}-activate" (if system == nixosConfig.config.nixpkgs.system then { type = "app"; program = "${nixosConfig.config.system.build.toplevel}/bin/switch-to-configuration"; } else null)) self.nixosConfigurations));
296 startVMs = forAllSystems (system: pkgs: mapAttrs' (hostName: nixosConfig: nameValuePair "run-${hostName}-vm" { type = "app"; program = "${nixosConfig.config.system.build.vm}/bin/run-${hostName}-vm"; }) (nixImport rec { dir = ./hosts; _import = mkNixosConfiguration [ { config.virtualisation.host.pkgs = pkgs; } ] dir; })); 345 # startVMs = forAllSystems (system: pkgs: mapAttrs' (hostName: nixosConfig: nameValuePair "run-${hostName}-vm" { type = "app"; program = "${nixosConfig.config.system.build.vm}/bin/run-${hostName}-vm"; }) (nixImport rec { dir = ./hosts; _import = mkNixosConfiguration [ { config.virtualisation.host.pkgs = pkgs; } ] dir; }));
297 activateHomeManagerConfigurations = forAllSystems (system: _pkgs: filterAttrs (_n: v: v != null) (listToAttrs (concatLists (mapAttrsToList (hostName: nixosConfig: mapAttrsToList (userName: userCfg: nameValuePair "${userName}@${hostName}-activate" (if system == nixosConfig.config.nixpkgs.system then { type = "app"; program = "${userCfg.home.activationPackage}/activate"; } else null)) nixosConfig.config.home-manager.users) self.nixosConfigurations)))); 346 activateHomeManagerConfigurations = forAllSystems (system: _pkgs: filterAttrs (_n: v: v != null) (listToAttrs (concatLists (mapAttrsToList (hostName: nixosConfig: mapAttrsToList (userName: userCfg: nameValuePair "${userName}@${hostName}-activate" (if system == nixosConfig.config.nixpkgs.system then { type = "app"; program = "${userCfg.home.activationPackage}/activate"; } else null)) nixosConfig.config.home-manager.users) self.nixosConfigurations))));
298 installerShells = system: pkgs: mapAttrs (installerName: config: pkgs.callPackage ./installer/shell.nix { 347 installerShells = system: pkgs: mapAttrs (installerName: config: pkgs.callPackage ./installer/shell.nix {
299 inherit system installerName config; 348 inherit system installerName config;
@@ -330,18 +379,23 @@
330 nixosConfigurations = installerNixosConfigurations // nixImport rec { dir = ./hosts; _import = mkNixosConfiguration [] dir; }; 379 nixosConfigurations = installerNixosConfigurations // nixImport rec { dir = ./hosts; _import = mkNixosConfiguration [] dir; };
331 380
332 homeModules = nixImport rec { dir = ./home-modules; }; 381 homeModules = nixImport rec { dir = ./home-modules; };
333 homeConfigurations = listToAttrs (concatLists (mapAttrsToList (hostname: nixosConfig: mapAttrsToList (username: configuration: nameValuePair "${username}@${hostname}" { inherit (configuration.home) activationPackage; inherit (configuration) home-files; }) nixosConfig.config.home-manager.users) self.nixosConfigurations)); 382 homeConfigurations = listToAttrs (concatLists (mapAttrsToList (hostname: nixosConfig: mapAttrsToList (username: nameValuePair "${username}@${hostname}") nixosConfig.config.home-manager.users) self.nixosConfigurations));
334 383
335 overlays = mapAttrs (_name: path: mkOverlay path) overlayPaths; 384 overlays = mapAttrs (_name: path: mkOverlay path) overlayPaths;
336 385
337 packages = forAllSystems (system: systemPkgs: nixImport rec { dir = ./tools; _import = _path: name: import "${toString dir}/${name}" ({ inherit system; } // inputs); }); 386 packages = forAllSystems (system: systemPkgs: nixImport rec { dir = ./tools; _import = name: _base: import (dir + "/${name}") ({ inherit system; } // inputs); });
338 387
339 # packages = mapAttrs (_name: filterAttrs (_name: isDerivation)) packages; 388 # packages = mapAttrs (_name: filterAttrs (_name: isDerivation)) packages;
340 # packages' = mapAttrs (_name: filterAttrs (_name: value: !(isDerivation value))) packages; 389 # packages' = mapAttrs (_name: filterAttrs (_name: value: !(isDerivation value))) packages;
341 390
342 legacyPackages = forAllSystems (system: systemPkgs: systemPkgs.override { overlays = attrValues self.overlays; }); 391 legacyPackages = forAllSystems (system: systemPkgs: systemPkgs.override { overlays = attrValues self.overlays; });
343 392
344 apps = foldr recursiveUpdate {} [startVMs activateNixosConfigurations activateHomeManagerConfigurations]; 393 apps = foldr recursiveUpdate {} [
394 #startVMs
395 activateNixosConfigurations activateHomeManagerConfigurations
396 ];
397
398 lib = nixImport rec { dir = ./lib; _import = name: _base: import (dir + "/${name}") inputs; };
345 399
346 devShells = forAllSystems (system: systemPkgs: { default = import ./shell.nix ({ inherit system; } // inputs); } // installerShells system systemPkgs); 400 devShells = forAllSystems (system: systemPkgs: { default = import ./shell.nix ({ inherit system; } // inputs); } // installerShells system systemPkgs);
347 401
@@ -366,10 +420,10 @@
366 # path = activateHomeManager (self.nixosConfigurations.${hostname}.config.nixpkgs.system) usercfg.home; 420 # path = activateHomeManager (self.nixosConfigurations.${hostname}.config.nixpkgs.system) usercfg.home;
367 # }) self.nixosConfigurations.${hostname}.config.home-manager.users); 421 # }) self.nixosConfigurations.${hostname}.config.home-manager.users);
368 }) (nixImport { dir = ./hosts; _import = (_path: name: name); }); 422 }) (nixImport { dir = ./hosts; _import = (_path: name: name); });
369 overrides = if pathExists ./deploy then nixImport { dir = ./deploy; _import = path: _name: import (./deploy + "/${path}") inputs; } else {}; 423 overrides = if pathExists ./deploy then nixImport rec { dir = ./deploy; _import = path: _name: import (dir + "/${path}") inputs; } else {};
370 filterEnabled = attrs: mapAttrs (_n: v: filterAttrs (n: _v: n != "enabled") v) (filterAttrs (_n: v: v.enabled or true) attrs); 424 filterEnabled = attrs: mapAttrs (_n: v: filterAttrs (n: _v: n != "enabled") v) (filterAttrs (_n: v: v.enabled or true) attrs);
371 in mapAttrs (_n: v: if v ? "profiles" then v // { profiles = filterEnabled v.profiles; } else v) (filterEnabled (recursiveUpdate defaults overrides)); 425 in mapAttrs (_n: v: if v ? "profiles" then v // { profiles = filterEnabled v.profiles; } else v) (filterEnabled (recursiveUpdate defaults overrides));
372 426
373 checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; 427 # checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
374 }; 428 };
375} 429}