0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

nixos/users-groups: Add dry mode

This commit is contained in:
Janne Heß 2021-09-03 17:21:36 +02:00
parent 3156730402
commit a851b4d20e
No known key found for this signature in database
GPG key ID: 69165158F05265DF
3 changed files with 60 additions and 17 deletions

View file

@ -561,14 +561,16 @@ in {
shadow.gid = ids.gids.shadow;
};
system.activationScripts.users = stringAfter [ "stdio" ]
''
system.activationScripts.users = {
supportsDryActivation = true;
text = ''
install -m 0700 -d /root
install -m 0755 -d /home
${pkgs.perl.withPackages (p: [ p.FileSlurp p.JSON ])}/bin/perl \
-w ${./update-users-groups.pl} ${spec}
'';
};
# for backwards compatibility
system.activationScripts.groups = stringAfter [ "users" ] "";