From 5788a5e3a377c87e314239e140310040ba0fe27c Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Mon, 2 Sep 2024 11:48:40 +0200 Subject: [PATCH] yodaTux: working lan with linux 6.1 --- hosts/yodaTux/configuration.nix | 34 +----------------------- hosts/yodaTux/lan.nix | 47 +++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 33 deletions(-) create mode 100644 hosts/yodaTux/lan.nix diff --git a/hosts/yodaTux/configuration.nix b/hosts/yodaTux/configuration.nix index a1fed23..5ce8927 100644 --- a/hosts/yodaTux/configuration.nix +++ b/hosts/yodaTux/configuration.nix @@ -3,6 +3,7 @@ imports = [ ./hardware-configuration.nix + ./lan.nix ../../modules/home-manager.nix ../../modules/nur-and-unstable.nix ../../modules/unfree.nix @@ -80,39 +81,6 @@ # S Sat Sep 23 16:11:52 2023 p4 kernel: TSC found unstable after boot, most likely due to broken BIOS. Use 'tsc=unstable'. boot.kernelParams = [ "tsc=unstable" ]; - # LAN Internet is not working, only WiFi. - # Replacing in-kernel r8169 with r8168 fixes this. - # https://github.com/avnik/nixos-configs/blob/master/modules/r8168.nix - # https://github.com/poscat0x04/nixos-configuration/blob/master/hardware/profiles/r8168.nix - # https://github.com/NixOS/nixpkgs/blob/961c422b48b3458a01a9c0f2a24e25a1d61018e9/pkgs/os-specific/linux/r8168/default.nix#L51-L52 - # But this requires an old kernel version (we use 5.15 LTS) as r8168 is broken for kernels >= 6 - # https://github.com/NixOS/nixpkgs/issues/256329 - # This does not help, there is a compile error - # nixpkgs.config.allowBroken = true; - # - boot.blacklistedKernelModules = [ "r8169" ]; - boot.extraModulePackages = [ - config.boot.kernelPackages.r8168 - ]; - - # List all available kernel versions: - # `nix repl` -> `:l ` -> `pkgs.linuxPackages` and press `TAB` - # Default. - #boot.kernelPackages = pkgs.linuxPackages; - # Latest. - #boot.kernelPackages = pkgs.linuxPackages_latest; - # LTS, see https://endoflife.date/linux - # TODO: When NixOS 26.05 is out, this kernel is near EOL - boot.kernelPackages = pkgs.linuxPackages_5_15; - #boot.kernelPackages = pkgs.linuxPackages_6_1; - # Hardened. - # https://archlinux.org/packages/extra/x86_64/linux-hardened/ - # -> https://github.com/anthraxx/linux-hardened - #boot.kernelPackages = pkgs.linuxPackages_hardened; - # Free/Libre. - # https://en.wikipedia.org/wiki/Linux-libre - #boot.kernelPackages = pkgs.linuxPackages-libre; - # Most users should never change this value after the initial install, for any reason, even if you've upgraded your system to a new NixOS release. system.stateVersion = "23.05"; } diff --git a/hosts/yodaTux/lan.nix b/hosts/yodaTux/lan.nix new file mode 100644 index 0000000..a60c75c --- /dev/null +++ b/hosts/yodaTux/lan.nix @@ -0,0 +1,47 @@ +{ config, pkgs, ... }: +{ + # Working LAN Internet vs mainline Linux. + # + # With the in-tree kernel driver r8169 for the network card (LAN and Wi-Fi), LAN Internet is not working. + # + # With the out-of-tree r8168 kernel driver, LAN is working. + # https://github.com/avnik/nixos-configs/blob/master/modules/r8168.nix + # https://github.com/poscat0x04/nixos-configuration/blob/master/hardware/profiles/r8168.nix + # https://github.com/NixOS/nixpkgs/blob/961c422b48b3458a01a9c0f2a24e25a1d61018e9/pkgs/os-specific/linux/r8168/default.nix#L51-L52 + # But this requires an old kernel version (we use 5.15 LTS) as r8168 is broken for 6 <= kernel <= 6.8 + # https://github.com/NixOS/nixpkgs/issues/256329 + # -> https://github.com/NixOS/nixpkgs/pull/311238 + + boot.blacklistedKernelModules = [ "r8169" ]; + boot.extraModulePackages = [ + config.boot.kernelPackages.r8168 + ]; + + # https://nixos.wiki/wiki/Linux_kernel#List_available_kernels + # List all available kernel versions: + # `nix repl` -> `:l ` -> `pkgs.linuxPackages` and press `TAB` + + # Default value. + #boot.kernelPackages = pkgs.linuxPackages; + # Latest stable. + #boot.kernelPackages = pkgs.linuxPackages_latest; + # Latest unstable. + #boot.kernelPackages = pkgs.unstable.linuxPackages_latest; + + # LTS, see https://endoflife.date/linux + # TODO: When NixOS 26.05 is out, this kernel is near EOL + #boot.kernelPackages = pkgs.linuxPackages_5_15; + + # LTS, see https://endoflife.date/linux + # TODO: When NixOS 26.05 is out, this kernel is near EOL + boot.kernelPackages = pkgs.linuxPackages_6_1; + nixpkgs.config.allowBroken = true; + + # Hardened. + # https://archlinux.org/packages/extra/x86_64/linux-hardened/ + # -> https://github.com/anthraxx/linux-hardened + #boot.kernelPackages = pkgs.linuxPackages_hardened; + # Free/Libre. + # https://en.wikipedia.org/wiki/Linux-libre + #boot.kernelPackages = pkgs.linuxPackages-libre; +}