fix nixpkgs disabled when home-manager.useGlobalPkgs
This commit is contained in:
parent
1c68485dcf
commit
39ec2e62d0
2 changed files with 13 additions and 10 deletions
|
|
@ -62,8 +62,8 @@ in {
|
|||
users =
|
||||
config.users.users
|
||||
|> filterAttrs (name: value: value.manageHome && pathExists /${root}/homes/${name})
|
||||
|> mapAttrs (name: _: {
|
||||
imports = [import /${root}/homes/${name}];
|
||||
|> mapAttrs (name: _: {...}: {
|
||||
imports = [/${root}/homes/${name}];
|
||||
|
||||
# per-user arguments
|
||||
_module.args.username = name;
|
||||
|
|
@ -73,7 +73,6 @@ in {
|
|||
sharedModules = [
|
||||
../home
|
||||
|
||||
# user configuration
|
||||
(import /${root}/nixpkgs.nix)
|
||||
# options declarations
|
||||
(import ./nixpkgs.nix (args // {contextName = "homes";}))
|
||||
|
|
|
|||
|
|
@ -73,19 +73,23 @@ in {
|
|||
_module.args = removeAttrs repos ["pkgs" "base"];
|
||||
|
||||
nixpkgs = let
|
||||
nixpkgConfig = {
|
||||
nixpkgsConfig = {
|
||||
config = lib.mkForce (basePkgs.config or {});
|
||||
overlays = lib.mkForce (basePkgs.overlays or []);
|
||||
};
|
||||
in
|
||||
if contextName == "hosts"
|
||||
then
|
||||
nixpkgConfig
|
||||
|
||||
nixpkgsHostsConfig =
|
||||
nixpkgsConfig
|
||||
// {
|
||||
flake.source = lib.mkForce base;
|
||||
}
|
||||
};
|
||||
|
||||
nixpkgsHomesConfig = lib.mkIf (!config.home-manager.useGlobalPkgs) nixpkgsConfig;
|
||||
in
|
||||
if contextName == "hosts"
|
||||
then nixpkgsHostsConfig
|
||||
else if contextName == "homes"
|
||||
then nixpkgConfig
|
||||
then nixpkgsHomesConfig
|
||||
else {};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue