feat: assignment 3
This commit is contained in:
parent
06fbd2d6ad
commit
3cc3f6332d
7 changed files with 281 additions and 0 deletions
21
assignment3/default.nix
Normal file
21
assignment3/default.nix
Normal 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";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue