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.
This commit is contained in:
Felipe Silva 2024-04-19 08:01:05 -03:00 committed by GitHub
parent b62cad68b7
commit b1a5b3d6a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,9 +26,11 @@ let
filterAttrs (_: v: v != null) filterAttrs (_: v: v != null)
((getAttrs [ "type" "fileExt" "encoding" ] a.local) // { ((getAttrs [ "type" "fileExt" "encoding" ] a.local) // {
path = a.local.path; path = a.local.path;
postHook = optionalString (a.vdirsyncer.postHook != null) postHook = if a.vdirsyncer.postHook != null then
(pkgs.writeShellScriptBin "post-hook" a.vdirsyncer.postHook (pkgs.writeShellScriptBin "post-hook" a.vdirsyncer.postHook
+ "/bin/post-hook"); + "/bin/post-hook")
else
null;
}); });
remoteStorage = a: remoteStorage = a: