From b675486b89454fa44d94ea07341fa5986d083ada Mon Sep 17 00:00:00 2001 From: Lach Date: Sat, 24 May 2025 19:22:55 +0000 Subject: [PATCH] feat: prevent restart of NetworkManager during activation --- --- a/modules/nixos/online.nix +++ b/modules/nixos/online.nix @@ -5,6 +5,7 @@ }: let inherit (lib.options) mkOption; + inherit (lib.modules) mkIf mkDefault; inherit (lib.types) attrsOf str @@ -80,4 +81,12 @@ supportsDryActivation = true; }; } // config.system.onlineActivationScripts; + + config.systemd.services = mkIf config.networking.networkmanager.enable { + # If machine is managed by fleet, we should not restart NetworkManager during activation, + # as it will disrupt the activation process. Furthermore, NetworkManager is not declarative, + # so even if user wants to update his network settings - disabled NetworkManager restart + # will not affect that. + NetworkManager.restartIfChanged = mkDefault false; + }; } -- gitstuff