chore(nix): add style tooling #52
Reference in New Issue
Block a user
Delete Branch "setup-nix-style-tools"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Verification
Follow-up pushed:
a779beb refactor(nix): simplify style tool outputs.\n\nThis removes the speculative multi-system helpers and keeps the new formatter/app surfaces explicitly scoped tox86_64-linux. Re-verified with:\n\n-nix eval --raw .#apps.x86_64-linux.nix-style-check.type\n-nix eval --raw .#formatter.x86_64-linux.typeFollow-up pushed:
9ebd79f refactor(nix): move style app wiring into dotfiles.\n\nChanges:\n- moved formatter/app wiring fromflake.nixintosrc/dotfiles/apps.nix\n- removed standalonetreefmt.nixand kept the small treefmt config with the app surface\n- renamed the app tostyle-checkso it can grow beyond Nix-only checks later\n- added the remote deployment flake-app idea todocs/TODO.md\n\nRe-verified with:\n\n-nix eval --raw .#apps.x86_64-linux.style-check.type\n-nix eval --raw .#formatter.x86_64-linux.type\n-nix eval --raw .#apps.x86_64-linux.nix-style-check.typefails, confirming the old app name is goneFollow-up pushed:
3d3c3f7 refactor(nix): split formatter and app outputs.\n\nFinal shape:\n-flake.nixpassessystem = "x86_64-linux"intosrc/dotfiles.\n-src/dotfiles/formatter.nixowns treefmt evaluation and returns the formatter derivation.\n-src/dotfiles/apps.nixonly defines flake apps and receives the formatter during import.\n-src/dotfiles/default.nixsetsformatter.${system}andapps.${system}directly in the returned flake attrset.\n\nVerified:\n-nix eval --raw .#apps.x86_64-linux.style-check.type\n-nix eval --raw .#formatter.x86_64-linux.typeFollow-up pushed:
5256e52 refactor(nix): inline flake system argument.\n\nRemoved the one-uselet system = "x86_64-linux"block inflake.nixand passes the system string directly tosrc/dotfiles.\n\nVerified:\n-nix eval --raw .#apps.x86_64-linux.style-check.type\n-nix eval --raw .#formatter.x86_64-linux.typeFollow-up pushed:
0114bed refactor(nix): inline formatter evaluation.\n\nRemoved the one-usepkgsandtreefmtEvallet bindings fromsrc/dotfiles/formatter.nix. The formatter module now returns the evaluated wrapper directly.\n\nVerified:\n-nix eval --raw .#formatter.x86_64-linux.type\n-nix eval --raw .#apps.x86_64-linux.style-check.typeFollow-up pushed:
1cfab7e refactor(nix): expose formatter wrapper in outputs.\n\nChangedsrc/dotfiles/formatter.nixto return the treefmt evaluation object.src/dotfiles/default.nixnow usesformatter.config.build.wrapperdirectly for both the flake formatter output and the style-check app input.\n\nVerified:\n-nix eval --raw .#formatter.x86_64-linux.type\n-nix eval --raw .#apps.x86_64-linux.style-check.typeFollow-up pushed:
9caf79d refactor(nix): inline style-check app package.\n\nRemoved the one-usestyleChecklet binding fromsrc/dotfiles/apps.nix;programnow referencespkgs.writeShellApplicationdirectly.\n\nVerified:\n-nix eval --raw .#apps.x86_64-linux.style-check.type\n-nix eval --raw .#formatter.x86_64-linux.typeFollow-up pushed:
5271523 fix(nix): make style app check-only.\n\nRoot cause:treefmt --fail-on-changestill formats the working tree before returning an error. The app now depends onformatter.config.build.check selfinstead, so the formatting check runs in the Nix build sandbox and cannot mutate the checkout.\n\nI reverted the formatter changes thatnix run .#style-checkmade in the worktree.\n\nVerified:\n-nix run .#style-checknow fails on formatting diffs without changing tracked Nix files\n-nix eval --raw .#apps.x86_64-linux.style-check.type\n-nix eval --raw .#formatter.x86_64-linux.typeFollow-up pushed:
f8b7319 refactor(nix): pass formatter to style app.\n\nRestored the app import shape to passformatterintoapps.nix; the style-check command now usesformatter.config.build.check selfdirectly instead of a poorly namedformattingCheckargument.\n\nVerified:\n-nix run .#style-checkstill fails on existing formatting diffs without mutating the checkout\n-nix eval --raw .#apps.x86_64-linux.style-check.type\n-nix eval --raw .#formatter.x86_64-linux.typeFollow-up pushed:
caaa53c feat(nix): add style fix app.\n\nChanged the app surface from check-only to mutating as discussed:\n- app name is nowfix\n-nix run .#fixrunstreefmt,statix fix .,deadnix --edit --no-lambda-pattern-names --no-underscore ., thentreefmtagain\n- removed the oldstyle-checkapp\n\nVerified the flake outputs:\n-nix eval --raw .#apps.x86_64-linux.fix.type\n-nix eval --raw .#apps.x86_64-linux.fix.program\n-nix eval --raw .#formatter.x86_64-linux.type\n-nix eval --raw .#apps.x86_64-linux.style-check.typefails, confirming the old app name is goneSquashed PR branch as requested.\n\nCurrent branch contains one commit:\n-
6ca431b feat(nix): add style tooling\n\nRe-verified after squash:\n-nix eval --raw .#apps.x86_64-linux.fix.type\n-nix eval --raw .#formatter.x86_64-linux.typeFollow-up pushed:
c293cc0 refactor(nix): use default deadnix fixes.\n\nRemoved the assumed deadnix flags from the fix app. It now runsdeadnix --edit .so deadnix behavior stays at its defaults instead of encoding assumptions about this repo's lambda args or underscore bindings.\n\nVerified:\n-nix eval --raw .#apps.x86_64-linux.fix.type\n-nix eval --raw .#apps.x86_64-linux.fix.programFollow-up pushed:
aafcbc1 fix(nix): exclude generated hardware configs.\n\nDeadnix exclusion details:\n- quoted glob did not protect generated hardware configs during--edit\n- verified working form is shell-expanded paths plus--before the scan root\n- app now runsdeadnix --edit --exclude configs/nixos/hosts/*/hardware-configuration.nix -- .\n\nVerification command run before updating the app:\n-nix shell nixpkgs#deadnix -c deadnix --edit --exclude configs/nixos/hosts/*/hardware-configuration.nix -- .\n\nThat changed onlysrc/dotfiles/registry.nix, not generated hardware configs; I reverted the verification edit afterward.\n\nOutput shape re-verified:\n-nix eval --raw .#apps.x86_64-linux.fix.type\n-nix eval --raw .#apps.x86_64-linux.fix.programaafcbc1179tod24f58a4c9Squashed PR branch after reverting the deadnix test edit.\n\nCurrent branch contains one commit:\n-
d24f58a feat(nix): add style tooling\n\nRe-verified after squash:\n-nix eval --raw .#apps.x86_64-linux.fix.type\n-nix eval --raw .#apps.x86_64-linux.fix.program\n-nix eval --raw .#formatter.x86_64-linux.type