1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-06 16:57:03 +00:00

imapnotify: add extraArgs option to imapnotify-accounts

`wait` is no longer a part of the goimapnotify's config, but one of its
cli options.
This commit is contained in:
Coutinho de Souza 2025-01-29 10:29:02 -03:00 committed by Austin Horstman
parent f4a07823a2
commit dd21b9afd5
4 changed files with 13 additions and 3 deletions

View file

@ -30,10 +30,16 @@ with lib;
description = "IMAP folders to watch."; description = "IMAP folders to watch.";
}; };
extraArgs = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "-wait 1" ];
description = "Extra arguments to pass to goimapnotify.";
};
extraConfig = mkOption { extraConfig = mkOption {
type = let jsonFormat = pkgs.formats.json { }; in jsonFormat.type; type = let jsonFormat = pkgs.formats.json { }; in jsonFormat.type;
default = { }; default = { };
example = { wait = 10; };
description = "Additional configuration to add for this account."; description = "Additional configuration to add for this account.";
}; };
}; };

View file

@ -23,7 +23,10 @@ let
Service = { Service = {
# Use the nix store path for config to ensure service restarts when it changes # Use the nix store path for config to ensure service restarts when it changes
ExecStart = ExecStart =
"${getExe cfg.package} -conf '${genAccountConfig account}'"; "${getExe cfg.package} -conf '${genAccountConfig account}'" + " ${
lib.optionalString (account.imapnotify.extraArgs != [ ])
(toString account.imapnotify.extraArgs)
}";
Restart = "always"; Restart = "always";
RestartSec = 30; RestartSec = 30;
Type = "simple"; Type = "simple";

View file

@ -11,6 +11,7 @@
imapnotify = { imapnotify = {
enable = true; enable = true;
boxes = [ "Inbox" ]; boxes = [ "Inbox" ];
extraArgs = [ "--wait 1" ];
onNotify = '' onNotify = ''
${pkgs.notmuch}/bin/notmuch new ${pkgs.notmuch}/bin/notmuch new
''; '';

View file

@ -4,7 +4,7 @@ WantedBy=default.target
[Service] [Service]
Environment=PATH= Environment=PATH=
Environment=NOTMUCH_CONFIG=/home/hm-user/.config/notmuch/default/config Environment=NOTMUCH_CONFIG=/home/hm-user/.config/notmuch/default/config
ExecStart=@goimapnotify@/bin/goimapnotify -conf '/nix/store/00000000000000000000000000000000-imapnotify-hm-example.com-config.json' ExecStart=@goimapnotify@/bin/goimapnotify -conf '/nix/store/00000000000000000000000000000000-imapnotify-hm-example.com-config.json' --wait 1
Restart=always Restart=always
RestartSec=30 RestartSec=30
Type=simple Type=simple