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

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
))