Skip to content

Minimizing eval time using `flake-parts` partitions functionality

License

Notifications You must be signed in to change notification settings

ink-splatters/flake-partitions-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nix flake partitioning

TL;DR

The PoC implements flake-parts partitions functionality.

Longer version:

while the module system does a good job at preserving laziness, the fact that a development related import can define packages means that in order to evaluate packages, you need to evaluate at least to the point where you can conclude that the development related import does not actually define a packages attribute. While the actual evaluation is cheap, it can only happen after fetching the input, which is not as cheap.

The "production" flow of the PoC uses nixpkgs#hello-unfree under the hood.

TODO: templates

Prerequisites

  • nix with flakes functionality enabled
  • direnv [optionally, for development only]

Hello unfree world

...free of development inputs

nix run github:ink-splatters/flake-partitions-poc

Development

The flow uses another flake-parts partition (and that's the whole point).

Dev shell

nix develop --accept-flake-config

Alternatively, if you have direnv installed:

direnv allow .

Formatter

Currently, the formatter is alejandra

nix fmt .

pre-commit

Normally, pre-commit hooks are installed during dev shell initialization. This also can be done manually, using:

nix run .#install-hooks

To manually run the checks:

nix flake check

Extras

Consumer flake

About

Minimizing eval time using `flake-parts` partitions functionality

Topics

Resources

License

Stars

Watchers

Forks