Fixup mkCfg

Previously, dollar signs in the tf2 config str would be interpreted as bash variables during build
This commit is contained in:
Shelvacu
2025-06-29 18:19:52 -07:00
committed by Shelvacu on fw
parent 36fb39c38b
commit affcea3dd9

View File

@@ -14,15 +14,14 @@ let
inherit hash name; inherit hash name;
}; };
mkCfg = name: body: mkCfg = path: body:
pkgs.runCommand name {} '' pkgs.runCommand path {} ''
${lib.toShellVar "name" name} ${lib.toShellVar "pathPart" path}
mkdir -p $out/cfg "$(dirname "$out/cfg/$name")" path="$out/cfg/$pathPart.cfg"
tee "$out/cfg/$name.cfg" << SUPER_UNIQUE_EOF mkdir -p "$(dirname -- "$path")"
// Generated by tf2.nix echo "// Generated by tf2.nix" >> "$path"
echo >> "$path"
${body} echo ${lib.escapeShellArg body} >> "$path"
SUPER_UNIQUE_EOF
''; '';
mergeTf2Configs = configs: mergeTf2Configs = configs: