From d03e463a3a9be2ff44200a3ee8470979a18341e2 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Wed, 21 Aug 2024 01:53:31 +0200 Subject: [PATCH] restic/system: Fix QoS enabling logic --- modules/restic/system.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/restic/system.nix b/modules/restic/system.nix index d69cc3c..82d2c99 100644 --- a/modules/restic/system.nix +++ b/modules/restic/system.nix @@ -87,7 +87,7 @@ in type = lib.types.nullOr lib.types.int; default = null; }; - qos = (lib.mkEnableOption "QoS marking (DSCP AF12) of outgoing packets") // { default = !(lib.isNull cfg.uploadLimit); }; + qos = (lib.mkEnableOption "QoS marking (DSCP AF12) of outgoing packets") // { default = !(isNull cfg.uploadLimit); }; prune = lib.mkEnableOption "pruning"; }; @@ -119,13 +119,14 @@ in "--tag system" "--verbose" ] ++ lib.optional (cfg.uploadLimit != null) "--limit-upload=${toString cfg.uploadLimit}"; + } // (lib.optionalAttrs cfg.qos { backupPrepareCommand = '' ${pkgs.nftables}/bin/nft -f ${qosRules} ''; backupCleanupCommand = '' ${pkgs.nftables}/bin/nft delete table inet restic ''; - }; + }); systemd.services."restic-backups-system".serviceConfig = { "Nice" = 10;