[INVESTIGATION] Evaluate numtide/flake-utils for potential NixOS configuration integration #147

Closed
opened 2026-08-06 23:22:40 +01:00 by nimmo · 1 comment
Owner

Investigation: numtide/flake-utils

Overview

Investigate the numtide/flake-utils repository to determine if it provides valuable enhancements, simplifications, or performance improvements for the NixOS configuration at https://git.nimmog.uk/nimmo/nixos-config.

Repository Information

Investigation Goals

  1. Understand the core functionality and purpose of flake-utils
  2. Evaluate relevance to current NixOS configuration flake structure and outputs
  3. Identify potential integration points for simplifying flake outputs, module composition, or development patterns
  4. Assess maintenance burden and compatibility with existing flake structure
  5. Determine if proof-of-concept implementation is warranted
  • Flake outputs in flake.nix with complex outputs structure
  • Module system in modules/ directory
  • Auto-update system in packages/nixos-auto-update and modules/services/nixos-auto-update.nix
  • Formatting via nix fmt and treefmt
  • Multiple host configurations with shared patterns

Specific Areas to Examine

  1. flakeUtils.lib.eachDefaultSystem - for simplifying cross-platform flake outputs
  2. flakeUtils.lib.flakeify - for converting attrsets to proper flakes
  3. Template libraries for reducing boilerplate in flake modules
  4. Validation and error handling utilities
  5. Library functions for common flake patterns used in the configuration

Suggested Evaluation Approach

  • Review documentation and README
  • Examine example usage patterns in NixOS context
  • Check compatibility with NixOS unstable channel
  • Test integration by creating a simple test flake
  • Evaluate how it would simplify current flake.nix structure
  • Review maintenance history and community adoption

Decision Criteria

  • Significant simplification of flake outputs structure
  • Reduction in boilerplate in module system
  • Better organization of cross-platform outputs
  • Active maintenance and community support
  • Clear migration path from current implementation

Notes for Investigating Agent

  • Feel free to adjust investigation focus based on initial findings
  • If a repository shows little promise, document reasons for closing investigation
  • If additional related repositories are discovered during investigation, feel free to create issues for those as well
  • Initial investigation should be time-boxed (e.g., 2-4 hours per repository max) unless significant promise is found
# Investigation: numtide/flake-utils ## Overview Investigate the numtide/flake-utils repository to determine if it provides valuable enhancements, simplifications, or performance improvements for the NixOS configuration at https://git.nimmog.uk/nimmo/nixos-config. ## Repository Information - **URL**: https://github.com/numtide/flake-utils - **Description**: Provides helper functions and utilities for Nix flake programming ## Investigation Goals 1. Understand the core functionality and purpose of flake-utils 2. Evaluate relevance to current NixOS configuration flake structure and outputs 3. Identify potential integration points for simplifying flake outputs, module composition, or development patterns 4. Assess maintenance burden and compatibility with existing flake structure 5. Determine if proof-of-concept implementation is warranted ## Current Related Infrastructure - Flake outputs in flake.nix with complex outputs structure - Module system in modules/ directory - Auto-update system in packages/nixos-auto-update and modules/services/nixos-auto-update.nix - Formatting via nix fmt and treefmt - Multiple host configurations with shared patterns ## Specific Areas to Examine 1. flakeUtils.lib.eachDefaultSystem - for simplifying cross-platform flake outputs 2. flakeUtils.lib.flakeify - for converting attrsets to proper flakes 3. Template libraries for reducing boilerplate in flake modules 4. Validation and error handling utilities 5. Library functions for common flake patterns used in the configuration ## Suggested Evaluation Approach - Review documentation and README - Examine example usage patterns in NixOS context - Check compatibility with NixOS unstable channel - Test integration by creating a simple test flake - Evaluate how it would simplify current flake.nix structure - Review maintenance history and community adoption ## Decision Criteria - Significant simplification of flake outputs structure - Reduction in boilerplate in module system - Better organization of cross-platform outputs - Active maintenance and community support - Clear migration path from current implementation ## Notes for Investigating Agent - Feel free to adjust investigation focus based on initial findings - If a repository shows little promise, document reasons for closing investigation - If additional related repositories are discovered during investigation, feel free to create issues for those as well - Initial investigation should be time-boxed (e.g., 2-4 hours per repository max) unless significant promise is found
Author
Owner

Evaluation conclusion: do not adopt at present

Reviewed upstream numtide/flake-utils at commit 11707dc.

What it actually provides

flake-utils is a small, pure-Nix helper library for generating per-system flake outputs, flattening package trees, making app outputs, and composing subflakes. Its main convenience is eachDefaultSystem, whose default platform set is x86_64-linux, aarch64-linux, x86_64-darwin, and aarch64-darwin.

The flakeify function named in this issue does not exist in the reviewed library. The nearest relevant functions are simpleFlake, meld, and the eachSystem family.

Fit with this repository

  • A direct evaluation of every current nixosConfiguration confirmed that all six active hosts are x86_64-linux.
  • The system-qualified outputs in flake.nix are deliberately limited to x86_64-linux. eachDefaultSystem would broaden that contract to four platforms unless another input or explicit system list narrowed it again.
  • The existing makeNixosSystem helper already removes the meaningful host-construction duplication while keeping stable and unstable nixpkgs/Home Manager selection explicit.
  • simpleFlake targets package-oriented flakes and would not simplify this multi-host NixOS output shape. meld would add indirection without solving an observed maintenance problem.
  • Adding a root input would also add another item to the repository's explicit auto-update classification surface for a small amount of syntactic compression.

Validation performed

  • nix flake check --no-build passed against the reviewed upstream commit.
  • Local nix eval confirmed chaos, cosmos, electra, lena, lyra, and vega all resolve to x86_64-linux.

Decision

Do not add flake-utils and do not create an integration proof of concept. It would replace a handful of visible system-qualified attributes with a new dependency and a broader or separately constrained platform abstraction, without reducing the harder parts of this flake.

Revisit only if this repository begins publishing the same packages/checks/dev shells for multiple supported platforms. At that point compare flake-utils with flake-parts and a small local genAttrs helper against the then-current output shape.

## Evaluation conclusion: do not adopt at present Reviewed upstream `numtide/flake-utils` at commit [`11707dc`](https://github.com/numtide/flake-utils/tree/11707dc2f618dd54ca8739b309ec4fc024de578b). ### What it actually provides `flake-utils` is a small, pure-Nix helper library for generating per-system flake outputs, flattening package trees, making app outputs, and composing subflakes. Its main convenience is [`eachDefaultSystem`](https://github.com/numtide/flake-utils/blob/11707dc2f618dd54ca8739b309ec4fc024de578b/README.md#eachdefaultsystem-system---attrs), whose default platform set is `x86_64-linux`, `aarch64-linux`, `x86_64-darwin`, and `aarch64-darwin`. The `flakeify` function named in this issue does not exist in the reviewed library. The nearest relevant functions are `simpleFlake`, `meld`, and the `eachSystem` family. ### Fit with this repository - A direct evaluation of every current `nixosConfiguration` confirmed that all six active hosts are `x86_64-linux`. - The system-qualified outputs in [`flake.nix`](https://git.nimmog.uk/nimmo/nixos-config/src/commit/a4a9ad1b9fd817b4f8146849849ba3f0b5b603ab/flake.nix) are deliberately limited to `x86_64-linux`. `eachDefaultSystem` would broaden that contract to four platforms unless another input or explicit system list narrowed it again. - The existing `makeNixosSystem` helper already removes the meaningful host-construction duplication while keeping stable and unstable nixpkgs/Home Manager selection explicit. - `simpleFlake` targets package-oriented flakes and would not simplify this multi-host NixOS output shape. `meld` would add indirection without solving an observed maintenance problem. - Adding a root input would also add another item to the repository's explicit auto-update classification surface for a small amount of syntactic compression. ### Validation performed - `nix flake check --no-build` passed against the reviewed upstream commit. - Local `nix eval` confirmed `chaos`, `cosmos`, `electra`, `lena`, `lyra`, and `vega` all resolve to `x86_64-linux`. ### Decision Do not add `flake-utils` and do not create an integration proof of concept. It would replace a handful of visible system-qualified attributes with a new dependency and a broader or separately constrained platform abstraction, without reducing the harder parts of this flake. Revisit only if this repository begins publishing the same packages/checks/dev shells for multiple supported platforms. At that point compare `flake-utils` with `flake-parts` and a small local `genAttrs` helper against the then-current output shape.
nimmo closed this issue 2026-08-09 23:03:53 +01:00
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/nixos-config#147
No description provided.