mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 14:45:27 +00:00
Merge pull request #25938 from bachp/emby-datadir
emby service: allow changing data directory
This commit is contained in:
commit
f059ddf85d
|
@ -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 a new issue