Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into staging-next
Browse files Browse the repository at this point in the history
  • Loading branch information
K900 committed Dec 22, 2024
2 parents d8b54e3 + 5f02383 commit c03fa0c
Show file tree
Hide file tree
Showing 162 changed files with 2,011 additions and 1,414 deletions.
12 changes: 0 additions & 12 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12067,12 +12067,6 @@
github = "svelterust";
githubId = 85593302;
};
knedlsepp = {
email = "[email protected]";
github = "knedlsepp";
githubId = 3287933;
name = "Josef Kemetmüller";
};
knightpp = {
email = "[email protected]";
github = "knightpp";
Expand Down Expand Up @@ -18388,12 +18382,6 @@
github = "pyle";
githubId = 7279609;
};
pyrolagus = {
email = "[email protected]";
github = "PyroLagus";
githubId = 4579165;
name = "Danny Bautista";
};
pyrotelekinetic = {
name = "Clover";
email = "[email protected]";
Expand Down
101 changes: 67 additions & 34 deletions nixos/modules/config/users-groups.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,37 +53,71 @@ let
"*" # password unset
]);

overrideOrderMutable = ''{option}`initialHashedPassword` -> {option}`initialPassword` -> {option}`hashedPassword` -> {option}`password` -> {option}`hashedPasswordFile`'';

overrideOrderImmutable = ''{option}`initialHashedPassword` -> {option}`hashedPassword` -> {option}`initialPassword` -> {option}`password` -> {option}`hashedPasswordFile`'';

overrideOrderText = isMutable: ''
If the option {option}`users.mutableUsers` is
`${if isMutable then "true" else "false"}`, then the order of precedence is as shown
below, where values on the left are overridden by values on the right:
${if isMutable then overrideOrderMutable else overrideOrderImmutable}
'';

multiplePasswordsWarning = ''
If multiple of these password options are set at the same time then a
specific order of precedence is followed, which can lead to surprising
results. The order of precedence differs depending on whether the
{option}`users.mutableUsers` option is set.
'';

overrideDescription = ''
${multiplePasswordsWarning}
${overrideOrderText false}
${overrideOrderText true}
'';

passwordDescription = ''
The options {option}`hashedPassword`,
{option}`password` and {option}`hashedPasswordFile`
controls what password is set for the user.
{option}`hashedPassword` overrides both
{option}`password` and {option}`hashedPasswordFile`.
{option}`password` overrides {option}`hashedPasswordFile`.
If none of these three options are set, no password is assigned to
the user, and the user will not be able to do password logins.
If the option {option}`users.mutableUsers` is true, the
password defined in one of the three options will only be set when
the user is created for the first time. After that, you are free to
change the password with the ordinary user management commands. If
{option}`users.mutableUsers` is false, you cannot change
user passwords, they will always be set according to the password
options.
The {option}`initialHashedPassword`, {option}`hashedPassword`,
{option}`initialPassword`, {option}`password` and
{option}`hashedPasswordFile` options all control what password is set for
the user.
In a system where [](#opt-systemd.sysusers.enable) is `false`, typically
only one of {option}`hashedPassword`, {option}`password`, or
{option}`hashedPasswordFile` will be set.
In a system where [](#opt-systemd.sysusers.enable) is `true`, typically
only one of {option}`initialPassword`, {option}`initialHashedPassword`,
or {option}`hashedPasswordFile` will be set.
If the option {option}`users.mutableUsers` is true, the password defined
in one of the above password options will only be set when the user is
created for the first time. After that, you are free to change the
password with the ordinary user management commands. If
{option}`users.mutableUsers` is false, you cannot change user passwords,
they will always be set according to the password options.
If none of the password options are set, then no password is assigned to
the user, and the user will not be able to do password-based logins.
${overrideDescription}
'';

hashedPasswordDescription = ''
To generate a hashed password run `mkpasswd`.
If set to an empty string (`""`), this user will
be able to log in without being asked for a password (but not via remote
services such as SSH, or indirectly via {command}`su` or
{command}`sudo`). This should only be used for e.g. bootable
live systems. Note: this is different from setting an empty password,
which can be achieved using {option}`users.users.<name?>.password`.
If set to an empty string (`""`), this user will be able to log in without
being asked for a password (but not via remote services such as SSH, or
indirectly via {command}`su` or {command}`sudo`). This should only be used
for e.g. bootable live systems. Note: this is different from setting an
empty password, which can be achieved using
{option}`users.users.<name?>.password`.
If set to `null` (default) this user will not
be able to log in using a password (i.e. via {command}`login`
command).
If set to `null` (default) this user will not be able to log in using a
password (i.e. via {command}`login` command).
'';

userOpts = { name, config, ... }: {
Expand Down Expand Up @@ -281,6 +315,7 @@ let
default = null;
description = ''
Specifies the hashed password for the user.
${passwordDescription}
${hashedPasswordDescription}
'';
Expand All @@ -294,6 +329,7 @@ let
Warning: do not set confidential information here
because it is world-readable in the Nix store. This option
should only be used for public accounts.
${passwordDescription}
'';
};
Expand All @@ -307,6 +343,7 @@ let
password. The password file is read on each system activation. The
file should contain exactly one line, which should be the password in
an encrypted form that is suitable for the `chpasswd -e` command.
${passwordDescription}
'';
};
Expand All @@ -329,9 +366,7 @@ let
{command}`passwd` command. Otherwise, it's
equivalent to setting the {option}`hashedPassword` option.
Note that the {option}`hashedPassword` option will override
this option if both are set.
${passwordDescription}
${hashedPasswordDescription}
'';
};
Expand All @@ -351,8 +386,7 @@ let
used for guest accounts or passwords that will be changed
promptly.
Note that the {option}`password` option will override this
option if both are set.
${passwordDescription}
'';
};

Expand Down Expand Up @@ -960,12 +994,11 @@ in {
(filter (x: x != null) (map (flip getAttr user) passwordOptions));
in optional (!unambiguousPasswordConfiguration) ''
The user '${user.name}' has multiple of the options
`hashedPassword`, `password`, `hashedPasswordFile`, `initialPassword`
& `initialHashedPassword` set to a non-null value.
The options silently discard others by the order of precedence
given above which can lead to surprising results. To resolve this warning,
set at most one of the options above to a non-`null` value.
`initialHashedPassword`, `hashedPassword`, `initialPassword`, `password`
& `hashedPasswordFile` set to a non-null value.
${multiplePasswordsWarning}
${overrideOrderText cfg.mutableUsers}
The values of these options are:
${concatMapStringsSep
"\n"
Expand Down
9 changes: 3 additions & 6 deletions nixos/modules/services/mail/mailman.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ in {
(lib.mkRemovedOptionModule [ "services" "mailman" "package" ] ''
Didn't have an effect for several years.
'')
(lib.mkRemovedOptionModule [ "services" "mailman" "extraPythonPackages" ] ''
Didn't have an effect for several years.
'')
];

options = {
Expand Down Expand Up @@ -282,12 +285,6 @@ in {
};
};

extraPythonPackages = lib.mkOption {
description = "Packages to add to the python environment used by mailman and mailman-web";
type = lib.types.listOf lib.types.package;
default = [];
};

settings = lib.mkOption {
description = "Settings for mailman.cfg";
type = lib.types.attrsOf (lib.types.attrsOf lib.types.str);
Expand Down
2 changes: 2 additions & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@ in {
pantheon = handleTest ./pantheon.nix {};
paperless = handleTest ./paperless.nix {};
parsedmarc = handleTest ./parsedmarc {};
password-option-override-ordering = handleTest ./password-option-override-ordering.nix {};
pdns-recursor = handleTest ./pdns-recursor.nix {};
peerflix = handleTest ./peerflix.nix {};
peering-manager = handleTest ./web-apps/peering-manager.nix {};
Expand Down Expand Up @@ -1050,6 +1051,7 @@ in {
systemd-sysupdate = runTest ./systemd-sysupdate.nix;
systemd-sysusers-mutable = runTest ./systemd-sysusers-mutable.nix;
systemd-sysusers-immutable = runTest ./systemd-sysusers-immutable.nix;
systemd-sysusers-password-option-override-ordering = runTest ./systemd-sysusers-password-option-override-ordering.nix;
systemd-timesyncd = handleTest ./systemd-timesyncd.nix {};
systemd-timesyncd-nscd-dnssec = handleTest ./systemd-timesyncd-nscd-dnssec.nix {};
systemd-user-linger = handleTest ./systemd-user-linger.nix {};
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/fenics.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import ./make-test-python.nix (
{
name = "fenics";
meta = {
maintainers = with pkgs.lib.maintainers; [ knedlsepp ];
maintainers = with pkgs.lib.maintainers; [ ];
};

nodes = {
Expand Down
Loading

0 comments on commit c03fa0c

Please sign in to comment.