feat(nixos): add user password secrets to sops

This commit adds the user password secrets to sops.
It leverages the `userListToAttrs` lib function.
This commit is contained in:
Mohammad Rafiq 2025-07-07 17:26:57 +08:00
parent 782a4324a8
commit 4ff7b8e18f
No known key found for this signature in database
5 changed files with 42 additions and 15 deletions

View file

@ -18,17 +18,22 @@ in
type = lazyAttrsOf raw;
default = { };
};
root = mkOption {
type = path;
default = "";
paths = {
root = mkOption { type = path; };
secrets = mkOption {
type = path;
readOnly = true;
};
};
admin = mkOption {
type = lazyAttrsOf raw;
default = { };
};
};
config.flake.admin = cfg.manifest.users.${username} // {
inherit username;
config.flake = {
paths.secrets = cfg.paths.root + "/secrets";
admin = cfg.manifest.users.${username} // {
inherit username;
};
};
}