@@ -20,8 +20,8 @@ let
2020 sources = map (x: x.source) etc';
2121 targets = map (x: x.target) etc';
2222 modes = map (x: x.mode) etc';
23− uids = map (x: x.uid) etc';
24− gids = map (x: x.gid) etc';
23+ users = map (x: x.user) etc';
24+ groups = map (x: x.group) etc';
2525 };
2626
2727in
@@ -108,6 +108,26 @@ in
108108 '';
109109 };
110110
111+ user = mkOption {
112+ default = "+${toString config.uid}";
113+ type = types.str;
114+ description = ''
115+ User name of created file.
116+ Only takes affect when the file is copied (that is, the mode is not 'symlink').
117+ Changing this option takes precedence over <literal>uid</literal>.
118+ '';
119+ };
120+
121+ group = mkOption {
122+ default = "+${toString config.gid}";
123+ type = types.str;
124+ description = ''
125+ Group name of created file.
126+ Only takes affect when the file is copied (that is, the mode is not 'symlink').
127+ Changing this option takes precedence over <literal>gid</literal>.
128+ '';
129+ };
130+
111131 };
112132
113133 config = {
@@ -130,7 +150,7 @@ in
130150
131151 system.build.etc = etc;
132152
133− system.activationScripts.etc = stringAfter [ "stdio" ]
153+ system.activationScripts.etc = stringAfter [ "users" "groups" ]
134154 ''
135155 # Set up the statically computed bits of /etc.
136156 echo "setting up /etc..."