Skip to content

whisperpine/dev-templates

Nix flake templates for dev environments

Use nix flake to make dev environments reproducible (e.g. tools, environment variables, init scripts).

This repository is heavily inspired by the-nix-way/dev-templates and tailored for personal preferences.

Prerequisites

Install Nix and enable the following experimental features:

nix.settings.experimental-features = [ "nix-command" "flakes" ];

Get started

# To initialize (where `ENV` is listed in the table below):
nix flake init --template github:whisperpine/dev-templates#ENV

# Here's an example (for the rust template):
nix flake init --template github:whisperpine/dev-templates#rust
# To ensure it's up to date, use `--refresh`:
nix flake init --refresh --template github:whisperpine/dev-templates#rust

How to use the templates

Once your preferred template has been initialized, you can use the provided shell in two ways:

  • If you have nix-direnv installed, you can initialize the environment by running direnv allow.
  • If you don't have nix-direnv installed, you can run nix develop to enter the nix-defined shell environment.

Available templates

# list all the templates (notice items under "templates"):
nix flake show github:whisperpine/dev-templates
  • empty: a good start point for any projects.
  • golang: manage golang toolchain with configurable versions.
  • python: python virtual environment managed by uv.
    Notice the shellHook "source .venv/bin/activate", which is essential.
  • rust: manage rust toolchain, targets and others tools.
    It supersedes the functions of rustup in a declarative way.
  • web: web or nodejs dev environment managed by bun.
    Notice web/.envrc extends PATH environment variable.

About

Nix flake templates for managing repo-level dev environments.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors

Languages