1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-05 16:41:04 +01:00
home-manager/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
..
imapnotify accounts.email: add option to disable an account 2025-08-07 14:08:46 -05:00
macos-remap-keys macos-remap-keys: add Fn (Globe) keycode 2025-10-09 08:15:50 -05:00
podman-linux podman: add nftables to default container path (#7802) 2025-09-13 19:14:18 -05:00
redshift-gammastep treewide: format with latest stable formatter 2025-07-23 10:27:52 -05:00
window-managers treewide: assertions at top of config 2025-11-22 15:00:15 -06:00
activitywatch.nix activitywatch: use mkPackageOption for service 2025-11-22 14:48:56 -06:00
amberol.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
arrpc.nix arrpc: assert linux 2025-07-29 10:31:11 -05:00
autorandr.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
autotiling.nix autotiling: update maintainer entry 2025-10-12 17:34:57 -05:00
avizo.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
batsignal.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
betterlockscreen.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
blanket.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
blueman-applet.nix blueman-applet: fix typo in systemdTargets 2025-08-26 17:23:34 -05:00
borgmatic.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
cachix-agent.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
caffeine.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
cbatticon.nix cbatticon: add package example 2025-11-02 06:44:15 -06:00
clipcat.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
cliphist.nix cliphist: remove example package 2025-10-18 12:46:31 -05:00
clipman.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
clipmenu.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
clipse.nix clipse: fix keyBindings example syntax (#8058) 2025-10-26 15:36:37 -05:00
comodoro.nix maintainers: remove duplicate HM entries 2025-07-04 09:20:48 -05:00
conky.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
copyq.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
darkman.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
davmail.nix davmail: enable access to the display server (#7671) 2025-08-13 15:52:17 -05:00
devilspie2.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
dropbox.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
dunst.nix dunst: fix deprecated configuration in example 2025-09-11 10:15:27 +02:00
dwm-status.nix treewide: format with latest stable formatter 2025-07-23 10:27:52 -05:00
easyeffects.nix easyeffects: Make service compatible with v8.0.x (#8192) 2025-11-24 18:56:44 +01:00
emacs.nix treewide: format with latest stable formatter 2025-07-23 10:27:52 -05:00
espanso.nix treewide: meta.maintainers at top 2025-11-22 14:51:05 -06:00
etesync-dav.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
flameshot.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
fluidsynth.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
fnott.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
fusuma.nix maintainers: remove duplicate HM entries 2025-07-04 09:20:48 -05:00
getmail.nix accounts.email: add option to disable an account 2025-08-07 14:08:46 -05:00
git-sync.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
glance.nix glance: restart service when settings file changes 2025-08-13 12:43:52 -05:00
gnome-keyring.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
gpg-agent.nix gpg-agent: restore empty newlines after commands 2025-11-02 05:52:54 -06:00
grobi.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
gromit-mpx.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
home-manager-auto-expire.nix home-manager: define a central package 2025-10-30 08:20:54 -05:00
home-manager-auto-upgrade.nix home-manager: define a central package 2025-10-30 08:20:54 -05:00
hound.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
hypridle.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
hyprpaper.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
hyprpolkitagent.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
hyprshell.nix hyprshell: fixed path for style file 2025-10-03 23:00:58 -05:00
hyprsunset.nix hyprsunset: fixed evaluation when hyprland package is null 2025-09-07 09:44:28 -05:00
jankyborders.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
jellyfin-mpv-shim.nix maintainers: remove duplicate HM entries 2025-07-04 09:20:48 -05:00
kanshi.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
kbfs.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
kdeconnect.nix treewide: assertions at top of config 2025-11-22 15:00:15 -06:00
keybase.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
keynav.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
librespot.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
lieer.nix accounts.email: add option to disable an account 2025-08-07 14:08:46 -05:00
linux-wallpaperengine.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
listenbrainz-mpd.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
local-ai.nix local-ai: string -> str (#8116) 2025-11-03 04:41:08 +00:00
lorri.nix lorri: don't start until daemon is really running 2025-10-25 21:21:03 -05:00
ludusavi.nix ludusavi: use config.xdg.stateHome instead of $XDG_STATE_HOME 2025-12-02 21:57:23 -06:00
lxqt-policykit-agent.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
mako.nix mako: "settings" is an attrset, so use that as example too (#7330) 2025-06-26 16:36:45 -05:00
mbsync.nix treewide: format with latest stable formatter 2025-07-23 10:27:52 -05:00
megasync.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
mopidy.nix maintainers: remove duplicate HM entries 2025-07-04 09:20:48 -05:00
mpd-discord-rpc.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
mpd-mpris.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
mpd.nix mpd: fix typo (#7541) 2025-07-25 12:44:09 -05:00
mpdris2.nix treewide: format with latest stable formatter 2025-07-23 10:27:52 -05:00
mpdscribble.nix treewide: meta.maintainers at top 2025-11-22 14:51:05 -06:00
mpris-proxy.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
muchsync.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
network-manager-applet.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
nextcloud-client.nix nextcloud-client: add stop and restart settings to the service 2025-09-18 10:30:48 +02:00
nix-gc.nix nix-gc: remove unnecessary toString 2025-08-22 21:03:56 -05:00
notify-osd.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
ollama.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
opensnitch-ui.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
osmscout-server.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
owncloud-client.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
pantalaimon.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
parcellite.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
pass-secret-service.nix test: update tests path for new pwd-store path 2025-11-25 23:33:06 -06:00
pasystray.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
pbgopy.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
picom.nix treewide: meta.maintainers at top 2025-11-22 14:51:05 -06:00
pimsync.nix services/pimsync: init 2025-10-20 17:10:44 +02:00
pizauth.nix pizauth: update maintainer entry 2025-10-12 17:34:57 -05:00
plan9port.nix plan9port: drop ehmry maintainer 2025-09-07 09:28:15 -05:00
playerctld.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
plex-mpv-shim.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
polkit-gnome.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
polybar.nix polybar: make sure X-Restart-Triggers is a list 2025-09-05 14:31:31 +02:00
poweralertd.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
protonmail-bridge.nix protonmail-bridge: init module 2025-08-17 09:44:56 -05:00
psd.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
pueue.nix pueue: enable darwin configuration (#7519) 2025-07-23 13:12:46 -05:00
pulseeffects.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
radicle.nix treewide: meta.maintainers at top 2025-11-22 14:51:05 -06:00
random-background.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
recoll.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
remmina.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
rescrobbled.nix treewide: awwpotato -> da157 2025-11-22 12:48:17 -06:00
restic.nix treewide: meta.maintainers at top 2025-11-22 14:51:05 -06:00
rsibreak.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
safeeyes.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
screen-locker.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
sctd.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
shikane.nix shikane: add package to PATH (#8233) 2025-11-30 14:48:16 +01:00
shpool.nix shpool: init shpool module 2025-08-31 11:53:50 -05:00
signaturepdf.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
skhd.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
snixembed.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
spotifyd.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
ssh-agent.nix ssh-agent: add macOS support 2025-11-08 22:10:01 -06:00
ssh-tpm-agent.nix ssh-tpm-agent: match the upstream systemd units 2025-08-18 21:16:27 -05:00
stalonetray.nix formatter: add deadnix (#7331) 2025-06-28 16:28:39 -05:00
status-notifier-watcher.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
swayidle.nix swayidle: improve confusing "events" configuration 2025-12-02 22:24:56 -06:00
swaync.nix swaync: fix eval problem (#7844) 2025-09-19 08:15:27 -05:00
swayosd.nix swayosd: Remove non-existing display arg option (#7752) 2025-09-03 07:42:44 -05:00
swww.nix swww: add package to service path 2025-11-15 09:51:45 +01:00
sxhkd.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
syncthing.nix syncthing: use mkPackageOption tray package 2025-11-22 14:48:56 -06:00
systembus-notify.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
taffybar.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
tahoe-lafs.nix tahoe-lafs: update default package 2025-09-25 08:26:37 +02:00
tailscale-systray.nix tailscale-systray: add module (#7821) 2025-09-26 15:14:09 +00:00
taskwarrior-sync.nix taskwarrior-sync: taskwarrior -> taskwarrior2 2025-11-02 22:59:59 -06:00
tldr-update.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
tomat.nix tomat: init service (#8138) 2025-11-06 16:44:08 +00:00
trayer.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
trayscale.nix maintainers: remove duplicate HM entries 2025-07-04 09:20:48 -05:00
twmn.nix treewide: Remove unwanted dependencies (#7487) 2025-07-17 14:12:50 -05:00
udiskie.nix treewide: fold -> foldr 2025-11-26 09:23:05 -06:00
unclutter.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
unison.nix treewide: Remove unwanted dependencies (#7487) 2025-07-17 14:12:50 -05:00
vdirsyncer.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
volnoti.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
walker.nix walker: add module (#7649) 2025-08-10 23:23:58 -05:00
way-displays.nix treewide: fold -> foldr 2025-11-26 09:23:05 -06:00
wayvnc.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
wl-clip-persist.nix wl-clip-persist: add module 2025-10-16 19:26:10 -05:00
wlsunset.nix treewide: remove config dependency on docs (#7547) 2025-07-26 17:11:53 -05:00
wluma.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
wob.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
wpaperd.nix wpaperd: handle empty settings properly 2025-07-11 15:26:17 -05:00
xcape.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
xembed-sni-proxy.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
xidlehook.nix treewide: format with latest stable formatter 2025-07-23 10:27:52 -05:00
xscreensaver.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
xsettingsd.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00
xsuspender.nix treewide: add missing package options (#7575) 2025-07-29 12:20:22 -05:00
yubikey-agent.nix treewide: flatten single file modules 2025-06-23 16:20:26 -05:00