nixos/qbittorrent: just copy the config file in ourselves
tmpfiles won't replace existing files, so we have to DIY it. Fixes #503103.
This commit is contained in:
@@ -154,11 +154,6 @@ in
|
||||
mode = "755";
|
||||
inherit (cfg) user group;
|
||||
};
|
||||
"${cfg.profileDir}/qBittorrent/config/qBittorrent.conf"."C+" = mkIf (cfg.serverConfig != { }) {
|
||||
mode = "600";
|
||||
inherit (cfg) user group;
|
||||
argument = toString configFile;
|
||||
};
|
||||
};
|
||||
};
|
||||
services.qbittorrent = {
|
||||
@@ -176,6 +171,12 @@ in
|
||||
Type = "simple";
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
|
||||
# the config file has to be writable, so we have to do this weird dance
|
||||
ExecStartPre = lib.mkIf (cfg.serverConfig != { }) ''
|
||||
${pkgs.coreutils}/bin/install -Dm600 ${configFile} "${cfg.profileDir}/qBittorrent/config/qBittorrent.conf"
|
||||
'';
|
||||
|
||||
ExecStart = utils.escapeSystemdExecArgs (
|
||||
[
|
||||
(getExe cfg.package)
|
||||
|
||||
Reference in New Issue
Block a user