summaryrefslogtreecommitdiffstats
path: root/nixos/modules/system/etc/etc.nix
diff options
context:
space:
mode:
authorVolth <volth@webmaster.ms>2017-07-21 14:41:19 +0000
committerJörg Thalheim <joerg@thalheim.io>2017-07-29 23:56:46 +0100
commitfaac018630b8d3f89c633c1235ae649498c938e8 (patch)
tree13223ce0d726897851f1d7c846af33e0c0caf0d6 /nixos/modules/system/etc/etc.nix
parent6f2715e47de317aa196c81a31b3632c93cf54e8f (diff)
environment.etc: add user/group option
fixes #27546
Diffstat (limited to 'nixos/modules/system/etc/etc.nix')
-rw-r--r--nixos/modules/system/etc/etc.nix26
1 files changed, 23 insertions, 3 deletions
diff --git a/nixos/modules/system/etc/etc.nix b/nixos/modules/system/etc/etc.nix
index fd6e58cd5b43..7d43ba07ca57 100644
--- a/nixos/modules/system/etc/etc.nix
+++ b/nixos/modules/system/etc/etc.nix
@@ -20,8 +20,8 @@ let
sources = map (x: x.source) etc';
targets = map (x: x.target) etc';
modes = map (x: x.mode) etc';
- uids = map (x: x.uid) etc';
- gids = map (x: x.gid) etc';
+ users = map (x: x.user) etc';
+ groups = map (x: x.group) etc';
};
in
@@ -108,6 +108,26 @@ in
'';
};
+ user = mkOption {
+ default = "+${toString config.uid}";
+ type = types.str;
+ description = ''
+ User name of created file.
+ Only takes affect when the file is copied (that is, the mode is not 'symlink').
+ Changing this option takes precedence over <literal>uid</literal>.
+ '';
+ };
+
+ group = mkOption {
+ default = "+${toString config.gid}";
+ type = types.str;
+ description = ''
+ Group name of created file.
+ Only takes affect when the file is copied (that is, the mode is not 'symlink').
+ Changing this option takes precedence over <literal>gid</literal>.
+ '';
+ };
+
};
config = {
@@ -130,7 +150,7 @@ in
system.build.etc = etc;
- system.activationScripts.etc = stringAfter [ "stdio" ]
+ system.activationScripts.etc = stringAfter [ "users" "groups" ]
''
# Set up the statically computed bits of /etc.
echo "setting up /etc..."