nixos/uinput: set a static GID for the uinput group (#333762)

This commit is contained in:
h7x4 2024-10-05 20:59:16 +02:00 committed by GitHub
commit cc76cf58f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 7 deletions

View File

@ -1,8 +1,9 @@
{ config, pkgs, lib, ... }: { config, lib, ... }:
let let
cfg = config.hardware.uinput; cfg = config.hardware.uinput;
in { in
{
options.hardware.uinput = { options.hardware.uinput = {
enable = lib.mkEnableOption "uinput support"; enable = lib.mkEnableOption "uinput support";
}; };
@ -10,7 +11,7 @@ in {
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
boot.kernelModules = [ "uinput" ]; boot.kernelModules = [ "uinput" ];
users.groups.uinput = {}; users.groups.uinput.gid = config.ids.gids.uinput;
services.udev.extraRules = '' services.udev.extraRules = ''
SUBSYSTEM=="misc", KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput" SUBSYSTEM=="misc", KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"

View File

@ -35,7 +35,6 @@ in
}; };
config = { config = {
ids.uids = { ids.uids = {
@ -111,7 +110,7 @@ in
postgres = 71; postgres = 71;
#vboxusers = 72; # unused #vboxusers = 72; # unused
#vboxsf = 73; # unused #vboxsf = 73; # unused
smbguest = 74; # unused smbguest = 74; # unused
varnish = 75; varnish = 75;
datadog = 76; datadog = 76;
lighttpd = 77; lighttpd = 77;
@ -290,7 +289,7 @@ in
postgrey = 258; postgrey = 258;
# hound = 259; # unused, removed 2023-11-21 # hound = 259; # unused, removed 2023-11-21
leaps = 260; leaps = 260;
ipfs = 261; ipfs = 261;
# stanchion = 262; # unused, removed 2020-10-14 # stanchion = 262; # unused, removed 2020-10-14
# riak-cs = 263; # unused, removed 2020-10-14 # riak-cs = 263; # unused, removed 2020-10-14
infinoted = 264; infinoted = 264;
@ -436,7 +435,7 @@ in
postgres = 71; postgres = 71;
vboxusers = 72; vboxusers = 72;
vboxsf = 73; vboxsf = 73;
smbguest = 74; # unused smbguest = 74; # unused
varnish = 75; varnish = 75;
datadog = 76; datadog = 76;
lighttpd = 77; lighttpd = 77;
@ -666,6 +665,7 @@ in
rstudio-server = 324; rstudio-server = 324;
localtimed = 325; localtimed = 325;
automatic-timezoned = 326; automatic-timezoned = 326;
uinput = 327;
# When adding a gid, make sure it doesn't match an existing # When adding a gid, make sure it doesn't match an existing
# uid. Users and groups with the same name should have equal # uid. Users and groups with the same name should have equal