Skip to content

refactor: reduce imperative shell logic in flake.nix #320

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

Merged
merged 2 commits into from
Nov 2, 2023
Merged

refactor: reduce imperative shell logic in flake.nix #320

merged 2 commits into from
Nov 2, 2023

Conversation

shanesveller
Copy link
Contributor

Regarding HOME specifically, I would've liked to eliminate that too as it's nearly always a pungent smell in Nix builds, but Burrito.Steps.Build.PackAndBuild seems to
want a writable path to work in. AFAICT it's purely for scratch space, so we can just directly reuse the Nix build's temporary directory.

Copy link
Collaborator

@mhanberg mhanberg left a comment

Choose a reason for hiding this comment

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

Looks nice, I'll take a closer look when I get back to a computer.

name = "7zz-aliased";
paths = [pkgs._7zz];
postBuild = ''
ln -s ${pkgs._7zz}/bin/7zz $out/bin/7z
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh heck yeah. I figured there had to be a nix way to do this

bin/7z Outdated
@@ -1,3 +0,0 @@
#!/usr/bin/env bash
Copy link
Collaborator

Choose a reason for hiding this comment

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

I still use in the release pipeline, so please revert

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem at all! Reinstated and re-pushed at ff4c817.

@mhanberg
Copy link
Collaborator

mhanberg commented Nov 2, 2023

Works on my x86 Linux and M1 Mac computers, will merge once you revert the bin/7z deletion

...as their contents are deterministic directly from Nix.

Regarding HOME specifically, Burrito.Steps.Build.PackAndBuild seems to
want a writable path to work in, but AFAICT it's for scratch space, so we can reuse the Nix build's temporary directory.

Ref: https://github.com/burrito-elixir/burrito/blob/a60c6ab21156fc4c788907d33bfd0c546a022272/lib/steps/build/pack_and_build.ex#L26
@mhanberg mhanberg enabled auto-merge (squash) November 2, 2023 02:51
@mhanberg mhanberg changed the title refactor: Reduce imperative shell logic in flake.nix refactor: reduce imperative shell logic in flake.nix Nov 2, 2023
@mhanberg mhanberg disabled auto-merge November 2, 2023 02:52
@mhanberg mhanberg merged commit dc0755e into elixir-tools:main Nov 2, 2023
mhanberg pushed a commit that referenced this pull request Nov 2, 2023
* refactor(nix): Use symlinkJoin to provide aliased 7z binary

* refactor(nix): Assign Burrito envvars as derivation arguments

...as their contents are deterministic directly from Nix.

Regarding HOME specifically, Burrito.Steps.Build.PackAndBuild seems to
want a writable path to work in, but AFAICT it's for scratch space, so we can reuse the Nix build's temporary directory.

Ref: https://github.com/burrito-elixir/burrito/blob/a60c6ab21156fc4c788907d33bfd0c546a022272/lib/steps/build/pack_and_build.ex#L26
@shanesveller shanesveller deleted the shanesveller/nix-package-refactors branch November 2, 2023 04:02
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