Stop recommending bcrypt everywhere

By passing no method to mkpasswd we make it select the strongest cipher
that libxcrypt recommends.

Replaces the example hashes with yescrypt hashes, which is the current
default.
This commit is contained in:
Martin Weinelt
2025-11-16 18:27:29 +01:00
parent 33ba1ff52b
commit ff9b046f0f
4 changed files with 9 additions and 9 deletions
+6 -6
View File
@@ -152,12 +152,12 @@ in
hashedPassword = mkOption {
type = with types; nullOr str;
default = null;
example = "$6$evQJs5CFQyPAW09S$Cn99Y8.QjZ2IBnSu4qf1vBxDRWkaIZWOtmu1Ddsm3.H3CFpeVc0JU4llIq8HQXgeatvYhh5O33eWG3TSpjzu6/";
example = "$y$j9T$vfGrwkAaXCjCEWtVNMQck1$383uIXQmn2z0hnmVAA8kwFQmjNj78.nYbvWeyNLIaP1";
description = ''
The user's hashed password. Use `mkpasswd` as follows
```
nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt'
nix-shell -p mkpasswd --run 'mkpasswd -s'
```
Warning: this is stored in plaintext in the Nix store!
@@ -173,7 +173,7 @@ in
A file containing the user's hashed password. Use `mkpasswd` as follows
```
nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt'
nix-shell -p mkpasswd --run 'mkpasswd -s'
```
'';
};
@@ -275,10 +275,10 @@ in
);
example = {
user1 = {
hashedPassword = "$6$evQJs5CFQyPAW09S$Cn99Y8.QjZ2IBnSu4qf1vBxDRWkaIZWOtmu1Ddsm3.H3CFpeVc0JU4llIq8HQXgeatvYhh5O33eWG3TSpjzu6/";
hashedPassword = "$y$j9T$y6eZ1o.IvVNfdGMAsUEvh1$6K/llP52uw2iDh4iSwtAn54/JYy7FzCcoCHmjmx00H5";
};
user2 = {
hashedPassword = "$6$oE0ZNv2n7Vk9gOf$9xcZWCCLGdMflIfuA0vR1Q1Xblw6RZqPrP94mEit2/81/7AKj2bqUai5yPyWE.QYPyv6wLMHZvjw3Rlg7yTCD/";
hashedPassword = "$y$j9T$hZ.ubq0M897Hw.znxnGG9.$14EJBoOwbwKeWt.W4vpnBPEBZC9mYz4fWI9kOCLoZf4";
};
};
description = ''
@@ -287,7 +287,7 @@ in
follows
```
nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt'
nix-shell -p mkpasswd --run 'mkpasswd -s'
```
'';
default = { };
+1 -1
View File
@@ -32,7 +32,7 @@
x509.useACMEHost = config.mailserver.fqdn;
# A list of all login accounts. To create the password hashes, use
# nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt'
# nix-shell -p mkpasswd --run 'mkpasswd -s'
loginAccounts = {
"user1@example.com" = {
hashedPasswordFile = "/a/file/containing/a/hashed/password";
+1 -1
View File
@@ -38,7 +38,7 @@ let
inherit password;
}
''
mkpasswd -sm bcrypt <<<"$password" > $out
mkpasswd -s <<<"$password" > $out
'';
hashedPasswordFile = hashPassword "my-password";
+1 -1
View File
@@ -15,7 +15,7 @@ let
inherit password;
}
''
mkpasswd -sm bcrypt <<<"$password" > $out
mkpasswd -s <<<"$password" > $out
'';
password = pkgs.writeText "password" "password";