feat(assign1): add employee.c
This commit is contained in:
parent
0122c877ac
commit
eb87fd068d
2 changed files with 48 additions and 5 deletions
|
|
@ -1,12 +1,21 @@
|
|||
{
|
||||
assign1-hello = { stdenv }:
|
||||
let
|
||||
basic-c = name: { stdenv }:
|
||||
stdenv.mkDerivation {
|
||||
name = "hello";
|
||||
inherit name;
|
||||
src = ./.;
|
||||
buildPhase = "gcc c-programs/hello.c -o hello";
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
gcc c-programs/${name}.c -o ${name}
|
||||
runHook postBuild
|
||||
'';
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
install hello $out/bin/hello
|
||||
install ${name} $out/bin/
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
in {
|
||||
assign1-hello = basic-c "hello";
|
||||
assign1-employee = basic-c "employee";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue