mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nixos/user-groups: add a toggle for user account creation
Microscopic change that allows users to toggle user accounts, per user, conditionally.
This commit is contained in:
parent
0cc23d26e1
commit
1dd23b5d74
2 changed files with 14 additions and 1 deletions
|
@ -462,8 +462,11 @@
|
||||||
|
|
||||||
- `gerbera` now has wavpack support.
|
- `gerbera` now has wavpack support.
|
||||||
|
|
||||||
|
- A toggle has been added under `users.users.<name>.enable` to allow toggling individual users conditionally. If set to false, the user account will not be created.
|
||||||
|
|
||||||
- `ddclient` was updated from 3.11.2 to 4.0.0 [Release notes](https://github.com/ddclient/ddclient/releases/tag/v4.0.0)
|
- `ddclient` was updated from 3.11.2 to 4.0.0 [Release notes](https://github.com/ddclient/ddclient/releases/tag/v4.0.0)
|
||||||
|
|
||||||
|
|
||||||
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
||||||
|
|
||||||
```{=include=} sections
|
```{=include=} sections
|
||||||
|
|
|
@ -124,6 +124,16 @@ let
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
example = false;
|
||||||
|
description = ''
|
||||||
|
If set to false, the user account will not be created. This is useful for when you wish to conditionally
|
||||||
|
disable user accounts.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
type = types.passwdEntry types.str;
|
type = types.passwdEntry types.str;
|
||||||
apply = x: assert (stringLength x < 32 || abort "Username '${x}' is longer than 31 characters which is not allowed!"); x;
|
apply = x: assert (stringLength x < 32 || abort "Username '${x}' is longer than 31 characters which is not allowed!"); x;
|
||||||
|
@ -557,7 +567,7 @@ let
|
||||||
autoSubUidGidRange subUidRanges subGidRanges
|
autoSubUidGidRange subUidRanges subGidRanges
|
||||||
initialPassword initialHashedPassword expires;
|
initialPassword initialHashedPassword expires;
|
||||||
shell = utils.toShellPath u.shell;
|
shell = utils.toShellPath u.shell;
|
||||||
}) cfg.users;
|
}) (filterAttrs (_: u: u.enable) cfg.users);
|
||||||
groups = attrValues cfg.groups;
|
groups = attrValues cfg.groups;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue