feat: C templates

This commit is contained in:
Kiana Sheibani 2026-01-19 14:10:56 -05:00
parent e5faf58ba8
commit f5427d28a9
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
15 changed files with 236 additions and 0 deletions

View file

@ -0,0 +1,23 @@
{
stdenv
}:
let
source = "src/hello.c";
exec = "hello";
in stdenv.mkDerivation {
pname = "hello";
version = "0.1";
src = ./.;
buildPhase = ''
runHook preBuild
gcc ${source} -o ${exec}.bin
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install ${exec}.bin $out/bin/${exec}
runHook postInstall
'';
}