feat: min C writer
This commit is contained in:
11
flake.nix
11
flake.nix
@@ -309,9 +309,20 @@
|
|||||||
${prev.gcc}/bin/gcc -xc -o $out $contentPath
|
${prev.gcc}/bin/gcc -xc -o $out $contentPath
|
||||||
'';
|
'';
|
||||||
} name argsOrScript;
|
} name argsOrScript;
|
||||||
|
writeMinC =
|
||||||
|
name: includes: body:
|
||||||
|
writeC name ''
|
||||||
|
${builtins.concatStringsSep "\n" (map (h: "#include " + h) includes)}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
${body}
|
||||||
|
}
|
||||||
|
'';
|
||||||
in prev.writers // {
|
in prev.writers // {
|
||||||
writeCBin = name: writeC "/bin/${name}";
|
writeCBin = name: writeC "/bin/${name}";
|
||||||
writeC = writeC;
|
writeC = writeC;
|
||||||
|
writeMinCBin = name: includes: body: writeMinC "/bin/${name}" includes body;
|
||||||
|
writeMinC = writeMinC;
|
||||||
};
|
};
|
||||||
postgresql_15 = prev.postgresql_15 // {pkgs = prev.postgresql_15.pkgs // {
|
postgresql_15 = prev.postgresql_15 // {pkgs = prev.postgresql_15.pkgs // {
|
||||||
http = buildHttpExt "15";
|
http = buildHttpExt "15";
|
||||||
|
|||||||
Reference in New Issue
Block a user