vars: add the user and group options on files

This changeset forwards the ownership control options from sops-nix.
This commit is contained in:
Louis Opter
2024-10-12 11:17:38 -07:00
committed by Mic92
parent 004cd31857
commit f540ab91a1
4 changed files with 15 additions and 2 deletions

View File

@@ -119,6 +119,14 @@ in
'';
type = str;
};
owner = {
description = "The user name or id that will own the secret file. This option is currently only implemented for sops";
default = "root";
};
group = {
description = "The group name or id that will own the secret file. This option is currently only implemented for sops";
default = "root";
};
value =
{
description = ''

View File

@@ -40,6 +40,7 @@ in
flip map vars (secret: {
name = "vars/${secret.generator}/${secret.name}";
value = {
inherit (secret) owner group;
sopsFile = secretPath secret;
format = "binary";
};

View File

@@ -21,10 +21,11 @@ in
flip mapAttrsToList vars.generators (
gen_name: generator:
flip mapAttrsToList (relevantFiles generator) (
fname: _file: {
fname: file: {
name = fname;
generator = gen_name;
inherit (generator) share;
inherit (file) owner group;
}
)
)