mirror of
https://github.com/youwen5/nix-dev-envs.git
synced 2024-11-24 10:23:51 -08:00
add README
This commit is contained in:
parent
2eb9502171
commit
4278718975
1 changed files with 43 additions and 0 deletions
43
README.md
Normal file
43
README.md
Normal file
|
@ -0,0 +1,43 @@
|
|||
# Nix development environments, for various languages
|
||||
|
||||
Those of us on NixOS never install language toolkits system-wide, unlike other distros.
|
||||
Regrettably, many projects are not taking advantage of Nix for reproducible development environments. You should
|
||||
make a big fuss about this in every open source project you are a part of and constantly evangelize about Nix.
|
||||
Until Nix is universally adopted, this repository serves as a collection of flakes which provides compilers,
|
||||
package managers, and basic development tools like LSPs for common languages. Simply clone this to a desired location,
|
||||
then run:
|
||||
|
||||
```bash
|
||||
nix develop <location-of-repo>#<language>
|
||||
|
||||
# example
|
||||
nix develop ~/.devenvs#rustNightly
|
||||
|
||||
# provides rust-analyzer, rustc, cargo, and some others from nightly toolchain
|
||||
```
|
||||
|
||||
## Automatic environment loading
|
||||
|
||||
For convenience, you can use [nix-direnv](https://github.com/nix-community/nix-direnv) to
|
||||
automatically load these environments.
|
||||
|
||||
Simply add the following `.envrc` to the project directory:
|
||||
|
||||
```bash
|
||||
# file: .envrc
|
||||
use flake <path-to-this-repo>#<language>
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
use flake ~/.devenvs#go
|
||||
```
|
||||
|
||||
If you don't want to commit these files, make sure to run the following:
|
||||
|
||||
```bash
|
||||
# tell git to ignore these direnv files for this local repository
|
||||
git update-index --skip-worktree .envrc .direnv
|
||||
```
|
||||
|
Loading…
Reference in a new issue