Skip to content
LogoLogo

purr

Nix flake framework with automatic discovery and module system

purr is a Nix framework that turns your project structure into a fully configured flake — automatically. No boilerplate, no manual wiring.


Quick Start

{
  inputs = {
    nixpkgs.url = "...";
    purr.url = "https://flakehub.com/f/nixcafe/purr/0.1.*.tar.gz";
  };
 
  outputs = inputs:
    inputs.purr.lib.mkFlake {
      inherit inputs;
      src = ./develop;
    };
}

Just drop a develop/ directory with shells/, checks/, and packages/ — purr discovers everything and wires up your flake.


Features

  • Automatic Discovery — Organize your project by convention and purr handles the rest
  • flake-parts Compatible — Use as a flake-parts module alongside other frameworks
  • Direct mkFlake — Also works standalone with the simple mkFlake API
  • Module System — Compose shells, checks, packages, and more with reusable modules
  • Pre-configured Batteries — git-hooks.nix, dev shells, formatters all set up

Installation

Add purr to your flake inputs:

{
  inputs.purr.url = "https://flakehub.com/f/nixcafe/purr/0.1.*.tar.gz";
}

Usage

Via flake-parts

{
  inputs = {
    nixpkgs.url = "...";
    purr.url = "...";
    flake-parts.url = "...";
  };
 
  outputs = inputs:
    inputs.flake-parts.lib.mkFlake { inherit inputs; } {
      imports = [ inputs.purr.flakeModules.default ];
    };
}

Via mkFlake

{
  inputs = {
    nixpkgs.url = "...";
    purr.url = "...";
  };
 
  outputs = inputs:
    inputs.purr.lib.mkFlake {
      inherit inputs;
      src = ./develop;
    };
}

Project Structure

purr expects the following layout under your src directory:

develop/
├── shells/
│   └── default/
│       └── default.nix     # Dev shell
├── checks/
│   └── git-hooks/
│       └── default.nix     # Pre-commit hooks
└── packages/
    └── ...                 # Custom packages

Each .nix file is auto-discovered and wired into the flake.