I’m a bit confused about how passwordFile options fit into the flake ecosystem and also about the contents of the users.users..passwordFile. Here are my questions
As far as I can tell one of the flakes selling features is their hermetic or ‘pure’ evaluation of nix code which results in more reproducible outputs. This means that you can’t do things like readFile or fetchGit. However, it seems to me that passwordFile options are just as ‘impure’ as they rely on an external file that can change between evaluations thus producing different outputs. How is the passwordFile mechanism different?
Are the contents of the passwordFile file copied to the nix store or only the path to the file?
Regarding the users.users..passwordFile option, the docs say:
The file should contain exactly one line, which should be the password in an encrypted form that is suitable for the
Would any type of encryption work? Will NixOS automatically recognize the encryption method used? I’ve seen people use
mkpasswd -m sha-512 to generate the hash but I don’t know if it’s because Linux (or NixOS) uses sha-512 as the default algo for user login or it’s because you can use any algo you want. Is the algo used for user logins defined somewhere?