Skip to content

feat(flakeModules): fetch shared configs + with-hooks template#35

Merged
JacobPEvans-personal merged 1 commit into
mainfrom
feat/precommit-shared-configs
May 31, 2026
Merged

feat(flakeModules): fetch shared configs + with-hooks template#35
JacobPEvans-personal merged 1 commit into
mainfrom
feat/precommit-shared-configs

Conversation

@JacobPEvans-personal
Copy link
Copy Markdown
Member

Summary

Phase 1a follow-up. Wires the dryvist/.github canonical lint configs (added in dryvist/.github#12) into the terraform and ansible profile modules so consumer repos can delete their per-repo copies of .tflint.hcl, .ansible-lint, .yamllint.yml.

New surfaces

  • lib/fetch-shared-configs.nix — pure helper returning nix-store paths to each canonical config, keyed by tool name. Sourced from the dryvist-github flake input, so flake.lock controls which revision every consumer pulls.
  • templates/with-hooks/ — new nix flake init -t github:JacobPEvans/nix-devenv#with-hooks scaffold. Drops in a flake.nix that uses flake-parts and imports the matching profile in one line, plus a .envrc.

Profile wiring

Profile Before After
terraform tflint.enable = true; (no config) tflint.args = [ "--config" sharedConfigs.tflint ]
ansible ansible-lint.enable = true; (no config) ansible-lint.settings.configPath = sharedConfigs.ansible-lint
ansible yamllint.enable = true; (no config) yamllint.settings.configPath = sharedConfigs.yamllint
python unchanged ruff / ruff-format / mypy read from pyproject.toml, no on-disk linter configs needed

flake.lock bump

dryvist-github: 61f5215 (zizmor.yml only) → 2e42c2a (commit where precommit/configs/ landed via dryvist/.github#12).

Test plan

  • tests/profile-modules/terraform/nix flake check passes against the new wiring (verified locally)
  • tests/profile-modules/ansible/nix flake check passes against the new wiring (verified locally)
  • tests/profile-modules/python/nix flake check passes (no behavior change) (verified locally)
  • Root nix flake check passes
  • CI green
  • First Phase 2 trial migration adopts the terraform profile and deletes .tflint.hcl to exercise the new wiring end-to-end (separate PR)

Architecture context

Pairs with dryvist/.github PR #12 (canonical configs) and PR #34 (profile modules). After this merges, Phase 2 consumer migrations delete per-repo lint configs in the same PR that adopts the profile import.

Refs: dryvist/.github#12, #34

Assisted-by: Claude noreply@anthropic.com

Phase 1a follow-up. Wires the dryvist/.github canonical lint configs
(precommit/configs/{tflint.hcl,ansible-lint.yml,yamllint.yml}) into
the terraform and ansible profile modules so consumer repos can delete
their per-repo copies of those files.

New helpers and outputs:

  lib/fetch-shared-configs.nix - pure helper returning nix-store paths
    keyed by tool name. Sourced from the dryvist-github flake input, so
    flake.lock controls which canonical revision every consumer pulls.

  templates/with-hooks/ - new `nix flake init -t #with-hooks` scaffold.
    Drops in a flake.nix that uses flake-parts and imports the matching
    flakeModules profile in one line.

Profile wiring:

  flakeModules.terraform now sets tflint.args = [ "--config" path ]
    pointing at sharedConfigs.tflint. Consumer repos can delete
    .tflint.hcl.

  flakeModules.ansible now sets ansible-lint.settings.configPath and
    yamllint.settings.configPath to the canonical paths. Consumer repos
    can delete .ansible-lint and .yamllint.yml.

  flakeModules.python is unchanged - ruff / ruff-format / mypy take
    configuration from pyproject.toml, not on-disk linter configs.

flake.lock bump pulls dryvist-github from 61f5215 (zizmor.yml only) to
2e42c2a, the commit where precommit/configs/ landed in PR #12.

All three smoke-test consumers in tests/profile-modules/<profile>/ pass
`nix flake check` against the new wiring.

Refs: shared pre-commit architecture rollout, Phase 1a follow-up.

Assisted-by: Claude <noreply@anthropic.com>
@JacobPEvans-personal JacobPEvans-personal merged commit eb5b4a3 into main May 31, 2026
1 check passed
@JacobPEvans-personal JacobPEvans-personal deleted the feat/precommit-shared-configs branch May 31, 2026 03:29
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