1
0
Fork 0

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
, extraPatchPhase ? "echo"
} :
let writeConfig = 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
));
kconfigFile = writeConfig "kconfig" config;
inherit lib; in
let
writeConfig = import ./write-kconfig.nix { inherit lib writeText; };
kconfigFile = writeConfig "kconfig" config;
inherit lib; in
stdenv.mkDerivation rec {
name = "kernel";
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
))