about summary refs log tree commit diff
path: root/nixos/modules/system
diff options
context:
space:
mode:
authorarcnmx <git@git.arcn.mx>2022-11-25 17:47:47 -0800
committerarcnmx <git@git.arcn.mx>2022-12-02 19:00:31 -0800
commit51b5602b458f8ab2b62f397fe98dcd16b7f44135 (patch)
treebb0275b0ed15aff528b3adc5af86c3e49f233770 /nixos/modules/system
parent5bb01fc84459d6d2ea14b17f75b5cd99b7f2fac6 (diff)
nixos/networkd: add wait-online.enable option
When no interfaces are managed by systemd-networkd, it will
unconditionally fail. This option allows it to be disabled in those
situations where it prevents system switches from succeeding.
Diffstat (limited to 'nixos/modules/system')
-rw-r--r--nixos/modules/system/boot/networkd.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix
index 28abf820ec097..3f6666b20482c 100644
--- a/nixos/modules/system/boot/networkd.nix
+++ b/nixos/modules/system/boot/networkd.nix
@@ -1900,6 +1900,20 @@ in
     };
 
     systemd.network.wait-online = {
+      enable = mkOption {
+        type = types.bool;
+        default = true;
+        example = false;
+        description = lib.mdDoc ''
+          Whether to enable the systemd-networkd-wait-online service.
+
+          systemd-networkd-wait-online can timeout and fail if there are no network interfaces
+          available for it to manage. When systemd-networkd is enabled but a different service is
+          responsible for managing the system's internet connection (for example, NetworkManager or
+          connman are used to manage WiFi connections), this service is unnecessary and can be
+          disabled.
+        '';
+      };
       anyInterface = mkOption {
         description = lib.mdDoc ''
           Whether to consider the network online when any interface is online, as opposed to all of them.
@@ -1981,6 +1995,7 @@ in
       };
 
       systemd.services.systemd-networkd-wait-online = {
+        inherit (cfg.wait-online) enable;
         wantedBy = [ "network-online.target" ];
         serviceConfig.ExecStart = [
           ""