From 8b6fa3c8216e0fdb802ffd2415422c9d7e6c9dcb Mon Sep 17 00:00:00 2001 From: Austin Butler Date: Sun, 19 Sep 2021 12:40:54 -0700 Subject: [PATCH 1/3] nixos/tpm2: define group, fix after NixOS#133166 --- nixos/modules/security/tpm2.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/security/tpm2.nix b/nixos/modules/security/tpm2.nix index 27f9b58c9755..d37425166f88 100644 --- a/nixos/modules/security/tpm2.nix +++ b/nixos/modules/security/tpm2.nix @@ -146,6 +146,7 @@ in { # Create the tss user and group only if the default value is used users.users.${cfg.tssUser} = lib.mkIf (cfg.tssUser == "tss") { isSystemUser = true; + group = "tss"; }; users.groups.${cfg.tssGroup} = lib.mkIf (cfg.tssGroup == "tss") {}; @@ -172,7 +173,7 @@ in { BusName = "com.intel.tss2.Tabrmd"; ExecStart = "${cfg.abrmd.package}/bin/tpm2-abrmd"; User = "tss"; - Group = "nogroup"; + Group = "tss"; }; }; From b88b46b830d31db6a532a3302c3e98a6697aee08 Mon Sep 17 00:00:00 2001 From: Austin Butler Date: Sun, 19 Sep 2021 12:42:46 -0700 Subject: [PATCH 2/3] nixos/tcsd: make group uid dynamic --- nixos/modules/misc/ids.nix | 2 +- nixos/modules/services/hardware/tcsd.nix | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index 5f56e0602279..28d471b35a86 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -210,7 +210,7 @@ in #fleet = 173; # unused #input = 174; # unused sddm = 175; - tss = 176; + #tss = 176; # dynamically allocated as of 2021-09-17 #memcached = 177; removed 2018-01-03 #ntp = 179; # dynamically allocated as of 2021-09-17 zabbix = 180; diff --git a/nixos/modules/services/hardware/tcsd.nix b/nixos/modules/services/hardware/tcsd.nix index 0d36bce357ba..c549a6775013 100644 --- a/nixos/modules/services/hardware/tcsd.nix +++ b/nixos/modules/services/hardware/tcsd.nix @@ -149,12 +149,10 @@ in users.users = optionalAttrs (cfg.user == "tss") { tss = { group = "tss"; - uid = config.ids.uids.tss; + isSystemUser = true; }; }; - users.groups = optionalAttrs (cfg.group == "tss") { - tss.gid = config.ids.gids.tss; - }; + users.groups = optionalAttrs (cfg.group == "tss") { tss = {}; }; }; } From f0fac59a17557329024df8a031df6bac1c5f5e9f Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Mon, 20 Sep 2021 16:24:33 +0000 Subject: [PATCH 3/3] nixos/tpm2: remove tss static gid --- nixos/modules/misc/ids.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index 28d471b35a86..e760a18f5082 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -524,7 +524,7 @@ in #fleet = 173; # unused input = 174; sddm = 175; - tss = 176; + #tss = 176; #dynamically allocateda as of 2021-09-20 #memcached = 177; # unused, removed 2018-01-03 #ntp = 179; # unused zabbix = 180;