-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
@@ -0,0 +1,12 @@ | |||
let pkgs = import <nixpkgs> {}; |
There was a problem hiding this comment.
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).
stdenv.mkDerivation { | ||
name = "slippc"; | ||
src = ./.; | ||
buildDepends = [ xz ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default.nix
Outdated
|
||
installPhase = '' | ||
mkdir -p $out | ||
cp ./slippc $out/ |
There was a problem hiding this comment.
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.
@@ -14,3 +14,4 @@ __* | |||
.todo | |||
test-replays/zlptest.zlp | |||
test-replays/zlptest.slp | |||
result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nix-build
output
|
||
installPhase = '' | ||
mkdir -p $out/bin | ||
cp ./slippc $out/bin/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using bin/
here makes it work with nix-env -f default.nix
and I think is what Nix expects the installPhase
to do for executables?
Neat! 😮 Don't have access to a Nix machine myself at the moment, but this certainly isn't gonna break anything, so I'm just gonna trust this works. Thanks a ton! ❤️ 😄 |
The bare minimum to package it with Nix.