···
···
-
(runCommand "config.nix" { } ''
-
while IFS='=' read key val; do
-
[ "x''${key#CONFIG_}" != "x$key" ] || continue
-
no_firstquote="''${val#\"}";
-
echo ' "'"$key"'" = "'"''${no_firstquote%\"}"'";' >> "$out"
···
# Manually specified nixexpr representing the config
# If unspecified, this will be autodetected from the .config
-
config ? lib.optionalAttrs allowImportFromDerivation (readConfig configfile),
# Custom seed used for CONFIG_GCC_PLUGIN_RANDSTRUCT if enabled. This is
# automatically extended with extra per-version and per-config values.
···
···
+
match = lib.match "(.*)=\"?(.*)\"?" line;
+
name = lib.elemAt match 0;
+
value = lib.elemAt match 1;
+
lib.filter (line: !(lib.hasPrefix "#" line || line == "")) (
+
lib.splitString "\n" (builtins.readFile configfile)
···
# Manually specified nixexpr representing the config
# If unspecified, this will be autodetected from the .config
+
config ? lib.optionalAttrs (builtins.isPath configfile || allowImportFromDerivation) (
# Custom seed used for CONFIG_GCC_PLUGIN_RANDSTRUCT if enabled. This is
# automatically extended with extra per-version and per-config values.