add: assigment 2
This commit is contained in:
parent
3a0b8a5c3f
commit
32a6e07e56
11 changed files with 437 additions and 0 deletions
26
assignment2/default.nix
Normal file
26
assignment2/default.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
let
|
||||
basic-c = subdir: name: { stdenv }:
|
||||
stdenv.mkDerivation {
|
||||
inherit name;
|
||||
src = ./.;
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
gcc ${subdir}/${name}.c -o ${name}
|
||||
runHook postBuild
|
||||
'';
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
install ${name} $out/bin/
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
in {
|
||||
a2-p1-producer = basic-c "part1" "producer";
|
||||
a2-p1-consumer = basic-c "part1" "consumer";
|
||||
|
||||
a2-p2-bidirectional = basic-c "part2" "bidirectional";
|
||||
|
||||
a2-p3-producer = basic-c "part3" "producer";
|
||||
a2-p3-consumer = basic-c "part3" "consumer";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue