Skip to content

Instantly share code, notes, and snippets.

@mwilsoncoding
Last active December 15, 2019 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwilsoncoding/7e4d27f3a440c1a6f30491aeb7d83f25 to your computer and use it in GitHub Desktop.
Save mwilsoncoding/7e4d27f3a440c1a6f30491aeb7d83f25 to your computer and use it in GitHub Desktop.
{ config, pkgs, ... }:
let
linux_5_3_16_derivation = { stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
with stdenv.lib;
buildLinux (args // rec {
version = "5.3.16";
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = if (modDirVersionArg == null) then concatStrings (intersperse "." (take 3 (splitString "." "${version}.0"))) else modDirVersionArg;
# branchVersion needs to be x.y
extraMeta.branch = concatStrings (intersperse "." (take 2 (splitString "." version)));
src = fetchurl {
url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
sha256 = "19asdv08rzp33f0zxa2swsfnbhy4zwg06agj7sdnfy4wfkrfwx49";
};
} // (args.argsOverride or {}));
linux_5_3_16 = (pkgs.callPackage linux_5_3_16_derivation { kernelPatches = [ pkgs.kernelPatches.bridge_stp_helper ]; });
linuxPackages_5_3 = pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor linux_5_3_16);
in
{
boot.kernelPackages = linuxPackages_5_3;
# This is required for system76-driver, I believe. Can I just add this to the nix script?
boot.kernelParams = [ "ec_sys.write_support=1" ];
boot.extraModulePackages = [ config.boot.kernelPackages.system76-dkms ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment