notmuch: add programs.notmuch.package option

Allow users to specify which notmuch package should be used.

(cherry picked from commit 9bdb693810)
This commit is contained in:
nescias
2026-02-02 13:49:23 +00:00
committed by github-actions[bot]
parent e38e46c8b2
commit cc95a0dc4f

View File

@@ -72,6 +72,8 @@ in
programs.notmuch = {
enable = lib.mkEnableOption "Notmuch mail indexer";
package = lib.mkPackageOption pkgs "notmuch" { };
new = mkOption {
type = types.submodule {
options = {
@@ -197,7 +199,7 @@ in
}
];
home.packages = [ pkgs.notmuch ];
home.packages = [ cfg.package ];
home.sessionVariables = {
NOTMUCH_CONFIG = "${config.xdg.configHome}/notmuch/default/config";
@@ -208,7 +210,7 @@ in
let
hook = name: cmds: {
"notmuch/default/hooks/${name}".source = pkgs.writeShellScript name ''
export PATH="${pkgs.notmuch}/bin''${PATH:+:}$PATH"
export PATH="${cfg.package}/bin''${PATH:+:}$PATH"
export NOTMUCH_CONFIG="${config.xdg.configHome}/notmuch/default/config"
export NMBGIT="${config.xdg.dataHome}/notmuch/nmbug"