nix: isolate dev inputs in partitions.dev so consumers only fetch what they need #162

Merged
natsukium merged 3 commits from nix/partition-dev-inputs into main 2026-09-06 21:20:04 +09:00
Owner

Nix evaluates every flake input even when only packages/overlays are needed, so nix run and downstream consumers were fetching rust-overlay, treefmt-nix, git-hooks, and home-manager which are only needed for dev shells, checks, and formatting.

  • Move those inputs to dev/flake.nix and expose them via flake-parts partitions.dev (extraInputsFlake). Root flake.nix now declares only nixpkgs, flake-parts, and crane.
  • Follow the root nixpkgs pin as nixpkgs-dev in the dev flake to avoid revision skew; route checks/devShells/formatter back via partitionedAttrs so nix develop, nix fmt, and nix flake check keep working without workflow changes.
  • Keep nix build .#felis and downstream flake.lock free of dev-only nodes (verified with a filtered consumer lock). Docs and skill references updated from flake.nix to dev/flake-module.nix where appropriate.

Verification: nix flake show unchanged, nix build .#felis and nix flake check (including msrv/home-manager-module/pre-commit/treefmt) pass, and an isolated fetch test with broken dev URLs still builds the package.

Nix evaluates every flake input even when only `packages`/`overlays` are needed, so `nix run` and downstream consumers were fetching `rust-overlay`, `treefmt-nix`, `git-hooks`, and `home-manager` which are only needed for dev shells, checks, and formatting. - Move those inputs to `dev/flake.nix` and expose them via `flake-parts` `partitions.dev` (`extraInputsFlake`). Root `flake.nix` now declares only `nixpkgs`, `flake-parts`, and `crane`. - Follow the root `nixpkgs` pin as `nixpkgs-dev` in the dev flake to avoid revision skew; route `checks`/`devShells`/`formatter` back via `partitionedAttrs` so `nix develop`, `nix fmt`, and `nix flake check` keep working without workflow changes. - Keep `nix build .#felis` and downstream `flake.lock` free of dev-only nodes (verified with a filtered consumer lock). Docs and skill references updated from `flake.nix` to `dev/flake-module.nix` where appropriate. Verification: `nix flake show` unchanged, `nix build .#felis` and `nix flake check` (including `msrv`/`home-manager-module`/`pre-commit`/`treefmt`) pass, and an isolated fetch test with broken dev URLs still builds the package.
nix: isolate dev inputs in partitions.dev so consumers only fetch what they need
Some checks failed
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 48s
bench / Criterion regression gate (pull_request) Failing after 3m5s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m36s
pr / nix flake check (pull_request) Successful in 19s
pr / cargo build / clippy / test / deny (pull_request) Failing after 28s
pr / wire schema is compatible with the base (pull_request) Successful in 10s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 54s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
windows / cargo clippy (Windows cross) (pull_request) Failing after 54s
windows / cargo nextest (Windows) (pull_request) Successful in 6m44s
windows / frontend smoke (Windows) (pull_request) Successful in 2m1s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
ed030e7f21
Nix fetches every flake input even when only packages and overlays
are evaluated, so users running nix run or adding felis as a flake
input paid for rust-overlay, treefmt-nix, git-hooks, and home-manager
which are only needed for dev shells, checks, and formatting.

Move those inputs to dev/flake.nix and expose them through
flake-parts partitions.dev via extraInputsFlake. The root flake now
declares only nixpkgs, flake-parts, and crane, so downstream locks
no longer include dev-only nodes. The dev partition follows the root
nixpkgs pin as nixpkgs-dev to avoid revision skew, and
partitionedAttrs routes checks, devShells, and formatter back to root
so nix develop, nix fmt, and nix flake check keep working without
workflow changes.

Assisted-by: Pi Coding Agent:Muse Spark 1.2
nix: pin dev partition nixpkgs to root so dev and package share one revision
Some checks failed
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 48s
bench / Criterion regression gate (pull_request) Successful in 2m6s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m20s
pr / nix flake check (pull_request) Successful in 6s
pr / cargo build / clippy / test / deny (pull_request) Failing after 13s
pr / wire schema is compatible with the base (pull_request) Successful in 9s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 54s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
windows / cargo clippy (Windows cross) (pull_request) Failing after 8s
windows / cargo nextest (Windows) (pull_request) Successful in 5m43s
windows / frontend smoke (Windows) (pull_request) Successful in 1m57s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
5b2e17be85
dev/flake.nix needs its own nixpkgs-dev for standalone lock, but when
evaluated via partitions.dev that second copy is never fetched by
consumers and would double-fetch for developers. Override
extraInputs.nixpkgs-dev with the root input so the dev partition
builds shells and checks against the shipped revision. Follows cannot
refer to the root flake directly, so this override is the partitions
workaround.

Assisted-by: Pi Coding Agent:Muse Spark 1.2
nix: align dev pins with root so clippy and checks share one toolchain
Some checks failed
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 49s
bench / Criterion regression gate (pull_request) Failing after 2m17s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m44s
pr / nix flake check (pull_request) Successful in 28s
pr / wire schema is compatible with the base (pull_request) Successful in 8s
windows / cargo nextest (Windows) (pull_request) Successful in 7m30s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 56s
windows / cargo clippy (Windows cross) (pull_request) Successful in 14s
windows / frontend smoke (Windows) (pull_request) Successful in 2m30s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
pr / cargo build / clippy / test / deny (pull_request) Failing after 1m35s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
473c7f7d3f
dev/flake.lock had drifted ahead of the root lock after the
partition split (rust-overlay c361 vs b916, nixpkgs-dev 17de0b vs
89570f), so nix develop resolved nightly 1.100 on the branch while
main still used 1.98. The newer nightly enables additional pedantic
lints that make cargo clippy fail under -D warnings.

Copy the root-equivalent pins into dev for the shared inputs so the
dev partition and standalone main share the same revisions. The
extraInputs override for nixpkgs-dev remains so the partition keeps
using a single store path even after the next Renovate update.

Assisted-by: Pi Coding Agent:Muse Spark 1.2
natsukium force-pushed nix/partition-dev-inputs from 473c7f7d3f
Some checks failed
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 49s
bench / Criterion regression gate (pull_request) Failing after 2m17s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m44s
pr / nix flake check (pull_request) Successful in 28s
pr / wire schema is compatible with the base (pull_request) Successful in 8s
windows / cargo nextest (Windows) (pull_request) Successful in 7m30s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 56s
windows / cargo clippy (Windows cross) (pull_request) Successful in 14s
windows / frontend smoke (Windows) (pull_request) Successful in 2m30s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
pr / cargo build / clippy / test / deny (pull_request) Failing after 1m35s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
to 0bf59f02fa
Some checks failed
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 51s
bench / Criterion regression gate (pull_request) Successful in 2m1s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m5s
pr / nix flake check (pull_request) Successful in 17s
pr / wire schema is compatible with the base (pull_request) Successful in 12s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 59s
windows / cargo nextest (Windows) (pull_request) Successful in 7m16s
windows / cargo clippy (Windows cross) (pull_request) Successful in 18s
windows / frontend smoke (Windows) (pull_request) Successful in 2m37s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
pr / cargo build / clippy / test / deny (pull_request) Failing after 1m42s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
2026-09-06 14:46:27 +09:00
Compare
natsukium scheduled this pull request to auto merge when all checks succeed 2026-09-06 14:46:49 +09:00
natsukium force-pushed nix/partition-dev-inputs from 0bf59f02fa
Some checks failed
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 51s
bench / Criterion regression gate (pull_request) Successful in 2m1s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m5s
pr / nix flake check (pull_request) Successful in 17s
pr / wire schema is compatible with the base (pull_request) Successful in 12s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 59s
windows / cargo nextest (Windows) (pull_request) Successful in 7m16s
windows / cargo clippy (Windows cross) (pull_request) Successful in 18s
windows / frontend smoke (Windows) (pull_request) Successful in 2m37s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
pr / cargo build / clippy / test / deny (pull_request) Failing after 1m42s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
to 4dada3cf5c
Some checks failed
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
bench / Criterion regression gate (pull_request) Failing after 2m24s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m7s
pr / nix flake check (pull_request) Successful in 18s
pr / cargo build / clippy / test / deny (pull_request) Successful in 1m34s
pr / wire schema is compatible with the base (pull_request) Successful in 8s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 52s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
windows / cargo clippy (Windows cross) (pull_request) Successful in 14s
windows / cargo nextest (Windows) (pull_request) Successful in 6m57s
windows / frontend smoke (Windows) (pull_request) Successful in 1m38s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 12m33s
2026-09-06 21:07:29 +09:00
Compare
natsukium deleted branch nix/partition-dev-inputs 2026-09-06 21:20:04 +09:00
Sign in to join this conversation.
No description provided.