Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple Nix derivation for slippc #30

Merged
merged 2 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ __*
.todo
test-replays/zlptest.zlp
test-replays/zlptest.slp
result
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nix-build output

12 changes: 12 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
let pkgs = import <nixpkgs> {};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By including this, nix-build will build the slippc binary and output it under a result/ symlink directory.

If someone wants to add this to their package set, they can callPackage (import slippcSrc) {};)

(Laziness + default arguments are fun).

in { stdenv ? pkgs.stdenv, xz ? pkgs.xz }:
stdenv.mkDerivation {
name = "slippc";
src = ./.;
buildDepends = [ xz ];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


installPhase = ''
mkdir -p $out
cp ./slippc $out/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no make install target so we have to do this part ourselves.

'';
}