git.iko.soy/typeable/nixpkgs
on master help sign in
treewide: fix fallout of ip-up deprecation
c58654eFranz Pletz
nixos/modules/services/networking/avahi-daemon.nix+1−11
@@ -7,10 +7,6 @@ let
7
7
8 cfg = config.services.avahi;
8 cfg = config.services.avahi;
9
9
10− # We must escape interfaces due to the systemd interpretation
11− subsystemDevice = interface:
12− "sys-subsystem-net-devices-${utils.escapeSystemdPath interface}.device";
13−
14 avahiDaemonConf = with cfg; pkgs.writeText "avahi-daemon.conf" ''
10 avahiDaemonConf = with cfg; pkgs.writeText "avahi-daemon.conf" ''
15 [server]
11 [server]
16 ${# Users can set `networking.hostName' to the empty string, when getting
12 ${# Users can set `networking.hostName' to the empty string, when getting
@@ -180,14 +176,8 @@ in
180 environment.systemPackages = [ pkgs.avahi ];
176 environment.systemPackages = [ pkgs.avahi ];
181
177
182 systemd.services.avahi-daemon =
178 systemd.services.avahi-daemon =
183− let
184− deps = optionals (cfg.interfaces!=null) (map subsystemDevice cfg.interfaces);
185− in
186 { description = "Avahi daemon";
179 { description = "Avahi daemon";
187− wantedBy = [ "ip-up.target" ];
180+ wantedBy = [ "multi-user.target" ];
188− bindsTo = deps;
189− after = deps;
190− before = [ "ip-up.target" ];
191 # Receive restart event after resume
181 # Receive restart event after resume
192 partOf = [ "post-resume.target" ];
182 partOf = [ "post-resume.target" ];
193
183
nixos/modules/services/networking/dhcpcd.nix+3−4
@@ -147,10 +147,9 @@ in
147 systemd.services.dhcpcd =
147 systemd.services.dhcpcd =
148 { description = "DHCP Client";
148 { description = "DHCP Client";
149
149
150− wantedBy = [ "network.target" ];
150+ wantedBy = [ "multi-user.target" ];
151− # Work-around to deal with problems where the kernel would remove &
151+ wants = [ "network.target" ];
152− # re-create Wifi interfaces early during boot.
153− after = [ "network-interfaces.target" ];
152+ before = [ "network.target" ];
154
153
155 # Stopping dhcpcd during a reconfiguration is undesirable
154 # Stopping dhcpcd during a reconfiguration is undesirable
156 # because it brings down the network interfaces configured by
155 # because it brings down the network interfaces configured by
nixos/modules/services/networking/networkmanager.nix−10
@@ -52,13 +52,6 @@ let
52 });
52 });
53 '';
53 '';
54
54
55− ipUpScript = writeScript "01nixos-ip-up" ''
56− #!/bin/sh
57− if test "$2" = "up"; then
58− ${config.systemd.package}/bin/systemctl start network-online.target
59− fi
60− '';
61−
62 ns = xs: writeText "nameservers" (
55 ns = xs: writeText "nameservers" (
63 concatStrings (map (s: "nameserver ${s}\n") xs)
56 concatStrings (map (s: "nameserver ${s}\n") xs)
64 );
57 );
@@ -187,9 +180,6 @@ in {
187 boot.kernelModules = [ "ppp_mppe" ]; # Needed for most (all?) PPTP VPN connections.
180 boot.kernelModules = [ "ppp_mppe" ]; # Needed for most (all?) PPTP VPN connections.
188
181
189 environment.etc = with cfg.basePackages; [
182 environment.etc = with cfg.basePackages; [
190− { source = ipUpScript;
191− target = "NetworkManager/dispatcher.d/01nixos-ip-up";
192− }
193 { source = configFile;
183 { source = configFile;
194 target = "NetworkManager/NetworkManager.conf";
184 target = "NetworkManager/NetworkManager.conf";
195 }
185 }
nixos/modules/system/boot/systemd.nix−2
@@ -727,8 +727,6 @@ in
727 unitConfig.X-StopOnReconfiguration = true;
727 unitConfig.X-StopOnReconfiguration = true;
728 };
728 };
729
729
730− systemd.targets.network-online.after = [ "ip-up.target" ];
731−
732 systemd.units =
730 systemd.units =
733 mapAttrs' (n: v: nameValuePair "${n}.target" (targetToUnit n v)) cfg.targets
731 mapAttrs' (n: v: nameValuePair "${n}.target" (targetToUnit n v)) cfg.targets
734 // mapAttrs' (n: v: nameValuePair "${n}.service" (serviceToUnit n v)) cfg.services
732 // mapAttrs' (n: v: nameValuePair "${n}.service" (serviceToUnit n v)) cfg.services
nixos/modules/tasks/network-interfaces-scripted.nix−1
@@ -142,7 +142,6 @@ in
142 # (Flushing this interface may have removed it.)
142 # (Flushing this interface may have removed it.)
143 ${config.systemd.package}/bin/systemctl try-restart --no-block network-setup.service
143 ${config.systemd.package}/bin/systemctl try-restart --no-block network-setup.service
144 fi
144 fi
145− ${config.systemd.package}/bin/systemctl start network-online.target
146 '';
145 '';
147 preStop = flip concatMapStrings (ips) (ip:
146 preStop = flip concatMapStrings (ips) (ip:
148 let
147 let