From c6d39b2d83cf588e1198ac3a2ae1893e276271f9 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 22 Aug 2024 23:16:19 +0200 Subject: ... --- flake.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index a5bcc93c..728a6322 100644 --- a/flake.nix +++ b/flake.nix @@ -286,6 +286,7 @@ forAllUsers = genAttrs (unique (map accountUserName (attrNames self.nixosModules.accounts))); 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)); + 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; })); 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)))); installerShells = system: pkgs: mapAttrs (installerName: config: pkgs.callPackage ./installer/shell.nix { inherit system installerName config; @@ -302,7 +303,7 @@ mkInstallerForSystem = system: (lib.systems.elaborate system).isLinux; installers = let mkInstallers = system: mapAttrs (mkInstaller system) installerProfiles; - mkInstaller = system: name: profile: mkNixosConfiguration [profile { config = { nixpkgs.system = system; }; }] ./. installerConfig "installer"; + mkInstaller = system: name: profile: mkNixosConfiguration [profile { config.nixpkgs.system = system; }] ./. installerConfig "installer"; in forAllSystems (system: _systemPkgs: optionalAttrs (!(isNull installerConfig) && mkInstallerForSystem system) (mkInstallers system)); installerNixosConfigurations = listToAttrs (concatLists (mapAttrsToList (system: mapAttrsToList (profile: config: nameValuePair ("installer-${system}-${profile}") config)) installers)); @@ -333,7 +334,7 @@ legacyPackages = forAllSystems (system: systemPkgs: systemPkgs.override { overlays = attrValues self.overlays; }); - apps = foldr recursiveUpdate {} [activateNixosConfigurations activateHomeManagerConfigurations]; + apps = foldr recursiveUpdate {} [startVMs activateNixosConfigurations activateHomeManagerConfigurations]; devShells = forAllSystems (system: systemPkgs: { default = import ./shell.nix ({ inherit system; } // inputs); } // installerShells system systemPkgs); -- cgit v1.2.3