1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-07 11:05:30 +03:00

Merge staging-next into staging

This commit is contained in:
github-actions[bot] 2022-11-19 18:01:53 +00:00 committed by GitHub
commit 14b4aa3fd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 412 additions and 146 deletions

View file

@ -35,7 +35,7 @@ let
'';
hashedPasswordDescription = ''
To generate a hashed password run `mkpasswd -m sha-512`.
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
@ -592,6 +592,26 @@ in {
'';
};
# Warn about user accounts with deprecated password hashing schemes
system.activationScripts.hashes = {
deps = [ "users" ];
text = ''
users=()
while IFS=: read -r user hash tail; do
if [[ "$hash" = "$"* && ! "$hash" =~ ^\$(y|gy|7|2b|2y|2a|6)\$ ]]; then
users+=("$user")
fi
done </etc/shadow
if (( "''${#users[@]}" )); then
echo "
WARNING: The following user accounts rely on password hashes that will
be removed in NixOS 23.05. They should be renewed as soon as possible."
printf ' - %s\n' "''${users[@]}"
fi
'';
};
# for backwards compatibility
system.activationScripts.groups = stringAfter [ "users" ] "";