switch to networkd

This commit is contained in:
Gerg-L 2023-07-30 22:48:07 -04:00
parent 4068de6a5f
commit 019576dd7b
4 changed files with 45 additions and 26 deletions

View file

@ -168,7 +168,7 @@
</controller> </controller>
<interface type="bridge"> <interface type="bridge">
<mac address="52:54:00:05:03:2d"/> <mac address="52:54:00:05:03:2d"/>
<source bridge="bridge0"/> <source bridge="br0"/>
<model type="virtio"/> <model type="virtio"/>
<link state="up"/> <link state="up"/>
<address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/> <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>

View file

@ -80,31 +80,47 @@
programs.adb.enable = true; programs.adb.enable = true;
networking = { networking = {
useNetworkd = false;
useDHCP = false; useDHCP = false;
hostId = "288b56db"; 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; 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 #user managment
sops.secrets = { sops.secrets = {
gerg.neededForUsers = true; gerg.neededForUsers = true;

View file

@ -1,4 +1,4 @@
{...}: { _: {
pkgs, pkgs,
lib, lib,
config, config,
@ -156,8 +156,8 @@ in {
''; '';
in [ in [
"L /etc/Xorg/active.conf - - - - /etc/Xorg/2_mon.conf" "L /etc/Xorg/active.conf - - - - /etc/Xorg/2_mon.conf"
"L+ /var/lib/libvirt/hooks/qemu - - - - ${qemuHook}" "C /var/lib/libvirt/hooks/qemu - - - - ${qemuHook}"
"L+ /var/lib/libvirt/qemu/Windows.xml - - - - ${./Windows.xml}" "C /var/lib/libvirt/qemu/Windows.xml - - - - ${./Windows.xml}"
]; ];
_file = ./vfio.nix; _file = ./vfio.nix;
} }

View file

@ -10,7 +10,10 @@ _: {
"L /etc/nixos/flake.nix - - - - /home/gerg/Projects/nixos/flake.nix" "L /etc/nixos/flake.nix - - - - /home/gerg/Projects/nixos/flake.nix"
]; ];
#create machine-id for spotify #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 #make sure the sopskey is found
sops.age.sshKeyPaths = lib.mkForce ["/persist/ssh/ssh_host_ed25519_key"]; sops.age.sshKeyPaths = lib.mkForce ["/persist/ssh/ssh_host_ed25519_key"];
fileSystems."/persist".neededForBoot = true; fileSystems."/persist".neededForBoot = true;