Skip to content

fix(init): resolve filesystem attribute generation bugs#132

Merged
water-sucks merged 2 commits intonix-community:mainfrom
water-sucks:fix-init-fs-generation-bugs
Nov 12, 2025
Merged

fix(init): resolve filesystem attribute generation bugs#132
water-sucks merged 2 commits intonix-community:mainfrom
water-sucks:fix-init-fs-generation-bugs

Conversation

@water-sucks
Copy link
Copy Markdown
Collaborator

@water-sucks water-sucks commented Nov 12, 2025

Description

There were two bugs with generation of filesystem attributes:

  • A missing semicolon from the end of the attribute set
  • The filesystem type is specified as an attribute called fsType, not type.

Can't believe I didn't find these before, but oh well.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected Nix configuration generation for filesystem attribute definitions and syntax formatting.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 12, 2025

Walkthrough

A Nix filesystem template in the code generation module is updated to rename the type attribute to fsType and add a semicolon after the closing brace of the filesystem attribute set.

Changes

Cohort / File(s) Summary
Nix filesystem template update
cmd/init/generate.go
Renamed filesystem attribute from type to fsType and changed closing brace syntax from } to }; in the Nix fileSystems template

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify that fsType is the correct Nix attribute for filesystem type definitions
  • Confirm the semicolon syntax change aligns with Nix attribute set conventions
  • Check that the template change produces valid Nix configuration syntax in generated output

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main changes: fixing filesystem attribute generation bugs in the init command.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fdc0f56 and f53e933.

📒 Files selected for processing (1)
  • cmd/init/generate.go (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build/Test
🔇 Additional comments (2)
cmd/init/generate.go (2)

336-336: Critical fix: Add required semicolon for valid Nix syntax.

This change adds the required semicolon to close the filesystem attribute set properly. In Nix syntax, attribute sets that are values of other attributes must end with a semicolon. Without this fix, the generated configuration would have a syntax error.


318-318: ✓ Verified fix: Correct NixOS filesystem attribute name.

The correct NixOS attribute name is fsType, which sets the filesystem type passed to mount. This change correctly fixes the bug by replacing the invalid type attribute with the proper fsType attribute, ensuring generated NixOS configurations are valid.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@water-sucks water-sucks merged commit 9dbe106 into nix-community:main Nov 12, 2025
2 checks passed
@water-sucks water-sucks deleted the fix-init-fs-generation-bugs branch November 12, 2025 22:55
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