mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Add options nix.{trustedUsers,allowedUsers}
These are just trusted-users and allowed-users in nix.conf. It's useful to have options for them so that different modules can specify trusted/allowed users.
This commit is contained in:
parent
fb203a34c0
commit
1f3f31b2a8
1 changed files with 32 additions and 0 deletions
|
@ -47,6 +47,8 @@ let
|
||||||
${optionalString cfg.requireSignedBinaryCaches ''
|
${optionalString cfg.requireSignedBinaryCaches ''
|
||||||
signed-binary-caches = *
|
signed-binary-caches = *
|
||||||
''}
|
''}
|
||||||
|
trusted-users = ${toString cfg.trustedUsers}
|
||||||
|
allowed-users = ${toString cfg.allowedUsers}
|
||||||
$extraOptions
|
$extraOptions
|
||||||
END
|
END
|
||||||
'';
|
'';
|
||||||
|
@ -277,6 +279,36 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
trustedUsers = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ "root" ];
|
||||||
|
example = [ "root" "alice" "@wheel" ];
|
||||||
|
description = ''
|
||||||
|
A list of names of users that have additional rights when
|
||||||
|
connecting to the Nix daemon, such as the ability to specify
|
||||||
|
additional binary caches, or to import unsigned NARs. You
|
||||||
|
can also specify groups by prefixing them with
|
||||||
|
<literal>@</literal>; for instance,
|
||||||
|
<literal>@wheel</literal> means all users in the wheel
|
||||||
|
group.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
allowedUsers = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ "*" ];
|
||||||
|
example = [ "@wheel" "@builders" "alice" "bob" ];
|
||||||
|
description = ''
|
||||||
|
A list of names of users (separated by whitespace) that are
|
||||||
|
allowed to connect to the Nix daemon. As with
|
||||||
|
<option>nix.trustedUsers</option>, you can specify groups by
|
||||||
|
prefixing them with <literal>@</literal>. Also, you can
|
||||||
|
allow all users by specifying <literal>*</literal>. The
|
||||||
|
default is <literal>*</literal>. Note that trusted users are
|
||||||
|
always allowed to connect.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue