diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2024-08-22 23:16:19 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2024-08-22 23:16:19 +0200 |
commit | c6d39b2d83cf588e1198ac3a2ae1893e276271f9 (patch) | |
tree | a3bf0d2a2dd02faf9d51ccd4c32b5ab1b35174ff /flake.nix | |
parent | 567c22812fe1fbe525f1732661d253b3902710a9 (diff) | |
download | nixos-c6d39b2d83cf588e1198ac3a2ae1893e276271f9.tar nixos-c6d39b2d83cf588e1198ac3a2ae1893e276271f9.tar.gz nixos-c6d39b2d83cf588e1198ac3a2ae1893e276271f9.tar.bz2 nixos-c6d39b2d83cf588e1198ac3a2ae1893e276271f9.tar.xz nixos-c6d39b2d83cf588e1198ac3a2ae1893e276271f9.zip |
...
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -286,6 +286,7 @@ | |||
286 | forAllUsers = genAttrs (unique (map accountUserName (attrNames self.nixosModules.accounts))); | 286 | forAllUsers = genAttrs (unique (map accountUserName (attrNames self.nixosModules.accounts))); |
287 | 287 | ||
288 | 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)); | 288 | 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)); |
289 | 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; })); | ||
289 | 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)))); | 290 | 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)))); |
290 | installerShells = system: pkgs: mapAttrs (installerName: config: pkgs.callPackage ./installer/shell.nix { | 291 | installerShells = system: pkgs: mapAttrs (installerName: config: pkgs.callPackage ./installer/shell.nix { |
291 | inherit system installerName config; | 292 | inherit system installerName config; |
@@ -302,7 +303,7 @@ | |||
302 | mkInstallerForSystem = system: (lib.systems.elaborate system).isLinux; | 303 | mkInstallerForSystem = system: (lib.systems.elaborate system).isLinux; |
303 | installers = | 304 | installers = |
304 | let mkInstallers = system: mapAttrs (mkInstaller system) installerProfiles; | 305 | let mkInstallers = system: mapAttrs (mkInstaller system) installerProfiles; |
305 | mkInstaller = system: name: profile: mkNixosConfiguration [profile { config = { nixpkgs.system = system; }; }] ./. installerConfig "installer"; | 306 | mkInstaller = system: name: profile: mkNixosConfiguration [profile { config.nixpkgs.system = system; }] ./. installerConfig "installer"; |
306 | in forAllSystems (system: _systemPkgs: optionalAttrs (!(isNull installerConfig) && mkInstallerForSystem system) (mkInstallers system)); | 307 | in forAllSystems (system: _systemPkgs: optionalAttrs (!(isNull installerConfig) && mkInstallerForSystem system) (mkInstallers system)); |
307 | installerNixosConfigurations = listToAttrs (concatLists (mapAttrsToList (system: mapAttrsToList (profile: config: nameValuePair ("installer-${system}-${profile}") config)) installers)); | 308 | installerNixosConfigurations = listToAttrs (concatLists (mapAttrsToList (system: mapAttrsToList (profile: config: nameValuePair ("installer-${system}-${profile}") config)) installers)); |
308 | 309 | ||
@@ -333,7 +334,7 @@ | |||
333 | 334 | ||
334 | legacyPackages = forAllSystems (system: systemPkgs: systemPkgs.override { overlays = attrValues self.overlays; }); | 335 | legacyPackages = forAllSystems (system: systemPkgs: systemPkgs.override { overlays = attrValues self.overlays; }); |
335 | 336 | ||
336 | apps = foldr recursiveUpdate {} [activateNixosConfigurations activateHomeManagerConfigurations]; | 337 | apps = foldr recursiveUpdate {} [startVMs activateNixosConfigurations activateHomeManagerConfigurations]; |
337 | 338 | ||
338 | devShells = forAllSystems (system: systemPkgs: { default = import ./shell.nix ({ inherit system; } // inputs); } // installerShells system systemPkgs); | 339 | devShells = forAllSystems (system: systemPkgs: { default = import ./shell.nix ({ inherit system; } // inputs); } // installerShells system systemPkgs); |
339 | 340 | ||