Skip to content

Templates Overview

Den ships six templates that cover progressively complex setups. Use nix flake init to scaffold a new project:

Terminal window
nix flake init -t github:vic/den#<template>
TemplateUse caseFlakesflake-partsHome-Manager
minimalSmallest possible Den setup
defaultRecommended starting point
exampleFeature showcase with namespaces
noflakeStable Nix, no flakes
bogusBug reproduction
ciDen’s own test suite
Terminal window
mkdir my-nix && cd my-nix
nix flake init -t github:vic/den
nix flake update den

This clones the default template. Edit modules/hosts.nix to declare your machines, then:

Terminal window
nix run .#vm

Every template follows the same pattern:

flake.nix # or default.nix for noflake
modules/
den.nix # host/user declarations + den.flakeModule import
*.nix # aspect definitions, one concern per file

Den uses import-tree to recursively load all .nix files under modules/. You never need to manually list imports — just create files.

  • 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)

Start with the Minimal template to understand Den’s core, then graduate to Default for a real setup.

Contribute Community Sponsor