From 019576dd7bdfcd8c70fe8f67c3cdb458b93dba8a Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Sun, 30 Jul 2023 22:48:07 -0400 Subject: [PATCH] switch to networkd --- hosts/gerg-desktop/Windows.xml | 2 +- hosts/gerg-desktop/main.nix | 58 ++++++++++++++++++++++------------ hosts/gerg-desktop/vfio.nix | 6 ++-- hosts/gerg-desktop/zfs.nix | 5 ++- 4 files changed, 45 insertions(+), 26 deletions(-) diff --git a/hosts/gerg-desktop/Windows.xml b/hosts/gerg-desktop/Windows.xml index a995ac1..3c8a4ee 100644 --- a/hosts/gerg-desktop/Windows.xml +++ b/hosts/gerg-desktop/Windows.xml @@ -168,7 +168,7 @@ - +
diff --git a/hosts/gerg-desktop/main.nix b/hosts/gerg-desktop/main.nix index 8539f07..852cc1d 100644 --- a/hosts/gerg-desktop/main.nix +++ b/hosts/gerg-desktop/main.nix @@ -80,31 +80,47 @@ programs.adb.enable = true; networking = { + useNetworkd = false; useDHCP = false; hostId = "288b56db"; - nameservers = [ - "192.168.1.1" - "2605:59c8:252e:500::1" - ]; - defaultGateway = "192.168.1.1"; - interfaces = { - "enp11s0" = { - name = "eth0"; - }; - "bridge0" = { - name = "bridge0"; - macAddress = "D8:5E:D3:E5:47:90"; - ipv4.addresses = [ - { - address = "192.168.1.4"; - prefixLength = 24; - } - ]; - }; - }; - bridges."bridge0".interfaces = ["eth0"]; firewall.enable = true; }; + + systemd.network = { + enable = true; + netdevs."br0" = { + netdevConfig = { + Kind = "bridge"; + Name = "br0"; + }; + }; + networks = { + "enp11s0" = { + name = "enp11s0"; + bridge = ["br0"]; + linkConfig.RequiredForOnline = "enslaved"; + }; + "br0" = { + name = "br0"; + address = [ + "192.168.1.4/24" + ]; + gateway = [ + "192.168.1.1" + ]; + dns = [ + "192.168.1.1" + ]; + DHCP = "no"; + bridgeConfig = {}; + linkConfig = { + MACAddress = "D8:5E:D3:E5:47:90"; + RequiredForOnline = "routable"; + }; + }; + }; + }; + #user managment sops.secrets = { gerg.neededForUsers = true; diff --git a/hosts/gerg-desktop/vfio.nix b/hosts/gerg-desktop/vfio.nix index 9480bb3..3154f33 100644 --- a/hosts/gerg-desktop/vfio.nix +++ b/hosts/gerg-desktop/vfio.nix @@ -1,4 +1,4 @@ -{...}: { +_: { pkgs, lib, config, @@ -156,8 +156,8 @@ in { ''; in [ "L /etc/Xorg/active.conf - - - - /etc/Xorg/2_mon.conf" - "L+ /var/lib/libvirt/hooks/qemu - - - - ${qemuHook}" - "L+ /var/lib/libvirt/qemu/Windows.xml - - - - ${./Windows.xml}" + "C /var/lib/libvirt/hooks/qemu - - - - ${qemuHook}" + "C /var/lib/libvirt/qemu/Windows.xml - - - - ${./Windows.xml}" ]; _file = ./vfio.nix; } diff --git a/hosts/gerg-desktop/zfs.nix b/hosts/gerg-desktop/zfs.nix index 711ed0f..5cb9ca6 100644 --- a/hosts/gerg-desktop/zfs.nix +++ b/hosts/gerg-desktop/zfs.nix @@ -10,7 +10,10 @@ _: { "L /etc/nixos/flake.nix - - - - /home/gerg/Projects/nixos/flake.nix" ]; #create machine-id for spotify - environment.etc."machine-id".text = "b6431c2851094770b614a9cfa78fb6ea"; + environment.etc."machine-id" = { + text = "b6431c2851094770b614a9cfa78fb6ea"; + mode = "0644"; + }; #make sure the sopskey is found sops.age.sshKeyPaths = lib.mkForce ["/persist/ssh/ssh_host_ed25519_key"]; fileSystems."/persist".neededForBoot = true;