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

bin/nixos-shell: use nix run to run; flake.nix: use packages.<system>.default #76

Merged
merged 2 commits into from
Mar 17, 2024

Conversation

ShamrockLee
Copy link
Contributor

@ShamrockLee ShamrockLee commented Mar 12, 2024

This PR is a collection of small refactoring.

  • bin/nixos-shell:
    • Use nix run to run the code instead of current mktemp hack.
    • Note that Nix 3.0 commands like nix run evaluates purely by default, contrary to Nix classic commands like nix-build.
  • flake.nix:
    • Use packages.<system>.default instead of defaultPackages.<system>.
    • Recurse with inp.self instead of rec.

Use `nix run` instead of puttling the `result` in a temporary directory
and run the executable with a glob pattern.
@Mic92
Copy link
Owner

Mic92 commented Mar 17, 2024

We probably still need impure evaluation because getFlake needs it as well as those environment variables that it still uses (also those can be probably refactored out).

@Mic92 Mic92 merged commit 44ce07e into Mic92:master Mar 17, 2024
1 check passed
@Mic92
Copy link
Owner

Mic92 commented Mar 17, 2024

Thanks!

@ShamrockLee
Copy link
Contributor Author

ShamrockLee commented Mar 17, 2024

I didn't add --impure because the help message indicates that users can choose if they would like to add --impure or not.

BTW, why is -k added even if the help message lists --keep-going as an optional flag?

@ShamrockLee ShamrockLee deleted the bin-nix-run branch March 18, 2024 21:43
@Mic92
Copy link
Owner

Mic92 commented Mar 24, 2024

The --file flag already adds it --impure implicitly actually. Don't remember why I added --keep-going. Sometimes I like doing this for ci-related builds as it will try to build as much as possible so that on the next run it starts only with the failing derivations and it's dependencies. As such it won't abort working builds, which cuts down a bit of noise and avoids re-doing long-running builds.

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.

None yet

2 participants