pin old kernel for tablets

This commit is contained in:
2025-12-04 19:59:50 -05:00
parent a2332a5048
commit 4abc548c83
5 changed files with 47 additions and 20 deletions

36
flake.lock generated
View File

@@ -266,6 +266,22 @@
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1764440730,
"narHash": "sha256-ZlJTNLUKQRANlLDomuRWLBCH5792x+6XUJ4YdFRjtO4=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "9154f4569b6cdfd3c595851a6ba51bfaa472d9f3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1732981179,
@@ -282,6 +298,22 @@
"type": "github"
}
},
"nixpkgs-old-kernel": {
"locked": {
"lastModified": 1764560356,
"narHash": "sha256-M5aFEFPppI4UhdOxwdmceJ9bDJC4T6C6CzCK1E2FZyo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6c8f0cca84510cc79e09ea99a299c9bc17d03cb6",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1764522689,
@@ -359,7 +391,9 @@
"disko": "disko",
"home-manager": "home-manager",
"lazyvim-nixvim": "lazyvim-nixvim",
"nixpkgs": "nixpkgs_2"
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2",
"nixpkgs-old-kernel": "nixpkgs-old-kernel"
}
},
"systems": {

View File

@@ -1,6 +1,7 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
nixpkgs-old-kernel.url = "github:NixOS/nixpkgs/nixos-25.05";
home-manager = {
url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
@@ -12,7 +13,7 @@
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
lazyvim-nixvim.url = "github:azuwis/lazyvim-nixvim";
};
outputs = inputs@{ self, nixpkgs, home-manager, disko, lazyvim-nixvim, nixos-hardware,... }: {
outputs = inputs@{ self, nixpkgs, nixpkgs-old-kernel, home-manager, disko, lazyvim-nixvim, nixos-hardware,... }: {
nixosConfigurations = import ./hosts { inherit inputs; };
};
}

View File

@@ -1,4 +1,4 @@
{ inputs }:
{ inputs, ... }:
let
nixpkgs = inputs.nixpkgs;

View File

@@ -1,12 +0,0 @@
diff --recursive -u linux-6.15.9.orig/scripts/generate_rust_target.rs linux-6.15.9/scripts/generate_rust_target.rs
--- linux-6.15.9.orig/scripts/generate_rust_target.rs 2025-08-01 10:51:29.000000000 +0200
+++ linux-6.15.9/scripts/generate_rust_target.rs 2025-11-29 12:30:54.792372738 +0100
@@ -225,7 +225,7 @@
ts.push("features", features);
ts.push("llvm-target", "x86_64-linux-gnu");
ts.push("supported-sanitizers", ["kcfi", "kernel-address"]);
- ts.push("target-pointer-width", "64");
+ ts.push("target-pointer-width", 64);
} else if cfg.has("X86_32") {
// This only works on UML, as i386 otherwise needs regparm support in rustc
if !cfg.has("UML") {

View File

@@ -1,4 +1,11 @@
{ config, lib, modulesPath, ... }:
{ config, lib, pkgs, inputs, modulesPath, ... }:
let
refSystem = inputs.nixpkgs-old-kernel.lib.nixosSystem {
system = pkgs.system;
modules = [ inputs.nixos-hardware.nixosModules.microsoft-surface-go ];
};
refKernelPackages = refSystem.config.boot.kernelPackages;
in
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
@@ -16,10 +23,7 @@
"rd.systemd.show_status=auto"
];
boot.kernelPatches = [{
name = "rust-1.91-fix";
patch = ./hacks/rust-fix.patch;
}];
boot.kernelPackages = lib.mkForce refKernelPackages;
disko.devices.disk.main.content.partitions.swap.size = "8G";
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";