Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Perch

Perch provides a structured framework for Nix flakes, offering a stable place to organize, extend, and refine your configurations.

It does so by importing all nix files in a subdirectory of your repository and interpreting them as flake modules which define your flake outputs.

Get started

Add the following to flake.nix to build flake modules from the flake directory into a flake:

{
  inputs = {
    perch.url = "github:haras-unicorn/perch/refs/tags/<perch-version>";
  };

  outputs = { perch, ... } @inputs:
    perch.lib.flake.make {
      inherit inputs;
      root = ./.;
      prefix = "flake";
    };
}

This will interpret all nix files in the ./flake subdirectory as flake modules and produce a flake based off of them.

The next chapter of this book explains in more detail on how to write flake modules.