forked from DGNum/liminix
extract writeKconfig to its own file
This commit is contained in:
parent
15be80e9de
commit
591bd78509
2 changed files with 15 additions and 9 deletions
|
@ -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;
|
||||||
|
|
11
pkgs/kernel/write-kconfig.nix
Normal file
11
pkgs/kernel/write-kconfig.nix
Normal 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
|
||||||
|
))
|
Loading…
Reference in a new issue