home-manager/tests
David Baynard 719de878f7
imapnotify: Add launchd agent (#3291)
* imapnotify: expose package (and exe) options

There are multiple packages that provide an imapnotify interface. Those
packages have differently named executables. This can now be customized.

This change also means test configurations can use stub packages.

* imapnotify: use/create config in configHome

Exposing the configuration file makes testing imapnotify configurations much
easier. It also allows for golden tests in home-manager.

* imapnotify: extend with launchd agent

Now that home-manager supports launchd agents, the imapnotify service
can be configured (and enabled) for darwin. The configuration matches
that of the linux/systemd version. In particular, by not setting a
`UserName`, this runs as the user whose configuration includes the
module.

Due to the launchd `Program` implementation (it must take an absolute
path) it is not possible to use that for the program and stub the path
in tests. Instead, this uses `ProgramArguments` for the program name.

The `ThrottleInterval` is equivalent to `RestartSec`. `KeepAlive` is
equivalent to `Restart`.

The `ExitTimeOut` default is 20 seconds, but goimapnotify should not
time out — this is achieved by setting the `ExitTimeout` to 0.

* imapnotify: add launchd plist test

This only tests the generated plist (which is new), not the original
systemd implementation, nor the json config file.

(Note the lack of a newline at the end of the plist file.)
2023-07-07 11:39:12 +02:00
..
lib lib: add functions to create DAGs from lists 2023-06-05 23:08:30 +02:00
modules imapnotify: Add launchd agent (#3291) 2023-07-07 11:39:12 +02:00
asserts.nix tests: fix test.assert.assertions.enable not working 2021-10-13 01:29:23 +02:00
big-test.nix tests: make enableBig an option 2022-01-02 10:36:52 +01:00
default.nix imapnotify: Add launchd agent (#3291) 2023-07-07 11:39:12 +02:00
stubs.nix tests/stubs: inherit default versions from pkgs (#4069) 2023-06-09 00:59:06 +02:00