Skip to content

Commit

Permalink
nixos/udev: only restart when udev rules change
Browse files Browse the repository at this point in the history
Only restart `systemd-udevd.service` if udev rules in `/etc/udev/rules`
actually changed. The paths of `services.udev.packages` may change
frequently but the resulting udev rules built by `udevRulesFor`
likely change less often.

This has the added benefit of not adding `services.udev.packages` to
the system closure if they are only used for their udev rules
(issue #308937).
  • Loading branch information
Princemachiavelli authored and bjornfor committed Sep 19, 2024
1 parent 1bbc585 commit 4080d35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nixos/modules/services/hardware/udev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ in
'';

systemd.services.systemd-udevd =
{ restartTriggers = cfg.packages;
{ restartTriggers = [ config.environment.etc."udev/rules.d".source ];
};

};
Expand Down

0 comments on commit 4080d35

Please sign in to comment.