Skip to content

flake: Add nix flake and envrc for developers #2891

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 1 commit into from
Nov 6, 2021

Conversation

kinnison
Copy link
Contributor

@kinnison kinnison commented Nov 6, 2021

This adds a flake.nix and direnv's envrc for developing rustup
on a NixOS host. This is explicitly NOT for constructing rustup
for NixOS users.

Signed-off-by: Daniel Silverstone [email protected]

This adds a flake.nix and direnv's envrc for developing rustup
on a NixOS host.  This is explicitly *NOT* for constructing rustup
for NixOS users.

Signed-off-by: Daniel Silverstone <[email protected]>
@kinnison kinnison merged commit 0afddda into rust-lang:master Nov 6, 2021
@kinnison kinnison deleted the nix-support branch November 6, 2021 16:07
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 17, 2024
Provide a more convinient way of developing rustc on NixOS

This PR adds envrc files which, once symlinked as  `.envrc` will activates a dev shell from `src/tools/nix-dev-shell/flake.nix` or `src/tools/nix-dev-shell/shell.nix`.

This is based on
- [Current rustc dev guide recommendation for NixOS](https://rustc-dev-guide.rust-lang.org/building/suggested.html?highlight=nix#using-nix-shell)
- https://github.com/oxalica/rust-overlay?tab=readme-ov-file#use-in-devshell-for-nix-develop
- [Nora's `x` nix package](https://github.com/Noratrieb/nixos/tree/26ea68e1a0aadaab313c1b5a8c1033a9770bd138/custom-pkgs/x)
- rust-lang/rustup#2891
- [Direnv: use flake/nix according to availability](https://discourse.nixos.org/t/direnv-use-flake-nix-according-to-availability/29825)

This is something that I plan to use personally, but I thought it might be worth upstreaming :)

r? Noratrieb
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 17, 2024
Rollup merge of rust-lang#129620 - WaffleLapkin:flake, r=Noratrieb

Provide a more convinient way of developing rustc on NixOS

This PR adds envrc files which, once symlinked as  `.envrc` will activates a dev shell from `src/tools/nix-dev-shell/flake.nix` or `src/tools/nix-dev-shell/shell.nix`.

This is based on
- [Current rustc dev guide recommendation for NixOS](https://rustc-dev-guide.rust-lang.org/building/suggested.html?highlight=nix#using-nix-shell)
- https://github.com/oxalica/rust-overlay?tab=readme-ov-file#use-in-devshell-for-nix-develop
- [Nora's `x` nix package](https://github.com/Noratrieb/nixos/tree/26ea68e1a0aadaab313c1b5a8c1033a9770bd138/custom-pkgs/x)
- rust-lang/rustup#2891
- [Direnv: use flake/nix according to availability](https://discourse.nixos.org/t/direnv-use-flake-nix-according-to-availability/29825)

This is something that I plan to use personally, but I thought it might be worth upstreaming :)

r? Noratrieb
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.

1 participant