Skip to content

Proposal: Remove flake-utils for native lib.attrsets.genAttrs #555

@luuumine

Description

@luuumine

Description

Description:
Not a problem, just a minor optimization for the project's tooling. The flake.nix currently depends on the flake-utils input to generate outputs for the different architectures (aarch64-darwin, x86_64-darwin, and x86_64-linux).

I'd like to propose switching over to the bultin nixpkgs function lib.attrsets.genAttrs.
Since nixpkgs now has this functionality built natively in its library, it makes flake-utils a redundant input. Removing it would make the flake.lock lighter, by removing an unnecessary dependency (and its numtide/systems dependency). It would slightly speed up the flake evaluation by avoiding fetching flake-utils.

I saw the note in CONTRIUBUTING.md about avoiding tooling changes unless there is a good reason, and thus wanted to ask: would it be fine for me to make a PR doing a small refactor in flake.nix to use lib.attrsets.genAttrs ? The actual outputs would remain exactly the same and it would basically not change anything except removing those unneeded dependencies.

Comparison

  1. With the current flake.nix:
>  nix flake metadata
Resolved URL:  git+file:///home/lumine/headplane
Locked URL:    git+file:///home/lumine/headplane?ref=refs/heads/main&rev=c6b6cbc122642eb2752f284895e7fd7f7b310488
Description:   headplane
Path:          /nix/store/4zfkcry4451rn6lr69qngjfknhj5xzrl-source
Revision:      c6b6cbc122642eb2752f284895e7fd7f7b310488
Revisions:     960
Last modified: 2026-04-27 05:56:34
Fingerprint:   9ba334f9e4b9802c3e46cd6077ff693b6eb6bd4292b23a5b41bb67e062db7a0d
Inputs:
├───devshell: github:numtide/devshell/255a2b1725a20d060f566e4755dbf571bbbb5f76?narHash=sha256-460jc0%2BCZfyaO8%2Bw8JNtlClB2n4ui1RbHfPTLkpwhU8%3D (2026-01-19 10:23:42)
│   └───nixpkgs follows input 'nixpkgs'
├───flake-utils: github:numtide/flake-utils/11707dc2f618dd54ca8739b309ec4fc024de578b?narHash=sha256-l0KFg5HjrsfsO/JpG%2Br7fRrqm12kzFHyUHqHCVpMMbI%3D (2024-11-13 21:27:16)
│   └───systems: github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e?narHash=sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768%3D (2023-04-09 08:27:08)
└───nixpkgs: github:nixos/nixpkgs/01fbdeef22b76df85ea168fbfe1bfd9e63681b30?narHash=sha256-GMSVw35Q%2B294GlrTUKlx087E31z7KurReQ1YHSKp5iw%3D (2026-04-23 13:07:47)
  1. With the proposed change to flake.nix:
>  nix flake metadata                      
Resolved URL:  git+file:///home/lumine/headplane
Locked URL:    git+file:///home/lumine/headplane?ref=refs/heads/refactor/remove-flake-utils&rev=a9c49471308fe2fb87130a363c44ce7843b5976a
Description:   headplane
Path:          /nix/store/g68jmp1x35cva3h16fwhfs24xxy4hi77-source
Revision:      a9c49471308fe2fb87130a363c44ce7843b5976a
Revisions:     961
Last modified: 2026-05-09 00:26:11
Fingerprint:   ba7a3dd98085c225bca81e42c6a993bb7406b8d8e23d043ddf7b7900f85a28d1
Inputs:
├───devshell: github:numtide/devshell/255a2b1725a20d060f566e4755dbf571bbbb5f76?narHash=sha256-460jc0%2BCZfyaO8%2Bw8JNtlClB2n4ui1RbHfPTLkpwhU8%3D (2026-01-19 10:23:42)
│   └───nixpkgs follows input 'nixpkgs'
└───nixpkgs: github:nixos/nixpkgs/01fbdeef22b76df85ea168fbfe1bfd9e63681b30?narHash=sha256-GMSVw35Q%2B294GlrTUKlx087E31z7KurReQ1YHSKp5iw%3D (2026-04-23 13:07:47)

Metadata

Metadata

Assignees

Labels

FeatureAdditions to HeadplaneNeeds TriageIssues yet to be triaged

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions