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.
This commit is contained in:
Robert Irelan 2016-05-14 14:13:30 -07:00
parent 5ebf20db0f
commit a712d8ff0b

@ -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;