Skip to content

Commit

Permalink
export homeConfigurations for all host-user pairs and drop hmActivati…
Browse files Browse the repository at this point in the history
…onPackages
  • Loading branch information
Pacman99 committed Mar 14, 2021
1 parent 4e06a53 commit e19a013
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 19 deletions.
5 changes: 2 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
inherit (pkgs) lib;
});

homeConfigurations = os.mkHomeConfigurations { inherit self; };

nixosModules =
let moduleList = import ./modules/module-list.nix;
in lib.pathsToImportedAttrs moduleList;
Expand Down Expand Up @@ -88,9 +90,6 @@
devShell = import ./shell {
inherit self system;
};

legacyPackages.hmActivationPackages =
os.mkHomeActivation { inherit self; };
}
);
in
Expand Down
2 changes: 1 addition & 1 deletion lib/devos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

devosSystem = dev.callLibs ./devosSystem.nix;

mkHomeActivation = dev.callLibs ./mkHomeActivation.nix;
mkHomeConfigurations = dev.callLibs ./mkHomeConfigurations.nix;

mkPackages = dev.callLibs ./mkPackages.nix;
}
Expand Down
9 changes: 9 additions & 0 deletions lib/devos/devosSystem.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}];
})
13 changes: 0 additions & 13 deletions lib/devos/mkHomeActivation.nix

This file was deleted.

14 changes: 14 additions & 0 deletions lib/devos/mkHomeConfigurations.nix
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion shell/flk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
2 changes: 1 addition & 1 deletion users/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e19a013

Please sign in to comment.