support unhashed password files

This commit is contained in:
Ryan Gibb
2026-03-04 17:14:45 +00:00
parent e1afec5b08
commit 12ae5dd89b
5 changed files with 67 additions and 5 deletions
+9 -2
View File
@@ -45,12 +45,19 @@ rec {
in
lib.mapAttrs (
name: value:
if value.hashedPasswordFile == null then
if value.hashedPasswordFile != null then
value.hashedPasswordFile
else if value.hashedPassword != null then
builtins.toString (mkHashFile name value.hashedPassword)
else
value.hashedPasswordFile
value.passwordFile
) cfg.loginAccounts;
# Collect accounts with plain text passwords that require hashing
accountsWithPlaintextPasswordFiles = lib.filter (
name: cfg.loginAccounts.${name}.passwordFile != null
) (builtins.attrNames cfg.loginAccounts);
# Appends the LDAP bind password to files to avoid writing this
# password into the Nix store.
appendLdapBindPwd =