hercules-ci/flake-parts
hercules-ci/flake-parts has 1,517 GitHub stars and 84 forks. GitHot measured +1 stars in 24 hours and +6 in 7 days. Last checked 2026-11-11 19:04 UTC. Last push 2026-11-01.
❄️ Simplify Nix Flakes with the module system
What you can do
- Split your flake.nix into focused units, each in their own file.
- Take care of system.
- Allow users of your library flake to easily integrate your generated flake outputs into their flake.
- Reuse project logic written by others
Measured star growth
- in 24h
- +1
- in 7 days
- +6
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalFlake Parts
Core of a distributed framework for writing Nix Flakes.
flake-parts provides the options that represent standard flake attributes
and establishes a way of working with system.
Opinionated features are provided by an ecosystem of modules that you can import.
flake-parts itself has the goal to be a minimal mirror of the Nix flake schema.
Used by itself, it is very lightweight.
It is definitely the best Flake framework and it is simply out of this world!
—Pol Dellaiera (source)
Documentation: flake.parts
Why Modules?
Flakes are configuration. The module system lets you refactor configuration into modules that can be shared.
It reduces the proliferation of custom Nix glue code, similar to what the module system has done for NixOS configurations.
Unlike NixOS, but following Flakes' spirit, flake-parts is not a
monorepo with the implied goal of absorbing all of open source, but rather
a single module that other repositories can build upon, while ensuring a
baseline level of compatibility: the core attributes that constitute a flake.
Features
Split your
flake.nixinto focused units, each in their own file.Take care of system.
Allow users of your library flake to easily integrate your generated flake outputs into their flake.
Reuse project logic written by others
Getting Started
If your project does not have a flake yet:
nix flake init -t github:hercules-ci/flake-parts
Migrate
Otherwise, add the input,
flake-parts.url = "github:hercules-ci/flake-parts";
then slide mkFlake between your outputs function head and body,
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
flake = {
# Put your original flake attributes here.
};
systems = [
# systems for which you want to build the `perSystem` attributes
"x86_64-linux"
# ...
];
};
Now you can add the remaining module attributes like in the the template.
Templates
See the template.
Examples
See the examples/ directory.
Projects using flake-parts
- nixd (c++)
- hyperswitch (rust)
- argo-workflows (go)
- nlp-service (python)
- emanote (haskell)
Options Reference
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
561,889 starspublic-apis/public-apis
A collective list of free APIs
498,272 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
452,936 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,367 stars