https://github.com/ink-splatters/flake-partitions-poc
PoC using flake-parts `partitions` functionality
https://github.com/ink-splatters/flake-partitions-poc
Last synced: 2 months ago
JSON representation
PoC using flake-parts `partitions` functionality
- Host: GitHub
- URL: https://github.com/ink-splatters/flake-partitions-poc
- Owner: ink-splatters
- License: mit
- Created: 2025-01-24T12:56:51.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2025-02-20T17:55:49.000Z (3 months ago)
- Last Synced: 2025-02-20T18:33:17.396Z (3 months ago)
- Language: Nix
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nix flake partitioning
## TL;DR
The PoC implements [flake-parts partitions](https://flake.parts/options/flake-parts-partitions.html) 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
- [GitHub](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-template-repository) template
- [flake (`nix flake init`)](https://nix.dev/manual/nix/2.25/command-ref/new-cli/nix3-flake-init), potentially upstreaming it## Prerequisites
- `nix` with [flakes](https://nixos.wiki/wiki/Flakes) functionality enabled
- `direnv` [optionally, for development only]## Hello `unfree` world
### ...free of development inputs
```sh
nix run github:ink-splatters/flake-partitions-poc
```## Development
The flow uses another flake-parts _partition_ (and that's the whole point).
### Dev shell
```sh
nix develop --accept-flake-config
```Alternatively, if you have `direnv` installed:
```sh
direnv allow .
```### Formatter
Currently, the formatter is `alejandra`
```sh
nix fmt .
```### pre-commit
Normally, pre-commit hooks are installed during dev shell initialization.
This also can be done manually, using:```sh
nix run .#install-hooks
```To manually run the checks:
```sh
nix flake check
```## Extras
[Consumer flake](./extras/consumer-flake/README.md)