Skip to content

Add support for some deprecated output types#59

Merged
edolstra merged 1 commit intomainfrom
eelcodolstra/nix-345-support-deprecated-flake-outputs
Mar 18, 2026
Merged

Add support for some deprecated output types#59
edolstra merged 1 commit intomainfrom
eelcodolstra/nix-345-support-deprecated-flake-outputs

Conversation

@edolstra
Copy link
Copy Markdown
Collaborator

@edolstra edolstra commented Mar 18, 2026

defaultPackage, defaultApp and devShell have been deprecated a long time ago, but for compatibility we should still handle them.

Also, handle the meta.description field for apps.

Summary by CodeRabbit

  • Chores
    • Updated app, package, and development environment schemas with new helper functions and enhanced registrations.
    • Several schemas marked as deprecated; consider migrating configurations to standard patterns.

defaultPackage, defaultApp and devShell have been deprecated a long
time ago, but for compatibility we should still handle them.

Also, handle the meta.description field for apps.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 18, 2026

📝 Walkthrough

Walkthrough

Introduced helper builders (mkApp, mkPackage, singleDerivationInventory) for constructing flake outputs and modernized app, package, and devShell schemas to use these builders. New deprecated schemas are registered alongside existing ones for backward compatibility.

Changes

Cohort / File(s) Summary
Flake Helper Builders and Schema Modernization
flake.nix
Added three helper functions (mkApp, mkPackage, singleDerivationInventory) to standardize output construction. Introduced defaultAppSchema, defaultPackageSchema, and devShellSchema with deprecation notes. Updated inventory construction to use mkApp-based and mkPackage-based approaches. Registered new schemas in public outputs. Net change: +74/-31 lines.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Suggested reviewers

  • grahamc

Poem

🐰 With helpers new, the flakes align,
mkApp and mkPackage—how they shine!
Schemas dance in modern ways,
Building outputs through the maze.
A refactor's gift, both clean and bright! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding support for deprecated output types (defaultPackage, defaultApp, and devShell), which aligns with the comprehensive schema enhancements documented in the summary.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch eelcodolstra/nix-345-support-deprecated-flake-outputs
📝 Coding Plan
  • Generate coding plan for human review comments

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

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
flake.nix (1)

457-459: Consider using _ prefix for unused parameter.

The packageName parameter is intentionally unused (the name becomes the attribute key in children). In idiomatic Nix, prefixing with _ signals this intent to readers.

♻️ Suggested improvement
       children = builtins.mapAttrs (
-        packageName: mkPackage isFlakeCheck what systemType
+        _packageName: mkPackage isFlakeCheck what systemType
       ) packagesForSystem;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@flake.nix` around lines 457 - 459, The parameter name `packageName` in the
builtins.mapAttrs call is unused; rename it to an underscore-prefixed name
(e.g., `_packageName` or `_`) to signal intent. Update the lambda in the
`children = builtins.mapAttrs (packageName: mkPackage isFlakeCheck what
systemType) packagesForSystem;` expression so the first parameter is
`_packageName` (or `_`) while leaving the rest (`mkPackage`, `isFlakeCheck`,
`what`, `systemType`, and `packagesForSystem`) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@flake.nix`:
- Around line 457-459: The parameter name `packageName` in the builtins.mapAttrs
call is unused; rename it to an underscore-prefixed name (e.g., `_packageName`
or `_`) to signal intent. Update the lambda in the `children = builtins.mapAttrs
(packageName: mkPackage isFlakeCheck what systemType) packagesForSystem;`
expression so the first parameter is `_packageName` (or `_`) while leaving the
rest (`mkPackage`, `isFlakeCheck`, `what`, `systemType`, and
`packagesForSystem`) unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 88aa74b2-bcdb-4e42-ad14-341cc47c2141

📥 Commits

Reviewing files that changed from the base of the PR and between c4e68a9 and c5a3762.

📒 Files selected for processing (1)
  • flake.nix

@edolstra edolstra merged commit 19686d6 into main Mar 18, 2026
2 checks passed
@edolstra edolstra deleted the eelcodolstra/nix-345-support-deprecated-flake-outputs branch March 18, 2026 17:07
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.

2 participants