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:
parent
5ebf20db0f
commit
a712d8ff0b
@ -2,19 +2,14 @@
|
|||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let cfg = config.services.subsonic; in {
|
||||||
cfg = config.services.subsonic;
|
|
||||||
homeDir = "/var/subsonic";
|
|
||||||
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options = {
|
options = {
|
||||||
services.subsonic = {
|
services.subsonic = {
|
||||||
enable = mkEnableOption "Subsonic daemon";
|
enable = mkEnableOption "Subsonic daemon";
|
||||||
|
|
||||||
home = mkOption {
|
home = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
default = "${homeDir}";
|
default = "/var/lib/subsonic";
|
||||||
description = ''
|
description = ''
|
||||||
The directory where Subsonic will create files.
|
The directory where Subsonic will create files.
|
||||||
Make sure it is writable.
|
Make sure it is writable.
|
||||||
@ -146,7 +141,7 @@ in
|
|||||||
|
|
||||||
users.extraUsers.subsonic = {
|
users.extraUsers.subsonic = {
|
||||||
description = "Subsonic daemon user";
|
description = "Subsonic daemon user";
|
||||||
home = homeDir;
|
home = cfg.home;
|
||||||
createHome = true;
|
createHome = true;
|
||||||
group = "subsonic";
|
group = "subsonic";
|
||||||
uid = config.ids.uids.subsonic;
|
uid = config.ids.uids.subsonic;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user