feat: project 1

This commit is contained in:
Kiana Sheibani 2025-10-09 22:02:18 -04:00
parent d6ef47cff4
commit f04d70f615
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
16 changed files with 702 additions and 0 deletions

23
project1/default.nix Normal file
View file

@ -0,0 +1,23 @@
let
basicC = subdir: name: { stdenv }:
stdenv.mkDerivation {
inherit name;
src = ./.;
buildPhase = ''
runHook preBuild
gcc ${subdir}/${name}.c -o ${name}.bin
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install ${name}.bin $out/bin/${name}
runHook postInstall
'';
};
in {
p1-phase1 = basicC "phase1" "phase1";
p1-phase2 = basicC "phase2" "phase2";
p1-phase3 = basicC "phase3" "phase3";
p1-phase4 = basicC "phase4" "phase4";
}