From 7800817f3707d5754b099ff4eca10a85e3ab060e Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 12 Mar 2026 13:21:26 +0300 Subject: [PATCH] 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. --- nixos/modules/services/torrent/qbittorrent.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/torrent/qbittorrent.nix b/nixos/modules/services/torrent/qbittorrent.nix index 70f35e8e4058..8ecfd98fde65 100644 --- a/nixos/modules/services/torrent/qbittorrent.nix +++ b/nixos/modules/services/torrent/qbittorrent.nix @@ -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";