feat(nix): add forAllUsers' and docstrings to lib

Adds forAllUsers' function and docstrings to nix lib.
This commit is contained in:
Mohammad Rafiq 2025-07-07 08:41:00 +08:00
parent de72f9a869
commit 28076ee149
No known key found for this signature in database
2 changed files with 88 additions and 3 deletions

View file

@ -1,7 +1,7 @@
{ config, lib, ... }:
let
cfg = config.flake;
inherit (config.flake.lib) forAllUsers flattenAttrs;
inherit (config.flake.lib) forAllUsers' flattenAttrs;
inherit (lib.attrsets) filterAttrs;
owner = flattenAttrs (filterAttrs (_: v: (v.primary or false)) cfg.manifest.users);
in
@ -27,7 +27,7 @@ in
openssh.authorizedKeys.keys = [ owner.pubkey ];
};
};
home-manager.users = forAllUsers (
home-manager.users = forAllUsers' (
name: _: {
#TODO: move into nixos/darwin config - should not apply to homeConfigurations
home.username = name;