diff --git a/flake.nix b/flake.nix index 5932697a8..8c4313d5a 100644 --- a/flake.nix +++ b/flake.nix @@ -48,6 +48,8 @@ inherit (pkgs) lib; }); + homeConfigurations = os.mkHomeConfigurations { inherit self; }; + nixosModules = let moduleList = import ./modules/module-list.nix; in lib.pathsToImportedAttrs moduleList; @@ -88,9 +90,6 @@ devShell = import ./shell { inherit self system; }; - - legacyPackages.hmActivationPackages = - os.mkHomeActivation { inherit self; }; } ); in diff --git a/lib/devos/default.nix b/lib/devos/default.nix index 32ce49011..bf109ba37 100644 --- a/lib/devos/default.nix +++ b/lib/devos/default.nix @@ -19,7 +19,7 @@ devosSystem = dev.callLibs ./devosSystem.nix; - mkHomeActivation = dev.callLibs ./mkHomeActivation.nix; + mkHomeConfigurations = dev.callLibs ./mkHomeConfigurations.nix; mkPackages = dev.callLibs ./mkPackages.nix; } diff --git a/lib/devos/devosSystem.nix b/lib/devos/devosSystem.nix index b46b355be..c0d031310 100644 --- a/lib/devos/devosSystem.nix +++ b/lib/devos/devosSystem.nix @@ -21,10 +21,19 @@ lib.nixosSystem (args // { }) ]; })).config; + hmConfig = (lib.nixosSystem + (args // { + modules = modules ++ [ + ({ config, ... }: { + home-manager.useUserPackages = lib.mkForce false; + }) + ]; + })).config; in modules ++ [{ system.build = { iso = isoConfig.system.build.isoImage; + homes = hmConfig.home-manager.users; }; }]; }) diff --git a/lib/devos/mkHomeActivation.nix b/lib/devos/mkHomeActivation.nix deleted file mode 100644 index c88082400..000000000 --- a/lib/devos/mkHomeActivation.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ lib, ... }: - -{ self }: -let hmConfigs = - lib.mapAttrs - (_: config: config.config.home-manager.users) - self.nixosConfigurations; -in -lib.mapAttrs - (_: x: lib.mapAttrs - (_: cfg: cfg.home.activationPackage) - x) - hmConfigs diff --git a/lib/devos/mkHomeConfigurations.nix b/lib/devos/mkHomeConfigurations.nix new file mode 100644 index 000000000..38e7a844a --- /dev/null +++ b/lib/devos/mkHomeConfigurations.nix @@ -0,0 +1,14 @@ +{ lib, ... }: + +{ self }: +with lib; +let + mkHomes = host: homes: + mapAttrs' (n: v: nameValuePair "${host}-${n}" v) homes; + + hmConfigs = mapAttrs + (host: config: mkHomes host config.config.system.build.homes) + self.nixosConfigurations; + +in +foldl recursiveUpdate {} (attrValues hmConfigs) diff --git a/shell/flk.sh b/shell/flk.sh index 32b0a210c..11ba21b31 100755 --- a/shell/flk.sh +++ b/shell/flk.sh @@ -76,7 +76,7 @@ case "$1" in ;; "home") - ref="$DEVSHELL_ROOT/#hmActivationPackages.$2.$3" + ref="$DEVSHELL_ROOT/#homeConfigurations.$2-$3.home.activationPackage" if [[ "$4" == "switch" ]]; then nix build "$ref" && result/activate && diff --git a/users/README.md b/users/README.md index c36aa3ac9..6c1ec0e37 100644 --- a/users/README.md +++ b/users/README.md @@ -42,7 +42,7 @@ flk home NixOS nixos switch ### Manually from outside the project: ```sh # build -nix build "github:divnix/devos#hmActivationPackages.NixOS.nixos" +nix build "github:divnix/devos#homeConfigurations.NixOS-nixos.home.activationPackage" # activate ./result/activate && unlink result