mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 04:02:55 +03:00
emby service: allow changing data directory
This commit is contained in:
parent
9f6b1dca58
commit
1541140473
@ -22,6 +22,12 @@ in
|
||||
default = "emby";
|
||||
description = "Group under which emby runs.";
|
||||
};
|
||||
|
||||
dataDir = mkOption {
|
||||
type = types.path;
|
||||
default = "/var/lib/emby/ProgramData-Server";
|
||||
description = "Location where Emby stores its data.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -31,10 +37,10 @@ in
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
preStart = ''
|
||||
test -d /var/lib/emby/ProgramData-Server || {
|
||||
echo "Creating initial Emby data directory in /var/lib/emby/ProgramData-Server"
|
||||
mkdir -p /var/lib/emby/ProgramData-Server
|
||||
chown -R ${cfg.user}:${cfg.group} /var/lib/emby/ProgramData-Server
|
||||
test -d ${cfg.dataDir} || {
|
||||
echo "Creating initial Emby data directory in ${cfg.dataDir}"
|
||||
mkdir -p ${cfg.dataDir}
|
||||
chown -R ${cfg.user}:${cfg.group} ${cfg.dataDir}
|
||||
}
|
||||
'';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user