extract writeKconfig to its own file

This commit is contained in:
Daniel Barlow 2023-06-26 20:49:43 +01:00
parent 15be80e9de
commit 591bd78509
2 changed files with 15 additions and 9 deletions

View file

@ -8,15 +8,10 @@
, src , src
, extraPatchPhase ? "echo" , extraPatchPhase ? "echo"
} : } :
let writeConfig = name : config: writeText name let
(builtins.concatStringsSep writeConfig = import ./write-kconfig.nix { inherit lib writeText; };
"\n" kconfigFile = writeConfig "kconfig" config;
(lib.mapAttrsToList inherit lib; in
(name: value: (if value == "n" then "# CONFIG_${name} is not set" else "CONFIG_${name}=${value}"))
config
));
kconfigFile = writeConfig "kconfig" config;
inherit lib; in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "kernel"; name = "kernel";
inherit src extraPatchPhase; inherit src extraPatchPhase;

View file

@ -0,0 +1,11 @@
{
lib
, writeText
}:
name : config: writeText name
(builtins.concatStringsSep
"\n"
(lib.mapAttrsToList
(name: value: (if value == "n" then "# CONFIG_${name} is not set" else "CONFIG_${name}=${value}"))
config
))