diff --git a/flake.lock b/flake.lock index cc975d7..d1236c9 100644 --- a/flake.lock +++ b/flake.lock @@ -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": { diff --git a/flake.nix b/flake.nix index 5b1fb8e..e88605a 100644 --- a/flake.nix +++ b/flake.nix @@ -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; }; }; } diff --git a/hosts/default.nix b/hosts/default.nix index 5cea98d..739a4b8 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,4 +1,4 @@ -{ inputs }: +{ inputs, ... }: let nixpkgs = inputs.nixpkgs; diff --git a/hosts/nix-surface.nix b/hosts/nix-surface.nix index ecf4227..d922313 100644 --- a/hosts/nix-surface.nix +++ b/hosts/nix-surface.nix @@ -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,7 +23,9 @@ "rd.systemd.show_status=auto" ]; - disko.devices.disk.main.content.partitions.swap.size = "16G"; + boot.kernelPackages = lib.mkForce refKernelPackages; + + disko.devices.disk.main.content.partitions.swap.size = "8G"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;