Files
nix-config/packages/linux-cachyos/lib/kconfig-to-nix.nix
2025-12-10 09:30:35 -06:00

12 lines
379 B
Nix

{ runCommand, configfile }:
# taken from <nixpkgs>/pkgs/os-specific/linux/kernel/manual-config.nix
runCommand "config.nix" { } ''
echo "{" > "$out"
while IFS='=' read key val; do
[ "x''${key#CONFIG_}" != "x$key" ] || continue
no_firstquote="''${val#\"}";
echo ' "'"$key"'" = "'"''${no_firstquote%\"}"'";' >> "$out"
done < "${configfile}"
echo "}" >> $out
''