CS3502/assign1/default.nix

21 lines
463 B
Nix

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