mirror of
https://github.com/nix-community/home-manager
synced 2024-11-20 10:09:45 +01:00
719de878f7
* 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.)
29 lines
No EOL
850 B
Text
29 lines
No EOL
850 B
Text
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>EnvironmentVariables</key>
|
|
<dict>
|
|
<key>NOTMUCH_CONFIG</key>
|
|
<string>/home/hm-user/.config/notmuch/default/config</string>
|
|
</dict>
|
|
<key>ExitTimeOut</key>
|
|
<integer>0</integer>
|
|
<key>KeepAlive</key>
|
|
<true/>
|
|
<key>Label</key>
|
|
<string>org.nix-community.home.imapnotify-hm-example.com</string>
|
|
<key>ProcessType</key>
|
|
<string>Background</string>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>@goimapnotify@/bin/goimapnotify</string>
|
|
<string>-conf</string>
|
|
<string>/home/hm-user/.config/imapnotify/imapnotify-hm-example.com-config.json</string>
|
|
</array>
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
<key>ThrottleInterval</key>
|
|
<integer>30</integer>
|
|
</dict>
|
|
</plist> |