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:
parent
3156730402
commit
a851b4d20e
3 changed files with 60 additions and 17 deletions
|
@ -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" ] "";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue