add get-nixos-kconfig nix script 77/head
authoro8opi <o8opi@proton.me>
Thu, 29 Dec 2022 09:02:02 +0000 (10:02 +0100)
committero8opi <o8opi@proton.me>
Thu, 29 Dec 2022 09:02:02 +0000 (10:02 +0100)
kconfig_hardened_check/config_files/distros/get-nixos-kconfig.nix [new file with mode: 0644]

diff --git a/kconfig_hardened_check/config_files/distros/get-nixos-kconfig.nix b/kconfig_hardened_check/config_files/distros/get-nixos-kconfig.nix
new file mode 100644 (file)
index 0000000..cd91eea
--- /dev/null
@@ -0,0 +1,32 @@
+{ pkgs ? import <nixpkgs> {}
+}:
+with pkgs;
+stdenv.mkDerivation {
+  name = "kconf";
+  nativeBuildInputs = [
+    linuxPackages_hardened.kernel
+    linuxPackages_latest.kernel
+    linuxPackages.kernel
+  ];
+
+  dontUnpack = true;
+  dontInstall = true;
+
+  buildPhase = ''
+    mkdir  $out
+
+    mkdir $out/linuxPackages_hardened/
+    cp ${pkgs.linuxPackages_hardened.kernel.configfile} $out/linuxPackages_hardened/kernel.conf
+    echo ${pkgs.linuxPackages_hardened.kernel.version} > $out/linuxPackages_hardened/kernel.version
+
+    mkdir $out/linuxPackages_latest/
+    cp ${pkgs.linuxPackages_latest.kernel.configfile} $out/linuxPackages_latest/kernel.conf
+    echo ${pkgs.linuxPackages_latest.kernel.version} > $out/linuxPackages_latest/kernel.version
+
+    mkdir $out/linuxPackages_lts/
+    cp ${pkgs.linuxPackages.kernel.configfile} $out/linuxPackages_lts/kernel.conf
+    echo ${pkgs.linuxPackages.kernel.version} > $out/linuxPackages_lts/kernel.version
+    '';
+
+  
+}