Skip to content

feat(nix): expose reusable dev-hygiene flake-module#15

Merged
JacobPEvans-personal merged 1 commit into
mainfrom
feat/nix-dev-hygiene-flake
May 31, 2026
Merged

feat(nix): expose reusable dev-hygiene flake-module#15
JacobPEvans-personal merged 1 commit into
mainfrom
feat/nix-dev-hygiene-flake

Conversation

@JacobPEvans-personal
Copy link
Copy Markdown
Member

What

Make dryvist/.github a lean Nix flake that exposes flakeModules.dev-hygiene — the org's treefmt + git-hooks + zizmor config as one importable flake-parts module.

  • flake.nix — inputs: nixpkgs + treefmt-nix + git-hooks only (no devenv/crate2nix/devshell). Output: flakeModules.dev-hygiene, pre-bound to this repo's inputs and its own zizmor.yml (${self}/zizmor.yml).
  • nix/dev-hygiene.nix — the module (formatter set, pre-commit hooks, markdownlint with the CHANGELOG.md exclude, zizmor via --config). Includes the treefmt CHANGELOG.md exclude so prettier stops fighting release-please's generated bullets.

Why

Global dev-hygiene settings should live in .github and be inherited, not redefined per-repo. Today nix-claude-code inlines a full copy (PR #27, to dodge nix-devenv's ~30-node transitive closure) and only zizmor.yml is inherited. This gives every Nix repo a single, lean home to import from — the same source they already pull zizmor.yml from.

Consumer:

imports = [ inputs.dryvist-github.flakeModules.dev-hygiene ];

First consumer: dryvist/nix-claude-code#33 (drops its inlined flake/dev-hygiene.nix). Later, nix-ai/nix-home/nix-darwin can migrate off nix-devenv's copy.

Verification

.github: nix flake check passes (only the expected "flakeModules is unchecked" note); lock closure is lean (nixpkgs, treefmt-nix, git-hooks). Consumer-side: nix flake check in nix-claude-code passes end-to-end importing this module (markdownlint/statix/treefmt/zizmor all green), with the local copy deleted.

Plain-source consumers (flake = false, e.g. nix-devenv reading ${dryvist-github}/zizmor.yml) are unaffected by adding flake.nix.

Refs: dryvist/nix-claude-code#33

🤖 Generated with Claude Code

Make dryvist/.github a lean Nix flake (nixpkgs + treefmt-nix + git-hooks
only) exposing flakeModules.dev-hygiene — the org's treefmt + git-hooks +
zizmor config as one importable flake-parts module, pre-bound to this repo's
inputs and its own zizmor.yml. Consuming Nix repos import it instead of
inlining or pulling nix-devenv's heavier closure.

Includes the CHANGELOG.md treefmt exclude (release-please owns that file).
Plain-source consumers (flake = false, e.g. for zizmor.yml) are unaffected.

Assisted-by: Claude:claude-opus-4-8
JacobPEvans-personal added a commit to dryvist/nix-claude-code that referenced this pull request May 31, 2026
Stop redefining the org-wide dev-hygiene global settings locally. Delete the
inlined flake/dev-hygiene.nix and import inputs.dryvist-github.flakeModules.dev-hygiene
instead — the same dryvist/.github source already used for zizmor.yml, now a
lean flake (treefmt-nix + git-hooks only, no devenv/crate2nix/devshell).

dryvist-github becomes a flake input (nixpkgs follows ours); the standalone
treefmt-nix and git-hooks inputs are dropped (now transitive via .github).
The CHANGELOG.md treefmt exclude lives in the shared module, not here.

Lock temporarily pins the dryvist/.github#15 branch; repointed to main once it
merges. nix flake check passes (EXIT 0).

Refs: dryvist/.github#15

Assisted-by: Claude:claude-opus-4-8
JacobPEvans-personal added a commit to dryvist/nix-claude-code that referenced this pull request May 31, 2026
* fix(dev-hygiene): exclude CHANGELOG.md from treefmt

release-please regenerates CHANGELOG.md with `*` bullets each release;
prettier (via treefmt) rewrote them to `-` and failed the treefmt and
pre-commit flake checks. Exclude CHANGELOG.md from treefmt, mirroring the
existing markdownlint-cli2 exclude. Collapse the settings.* assignments
into one block to satisfy statix. This failure was masked until now because
CI died at the FlakeHub cache step before nix flake check ran.

Assisted-by: Claude:claude-opus-4-8

* fix(ci): drop FlakeHub cache, call shared nix-validate template

The inline ci.yml used DeterminateSystems/magic-nix-cache-action, which now
authenticates its cache against api.flakehub.com and fails CI:
  FlakeHub: cache initialized failed: Unauthenticated: Cannot find netrc
  credentials for https://api.flakehub.com/
FlakeHub's hosted cache no longer has a useful free tier. Replace the three
inline jobs with a single call to the shared, FlakeHub-free _nix-validate
template (actions/cache + Determinate installer). nix flake check covers
flake eval + treefmt + pre-commit + lib tests; all_systems:false keeps it to
the runner's system, matching prior x86_64-linux-only behavior.

Refs: dryvist/.github#13

Assisted-by: Claude:claude-opus-4-8

* chore(deps): bump dryvist-github for dryvist/* zizmor trust

dryvist/.github#13 merged: adds the _nix-validate template and the
dryvist/* entry to the zizmor unpinned-uses trusted-publisher policy.
Bump the pinned input so the local/CI zizmor check (which reads
${inputs.dryvist-github}/zizmor.yml) accepts the dryvist/.github@main
reusable-workflow reference in ci.yml. nix flake check passes (EXIT 0).

Assisted-by: Claude:claude-opus-4-8

* refactor(flake): inherit dev-hygiene from dryvist/.github flake-module

Stop redefining the org-wide dev-hygiene global settings locally. Delete the
inlined flake/dev-hygiene.nix and import inputs.dryvist-github.flakeModules.dev-hygiene
instead — the same dryvist/.github source already used for zizmor.yml, now a
lean flake (treefmt-nix + git-hooks only, no devenv/crate2nix/devshell).

dryvist-github becomes a flake input (nixpkgs follows ours); the standalone
treefmt-nix and git-hooks inputs are dropped (now transitive via .github).
The CHANGELOG.md treefmt exclude lives in the shared module, not here.

Lock temporarily pins the dryvist/.github#15 branch; repointed to main once it
merges. nix flake check passes (EXIT 0).

Refs: dryvist/.github#15

Assisted-by: Claude:claude-opus-4-8
@JacobPEvans-personal JacobPEvans-personal merged commit de34cfe into main May 31, 2026
1 check passed
JacobPEvans-personal added a commit to dryvist/nix-claude-code that referenced this pull request May 31, 2026
PR #33 merged with the lock pinned to the dryvist/.github#15 branch commit
(the module had not yet landed on main). #15 is now merged; move the pin to
dryvist/.github main (de34cfe) so nix-claude-code main no longer depends on a
feature-branch commit. nix flake check passes (EXIT 0).

Assisted-by: Claude:claude-opus-4-8
@JacobPEvans-personal JacobPEvans-personal deleted the feat/nix-dev-hygiene-flake branch May 31, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant