From fadadea7bf895c2ebfaa5000325d725bf469893a Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Sat, 12 Aug 2023 02:13:50 +0200 Subject: [PATCH] Only NetworkManager on desktops --- modules/base/network.nix | 6 +----- modules/desktop/default.nix | 1 + modules/desktop/network.nix | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 modules/desktop/network.nix diff --git a/modules/base/network.nix b/modules/base/network.nix index 41c9959..da4fad5 100644 --- a/modules/base/network.nix +++ b/modules/base/network.nix @@ -1,14 +1,10 @@ -{ lib, pkgs, ... }: { +{ ... }: { networking = { firewall = { allowedTCPPorts = [ 1234 1337 8000 8080 ]; allowedUDPPorts = [ 1234 1337 8000 8080 ]; }; nameservers = [ "127.0.0.53" ]; # resolved stub resolver - networkmanager = { - enable = true; - dns = lib.mkForce "none"; - }; }; # TODO: these systemd networkd settings will be the default once diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index acddb14..d311cb1 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -1,6 +1,7 @@ { pkgs, ... }: { imports = [ ./firefox.nix + ./network.nix ./ssh.nix ./sway.nix ]; diff --git a/modules/desktop/network.nix b/modules/desktop/network.nix new file mode 100644 index 0000000..6dffac8 --- /dev/null +++ b/modules/desktop/network.nix @@ -0,0 +1,15 @@ +{ lib, ... }: { + networking = { + networkmanager = { + enable = true; + dns = lib.mkForce "none"; + }; + }; + + # 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), this service is unnecessary and can be disabled. + # https://search.nixos.org/options?channel=23.05&show=systemd.network.wait-online.enable + systemd.network.wait-online.enable = false; +}