1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-12 12:01:08 +01:00
home-manager/tests/modules/services
Patrick Steinhardt 281e9398cc swayidle: improve confusing "events" configuration
With swayidle one can configure two different kinds of hooks:

  - Idle timeouts are executed after the session has been idle for a
    specific amount of time.

  - Events are executed when systemd notifies us that for example the
    user session is locked or that the device is about to suspend.

While not obvious, there is a significant difference between how these
two kinds are configured: there can be several timeouts with separate
commands to be executed, but each event can only be specified once. If
an event is specified multiple times, then the last command wins.

This can be very easy to miss in swayidle's documentation. Furthermore,
because the config is a list of `{ event = "..."; command = "..."; }`
attrset, we double down on this confusion and make it seem like having
multiple handlers for an event was actually supported.

Fix this by converting from a list of "event" submodules to an attrset
where the key is the event name and the value is the command to be
executed. This makes it impossible to specify multiple commands for a
single event by accident.

If a user _does_ want to have multiple commands executed on any event
they can for example use `pkgs.writeShellScript` and manually chain the
commands in that script.
2025-12-02 22:24:56 -06:00
..
activitywatch tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
arrpc tests/arrpc: add service module test coverage 2025-07-29 10:31:11 -05:00
autotiling autotiling: init module 2025-10-11 22:19:18 -05:00
avizo tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
blanket tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
borgmatic tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
bspwm tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
cachix-agent tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
caffeine tests/caffeine: add test coverage 2025-07-29 14:47:02 -05:00
clipcat tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
cliphist tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
clipman tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
clipse treewide: remove no-ops (#8061) 2025-10-26 15:43:53 -05:00
comodoro tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
conky tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
copyq tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
darkman tests/darkman: python -> python2 2025-11-02 22:59:59 -06:00
davmail tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
devilspie2 tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
dropbox tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
dunst dunst: fix deprecated configuration in example 2025-09-11 10:15:27 +02:00
easyeffects easyeffects: Make service compatible with v8.0.x (#8192) 2025-11-24 18:56:44 +01:00
emacs tests/emacs: reorganize darwin and linux 2025-06-22 23:58:37 -05:00
espanso espanso: fix accessibility permissions prompt for macos (#8180) 2025-11-21 12:06:12 -06:00
flameshot tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
fluidsynth tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
fnott tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
fusuma tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
git-sync tests/git-sync: reorganize darwin and linux 2025-06-22 23:58:37 -05:00
glance glance: restart service when settings file changes 2025-08-13 12:43:52 -05:00
gnome-keyring tests/gnome-keyring: add test coverage 2025-07-29 14:46:36 -05:00
gpg-agent tests/gpg-agent: add pinentry-program test 2025-04-29 20:36:45 -05:00
gromit-mpx tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
herbstluftwm tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
home-manager-auto-expire tests/home-manager-auto-expire: reorganize darwin and linux 2025-06-22 23:58:37 -05:00
home-manager-auto-upgrade home-manager-auto-upgrade: add flake support (#8053) 2025-10-26 16:21:41 -05:00
hypridle tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
hyprland tests/hyprland: add submap test 2025-09-01 23:49:51 -05:00
hyprpaper tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
hyprpolkitagent tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
hyprshell hyprshell: fixed tests to use correct name for style file 2025-10-03 23:00:58 -05:00
hyprsunset hyprsunset: Add tests for transitons option 2025-07-29 13:11:56 -05:00
i3 tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
imapnotify tests/imapnotify: reorganize darwin and linux 2025-06-22 23:58:37 -05:00
jankyborders tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
jellyfin-mpv-shim tests/jellyfin-mpv-shim: fix tests 2025-06-22 23:58:37 -05:00
kanshi tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
labwc tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
lieer tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
linux-wallpaperengine tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
local-ai local-ai: string -> str (#8116) 2025-11-03 04:41:08 +00:00
ludusavi ludusavi: add test 2025-12-02 21:57:23 -06:00
lxqt-policykit-agent tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
macos-remap-keys launchd+targets/darwin: Escape XML in plists (#7356) 2025-08-09 11:22:08 -05:00
mako tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
mopidy tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
mpd tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
mpd-mpris tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
mpdris2 tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
mpdscribble tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
nix-gc nix-gc: rename frequency to dates 2025-08-21 16:03:33 -05:00
ollama tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
osmscout-server tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
pantalaimon tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
parcellite tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
pass-secret-service test: update tests path for new pwd-store path 2025-11-25 23:33:06 -06:00
pasystray tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
pbgopy tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
picom picom: add test for extraConfig 2025-10-25 21:15:52 -05:00
pizauth pizauth: reload on change and option type 2025-08-30 13:53:07 -05:00
playerctld tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
podman-linux podman: support mounts configuration (#7377) 2025-07-03 19:34:57 -05:00
polkit-gnome tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
polybar tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
protonmail-bridge protonmail-bridge: init module 2025-08-17 09:44:56 -05:00
recoll tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
redshift-gammastep tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
remmina tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
rescrobbled rescrobbled: add module 2025-08-06 00:15:47 -05:00
restic tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
river tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
screen-locker tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
shikane tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
signaturepdf tests: fix tests 2025-09-15 09:22:58 +02:00
skhd tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
snixembed tests: fix tests 2025-09-15 09:22:58 +02:00
spectrwm tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
ssh-agent ssh-agent: add macOS support 2025-11-08 22:10:01 -06:00
ssh-tpm-agent ssh-tpm-agent: fix test case 2025-09-17 16:26:12 +02:00
sway sway: order input config from least to most specific (#7684) 2025-09-16 22:22:28 -05:00
swayidle swayidle: improve confusing "events" configuration 2025-12-02 22:24:56 -06:00
swaync tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
swayosd swayosd: Remove non-existing display arg option (#7752) 2025-09-03 07:42:44 -05:00
swww swww: add package to service path 2025-11-15 09:51:45 +01:00
sxhkd tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
syncthing syncthing: assert tray service content in test 2025-09-25 09:42:44 +02:00
tailscale-systray tailscale-systray: add module (#7821) 2025-09-26 15:14:09 +00:00
tldr-update tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
tomat tomat: init service (#8138) 2025-11-06 16:44:08 +00:00
trayer tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
trayscale tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
twmn tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
udiskie tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
volnoti tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
walker walker: add module (#7649) 2025-08-10 23:23:58 -05:00
way-displays tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
wayfire wayfire: fix broken configuration.ini test (#7478) 2025-07-15 10:20:41 -05:00
wayvnc tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
wl-clip-persist wl-clip-persist: add module 2025-10-16 19:26:10 -05:00
wlsunset tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
wob tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
wpaperd test/wpaperd: add test for empty settings 2025-07-11 15:26:17 -05:00
xsettingsd tests: implement auto importing for modules 2025-06-22 23:58:37 -05:00
yubikey-agent tests/yubikey-agent: reorganize darwin and linux 2025-06-22 23:58:37 -05:00