Skip to content

Conversation

vic
Copy link

@vic vic commented Jul 20, 2025

Add a new --write-meta CLI option that enables not removing flake-parts/<part>/meta.nix files. This is useful for other Nix tools that can take advantage of these meta files.

This option comes handy for projects using github:vic/flake-file that maintain flake.nix on behalf of the user. Because of this, modifying the flake.nix file is undesirable, however, having the meta files available (example) allows seamless integration with flake-parts-builder, letting users take advantage of such templates, while also automatically managing inputs read from meta files.

  • Add write_meta field to SharedArgs struct with documentation
  • Thread write_meta parameter through copy_parts_to_target function
  • Implement meta.nix file copying logic with proper error handling
  • Support existing init strategies (skip/overwrite) for meta files
  • Update both init and add commands to use the new functionality

Testing

Tested manually by invoking init and add commands with the new option.

Dependencies

None

Screenshots

None

Checklist

  • I have tested the relevant changes locally.
  • I have checked that nix flake check passes.
  • I have ensured my commits follow the project's commits guidelines.
  • I have checked that the changes follow a linear history.
  • (If applicable) I have commented any relevant parts of my code.
  • (If applicable) I have added appropriate unit/feature tests.
  • (If applicable) I have updated the documentation accordingly (in English).

Additional Notes

None

Add a new --write-meta CLI option that enables copying flake-parts/<part>/meta.nix
files during init and add operations. This is useful for other Nix tools that can
process the meta files, such as github:vic/flake-file for updating flake inputs.

- Add write_meta field to SharedArgs struct with documentation
- Thread write_meta parameter through copy_parts_to_target function
- Implement meta.nix file copying logic with proper error handling
- Support existing init strategies (skip/overwrite) for meta files
- Update both init and add commands to use the new functionality
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