From d503b7ee9ef846c669903e0a91d43fc3c9423185 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Fri, 29 Nov 2024 04:47:05 +0300 Subject: [PATCH] Desktop: Fix NM unmanaged networks. --- host/x86_64-linux/dasha/Network.nix | 29 ++++++++++++-------------- host/x86_64-linux/desktop/Network.nix | 30 +++++++++++++-------------- host/x86_64-linux/home/Network.nix | 3 --- system/Network.nix | 13 ++++++++---- 4 files changed, 36 insertions(+), 39 deletions(-) diff --git a/host/x86_64-linux/dasha/Network.nix b/host/x86_64-linux/dasha/Network.nix index bff97a4b..eaaf208e 100644 --- a/host/x86_64-linux/dasha/Network.nix +++ b/host/x86_64-linux/dasha/Network.nix @@ -1,21 +1,18 @@ { ... }: { - systemd.network = { - networks = { - "10-lan" = { - matchConfig.Name = "enp5s0"; - linkConfig.RequiredForOnline = "routable"; - networkConfig = { - DHCP = "yes"; - DNS = "10.0.0.1"; - IPv6AcceptRA = true; - }; - address = [ - "10.0.0.7/24" - ]; - routes = [ - { Gateway = "10.0.0.1"; } - ]; + systemd.network.networks = { + "10-lan" = { + matchConfig.Name = "enp5s0"; + linkConfig.RequiredForOnline = "routable"; + networkConfig = { + DHCP = false; + DNS = "10.0.0.1"; }; + address = [ + "10.0.0.7/24" + ]; + routes = [ + { Gateway = "10.0.0.1"; } + ]; }; }; } diff --git a/host/x86_64-linux/desktop/Network.nix b/host/x86_64-linux/desktop/Network.nix index 7849ec0a..ffb6b871 100644 --- a/host/x86_64-linux/desktop/Network.nix +++ b/host/x86_64-linux/desktop/Network.nix @@ -1,21 +1,19 @@ { ... }: { - systemd.network = { - networks = { - "10-lan" = { - matchConfig.Name = "enp4s0"; - linkConfig.RequiredForOnline = "routable"; - networkConfig = { - DHCP = "yes"; - DNS = "10.0.0.1"; - IPv6AcceptRA = true; - }; - address = [ - "10.0.0.3/24" - ]; - routes = [ - { Gateway = "10.0.0.1"; } - ]; + systemd.network.networks = { + "10-lan" = { + matchConfig.Name = "enp4s0"; + linkConfig.RequiredForOnline = "routable"; + networkConfig = { + DHCP = false; + DNS = "10.0.0.1"; + # IPv6AcceptRA = true; }; + address = [ + "10.0.0.3/24" + ]; + routes = [ + { Gateway = "10.0.0.1"; } + ]; }; }; } diff --git a/host/x86_64-linux/home/Network.nix b/host/x86_64-linux/home/Network.nix index 24743174..17184d7f 100644 --- a/host/x86_64-linux/home/Network.nix +++ b/host/x86_64-linux/home/Network.nix @@ -19,9 +19,6 @@ in { # Disable SSH access from everywhere, configure access bellow. services.openssh.openFirewall = false; - # NOTE: Debugging. - systemd.services."systemd-networkd".environment.SYSTEMD_LOG_LEVEL = "debug"; - # Wan configuration. systemd.network = { networks = { diff --git a/system/Network.nix b/system/Network.nix index dd826b9c..2aa766b5 100644 --- a/system/Network.nix +++ b/system/Network.nix @@ -8,14 +8,19 @@ networking = { dhcpcd.enable = false; + useDHCP = false; + useNetworkd = true; networkmanager = { enable = true; unmanaged = [ - "bridge" - "ethernet" - "loopback" - "wireguard" + "type:bridge" + "type:ethernet" + "type:loopback" + # "type:wireguard" ]; }; }; + + # NOTE: Debugging. + # systemd.services."systemd-networkd".environment.SYSTEMD_LOG_LEVEL = "debug"; }