move the nvme patch to its own file
parent
74c6c7acae
commit
a4bd9ee92f
|
@ -48,4 +48,6 @@ in
|
|||
export SSH_AUTH_SOCK="''${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh"
|
||||
${pkgs.xorg.xrandr}/bin/xrandr --dpi 192
|
||||
'';
|
||||
nix.gc.automatic = pkgs.lib.mkOverride 30 false;
|
||||
|
||||
}
|
||||
|
|
|
@ -2,15 +2,10 @@
|
|||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
kpkgs = pkgs.linuxPackages_testing;
|
||||
#kpkgs = pkgs.linuxPackages_custom (pkgs.linuxPackages_latest.kernel.overrideDerivation (oldAttr: {
|
||||
# enableParallelBuild = true;
|
||||
#}));
|
||||
in
|
||||
{
|
||||
imports =
|
||||
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
|
||||
./linux-nvme.nix
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
|
||||
|
@ -26,27 +21,7 @@ in
|
|||
|
||||
networking.wireless.enable = true;
|
||||
hardware.bluetooth.enable = true;
|
||||
boot.kernelPackages = kpkgs;
|
||||
boot.kernelParams = ["i915.enable_fbc=1"]; # "i915.enable_psr=1"]; # lvds downclock is no longer a thing
|
||||
boot.kernelPatches = let
|
||||
kver = "4.8.8"; #kpkgs.kernel.version;
|
||||
linux-nvme = pkgs.fetchFromGitHub {
|
||||
owner = "damige";
|
||||
repo = "linux-nvme";
|
||||
rev = "e58f5a1e9357fb0647fc173a17ceebe6280ba43c";
|
||||
sha256 = "0n42s6a6wzckm5k6mfpx0mp66ql52wv3irs9s0c000nx039hg57m";
|
||||
};
|
||||
in [
|
||||
# half of thesea are in 4.9 already
|
||||
# { patch = "${linux-nvme}/src/${kver}/nvmepatch1-V4.patch"; name = "nvme-1";}
|
||||
# { patch = "${linux-nvme}/src/${kver}/nvmepatch2-V4.patch"; name = "nvme-2";}
|
||||
{ patch = "${linux-nvme}/src/${kver}/nvmepatch3-V4.patch"; name = "nvme-3";}
|
||||
];
|
||||
# nixpkgs.config.packageOverrides = pkgs:
|
||||
# { linux_testing = pkgs.linux_testing.overrideDerivation (attrs: {
|
||||
# enableParallelBuilding = true;
|
||||
# });
|
||||
# };
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/a751e4ea-f1aa-48e1-9cbe-423878e29b62";
|
||||
|
@ -85,10 +60,5 @@ in
|
|||
|
||||
services.xserver.videoDrivers = ["modesetting"];
|
||||
hardware.opengl.extraPackages = [ pkgs.vaapiIntel ];
|
||||
nixpkgs.config = {
|
||||
packageOverrides = pkgs : {
|
||||
mpv = pkgs.mpv.override { vaapiSupport = true; };
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
{ 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
|
||||
{ boot = rec {
|
||||
# gotta go faster
|
||||
kernelPackages = pkgs.linuxPackages_latest // {
|
||||
kernel = pkgs.linuxPackages_latest.kernel.overrideDerivation (attr: {
|
||||
enableParallelBuilding = true;
|
||||
});
|
||||
};
|
||||
|
||||
kernelPatches = let
|
||||
kver = kernelPackages.kernel.version;
|
||||
kernel_newer_4_9 = builtins.compareVersions kver "4.9" > -1;
|
||||
# https://github.com/damige/linux-nvme/
|
||||
linux-nvme = pkgs.fetchFromGitHub {
|
||||
owner = "damige";
|
||||
repo = "linux-nvme";
|
||||
rev = "d6f6df100db9b8f1ee6fc04f8d2f8ddbcbec87f8";
|
||||
sha256 = "0iqxzk3q7vzg7gmqrlvq1lf9wf3qfq5dm79hjsb48s6q12l3ml06";
|
||||
};
|
||||
in map (name: { patch = "${linux-nvme}/src/${kver}/${name}.patch"; inherit name; })
|
||||
(if kernel_newer_4_9
|
||||
then ["APST" "pm_qos1" "pm_qos2" "pm_qos3" "nvme"]
|
||||
else ["nvmepatch1-V4" "nvmepatch2-V4" "nvmepatch3-V4"]);
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue