use networkd

This commit is contained in:
Christoph Cullmann 2023-04-29 15:51:29 +02:00
parent e63568518c
commit 624be0a4d0
4 changed files with 21 additions and 9 deletions

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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";