mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
imapnotify: provide an option for setting PATH
Including some useful presetting for notmuch and mbsync.
This commit is contained in:
parent
a46e702093
commit
396f3af0d9
1 changed files with 19 additions and 3 deletions
|
@ -27,9 +27,11 @@ let
|
|||
Restart = "always";
|
||||
RestartSec = 30;
|
||||
Type = "simple";
|
||||
} // optionalAttrs account.notmuch.enable {
|
||||
Environment =
|
||||
"NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/default/config";
|
||||
Environment = [
|
||||
(lib.mkIf account.notmuch.enable
|
||||
"NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/default/config")
|
||||
"PATH=${cfg.path}"
|
||||
];
|
||||
};
|
||||
|
||||
Install = { WantedBy = [ "default.target" ]; };
|
||||
|
@ -97,6 +99,14 @@ in {
|
|||
example = literalExpression "pkgs.imapnotify";
|
||||
description = "The imapnotify package to use";
|
||||
};
|
||||
|
||||
path = mkOption {
|
||||
description =
|
||||
"List of packages to provide in PATH for the imapnotify service";
|
||||
type = types.listOf types.package;
|
||||
apply = lib.makeBinPath;
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
accounts.email.accounts = mkOption {
|
||||
|
@ -122,6 +132,12 @@ in {
|
|||
(checkAccounts (a: a.userName == null) "username")
|
||||
];
|
||||
|
||||
services.imapnotify.path = lib.mkMerge [
|
||||
(lib.mkIf config.programs.notmuch.enable [ pkgs.notmuch ])
|
||||
(lib.mkIf config.programs.mbsync.enable
|
||||
[ config.programs.mbsync.package ])
|
||||
];
|
||||
|
||||
systemd.user.services = listToAttrs (map genAccountUnit imapnotifyAccounts);
|
||||
|
||||
launchd.agents = listToAttrs (map genAccountAgent imapnotifyAccounts);
|
||||
|
|
Loading…
Reference in a new issue