nixpkgs/modules/misc/ids.nix
Peter Simons 0ef085d58a Add services.httpd.fixUidAndGid option to assign reliable numeric UID and GID for the Apache user.
The option is disabled by default so that previously existing installations
aren't affected.

If you'd like to migrate to the fixed numeric id for Apache, set "fixUidAndGid
= true", edit the file "/etc/groups" and replace the old GID value with 54.
(NixOS can't do that for you because it refuses to change a GID that identifies
the primary group of a user.) Then run

  find / -xdev -uid $oldUID -exec chown 54 {} +
  find / -xdev -gid $oldGID -exec chgrp 54 {} +

to update ownership of all files that are supposed to be owned by Apache.
2012-08-03 16:39:55 +02:00

139 lines
2.4 KiB
Nix

# This module defines the global list of uids and gids. We keep a
# central list to prevent id collissions.
{config, pkgs, ...}:
let
options = {
ids.uids = pkgs.lib.mkOption {
description = ''
The user IDs used in NixOS.
'';
};
ids.gids = pkgs.lib.mkOption {
description = ''
The group IDs used in NixOS.
'';
};
};
in
{
require = options;
ids.uids = {
root = 0;
nscd = 1;
sshd = 2;
ntp = 3;
messagebus = 4; # D-Bus
haldaemon = 5;
nagios = 6;
vsftpd = 7;
ftp = 8;
bitlbee = 9;
avahi = 10;
portmap = 11;
atd = 12;
zabbix = 13;
postfix = 14;
dovecot = 15;
tomcat = 16;
gnunetd = 17;
pulseaudio = 22; # must match `pulseaudio' GID
gpsd = 23;
polkituser = 28;
uptimed = 29;
ddclient = 30;
davfs2 = 31;
privoxy = 32;
osgi = 34;
tor = 35;
cups = 36;
foldingAtHome = 37;
sabnzbd = 38;
kdm = 39;
ghostOne = 40;
git = 41;
fourStore = 42;
fourStoreEndpoint = 43;
virtuoso = 44;
rtkit = 45;
dovecot2 = 46;
dovenull2 = 47;
unbound = 48;
prayer = 49;
mpd = 50;
clamav = 51;
fprot = 52;
bind = 53;
wwwrun = 54;
# When adding a uid, make sure it doesn't match an existing gid.
nixbld = 30000; # start of range of uids
nobody = 65534;
};
ids.gids = {
root = 0;
wheel = 1;
kmem = 2;
tty = 3;
messagebus = 4; # D-Bus
haldaemon = 5;
disk = 6;
vsftpd = 7;
ftp = 8;
bitlbee = 9;
avahi = 10;
portmap = 11;
atd = 12;
postfix = 13;
postdrop = 14;
dovecot = 15;
audio = 17;
floppy = 18;
uucp = 19;
lp = 20;
tomcat = 21;
pulseaudio = 22; # must match `pulseaudio' UID
gpsd = 23;
cdrom = 24;
tape = 25;
video = 26;
dialout = 27;
polkituser = 28;
utmp = 29;
davfs2 = 31;
privoxy = 32;
disnix = 33;
osgi = 34;
ghostOne = 40;
git = 41;
fourStore = 42;
fourStoreEndpoint = 43;
virtuoso = 44;
dovecot2 = 46;
prayer = 49;
mpd = 50;
clamav = 51;
fprot = 52;
# Group id 53 is still free! I didn't use it, because I wanted the
# the same numeric value for the 'wwwrun' user and group.
wwwrun = 54;
# When adding a gid, make sure it doesn't match an existing uid.
users = 100;
nixbld = 30000;
nogroup = 65534;
};
}