summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorDomen Kožar <domen@dev.si>2016-08-30 17:13:41 +0200
committerDomen Kožar <domen@dev.si>2016-08-30 17:14:14 +0200
commite561edc322d275c3687fec431935095cfc717147 (patch)
treec87300066e06c9092e4421343d5bdf22727d0101 /nixos/modules
parent95021f061a3df49e041b474a7088f105c3a69dd1 (diff)
downloadnixlib-e561edc322d275c3687fec431935095cfc717147.tar
nixlib-e561edc322d275c3687fec431935095cfc717147.tar.gz
nixlib-e561edc322d275c3687fec431935095cfc717147.tar.bz2
nixlib-e561edc322d275c3687fec431935095cfc717147.tar.lz
nixlib-e561edc322d275c3687fec431935095cfc717147.tar.xz
nixlib-e561edc322d275c3687fec431935095cfc717147.tar.zst
nixlib-e561edc322d275c3687fec431935095cfc717147.zip
update-users-groups.pl: correctly guard duplicate uids for declarative users
Verified that following nixos configuration:

    users.users.foo = {
      uid = 1000;
      name = "foo";
    };
    users.users.bar = {
      name = "bar";
    };

Before this commit both users will get uid of 1000, after it's applied
bar will correctly get 1001.
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/config/update-users-groups.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/config/update-users-groups.pl b/nixos/modules/config/update-users-groups.pl
index 967f427374b1..cbbe216e5a17 100644
--- a/nixos/modules/config/update-users-groups.pl
+++ b/nixos/modules/config/update-users-groups.pl
@@ -52,8 +52,8 @@ foreach my $g (@{$spec->{groups}}) {
     $gidsUsed{$g->{gid}} = 1 if defined $g->{gid};
 }
 
-foreach my $u (@{$spec->{groups}}) {
-    $uidsUsed{$u->{u}} = 1 if defined $u->{uid};
+foreach my $u (@{$spec->{users}}) {
+    $uidsUsed{$u->{uid}} = 1 if defined $u->{uid};
 }
 
 # Read the current /etc/group.