CS3502/assignment1/default.nix

22 lines
486 B
Nix

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