CS3502/assignment1/default.nix

22 lines
497 B
Nix

let
basicC = name: { stdenv }:
stdenv.mkDerivation {
inherit name;
src = ./.;
buildPhase = ''
runHook preBuild
gcc part2/${name}.c -o ${name}.bin
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install ${name}.bin $out/bin/${name}
runHook postInstall
'';
};
in {
a1-hello = basicC "hello";
a1-employee = basicC "employee";
a1-logwriter = basicC "logwriter";
}