mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-23 20:44:12 +00:00
Merge pull request #249643 from amarshall/networkd-reload
nixos/networkd: Reload (not restart) when only .network units change
This commit is contained in:
commit
6b8306c21c
@ -2812,9 +2812,16 @@ let
|
||||
|
||||
environment.etc."systemd/networkd.conf" = renderConfig cfg.config;
|
||||
|
||||
systemd.services.systemd-networkd = {
|
||||
systemd.services.systemd-networkd = let
|
||||
isReloadableUnitFileName = unitFileName: strings.hasSuffix ".network" unitFileName;
|
||||
partitionedUnitFiles = lib.partition isReloadableUnitFileName unitFiles;
|
||||
reloadableUnitFiles = partitionedUnitFiles.right;
|
||||
nonReloadableUnitFiles = partitionedUnitFiles.wrong;
|
||||
unitFileSources = unitFiles: map (x: x.source) (attrValues unitFiles);
|
||||
in {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
restartTriggers = map (x: x.source) (attrValues unitFiles) ++ [
|
||||
reloadTriggers = unitFileSources reloadableUnitFiles;
|
||||
restartTriggers = unitFileSources nonReloadableUnitFiles ++ [
|
||||
config.environment.etc."systemd/networkd.conf".source
|
||||
];
|
||||
aliases = [ "dbus-org.freedesktop.network1.service" ];
|
||||
|
Loading…
Reference in New Issue
Block a user