Templates Overview
Den ships six templates that cover progressively complex setups. Use nix flake init to scaffold a new project:
nix flake init -t github:vic/den#<template>Choosing a Template
Section titled “Choosing a Template”| Template | Use case | Flakes | flake-parts | Home-Manager |
|---|---|---|---|---|
| minimal | Smallest possible Den setup | ✓ | ✗ | ✗ |
| default | Recommended starting point | ✓ | ✓ | ✓ |
| example | Feature showcase with namespaces | ✓ | ✓ | ✓ |
| noflake | Stable Nix, no flakes | ✗ | ✗ | ✗ |
| bogus | Bug reproduction | ✓ | ✓ | ✓ |
| ci | Den’s own test suite | ✓ | ✓ | ✓ |
Quick Start
Section titled “Quick Start”mkdir my-nix && cd my-nixnix flake init -t github:vic/dennix flake update denThis clones the default template. Edit modules/hosts.nix to declare your machines, then:
nix run .#vmProject Structure
Section titled “Project Structure”Every template follows the same pattern:
flake.nix # or default.nix for noflakemodules/ den.nix # host/user declarations + den.flakeModule import *.nix # aspect definitions, one concern per fileDen uses import-tree to recursively load all .nix files under modules/. You never need to manually list imports — just create files.
What Each Template Demonstrates
Section titled “What Each Template Demonstrates”- minimal — The absolute minimum: one host, one user, no extra dependencies
- default — Production-ready structure with Home-Manager, VM testing, dendritic flake-file
- example — Namespaces, angle brackets, cross-platform (NixOS + Darwin), providers
- noflake — Using Den with npins instead of flakes
- bogus — Creating minimal reproductions for bug reports with nix-unit
- ci — Comprehensive tests covering every Den feature (your best learning resource)
Next Steps
Section titled “Next Steps”Start with the Minimal template to understand Den’s core, then graduate to Default for a real setup.