-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rust-toolchain and nix flake (#20)
rust-toolchain will allow us to ensure that everyone developing on the repository is using the same version of rust. Nix flake will provide out-of-the-box development environment for nix users with the right rust version.
- Loading branch information
Showing
4 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
# This is a Nix Flake that defines development environment for this project. | ||
# | ||
# Using Nix is NOT required to develop this project. | ||
# | ||
# Nix provides a declariative way to define reproducible development environment | ||
# and aims to remove the issue of "works on my machine". | ||
# | ||
# If you use Nix, you can install and activate all dependencies required to | ||
# develop on this project with: | ||
# | ||
# $ nix develop | ||
# | ||
# If in addition you have `direnv` installed, you can create `.envrc` file with | ||
# `use flake` content, so that development environment activates automatically | ||
# when the project root directory is entered. | ||
# | ||
# More information: | ||
# - Nix: https://nixos.org | ||
# - Nix flakes: https://wiki.nixos.org/wiki/Flakes | ||
# - Direnv: https://direnv.net | ||
description = "The New Nushell Parser"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
rust-overlay = { | ||
url = "github:oxalica/rust-overlay"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
}; | ||
|
||
outputs = | ||
{ | ||
nixpkgs, | ||
rust-overlay, | ||
flake-utils, | ||
... | ||
}: | ||
flake-utils.lib.eachDefaultSystem ( | ||
system: | ||
let | ||
overlays = [ (import rust-overlay) ]; | ||
pkgs = import nixpkgs { inherit system overlays; }; | ||
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; | ||
in | ||
{ | ||
devShells.default = pkgs.mkShell { | ||
nativeBuildInputs = [ | ||
(rustToolchain.override { | ||
extensions = [ | ||
"rust-src" | ||
"rust-analyzer" | ||
]; | ||
}) | ||
]; | ||
}; | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters