diff --git a/modules/programs/vdirsyncer-accounts.nix b/modules/programs/vdirsyncer-accounts.nix index 35badb927..fac4d01da 100644 --- a/modules/programs/vdirsyncer-accounts.nix +++ b/modules/programs/vdirsyncer-accounts.nix @@ -137,8 +137,8 @@ in { }; postHook = mkOption { - type = types.lines; - default = ""; + type = types.nullOr types.lines; + default = null; description = '' Command to call for each item creation and modification. The command will be called with the path of the new/updated diff --git a/modules/programs/vdirsyncer.nix b/modules/programs/vdirsyncer.nix index ec1b38796..545df71b5 100644 --- a/modules/programs/vdirsyncer.nix +++ b/modules/programs/vdirsyncer.nix @@ -26,8 +26,9 @@ let filterAttrs (_: v: v != null) ((getAttrs [ "type" "fileExt" "encoding" ] a.local) // { path = a.local.path; - postHook = pkgs.writeShellScriptBin "post-hook" a.vdirsyncer.postHook - + "/bin/post-hook"; + postHook = optionalString (a.vdirsyncer.postHook != null) + (pkgs.writeShellScriptBin "post-hook" a.vdirsyncer.postHook + + "/bin/post-hook"); }); remoteStorage = a: