From a712d8ff0b3a341d6e9ac30ecb2d88fbd2e0ddb1 Mon Sep 17 00:00:00 2001 From: Robert Irelan Date: Sat, 14 May 2016 14:13:30 -0700 Subject: [PATCH] subsonic: change NixOS home directory config Move Subsonic state directory from `/var/subsonic` to `/var/lib/subsonic`, since the general convention is for each application to put its state directory there. Also, automatically set the home directory of the `subsonic` user to the value of `config.services.subsonic.home`, rather than setting it to a value hardcoded in the module. This keeps the home directory of the `subsonic` user and the state directory for the Subsonic application in sync. --- nixos/modules/services/misc/subsonic.nix | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/misc/subsonic.nix b/nixos/modules/services/misc/subsonic.nix index c1ebe418f72..0013912be77 100644 --- a/nixos/modules/services/misc/subsonic.nix +++ b/nixos/modules/services/misc/subsonic.nix @@ -2,19 +2,14 @@ with lib; -let - cfg = config.services.subsonic; - homeDir = "/var/subsonic"; - -in -{ +let cfg = config.services.subsonic; in { options = { services.subsonic = { enable = mkEnableOption "Subsonic daemon"; home = mkOption { type = types.path; - default = "${homeDir}"; + default = "/var/lib/subsonic"; description = '' The directory where Subsonic will create files. Make sure it is writable. @@ -146,7 +141,7 @@ in users.extraUsers.subsonic = { description = "Subsonic daemon user"; - home = homeDir; + home = cfg.home; createHome = true; group = "subsonic"; uid = config.ids.uids.subsonic;