From 07dc3e542538f42c28ee18dfd98a1b000ec57720 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 11 Jan 2020 19:39:58 +0100 Subject: [PATCH] notmuch: use attribute set to define files To avoid warning message concerning deprecation of the `loaOf` type. --- modules/programs/notmuch.nix | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/modules/programs/notmuch.nix b/modules/programs/notmuch.nix index cd0b1384a..f1fb1d819 100644 --- a/modules/programs/notmuch.nix +++ b/modules/programs/notmuch.nix @@ -186,26 +186,27 @@ in let hook = name: cmds: { - target = "${notmuchIni.database.path}/.notmuch/hooks/${name}"; - source = pkgs.writeScript name '' - #!${pkgs.runtimeShell} + "${notmuchIni.database.path}/.notmuch/hooks/${name}" = { + source = pkgs.writeScript name '' + #!${pkgs.runtimeShell} - export PATH="${pkgs.notmuch}/bin''${PATH:+:}$PATH" - export NOTMUCH_CONFIG="${config.xdg.configHome}/notmuch/notmuchrc" - export NMBGIT="${config.xdg.dataHome}/notmuch/nmbug" + export PATH="${pkgs.notmuch}/bin''${PATH:+:}$PATH" + export NOTMUCH_CONFIG="${config.xdg.configHome}/notmuch/notmuchrc" + export NMBGIT="${config.xdg.dataHome}/notmuch/nmbug" - ${cmds} - ''; - executable = true; + ${cmds} + ''; + executable = true; + }; }; in - optional (cfg.hooks.preNew != "") + optionalAttrs (cfg.hooks.preNew != "") (hook "pre-new" cfg.hooks.preNew) - ++ - optional (cfg.hooks.postNew != "") + // + optionalAttrs (cfg.hooks.postNew != "") (hook "post-new" cfg.hooks.postNew) - ++ - optional (cfg.hooks.postInsert != "") + // + optionalAttrs (cfg.hooks.postInsert != "") (hook "post-insert" cfg.hooks.postInsert); }; }