Skip to content

Commit

Permalink
nixos/networkmanager: fix service dependencies
Browse files Browse the repository at this point in the history
Fixes NixOS#283717

It brings me *zero bloody pleasure* to say that we apparently
didn't have any tests for networkmanager of all things!
NixOS#71151
  • Loading branch information
lf- committed Jan 25, 2024
1 parent b91485b commit df51365
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nixos/modules/services/networking/networkmanager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,13 @@ in
];

systemd.services.NetworkManager = {
wantedBy = [ "network.target" ];
# see systemd.special(7): since we are a provider, we pull in
# network.target, while ordered before it.
before = [ "network.target" "NetworkManager-wait-online.service" ];
after = [ "network-pre.target" ];
wants = [ "network.target" ];

wantedBy = [ "multi-user.target" ];
restartTriggers = [ configFile ];

aliases = [ "dbus-org.freedesktop.NetworkManager.service" ];
Expand Down Expand Up @@ -582,7 +588,7 @@ in
systemd.services.NetworkManager-ensure-profiles = mkIf (cfg.ensureProfiles.profiles != { }) {
description = "Ensure that NetworkManager declarative profiles are created";
wantedBy = [ "multi-user.target" ];
before = [ "network-online.target" ];
before = [ "network-pre.target" ];
script = let
path = id: "/run/NetworkManager/system-connections/${id}.nmconnection";
in ''
Expand Down

0 comments on commit df51365

Please sign in to comment.