summary refs log tree commit diff
path: root/nixos/modules/config/update-users-groups.pl
diff options
context:
space:
mode:
authorSilvan Mosberger <infinisil@icloud.com>2019-07-31 23:19:49 +0200
committerSilvan Mosberger <infinisil@icloud.com>2019-10-14 01:59:19 +0200
commit23d920c8f0d8d790fc69e155acbe9342853cc46a (patch)
treee9a0ac4f220c54f201ec012a553db4c695400f70 /nixos/modules/config/update-users-groups.pl
parent6c8aed6391a5e9f69cb59792aed58c5f33650275 (diff)
downloadnixpkgs-23d920c8f0d8d790fc69e155acbe9342853cc46a.tar
nixpkgs-23d920c8f0d8d790fc69e155acbe9342853cc46a.tar.gz
nixpkgs-23d920c8f0d8d790fc69e155acbe9342853cc46a.tar.bz2
nixpkgs-23d920c8f0d8d790fc69e155acbe9342853cc46a.tar.lz
nixpkgs-23d920c8f0d8d790fc69e155acbe9342853cc46a.tar.xz
nixpkgs-23d920c8f0d8d790fc69e155acbe9342853cc46a.tar.zst
nixpkgs-23d920c8f0d8d790fc69e155acbe9342853cc46a.zip
nixos/users: Increase maximum system uid/gid from 499 to 999
This enlarges the system uid/gid range 6-fold, from 100 to 600 ids. This
is a preventative measure against running out of dynamically allocated
ids for NixOS services with isSystemUser, which should become the
preferred way of allocating uids for non-real users.
Diffstat (limited to 'nixos/modules/config/update-users-groups.pl')
-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 59cea51c611..15e448b787a 100644
--- a/nixos/modules/config/update-users-groups.pl
+++ b/nixos/modules/config/update-users-groups.pl
@@ -56,12 +56,12 @@ sub allocGid {
         $gidsUsed{$prevGid} = 1;
         return $prevGid;
     }
-    return allocId(\%gidsUsed, \%gidsPrevUsed, 400, 499, 0, sub { my ($gid) = @_; getgrgid($gid) });
+    return allocId(\%gidsUsed, \%gidsPrevUsed, 400, 999, 0, sub { my ($gid) = @_; getgrgid($gid) });
 }
 
 sub allocUid {
     my ($name, $isSystemUser) = @_;
-    my ($min, $max, $up) = $isSystemUser ? (400, 499, 0) : (1000, 29999, 1);
+    my ($min, $max, $up) = $isSystemUser ? (400, 999, 0) : (1000, 29999, 1);
     my $prevUid = $uidMap->{$name};
     if (defined $prevUid && $prevUid >= $min && $prevUid <= $max && !defined $uidsUsed{$prevUid}) {
         print STDERR "reviving user '$name' with UID $prevUid\n";