4.11 stable released. can finally stop building my own kernel
parent
089078acfe
commit
2bfbc8bb82
|
@ -1,39 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
# check if it's working:
|
||||
# nix-shell -p nvme-cli --command "sudo nvme get-feature -f 0x0c -H /dev/nvme0" | grep Enable
|
||||
let
|
||||
cfg = config.linux_nvme;
|
||||
inherit (lib) mkIf mkOption mkEnableOption;
|
||||
in
|
||||
{
|
||||
options.linux_nvme = {
|
||||
basekpkgs = mkOption { default = pkgs.linuxPackages_latest; };
|
||||
gofaster = mkEnableOption "enable parallel building on kernel";
|
||||
nvmepatch = mkEnableOption "enable nvme patch";
|
||||
};
|
||||
config.boot = rec {
|
||||
# gotta go faster
|
||||
kernelPackages = mkIf cfg.gofaster (cfg.basekpkgs // {
|
||||
kernel = cfg.basekpkgs.kernel.overrideDerivation (attr: {
|
||||
enableParallelBuilding = true;
|
||||
});
|
||||
});
|
||||
|
||||
kernelPatches = mkIf cfg.nvmepatch (let
|
||||
newerThan = v: builtins.compareVersions config.boot.kernelPackages.kernel.version v > -1;
|
||||
# https://github.com/damige/linux-nvme/
|
||||
linux-nvme = pkgs.fetchFromGitHub {
|
||||
owner = "damige";
|
||||
repo = "linux-nvme";
|
||||
rev = "4e9b1de7ad5386f6c8c208d81005a77d79460d26";
|
||||
sha256 = "151pnv1gjrcmlvw8bx0ndpvn254jjy394h8yr3sgh2gqbc5i1aqp";
|
||||
};
|
||||
mkpatches = dir: map (name: { patch = "${linux-nvme}/patches/${dir}/${name}.patch"; inherit name; });
|
||||
in
|
||||
if newerThan "4.11" then [] else
|
||||
if newerThan "4.10" then (mkpatches "4.10.x" ["APST"]) else
|
||||
if newerThan "4.9" then (mkpatches "4.9.x" ["APST" "pm_qos1" "pm_qos2" "pm_qos3" "nvme"]) else
|
||||
if newerThan "4.8" then (mkpatches "4.8.x" ["nvmepatch1-V4" "nvmepatch2-V4" "nvmepatch3-V4"]) else
|
||||
throw "unknown kernel version");
|
||||
};
|
||||
}
|
|
@ -5,31 +5,16 @@
|
|||
{
|
||||
imports =
|
||||
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
|
||||
../modules/linux-nvme.nix
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.blacklistedKernelModules = ["psmouse"];
|
||||
linux_nvme = {
|
||||
basekpkgs = pkgs.linuxPackages_testing;
|
||||
gofaster = true;
|
||||
nvmepatch = true;
|
||||
};
|
||||
|
||||
# boot.kernelPackages = pkgs.linuxPackagesFor ((pkgs.linux_testing.override {
|
||||
# argsOverride = {
|
||||
# version = "4.11.0-drm";
|
||||
# modDirVersion = "4.11.0-rc1";
|
||||
# src = pkgs.fetchgit {
|
||||
# url = "git://anongit.freedesktop.org/drm-intel";
|
||||
# rev = "1d1c80ec6d4d6ac72aa80920d5290776f3c81a86";
|
||||
# sha256 = "1879cgzag8072rp99prhm3nqaf90z63j74p7si931bvz4qj4z7s0";
|
||||
# };
|
||||
# };
|
||||
# }).overrideDerivation (attr: {enableParallelBuilding = true;}));
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_4_11;
|
||||
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
|
Loading…
Reference in New Issue