add rust devshell

This commit is contained in:
Adithya 2023-12-08 15:22:58 +05:30
parent 2cedfe5274
commit beadfa5754
Signed by: adtya
GPG key ID: 48FC9915FFD326D0
3 changed files with 24 additions and 0 deletions

View file

@ -60,3 +60,19 @@ $ nix develop github:adtya/devshell#haskell
```sh ```sh
use flake github:adtya/devshell#haskell 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
```

View file

@ -17,6 +17,7 @@
go = import ./shells/go.nix { inherit pkgs; }; go = import ./shells/go.nix { inherit pkgs; };
haskell = import ./shells/haskell.nix { inherit pkgs; }; haskell = import ./shells/haskell.nix { inherit pkgs; };
python = import ./shells/python.nix { inherit pkgs; }; python = import ./shells/python.nix { inherit pkgs; };
rust = import ./shells/rust.nix { inherit pkgs; };
}; };
} }
); );

7
shells/rust.nix Normal file
View file

@ -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
'';
}