restic/system: Fix QoS enabling logic
This commit is contained in:
parent
b0898643fb
commit
d03e463a3a
|
@ -87,7 +87,7 @@ in
|
||||||
type = lib.types.nullOr lib.types.int;
|
type = lib.types.nullOr lib.types.int;
|
||||||
default = null;
|
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";
|
prune = lib.mkEnableOption "pruning";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -119,13 +119,14 @@ in
|
||||||
"--tag system"
|
"--tag system"
|
||||||
"--verbose"
|
"--verbose"
|
||||||
] ++ lib.optional (cfg.uploadLimit != null) "--limit-upload=${toString cfg.uploadLimit}";
|
] ++ lib.optional (cfg.uploadLimit != null) "--limit-upload=${toString cfg.uploadLimit}";
|
||||||
|
} // (lib.optionalAttrs cfg.qos {
|
||||||
backupPrepareCommand = ''
|
backupPrepareCommand = ''
|
||||||
${pkgs.nftables}/bin/nft -f ${qosRules}
|
${pkgs.nftables}/bin/nft -f ${qosRules}
|
||||||
'';
|
'';
|
||||||
backupCleanupCommand = ''
|
backupCleanupCommand = ''
|
||||||
${pkgs.nftables}/bin/nft delete table inet restic
|
${pkgs.nftables}/bin/nft delete table inet restic
|
||||||
'';
|
'';
|
||||||
};
|
});
|
||||||
|
|
||||||
systemd.services."restic-backups-system".serviceConfig = {
|
systemd.services."restic-backups-system".serviceConfig = {
|
||||||
"Nice" = 10;
|
"Nice" = 10;
|
||||||
|
|
Loading…
Reference in a new issue