diff --git a/README.md b/README.md index 7a0424e..4bb823d 100644 --- a/README.md +++ b/README.md @@ -60,3 +60,19 @@ $ nix develop github:adtya/devshell#haskell ```sh use flake github:adtya/devshell#haskell ``` + +### Rust + +#### What's included? + - rustc + - rustfmt + - rust-analyzer + +#### Activate with Nix +```sh +$ nix develop github:adtya/devshell#rust +``` +#### Activate with Direnv +```sh +use flake github:adtya/devshell#rust +``` diff --git a/flake.nix b/flake.nix index acc3a38..ad365b3 100644 --- a/flake.nix +++ b/flake.nix @@ -17,6 +17,7 @@ go = import ./shells/go.nix { inherit pkgs; }; haskell = import ./shells/haskell.nix { inherit pkgs; }; python = import ./shells/python.nix { inherit pkgs; }; + rust = import ./shells/rust.nix { inherit pkgs; }; }; } ); diff --git a/shells/rust.nix b/shells/rust.nix new file mode 100644 index 0000000..ec3af8b --- /dev/null +++ b/shells/rust.nix @@ -0,0 +1,7 @@ +{ pkgs }: pkgs.mkShell { + packages = with pkgs; [ cargo rustc rustfmt rust-analyzer ]; + shellHook = '' + export CARGO_HOME=$PWD/.nix/cargo + export PATH=$CARGO_HOME/bin:$PATH + ''; +}