about summary refs log tree commit diff
path: root/nixos/modules/services/backup
diff options
context:
space:
mode:
authorFelix Buehler <account@buehler.rocks>2023-06-25 11:47:43 +0200
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-06-25 09:11:40 -0300
commit933a41a73fe2174b90cabb7d671ee2cc5658701a (patch)
tree1f8228d1369ab51c644a47ab269fb9c638553752 /nixos/modules/services/backup
parent175e9d1f00c41b49606e4eacbc1bfe396641e90f (diff)
downloadnixlib-933a41a73fe2174b90cabb7d671ee2cc5658701a.tar
nixlib-933a41a73fe2174b90cabb7d671ee2cc5658701a.tar.gz
nixlib-933a41a73fe2174b90cabb7d671ee2cc5658701a.tar.bz2
nixlib-933a41a73fe2174b90cabb7d671ee2cc5658701a.tar.lz
nixlib-933a41a73fe2174b90cabb7d671ee2cc5658701a.tar.xz
nixlib-933a41a73fe2174b90cabb7d671ee2cc5658701a.tar.zst
nixlib-933a41a73fe2174b90cabb7d671ee2cc5658701a.zip
treewide: use optional instead of 'then []'
Diffstat (limited to 'nixos/modules/services/backup')
-rw-r--r--nixos/modules/services/backup/restic.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/services/backup/restic.nix b/nixos/modules/services/backup/restic.nix
index 3a951f7cbc83..1620770e5b56 100644
--- a/nixos/modules/services/backup/restic.nix
+++ b/nixos/modules/services/backup/restic.nix
@@ -298,7 +298,7 @@ in
           let
             extraOptions = concatMapStrings (arg: " -o ${arg}") backup.extraOptions;
             resticCmd = "${backup.package}/bin/restic${extraOptions}";
-            excludeFlags = if (backup.exclude != []) then ["--exclude-file=${pkgs.writeText "exclude-patterns" (concatStringsSep "\n" backup.exclude)}"] else [];
+            excludeFlags = optional (backup.exclude != []) "--exclude-file=${pkgs.writeText "exclude-patterns" (concatStringsSep "\n" backup.exclude)}";
             filesFromTmpFile = "/run/restic-backups-${name}/includes";
             backupPaths =
               if (backup.dynamicFilesFrom == null)