1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-03 23:51:03 +01:00
home-manager/tests
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
..
integration dconf: support configuring specific user databases (#6301) 2025-11-30 14:37:17 +01:00
lib generators: rewrite toSCFG 2025-10-20 17:10:44 +02:00
modules swayidle: improve confusing "events" configuration 2025-12-02 22:24:56 -06:00
asserts.nix treewide: reformat nixfmt-rfc-style 2025-04-08 08:50:05 -07:00
big-test.nix treewide: Prevent IFD by default 2025-05-07 10:34:18 -05:00
darwinScrublist.nix ludusavi: add test 2025-12-02 21:57:23 -06:00
default.nix tests: disable release check bypass 2025-11-28 14:27:50 -06:00
flake.nix tests: rename test-all-* tests 2025-09-28 16:26:13 -05:00
package.nix tests: explicitly define NIX_CONFIG 2025-11-01 14:29:06 -05:00
stubs.nix treewide: remove no-ops (#8061) 2025-10-26 15:43:53 -05:00
tests.py tests: improve debugging for failed test runs 2025-09-28 16:28:05 -05:00