Credit and inspiration for this repo comes from https://github.com/the-nix-way/dev-templates
These templates are derived, from their work, for our use cases. We have learned alot!
We also recommend https://determinate.systems/posts/nix-github-actions for continued reading.
To initialize (where ${ENV}
is listed in the table below):
echo "use flake \"github:iancleary/dev-templates?dir=${ENV}\"" >> .envrc
direnv allow
For example, for the rust
template:
echo "use flake \"github:iancleary/dev-templates?dir=rust\"" >> .envrc
direnv allow
If you want to pin the specific version of the flake, you can do so by specifying the rev
parameter:
echo "use flake \"github:iancleary/dev-templates?dir=rust&rev=ad6530c93629bb51f8e648840191da1d5b4eff27\"" >> .envrc
direnv allow
Here's an example (for the rust
template):
# Initialize in the current project
nix flake init --template github:iancleary/dev-templates#rust
# Create a new project
nix flake new --template github:iancleary/dev-templates#rust ${NEW_PROJECT_DIRECTORY}