refactor: nested ci flake with minimal root#1
Merged
Conversation
vic
requested changes
May 22, 2026
Minimal root flake.nix with zero inputs — exports only module, flakeModule, flakeModules.default. All dev/CI modules relocated to templates/ci/ as a nested flake following the ned pattern. - templates/ci/flake.nix holds all inputs - with-inputs.nix bootstraps from CI lock for shell.nix - Justfile uses CI flake's treefmt-nix formatter - GH Actions workflow uses nix-shell + just ci - test-cases moved to templates/ci/test-cases/ - README and LICENSE updated
Apply the formatting pipeline (treefmt, global formatters, per-file format) to files.files list entries, not just files.file attrset entries. - Add format option to files.files list API - New _formattedFiles internal option processes all entries uniformly - treefmtFormat uses file-based invocation instead of --stdin to match direct treefmt output - Fix unused onChange binding flagged by nixf-diagnose
8a4928f to
2ab57e5
Compare
Three templates showing the full API surface: - flake-parts: import-tree, treefmt, formatters, onChange, per-file format overrides, enable toggle, both APIs together - bare-flake: vanilla flake with evalModules, no flake-parts - no-flake: pure default.nix with import
2ab57e5 to
b375161
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Nested CI flake: root
flake.nixreduced to zero inputs, all dev/CI modules relocated totemplates/ci/following the ned pattern.with-inputs.nixbootstraps from the CI lock forshell.nix, Justfile uses the CI flake's treefmt-nix formatter, GH Actions runsnix-shell --run 'just ci'for local/CI parity.Unified formatting pipeline:
files.fileslist API now gets the same formatting treatment asfiles.fileattrset API — treefmt, global formatters, and per-fileformatall apply uniformly via internal_formattedFiles. Replacedtreefmt.tomlwith treefmt-nix as single source of truth. FixedtreefmtFormatto use file-based invocation instead of--stdinto match direct treefmt output.Demo templates: three templates showing the full API surface —
flake-parts(import-tree, treefmt, formatters, onChange, per-file overrides),bare-flake(evalModules, no flake-parts),no-flake(pure default.nix).Test plan
nix flake showon root exports onlymodule,flakeModule,flakeModules.defaulttreefmt --ci --no-cacheis a noop afternix run .#write-filesflake-partsandbare-flakedemo templates evaluateno-flaketemplate evaluates vianix-instantiaterecursive-nix)