Skip to content

Commit

Permalink
Merge pull request #198 from tennox/gettingstarted-improvements
Browse files Browse the repository at this point in the history
Docs on finding packages & let template watch devshell.toml
  • Loading branch information
zimbatm authored May 19, 2022
2 parents 9571328 + c8f3fd6 commit a5327cd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
25 changes: 24 additions & 1 deletion docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,30 @@ packages = [
]
```

devshell is extensible in many different ways. In the next chapters we will
### Finding packages

Check out the [Nix package repository](https://search.nixos.org/packages).

Note that it is also possible to **use specific versions** for some packages - e.g. for NodeJS, [search the repo](https://search.nixos.org/packages?type=packages&query=nodejs) & use like this:
```toml
[[commands]]
package = "nodejs-17_x" # https://search.nixos.org/packages?type=packages&query=nodejs
name = "node"
help = "NodeJS"
```

Or another example:
```toml
[devshell]
packages = [
"python27", # 2.7
"python311", # 3.11
]
```

### Wrapping up

**devshell** is extensible in many different ways. In the next chapters we will
discuss the various ways in which it can be adapted to your project's needs.
to find
of the configuration options available.
9 changes: 7 additions & 2 deletions template/.envrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/usr/bin/env bash
# ^ added for shellcheck and file-type detection

# Watch & reload direnv on change
watch_file devshell.toml

if [[ $(type -t use_flake) != function ]]; then
echo "ERROR: use_flake function missing."
echo "Please update direnv to v2.30.0 or later."
exit 1
fi

use flake
use flake

0 comments on commit a5327cd

Please sign in to comment.