mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
nixos/qbittorrent: use a file again, just be smarter about it
This avoids a massive warning splat about escape sequences if there's any in the config, and also a massive tmpfiles config and a massive restartTriggers, while keeping the core of the fix intact.
This commit is contained in:
parent
c7c841bdc9
commit
7800817f37
1 changed files with 4 additions and 4 deletions
|
|
@ -53,7 +53,7 @@ let
|
|||
else
|
||||
mkKeyValueDefault { } sep k v;
|
||||
};
|
||||
configContent = gendeepINI cfg.serverConfig;
|
||||
configFile = pkgs.writeText "qBittorrent.conf" (gendeepINI cfg.serverConfig);
|
||||
in
|
||||
{
|
||||
options.services.qbittorrent = {
|
||||
|
|
@ -154,10 +154,10 @@ in
|
|||
mode = "755";
|
||||
inherit (cfg) user group;
|
||||
};
|
||||
"${cfg.profileDir}/qBittorrent/config/qBittorrent.conf"."f+" = mkIf (cfg.serverConfig != { }) {
|
||||
"${cfg.profileDir}/qBittorrent/config/qBittorrent.conf"."C+" = mkIf (cfg.serverConfig != { }) {
|
||||
mode = "600";
|
||||
inherit (cfg) user group;
|
||||
argument = configContent;
|
||||
argument = toString configFile;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -170,7 +170,7 @@ in
|
|||
"nss-lookup.target"
|
||||
];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
restartTriggers = optionals (cfg.serverConfig != { }) [ configContent ];
|
||||
restartTriggers = optionals (cfg.serverConfig != { }) [ configFile ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue