Hello,
I am trying to compile linux-next-20230908, the exact version is not that important. But it contains a fix for r8169 that should solve the issue where the network card sometimes completely stops working.
In my configuration.nix I have it set up like on the wiki:
boot.kernelPackages = let
nixpkgsMaster = import "/home/michel/sources/nixpkgs/default.nix" {
config = config.nixpkgs.config;
};
in let
linux_next_pkg = { fetchurl, buildLinux, ... }@args:
buildLinux (args // rec {
version = "6.5.0-next-20230908";
modDirVersion = version;
src = fetchurl {
url =
"https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/snapshot/linux-next-next-20230908.tar.gz";
hash = "sha256-ht7qxewNo0Oxg6cT191yEG5EKxQROAz4nC2MyCvEcG4=";
};
kernelPatches = [ ];
extraMeta.branch = "linux-next";
} // (args.argsOverride or { }));
linux_next = nixpkgsMaster.pkgs.callPackage linux_next_pkg { };
in pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor linux_next);
My local copy of nixpkgs is at commit 1216b3 with the following change, as they removed some options in Linux:
diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix
index c8ae911c1287..f861f2c6a379 100644
--- a/pkgs/os-specific/linux/kernel/common-config.nix
+++ b/pkgs/os-specific/linux/kernel/common-config.nix
@@ -603,8 +603,8 @@ let
microcode = {
MICROCODE = yes;
- MICROCODE_INTEL = yes;
- MICROCODE_AMD = yes;
+ MICROCODE_INTEL = whenOlder "6.5.0-next-20230831" yes;
+ MICROCODE_AMD = whenOlder "6.5.0-next-20230831" yes;
# Write Back Throttling
# https://lwn.net/Articles/682582/
# https://bugzilla.kernel.org/show_bug.cgi?id=12309#c655
@@ -913,7 +913,7 @@ let
SECCOMP = yes; # used by systemd >= 231
SECCOMP_FILTER = yes; # ditto
POSIX_MQUEUE = yes;
- FRONTSWAP = yes;
+ FRONTSWAP = whenOlder "6.5.0-next-20230831" yes;
FUSION = yes; # Fusion MPT device support
IDE = whenOlder "5.14" no; # deprecated IDE support, removed in 5.14
IDLE_PAGE_TRACKING = yes;
When building the configuration, it fails like this:
...
XZ /nix/store/fwsjd82yjzyx629idivzjvmyrd61vjpi-linux-6.5.0-next-20230908/lib/modules/6.5.0-next-20230908/kernel/net/qrtr/qrtr-mhi.ko.xz
XZ /nix/store/fwsjd82yjzyx629idivzjvmyrd61vjpi-linux-6.5.0-next-20230908/lib/modules/6.5.0-next-20230908/kernel/virt/lib/irqbypass.ko.xz
DEPMOD /nix/store/fwsjd82yjzyx629idivzjvmyrd61vjpi-linux-6.5.0-next-20230908/lib/modules/6.5.0-next-20230908
Warning: 'make modules_install' requires depmod. Please install it.
This is probably in the kmod package.
unlink: cannot unlink '/nix/store/fwsjd82yjzyx629idivzjvmyrd61vjpi-linux-6.5.0-next-20230908/lib/modules/6.5.0-next-20230908/source': No such file or directory
/nix/store/1qxkj91n172qnypdrqdybh4p203nax7g-stdenv-linux/setup: line 144: pop_var_context: head of shell_variables not a function context
error: builder for '/nix/store/ymwk8xwmya74a690nl6r1dzl14cv5742-linux-6.5.0-next-20230908.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/ry6bb21mqxvvf2n8n099p12n19yq345q-nixos-system-windtunnel-23.05.3085.2ab91c8d65c0.drv'
I have tried commenting out this line, but that does not make a difference. It is probably also there for a good reason.
I don’t really know where to go from here, am I missing something obvious?
I am running NixOS 23.05.