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

Conversation

ramirez7
Copy link
Contributor

The bare minimum to package it with Nix.

@@ -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).

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.

default.nix Outdated

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.

@@ -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


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

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?

@pcrain pcrain merged commit cd4b2ad into pcrain:master Jun 30, 2024
1 check passed
@pcrain
Copy link
Owner

pcrain commented Jun 30, 2024

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! ❤️ 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants