21 lines
504 B
Nix
21 lines
504 B
Nix
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";
|
|
}
|