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:
K900
2026-03-25 09:30:39 +03:00
parent 75cff34fdd
commit e1e711ec17
@@ -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)