about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2017-09-24 15:55:02 +0200
committerFranz Pletz <fpletz@fnordicwalking.de>2017-09-25 14:06:38 +0200
commit3a670daa9882de4c7a95f81a36e988c5771c1724 (patch)
treeeea866e27e1ae01921fa8d4d14bfc2b25e33f45f
parent4429559aa15e59731462a91784d7c66b345d219e (diff)
downloadnixlib-3a670daa9882de4c7a95f81a36e988c5771c1724.tar
nixlib-3a670daa9882de4c7a95f81a36e988c5771c1724.tar.gz
nixlib-3a670daa9882de4c7a95f81a36e988c5771c1724.tar.bz2
nixlib-3a670daa9882de4c7a95f81a36e988c5771c1724.tar.lz
nixlib-3a670daa9882de4c7a95f81a36e988c5771c1724.tar.xz
nixlib-3a670daa9882de4c7a95f81a36e988c5771c1724.tar.zst
nixlib-3a670daa9882de4c7a95f81a36e988c5771c1724.zip
nixos/network-interfaces: IPs must always be set
Previously, depending on the environment and the type of interface that
was created, the configured IPs of an interface wouldn't be applied on a
nixos-rebuild switch. It works after a reboot.

This patch ensures that the network-addresses service is started
either via the network-link service or if the networking target is
activated (i.e. on system activation).

Fixes #28474 #16230.
-rw-r--r--nixos/modules/tasks/network-interfaces-scripted.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/nixos/modules/tasks/network-interfaces-scripted.nix b/nixos/modules/tasks/network-interfaces-scripted.nix
index 7ede8752bcc3..26fba1d5adbb 100644
--- a/nixos/modules/tasks/network-interfaces-scripted.nix
+++ b/nixos/modules/tasks/network-interfaces-scripted.nix
@@ -152,7 +152,11 @@ let
           in
           nameValuePair "network-addresses-${i.name}"
           { description = "Address configuration of ${i.name}";
-            wantedBy = [ "network-setup.service" ];
+            wantedBy = [
+              "network-setup.service"
+              "network-link-${i.name}.service"
+              "network.target"
+            ];
             # propagate stop and reload from network-setup
             partOf = [ "network-setup.service" ];
             # order before network-setup because the routes that are configured