Skip to content

Commit

Permalink
Merge pull request #57 from Dan-Theriault/home-manager-filter
Browse files Browse the repository at this point in the history
fix: improve check for home-manager nodes
  • Loading branch information
oddlama authored Jan 3, 2025
2 parents 1472730 + 71a5a60 commit d3836e5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nix/select-nodes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ let
nameValuePair
foldl'
optionalAttrs
filterAttrs
;

effectiveNixosConfigurations =
Expand All @@ -30,10 +31,10 @@ let

findHomeManagerForHost =
hostName: hostCfg:
if (hostCfg ? config.home-manager.users.age.rekey) then
(mapAttrs' (
name: value: nameValuePair "host-${hostName}-user-${name}" { config = value; }
) hostCfg.config.home-manager.users)
if (hostCfg ? config.home-manager.users) then
mapAttrs' (name: value: nameValuePair "host-${hostName}-user-${name}" { config = value; }) (
filterAttrs (_: value: value ? age.rekey) hostCfg.config.home-manager.users
)
else
{ };

Expand Down

0 comments on commit d3836e5

Please sign in to comment.