Currently calculate-id generates uids at evaluation time.
I'm proposing to make calculate-id as a regular package that generates contents of /etc/passwd that can be plugged in to NixOS — this way we can define lists of users in a usual way (e.g. readDir over public keys directory), but have IDs generated for us and collisions can be detected by looking at the output file, instead of threading those computations around. (in a nutshell, move calculate-id from eval-support to become a regular package you can use with stdenv.mkDerivation).
This will also simplify evaluation to use simple Nix instantiate+build model without nix-exec-style native plugins (thus this proposal conflicts with #33).
Currently
calculate-idgenerates uids at evaluation time.I'm proposing to make calculate-id as a regular package that generates contents of
/etc/passwdthat can be plugged in to NixOS — this way we can define lists of users in a usual way (e.g.readDirover public keys directory), but have IDs generated for us and collisions can be detected by looking at the output file, instead of threading those computations around. (in a nutshell, movecalculate-idfromeval-supportto become a regular package you can use withstdenv.mkDerivation).This will also simplify evaluation to use simple Nix instantiate+build model without nix-exec-style native plugins (thus this proposal conflicts with #33).