feat: assignment 3

This commit is contained in:
Kiana Sheibani 2025-11-01 22:14:35 -04:00
parent 06fbd2d6ad
commit 3cc3f6332d
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
7 changed files with 281 additions and 0 deletions

21
assignment3/default.nix Normal file
View file

@ -0,0 +1,21 @@
let
basicC = subdir: name: { stdenv }:
stdenv.mkDerivation {
inherit name;
src = ./.;
buildPhase = ''
runHook preBuild
gcc ${subdir}/${name}.c -o ${name}.bin -pthread -lrt
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install ${name}.bin $out/bin/${name}
runHook postInstall
'';
};
in {
a3-producer = basicC "src" "producer";
a3-consumer = basicC "src" "consumer";
}