From 9f9b458ce39e1e6fecb4dca2f659db8752d91e8a Mon Sep 17 00:00:00 2001 From: Alex Guzman Date: Wed, 7 Aug 2019 13:23:36 -0700 Subject: [PATCH] [roon-server] don't create user if user changes defaults If the user changes the user for roon, we can assume they handled the setup for it --- nixos/modules/services/audio/roon-server.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/nixos/modules/services/audio/roon-server.nix b/nixos/modules/services/audio/roon-server.nix index 8c56634cb75c..6ad5b6b4cbdc 100644 --- a/nixos/modules/services/audio/roon-server.nix +++ b/nixos/modules/services/audio/roon-server.nix @@ -48,6 +48,7 @@ in { ExecStart = "${pkgs.roon-server}/opt/start.sh"; LimitNOFILE = 8192; User = cfg.user; + Group = cfg.group; }; }; @@ -58,14 +59,14 @@ in { allowedUDPPorts = [ 9003 ]; }; - users.groups = singleton { - name = cfg.group; - }; - users.users = singleton { - name = cfg.user; - isSystemUser = true; - description = "Roon Server user"; - groups = [ cfg.group "audio" ]; - }; + + users.groups."${cfg.group}" = {}; + users.users."${cfg.user}" = + if cfg.user == "roon-server" then { + isSystemUser = true; + description = "Roon Server user"; + groups = [ cfg.group "audio" ]; + } + else {}; }; }