git.iko.soy/typeable/nixpkgs
on master help sign in
Add options nix.{trustedUsers,allowedUsers}
1f3f31bEelco Dolstra
nixos/modules/services/misc/nix-daemon.nix+32
@@ -47,6 +47,8 @@ let
47 ${optionalString cfg.requireSignedBinaryCaches ''
47 ${optionalString cfg.requireSignedBinaryCaches ''
48 signed-binary-caches = *
48 signed-binary-caches = *
49 ''}
49 ''}
50+ trusted-users = ${toString cfg.trustedUsers}
51+ allowed-users = ${toString cfg.allowedUsers}
50 $extraOptions
52 $extraOptions
51 END
53 END
52 '';
54 '';
@@ -277,6 +279,36 @@ in
277 '';
279 '';
278 };
280 };
279
281
282+ trustedUsers = mkOption {
283+ type = types.listOf types.str;
284+ default = [ "root" ];
285+ example = [ "root" "alice" "@wheel" ];
286+ description = ''
287+ A list of names of users that have additional rights when
288+ connecting to the Nix daemon, such as the ability to specify
289+ additional binary caches, or to import unsigned NARs. You
290+ can also specify groups by prefixing them with
291+ <literal>@</literal>; for instance,
292+ <literal>@wheel</literal> means all users in the wheel
293+ group.
294+ '';
295+ };
296+
297+ allowedUsers = mkOption {
298+ type = types.listOf types.str;
299+ default = [ "*" ];
300+ example = [ "@wheel" "@builders" "alice" "bob" ];
301+ description = ''
302+ A list of names of users (separated by whitespace) that are
303+ allowed to connect to the Nix daemon. As with
304+ <option>nix.trustedUsers</option>, you can specify groups by
305+ prefixing them with <literal>@</literal>. Also, you can
306+ allow all users by specifying <literal>*</literal>. The
307+ default is <literal>*</literal>. Note that trusted users are
308+ always allowed to connect.
309+ '';
310+ };
311+
280 };
312 };
281
313
282 };
314 };