|
|
|
# Development shells
|
|
|
|
|
|
|
|
To make development on NixOS slightly less excruciating, libkookie
|
|
|
|
ships with a set of development shells. These are environments that
|
|
|
|
can be included a by projects to provide the basic set of tools
|
|
|
|
required by a language or development framework.
|
|
|
|
|
|
|
|
libkookie itself then provides the `<shells>` key in the NIX_PATH,
|
|
|
|
which means that existing shells can easily be included and layered by
|
|
|
|
other `shell.nix` files.
|
|
|
|
|
|
|
|
|
|
|
|
## How to use
|
|
|
|
|
|
|
|
Create a `shell.nix` for a project that you want to include (and
|
|
|
|
optionally `.envrc` for lorri). The tool `msh` (Make SHell) is
|
|
|
|
available to generate these based on common defaults. Afterwards both
|
|
|
|
`lorri` and `nix-shell` will be able to pick up the required
|
|
|
|
environment for development.
|
|
|
|
|
|
|
|
```nix
|
|
|
|
{...}: import <shells/rust/stable> {}
|
|
|
|
```
|
|
|
|
|
|
|
|
The above snippet includes the basic Rust development toolchain. You
|
|
|
|
can also provide a set of additional packages to install
|
|
|
|
|
|
|
|
```nix
|
|
|
|
import <shells/rust/stable> {
|
|
|
|
userPackages = (pkgs: [ pkgs.hello ]);
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
You can also include `<shells/rust/nightly>` which will get the latest
|
|
|
|
nightly compiler with a complete toolchain. This feature is
|
|
|
|
implemented via the
|
|
|
|
[oxalica/rust-overlay](https://github.com/oxalica/rust-overlay/).
|