summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/linux-copperhead-stable.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/kernel/linux-copperhead-stable.nix')
-rw-r--r--pkgs/os-specific/linux/kernel/linux-copperhead-stable.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/kernel/linux-copperhead-stable.nix b/pkgs/os-specific/linux/kernel/linux-copperhead-stable.nix
new file mode 100644
index 000000000000..9d4b729060ae
--- /dev/null
+++ b/pkgs/os-specific/linux/kernel/linux-copperhead-stable.nix
@@ -0,0 +1,30 @@
+{ stdenv, buildPackages, hostPlatform, fetchFromGitHub, perl, buildLinux, ... } @ args:
+
+with stdenv.lib;
+
+let
+  version = "4.16.7";
+  revision = "a";
+  sha256 = "1kdy3sqrn161hm5avhk3nd75p07a21ja0rzar3ybibh1bl2mc6zq";
+
+  # modVersion needs to be x.y.z, will automatically add .0 if needed
+  modVersion = concatStrings (intersperse "." (take 3 (splitString "." "${version}.0")));
+
+  # branchVersion needs to be x.y
+  branchVersion = concatStrings (intersperse "." (take 2 (splitString "." version)));
+
+  modDirVersion = "${modVersion}-hardened";
+in
+buildLinux (args // {
+  inherit modDirVersion;
+
+  version = "${version}-${revision}";
+  extraMeta.branch = "${branchVersion}";
+
+  src = fetchFromGitHub {
+    inherit sha256;
+    owner = "copperhead";
+    repo = "linux-hardened";
+    rev = "${version}.${revision}";
+  };
+} // (args.argsOverride or {}))