From 624be0a4d0dc5f2760810143b35a49ba923dcdd5 Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Sat, 29 Apr 2023 15:51:29 +0200 Subject: [PATCH] use networkd --- common.nix | 18 +++++++++++++++--- kuro/hardware-configuration.nix | 4 ++-- mini/hardware-configuration.nix | 4 ++-- neko/hardware-configuration.nix | 4 ++-- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/common.nix b/common.nix index dd8a2bb..7ed82ab 100644 --- a/common.nix +++ b/common.nix @@ -90,6 +90,19 @@ in # allow all firmware hardware.enableAllFirmware = true; + # networking via networkd + systemd.network.enable = true; + systemd.network.networks."10-lan" = { + networkConfig = { + # start a DHCP Client for IPv4 Addressing/Routing + DHCP = "ipv4"; + # accept Router Advertisements for Stateless IPv6 Autoconfiguraton (SLAAC) + IPv6AcceptRA = true; + }; + # make routing on this interface a dependency for network-online.target + linkConfig.RequiredForOnline = "routable"; + }; + # ensure firewall is up, allow ssh and http in networking.firewall.enable = true; networking.firewall.allowedTCPPorts = [ 22 80 ]; @@ -133,6 +146,7 @@ in # X11 settings services.xserver = { libinput.enable = true; + upscaleDefaultCursor = false; # Configure keymap in X11 layout = "eu"; @@ -147,9 +161,6 @@ in enable = true; displayManager.sddm.enable = true; displayManager.defaultSession = "plasmawayland"; - - upscaleDefaultCursor = false; - }; # Enable sound with pipewire. @@ -529,6 +540,7 @@ in sqlitebrowser unrar unzip + wine64 xdotool # retroarch with some emulators diff --git a/kuro/hardware-configuration.nix b/kuro/hardware-configuration.nix index 8e59879..f185c24 100644 --- a/kuro/hardware-configuration.nix +++ b/kuro/hardware-configuration.nix @@ -20,8 +20,8 @@ swapDevices = [ ]; - # Enables DHCP on the right ethernet interface. - networking.interfaces.enp1s0.useDHCP = true; + # setup our network for later config in common.nix + systemd.network.networks."10-lan".matchConfig.Name = "enp1s0"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/mini/hardware-configuration.nix b/mini/hardware-configuration.nix index 89a00b7..56f6c23 100644 --- a/mini/hardware-configuration.nix +++ b/mini/hardware-configuration.nix @@ -20,8 +20,8 @@ swapDevices = [ ]; - # Enables DHCP on the right ethernet interface. - networking.interfaces.eno1.useDHCP = true; + # setup our network for later config in common.nix + systemd.network.networks."10-lan".matchConfig.Name = "eno1"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/neko/hardware-configuration.nix b/neko/hardware-configuration.nix index 1b2f52f..028ff5c 100644 --- a/neko/hardware-configuration.nix +++ b/neko/hardware-configuration.nix @@ -25,8 +25,8 @@ swapDevices = [ ]; - # Enables DHCP on the right ethernet interface. - networking.interfaces.enp8s0.useDHCP = true; + # setup our network for later config in common.nix + systemd.network.networks."10-lan".matchConfig.Name = "enp8s0"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";