dot

vizie's NixOS desktop: Hyprland, CachyOS kernel and gaming tweaks

46fe4cb

Static 10.0.0.40 on eno1 through systemd-networkd

By Gustaf Granström

NetworkManager keeps Wi-Fi and leaves eno1 unmanaged; the control centre's
network tile counts an unmanaged wired link that is up as connected. The VM
has no eno1, so it doesn't wait for networkd at boot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

3 files changed +25 −0

@@ -16,6 +16,13 @@
1616 # DEVICE:TYPE:STATE:CONNECTION
1717 devices=$(timeout 2 nmcli -t -f DEVICE,TYPE,STATE,CONNECTION device 2>/dev/null)
1818 wired=$(grep -m1 -E '^[^:]+:ethernet:connected:' <<<"$devices")
19+# eno1 is set up by systemd-networkd (hosts/desktop), so NetworkManager only
20+# sees it as unmanaged; it counts as connected when the link is up.
21+if [ -z "$wired" ]; then
22+ while IFS= read -r line; do
23+ [ "$(cat "/sys/class/net/${line%%:*}/operstate" 2>/dev/null)" = up ] && { wired=$line; break; }
24+ done < <(grep -E '^[^:]+:ethernet:unmanaged:' <<<"$devices")
25+fi
1926 wifi=$(grep -m1 -E '^[^:]+:wifi:connected:' <<<"$devices")
2027
2128 if [ -n "$wired" ]; then
@@ -17,6 +17,20 @@
1717
1818 networking.hostName = "desktop";
1919
20+ # The wired port has a fixed address, set by systemd-networkd rather than
21+ # handed out by the router. NetworkManager keeps Wi-Fi and leaves eno1 alone.
22+ networking.networkmanager.unmanaged = [ "eno1" ];
23+ systemd.network = {
24+ enable = true;
25+ networks."10-eno1" = {
26+ matchConfig.Name = "eno1";
27+ address = [ "10.0.0.40/24" ];
28+ gateway = [ "10.0.0.1" ];
29+ dns = [ "10.0.0.1" ];
30+ domains = [ "granstrm.com" ];
31+ };
32+ };
33+
2034 # The MacBook, which installs this machine with nixos-anywhere and can log in
2135 # before the home folder (and its ~/.ssh/authorized_keys) is restored. Root
2236 # too: a fresh install has no passwords, so that is how yours gets set.
@@ -48,6 +48,10 @@
4848 };
4949
5050 dot.nvidia.enable = false;
51+
52+ # The VM has no eno1 for systemd-networkd to bring up (NetworkManager does
53+ # its network), so don't hold the boot waiting for it.
54+ systemd.network.wait-online.enable = false;
5155 home-manager.users.vizie.dot.liveConfig = lib.mkForce false;
5256
5357 # The VM's user has no password of its own to unlock the session with.