1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-25 03:09:47 +01:00

vdirsyncer: create postHook script when non-empty

This commit is contained in:
Kylie McClain 2024-02-04 18:07:19 -05:00 committed by Mikilio
parent c103ab9566
commit 7d4dc024de
No known key found for this signature in database
GPG key ID: 5B2F1A890CF33F3F
2 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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: