1 # This module defines the global list of uids and gids. We keep a
2 # central list to prevent id collisions.
5 # We only add static uids and gids for services where it is not feasible
6 # to change uids/gids on service start, for example a service with a lot of
7 # files. Please also check if the service is applicable for systemd's
8 # DynamicUser option and does not need a uid/gid allocation at all.
9 # Systemd can also change ownership of service directories using the
10 # RuntimeDirectory/StateDirectory options.
20 ids.uids = lib.mkOption {
23 The user IDs used in NixOS.
25 type = types.attrsOf types.int;
28 ids.gids = lib.mkOption {
31 The group IDs used in NixOS.
33 type = types.attrsOf types.int;
45 messagebus = 4; # D-Bus
48 #vsftpd = 7; # dynamically allocated ass of 2021-09-14
50 # bitlbee = 9; # removed 2021-10-05 #139765
51 #avahi = 10; # removed 2019-05-22
55 #postdrop = 14; # unused
59 #floppy = 18; # unused
63 pulseaudio = 22; # must match `pulseaudio' GID
68 #dialout = 27; # unused
71 # ddclient = 30; # converted to DynamicUser = true
79 #kdm = 39; # dropped in 17.03
80 #ghostone = 40; # dropped in 18.03
82 #fourstore = 42; # dropped in 20.03
83 #fourstorehttp = 43; # dropped in 20.03
84 #virtuoso = 44; dropped module
85 #rtkit = 45; # dynamically allocated 2021-09-03
88 # prayer = 49; # dropped in 23.11
92 # bind = 53; #dynamically allocated as of 2021-09-03
96 #networkmanager = 57; # unused
101 #systemd-journal = 62; # unused
106 #libvirtd = 67; # unused
108 #statsd = 69; # removed 2018-11-14
111 #vboxusers = 72; # unused
112 #vboxsf = 73; # unused
113 smbguest = 74; # unused
121 #almir = 82; # removed 2018-03-25, the almir package was removed in 30291227f2411abaca097773eedb49b8f259e297 during 2017-08
132 tcpcryptd = 93; # tcpcryptd uses a hard-coded uid. We patch it in Nixpkgs to match this choice.
135 #haproxy = 97; # dynamically allocated as of 2020-03-11
136 #mongodb = 98; #dynamically allocated as of 2021-09-03
137 #openldap = 99; # dynamically allocated as of PR#94610
138 #users = 100; # unused
139 # cgminer = 101; #dynamically allocated as of 2021-09-17
141 #logcheck = 103; #dynamically allocated as of 2021-09-17
142 #nix-ssh = 104; #dynamically allocated as of 2021-09-03
145 #searx = 107; # dynamically allocated as of 2020-10-27
146 #kippo = 108; # removed 2021-10-07, the kippo package was removed in 1b213f321cdbfcf868b96fd9959c24207ce1b66a during 2021-04
148 systemd-journal-gateway = 110;
149 #notbit = 111; # unused
151 #ngircd = 112; #dynamically allocated as of 2021-09-03
152 #btsync = 113; # unused
153 #minecraft = 114; #dynamically allocated as of 2021-09-03
155 # rippled = 116; #dynamically allocated as of 2021-09-18
169 #docker = 131; # unused
171 #dhcpd = 133; # dynamically allocated as of 2021-09-03
174 #neo4j = 136;# dynamically allocated as of 2021-09-03
177 #radvd = 139;# dynamically allocated as of 2021-09-03
178 #zookeeper = 140;# dynamically allocated as of 2021-09-03
179 #dnsmasq = 141;# dynamically allocated as of 2021-09-03
180 #uhub = 142; # unused
182 # mxisd = 144; # removed 2024-07-10
183 #consul = 145;# dynamically allocated as of 2021-09-03
184 #mailpile = 146; # removed 2022-01-12
186 #seeks = 148; # removed 2020-06-21
189 systemd-coredump = 151;
190 systemd-network = 152;
191 systemd-resolve = 153;
192 systemd-timesync = 154;
194 #etcd = 156;# dynamically allocated as of 2021-09-03
201 #chronos = 164; # removed 2020-08-15
203 # tox-bootstrapd = 166; removed 2021-09-15
206 #apache-kafka = 169;# dynamically allocated as of 2021-09-03
207 #panamax = 170; # unused
209 #fleet = 173; # unused
210 #input = 174; # unused
212 #tss = 176; # dynamically allocated as of 2021-09-17
213 #memcached = 177; removed 2018-01-03
214 #ntp = 179; # dynamically allocated as of 2021-09-17
216 #redis = 181; removed 2018-01-03
217 #unifi = 183; dynamically allocated as of 2021-09-17
219 #zope2 = 185; # dynamically allocated as of 2021-09-18
220 #ripple-data-api = 186; dynamically allocated as of 2021-09-17
222 #rdnssd = 188; #dynamically allocated as of 2021-09-18
231 # ripple-rest = 198; # unused, removed 2017-08-12
232 # nix-serve = 199; # unused, removed 2020-12-12
233 #tvheadend = 200; # dynamically allocated as of 2021-09-18
235 # gitit = 202; # unused, module was removed 2023-04-03
238 # riak = 205; # unused, remove 2022-07-22
239 #shout = 206; # dynamically allocated as of 2021-09-18, module removed 2024-10-19
243 #kibana = 211;# dynamically allocated as of 2021-09-03
245 calibre-server = 213;
246 #heapster = 214; #dynamically allocated as of 2021-09-17
248 # pumpio = 216; # unused, removed 2018-02-24
250 # mathics = 218; # unused, removed 2020-08-15
255 # gale = 223; removed 2021-06-10
256 matrix-synapse = 224;
258 # rmilter = 226; # unused, removed 2019-08-22
260 # gammu-smsd = 228; #dynamically allocated as of 2021-09-17
264 # nntp-proxy = 232; #dynamically allocated as of 2021-09-17
266 #radicale = 234;# dynamically allocated as of 2021-09-03
267 hydra-queue-runner = 235;
272 # factorio = 241; # DynamicUser = true
273 # emby = 242; # unusued, removed 2019-05-01
274 #graylog = 243;# dynamically allocated as of 2021-09-03
278 #toxvpn = 247; # dynamically allocated as of 2021-09-18
279 # squeezelite = 248; # DynamicUser = true
281 #smokeping = 250;# dynamically allocated as of 2021-09-03
290 # hound = 259; # unused, removed 2023-11-21
293 # stanchion = 262; # unused, removed 2020-10-14
294 # riak-cs = 263; # unused, removed 2020-10-14
298 # couchpotato = 267; # unused, removed 2022-01-01
299 # gogs = 268; # unused, removed in 2024-10-12
300 #pdns-recursor = 269; # dynamically allocated as of 2020-20-18
301 #kresd = 270; # switched to "knot-resolver" with dynamic ID
303 #geoip = 272; # new module uses DynamicUser
313 # pykms = 282; # DynamicUser = true
315 # restya-board = 284; # removed 2024-01-22
318 #monero = 287; # dynamically allocated as of 2021-05-08
324 # meguca = 293; # removed 2020-08-21
329 #hydron = 298; # removed 2024-08-03
333 # kvm = 302; # unused
334 # render = 303; # unused
335 # zeronet = 304; # removed 2019-01-03
340 # solr = 309; removed 2023-03-16
347 #mailman = 316; # removed 2019-08-30
349 # shadow = 318; # unused
355 rstudio-server = 324;
357 automatic-timezoned = 326;
359 # When adding a uid, make sure it doesn't match an existing gid.
361 # !!! Don't use uids above "399"! !!!
363 # The reason behind this restriction is that, NixOS by default allocates
364 # system user UIDs/GIDs in the range of `400..999`. System users/groups
365 # created using command like `useradd` will have UID and GID in this range[1].
367 # If a newly added ID goes beyond "399", it may conflict with existing
368 # system user or group of the same id in someone else's NixOS.
369 # This could break their system and make that person upset for a whole day.
371 # Sidenote: the default is defined in `shadow` module[2], and the relavent change
372 # was made way back in 2014[3].
374 # [1]: https://man7.org/linux/man-pages/man5/login.defs.5.html#:~:text=SYS_UID_MAX%20(number)%2C%20SYS_UID_MIN%20(number)
375 # [2]: <nixos/modules/programs/shadow.nix>
376 # [3]: https://github.com/NixOS/nixpkgs/commit/0e23a175de3687df8232fe118cbe87f04228ff28
378 nixbld = 30000; # start of range of uids
387 messagebus = 4; # D-Bus
390 #vsftpd = 7; # dynamically allocated as of 2021-09-14
392 # bitlbee = 9; # removed 2021-10-05 #139765
393 #avahi = 10; # removed 2019-05-22
394 #nagios = 11; # unused
405 pulseaudio = 22; # must match `pulseaudio' UID
411 #polkituser = 28; # currently unused, polkitd doesn't need a group
413 # ddclient = 30; # converted to DynamicUser = true
419 #foldingathome = 37; # unused
420 #sabnzd = 38; # unused
421 #kdm = 39; # unused, even before 17.03
422 #ghostone = 40; # dropped in 18.03
427 #rtkit = 45; # unused
430 # prayer = 49; # dropped in 23.11
433 #fprot = 52; # unused
443 systemd-journal = 62;
450 #statsd = 69; # removed 2018-11-14
455 smbguest = 74; # unused
463 #almir = 82; # removed 2018-03-25, the almir package was removed in 30291227f2411abaca097773eedb49b8f259e297 during 2017-08
474 #tcpcryptd = 93; # unused
477 #haproxy = 97; # dynamically allocated as of 2020-03-11
478 #mongodb = 98; # unused
479 #openldap = 99; # dynamically allocated as of PR#94610
481 #logcheck = 103; # unused
482 #nix-ssh = 104; # unused
485 #searx = 107; # dynamically allocated as of 2020-10-27
486 #kippo = 108; # removed 2021-10-07, the kippo package was removed in 1b213f321cdbfcf868b96fd9959c24207ce1b66a during 2021-04
488 systemd-journal-gateway = 110;
489 #notbit = 111; # unused
491 #ngircd = 112; # unused
492 #btsync = 113; # unused
493 #minecraft = 114; # unused
495 #ripped = 116; # unused
511 #dhcpcd = 133; # unused
514 #neo4j = 136; # unused
517 #radvd = 139; # unused
518 #zookeeper = 140; # unused
519 #dnsmasq = 141; # unused
521 #yandexdisk = 143; # unused
522 # mxisd = 144; # removed 2024-07-10
523 #consul = 145; # unused
524 #mailpile = 146; # removed 2022-01-12
526 #seeks = 148; # removed 2020-06-21
529 systemd-network = 152;
530 systemd-resolve = 153;
531 systemd-timesync = 154;
533 #etcd = 156; # unused
539 #peerflix = 163; # unused
540 #chronos = 164; # unused
543 #panamax = 170; # unused
545 #fleet = 173; # unused
548 #tss = 176; #dynamically allocateda as of 2021-09-20
549 #memcached = 177; # unused, removed 2018-01-03
552 #redis = 181; # unused, removed 2018-01-03
553 #unifi = 183; # unused
554 #uptimed = 184; # unused
555 #zope2 = 185; # unused
556 #ripple-data-api = 186; #unused
558 #rdnssd = 188; # unused
565 #grafana = 196; #unused
566 #skydns = 197; #unused
567 # ripple-rest = 198; # unused, removed 2017-08-12
568 #nix-serve = 199; #unused
569 #tvheadend = 200; #unused
574 # riak = 205;#unused, removed 2022-06-22
575 #shout = 206; #unused
581 calibre-server = 213;
583 # pumpio = 216; # unused, removed 2018-02-24
590 # gale = 223; removed 2021-06-10
591 matrix-synapse = 224;
593 # rmilter = 226; # unused, removed 2019-08-22
597 #radicale = 234;# dynamically allocated as of 2021-09-03
601 # factorio = 241; # unused
602 # emby = 242; # unused, removed 2019-05-01
606 #toxvpn = 247; # unused
607 #squeezelite = 248; #unused
609 #smokeping = 250;# dynamically allocated as of 2021-09-03
615 #telegraf = 256; # unused
618 # hound = 259; # unused, removed 2023-11-21
621 # stanchion = 262; # unused, removed 2020-10-14
622 # riak-cs = 263; # unused, removed 2020-10-14
626 # couchpotato = 267; # unused, removed 2022-01-01
627 # gogs = 268; # unused, removed in 2024-10-12
628 #kresd = 270; # switched to "knot-resolver" with dynamic ID
630 #geoip = 272; # unused
640 # pykms = 282; # DynamicUser = true
642 # restya-board = 284; # removed 2024-01-22
645 # monero = 287; # dynamically allocated as of 2021-05-08
651 # meguca = 293; # removed 2020-08-21
656 #hydron = 298; # removed 2024-08-03
660 kvm = 302; # default udev rules from systemd requires these
661 render = 303; # default udev rules from systemd requires these
662 sgx = 304; # default udev rules from systemd requires these
667 # solr = 309; removed 2023-03-16
674 #mailman = 316; # removed 2019-08-30
682 rstudio-server = 324;
684 automatic-timezoned = 326;
687 # When adding a gid, make sure it doesn't match an existing
688 # uid. Users and groups with the same name should have equal
691 # !!! Don't use gids above "399"! !!!
693 # The reason behind this restriction is that, NixOS by default allocates
694 # system user UIDs/GIDs in the range of `400..999`. System users/groups
695 # created using command like `useradd` will have UID and GID in this range[1].
697 # If a newly added ID goes beyond "399", it may conflict with existing
698 # system user or group of the same id in someone else's NixOS.
699 # This could break their system and make that person upset for a whole day.
701 # Sidenote: the default is defined in `shadow` module[2], and the relavent change
702 # was made way back in 2014[3].
704 # [1]: https://man7.org/linux/man-pages/man5/login.defs.5.html#:~:text=SYS_UID_MAX%20(number)%2C%20SYS_UID_MIN%20(number)
705 # [2]: <nixos/modules/programs/shadow.nix>
706 # [3]: https://github.com/NixOS/nixpkgs/commit/0e23a175de3687df8232fe118cbe87f04228ff28
708 # For exceptional cases where you really need a gid above 399, leave a
709 # comment stating why.
711 # Also, avoid the following GID ranges:
713 # 1000 - 29999: user accounts (see ../config/update-users-groups.pl)
714 # 30000 - 31000: nixbld users (the upper limit is arbitrarily chosen)
715 # 61184 - 65519: systemd DynamicUser (see systemd.exec(5))
716 # 65535: the error return sentinel value when uid_t was 16 bits
718 # 100000 - 6653600: subgid allocated for user namespaces
719 # (see ../config/update-users-groups.pl)
720 # 4294967294: unauthenticated user in some NFS implementations
721 # 4294967295: error return sentinel value
724 # https://www.debian.org/doc/debian-policy/ch-opersys.html#uid-and-gid-classes
726 onepassword = 31001; # 1Password requires that its GID be larger than 1000
727 onepassword-cli = 31002; # 1Password requires that its GID be larger than 1000