Skip to content

Templates

flake-file ships several Nix flake templates. Initialise any of them with:

Terminal window
nix flake init -t github:vic/flake-file#<template>

A minimal, explicit setup without extra framework dependencies.

# flake-parts module — see templates/default
{ inputs, ... }: {
imports = [ inputs.flake-file.flakeModules.default ];
flake-file.inputs = {
flake-file.url = "github:vic/flake-file";
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
systems = inputs.nixpkgs.lib.systems.flakeExposed;
}

Run nix run .#write-flake to generate flake.nix.

Includes flakeModules.dendritic — the recommended starting point for new Dendritic projects. Comes with import-tree, flake-parts, and sensible defaults.

Terminal window
nix flake init -t github:vic/flake-file#dendritic
nix run ".#write-flake"
nix flake check

Uses lib.flakeModules.flake-parts-builder for projects that manage their flake-parts modules with flake-parts-builder.

For non-flake (stable Nix) environments. Uses npins to pin inputs. Supports channels, GitHub, GitLab, tarballs, and git repos. Recommended for new non-flake projects.

Terminal window
nix flake init -t github:vic/flake-file#npins

For non-flake (stable Nix) environments. Uses goldstein/unflake to pin inputs.

Terminal window
nix flake init -t github:vic/flake-file#unflake

Tip: You can use the write-flake app as part of a devshell command or a git pre-commit hook to keep flake.nix always up to date.

Contribute Community Sponsor