From b1a5b3d6a524c80c7dd20888bff227d52adf5f03 Mon Sep 17 00:00:00 2001 From: Felipe Silva Date: Fri, 19 Apr 2024 08:01:05 -0300 Subject: [PATCH] vdirsyncer: set `postHook` to null when not set (#5294) The `postHook` option was being processed and reset to a string, even if the user set it to null, causing issues under certain conditions (see Using `if-then-else` instead of `optionalString` keeps the option as null, instead of setting it to an empty string. --- modules/programs/vdirsyncer.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/programs/vdirsyncer.nix b/modules/programs/vdirsyncer.nix index 562d7b4b..2e013af0 100644 --- a/modules/programs/vdirsyncer.nix +++ b/modules/programs/vdirsyncer.nix @@ -26,9 +26,11 @@ let filterAttrs (_: v: v != null) ((getAttrs [ "type" "fileExt" "encoding" ] a.local) // { path = a.local.path; - postHook = optionalString (a.vdirsyncer.postHook != null) + postHook = if a.vdirsyncer.postHook != null then (pkgs.writeShellScriptBin "post-hook" a.vdirsyncer.postHook - + "/bin/post-hook"); + + "/bin/post-hook") + else + null; }); remoteStorage = a: