git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commita712d8ff0b3a341d6e9ac30ecb2d88fbd2e0ddb1 authorRobert Irelan <rirelan@gmail.com> dateSat 14 May 2016, 14:13 (11 years ago) parent5ebf20d
1 file changed+3−8
nixos/modules/services/misc/subsonic.nix+3−8
nixos/modules/services/misc/subsonic.nix+3−8
@@ -2,19 +2,14 @@
22
33with lib;
44
5−let
6− cfg = config.services.subsonic;
7− homeDir = "/var/subsonic";
8−
9−in
10−{
5+let cfg = config.services.subsonic; in {
116 options = {
127 services.subsonic = {
138 enable = mkEnableOption "Subsonic daemon";
149
1510 home = mkOption {
1611 type = types.path;
17− default = "${homeDir}";
12+ default = "/var/lib/subsonic";
1813 description = ''
1914 The directory where Subsonic will create files.
2015 Make sure it is writable.
@@ -146,7 +141,7 @@ in
146141
147142 users.extraUsers.subsonic = {
148143 description = "Subsonic daemon user";
149− home = homeDir;
144+ home = cfg.home;
150145 createHome = true;
151146 group = "subsonic";
152147 uid = config.ids.uids.subsonic;