Remove Some Static IDs (#367563)

Ramses 4af8ef3c 631ac7fa

Changed files
+13 -12
ci
nixos
modules
hardware
misc
services
+1
ci/OWNERS
···
/nixos/default.nix @infinisil
/nixos/lib/from-env.nix @infinisil
/nixos/lib/eval-config.nix @infinisil
+
/nixos/modules/misc/ids.nix @R-VdP
/nixos/modules/system/activation/bootspec.nix @grahamc @cole-h @raitobezarius
/nixos/modules/system/activation/bootspec.cue @grahamc @cole-h @raitobezarius
+1 -1
nixos/modules/hardware/uinput.nix
···
config = lib.mkIf cfg.enable {
boot.kernelModules = [ "uinput" ];
-
users.groups.uinput.gid = config.ids.gids.uinput;
+
users.groups.uinput = { };
services.udev.extraRules = ''
SUBSYSTEM=="misc", KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"
+9 -9
nixos/modules/misc/ids.nix
···
# central list to prevent id collisions.
# IMPORTANT!
-
# We only add static uids and gids for services where it is not feasible
-
# to change uids/gids on service start, for example a service with a lot of
-
# files. Please also check if the service is applicable for systemd's
-
# DynamicUser option and does not need a uid/gid allocation at all.
-
# Systemd can also change ownership of service directories using the
-
# RuntimeDirectory/StateDirectory options.
+
#
+
# https://github.com/NixOS/rfcs/blob/master/rfcs/0052-dynamic-ids.md
+
#
+
# Use of static ids is deprecated within NixOS. Dynamic allocation is
+
# required, barring special circumstacnes. Please check if the service
+
# is applicable for systemd's DynamicUser option and does not need a
+
# uid/gid allocation at all. Systemd can also change ownership of
+
# service directories using the RuntimeDirectory/StateDirectory
+
# options.
{ lib, ... }:
···
rstudio-server = 324;
localtimed = 325;
automatic-timezoned = 326;
-
whisparr = 328;
# When adding a uid, make sure it doesn't match an existing gid.
#
···
rstudio-server = 324;
localtimed = 325;
automatic-timezoned = 326;
-
uinput = 327;
-
whisparr = 328;
# When adding a gid, make sure it doesn't match an existing
# uid. Users and groups with the same name should have equal
+2 -2
nixos/modules/services/misc/whisparr.nix
···
whisparr = {
group = cfg.group;
home = cfg.dataDir;
-
uid = config.ids.uids.whisparr;
+
isSystemUser = true;
};
};
-
users.groups = lib.mkIf (cfg.group == "whisparr") { whisparr.gid = config.ids.gids.whisparr; };
+
users.groups.whisparr = lib.mkIf (cfg.group == "whisparr") { };
};
}