summary refs log tree commit diff
path: root/nixos/modules/services/audio/roon-server.nix
diff options
context:
space:
mode:
authorAlex Guzman <alex@guzman.io>2019-08-07 13:23:36 -0700
committerAlex Guzman <alex@guzman.io>2019-08-07 13:23:36 -0700
commit9f9b458ce39e1e6fecb4dca2f659db8752d91e8a (patch)
tree8a88ce16fb42b7941b5b850544d1b703ad79191c /nixos/modules/services/audio/roon-server.nix
parent6572b5e4a13f56d8ac1fb69a4b92fd65c8106eef (diff)
downloadnixpkgs-9f9b458ce39e1e6fecb4dca2f659db8752d91e8a.tar
nixpkgs-9f9b458ce39e1e6fecb4dca2f659db8752d91e8a.tar.gz
nixpkgs-9f9b458ce39e1e6fecb4dca2f659db8752d91e8a.tar.bz2
nixpkgs-9f9b458ce39e1e6fecb4dca2f659db8752d91e8a.tar.lz
nixpkgs-9f9b458ce39e1e6fecb4dca2f659db8752d91e8a.tar.xz
nixpkgs-9f9b458ce39e1e6fecb4dca2f659db8752d91e8a.tar.zst
nixpkgs-9f9b458ce39e1e6fecb4dca2f659db8752d91e8a.zip
[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
Diffstat (limited to 'nixos/modules/services/audio/roon-server.nix')
-rw-r--r--nixos/modules/services/audio/roon-server.nix19
1 files changed, 10 insertions, 9 deletions
diff --git a/nixos/modules/services/audio/roon-server.nix b/nixos/modules/services/audio/roon-server.nix
index 8c56634cb75..6ad5b6b4cbd 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 {};
   };
 }