Skip to content

Commit de187d3

Browse files
Improve documentation
Closes #2
1 parent a3e156f commit de187d3

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

readme.md

+30
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,40 @@ Have you ever found yourself wanting to work on a rust project on NixOS without
44

55
`rust-nix-shell` allows you to create a shell environment with any version of rust, à la `rustup`. You can also specify other dependencies with `-p`, à la `nix-shell`.
66

7+
## Note
8+
9+
This program is intended for use on NixOS. If your system is not NixOS then I'd recommend using `rustup` instead of this --- unless you **know** that you want a nix-based rust environment, you probably don't.
10+
11+
It produces a shell with a complete rust toolchain of the specified version (the most recent stable, by default). This is useful when you're working on a project that does not have nix development files in the repo, or if they are not compatible with a nix-based rust-analyzer installation.
12+
713
## Dependencies
814

915
This program shells out to `nix-shell`, finding it from `$PATH`. It also by default calls `zsh` from `$PATH`, but this is configurable
1016

17+
## Installation
18+
19+
This repository is a flake, providing the output `rust-nix-shell`, and contains a `default.nix` for backwards compatibility.
20+
21+
The recommended way of installing this is by adding it to your system configuration. (For an example, look at my [system flake](https://github.com/Sciencentistguy/nixfiles))
22+
23+
Failing that, it can be run ephemerally with `nix run`:
24+
25+
```sh
26+
nix run 'github:Sciencentistguy/rust-nix-shell' -- [rust-nix-shell arguments]
27+
```
28+
29+
Or, it can be installed using `nix profile`:
30+
31+
```sh
32+
nix profile install 'github:Sciencentistguy/rust-nix-shell'
33+
```
34+
35+
For backwards compatibility, a `default.nix` is provided, allowing `rust-nix-shell` to be installed using `nix-env`:
36+
37+
```sh
38+
nix-env --dry-run -f 'https://github.com/Sciencentistguy/rust-nix-shell/archive/master.tar.gz' -i rust-nix-shell
39+
```
40+
1141
## Usage
1242

1343
`rust-nix-shell --help`

0 commit comments

Comments
 (0)