Skip to content

Instantly share code, notes, and snippets.

@mwilsoncoding
Last active December 15, 2019 15:42
Show Gist options
  • Save mwilsoncoding/7e4d27f3a440c1a6f30491aeb7d83f25 to your computer and use it in GitHub Desktop.
Save mwilsoncoding/7e4d27f3a440c1a6f30491aeb7d83f25 to your computer and use it in GitHub Desktop.

Revisions

  1. mwilsoncoding revised this gist Dec 15, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions 5_3
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    { config, pkgs, ... }:
    let
    linux_5_3_16_package = { stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
    linux_5_3_16_derivation = { stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
    with stdenv.lib;
    buildLinux (args // rec {
    version = "5.3.16";
    @@ -17,7 +17,7 @@ let
    };
    } // (args.argsOverride or {}));

    linux_5_3_16 = (pkgs.callPackage linux_5_3_16_package { kernelPatches = [ pkgs.kernelPatches.bridge_stp_helper ]; });
    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
  2. mwilsoncoding revised this gist Dec 15, 2019. 1 changed file with 21 additions and 14 deletions.
    35 changes: 21 additions & 14 deletions 5_3
    Original file line number Diff line number Diff line change
    @@ -1,24 +1,31 @@
    { config, pkgs, ... }:

    let
    linux_5_3 = (pkgs.callPackage ./linux-5.3.nix { kernelPatches = [ pkgs.kernelPatches.bridge_stp_helper ]; });
    linuxPackages_5_3 = pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor linux_5_3);
    in
    linux_5_3_16_package = { 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_package { 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" ];

    # Imports the overlay
    nixpkgs.overlays = [
    (self: super: {
    linuxPackages_5_3 = linuxPackages_5_3.extend(lpself: lpsuper: {
    system76-dkms = (lpself.callPackage ./system76-dkms {}).latest;
    });
    })
    ];

    boot.extraModulePackages = [ (linuxPackages_5_3).system76-dkms ];
    boot.extraModulePackages = [ config.boot.kernelPackages.system76-dkms ];
    }
  3. mwilsoncoding revised this gist Dec 11, 2019. 1 changed file with 5 additions and 6 deletions.
    11 changes: 5 additions & 6 deletions 5_3
    Original file line number Diff line number Diff line change
    @@ -1,25 +1,24 @@
    # modified default.nix copied from stites' repository

    { config, pkgs, ... }:

    let
    lp = (pkgs.callPackage ./linux-5.3.nix {});
    linux_5_3 = (pkgs.callPackage ./linux-5.3.nix { kernelPatches = [ pkgs.kernelPatches.bridge_stp_helper ]; });
    linuxPackages_5_3 = pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor linux_5_3);
    in

    {
    boot.kernelPackages = lp;
    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" ];

    # Imports the overlay
    nixpkgs.overlays = [
    (self: super: {
    linuxPackages_5_3 = lp.extend(lpself: lpsuper: {
    linuxPackages_5_3 = linuxPackages_5_3.extend(lpself: lpsuper: {
    system76-dkms = (lpself.callPackage ./system76-dkms {}).latest;
    });
    })
    ];

    boot.extraModulePackages = [ (lp).system76-dkms ];
    boot.extraModulePackages = [ (linuxPackages_5_3).system76-dkms ];
    }
  4. mwilsoncoding revised this gist Dec 11, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions 5_3
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # modified default.nix copied from stites' repository

    { config, pkgs, ... }:

    let
  5. mwilsoncoding created this gist Dec 11, 2019.
    23 changes: 23 additions & 0 deletions 5_3
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    { config, pkgs, ... }:

    let
    lp = (pkgs.callPackage ./linux-5.3.nix {});
    in

    {
    boot.kernelPackages = lp;

    # This is required for system76-driver, I believe. Can I just add this to the nix script?
    boot.kernelParams = [ "ec_sys.write_support=1" ];

    # Imports the overlay
    nixpkgs.overlays = [
    (self: super: {
    linuxPackages_5_3 = lp.extend(lpself: lpsuper: {
    system76-dkms = (lpself.callPackage ./system76-dkms {}).latest;
    });
    })
    ];

    boot.extraModulePackages = [ (lp).system76-dkms ];
    }