fix: suppress nix derivation context warnings - #1202
Conversation
Replace pkgs.replaceVars with pkgs.substituteAll for hydrate scripts to avoid builtins.derivation store path context warnings in Nix 2.18+. Disable home-manager manual to suppress options.json warning. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
📝 WalkthroughWalkthroughTwo configuration adjustments: the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses and resolves two distinct Nix derivation context warnings. By switching to a more robust substitution method for hydration scripts and explicitly disabling a specific home-manager feature, the changes aim to clean up build output and ensure more reliable derivation behavior. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
Mesa DescriptionTL;DRSuppressed Nix derivation context warnings by refactoring hydrate script substitution in What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Code Review
The pull request updates Nix configurations by migrating the use of pkgs.replaceVars to pkgs.substituteAll in config/ccs/default.nix and config/openclaw/default.nix, requiring the script source to be explicitly defined with src = ./hydrate.sh;. Additionally, it disables home-manager manpage generation in home-manager/default.nix to suppress a warning related to options.json.
There was a problem hiding this comment.
Pull request overview
Suppress Nix “derivation context” warnings by moving hydrate script templating to build-time derivations and disabling a Home Manager manual output.
Changes:
- Switch hydrate scripts from
pkgs.replaceVarstopkgs.substituteAllinconfig/ccsandconfig/openclaw. - Disable Home Manager manpage generation via
manual.manpages.enable = false.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| home-manager/default.nix | Disables Home Manager manpage generation to reduce manual-related warnings. |
| config/openclaw/default.nix | Migrates hydrate script substitution from eval-time to build-time derivation. |
| config/ccs/default.nix | Migrates hydrate script substitution from eval-time to build-time derivation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| # Suppress home-manager manual options.json generation warning. | ||
| manual.manpages.enable = false; |
| hydrateScript = pkgs.substituteAll ( | ||
| { | ||
| src = ./hydrate.sh; |
substituteAll was removed from nixpkgs (2025-05-23). Use writeText with builtins.replaceStrings to create proper derivations that preserve store path context, avoiding builtins.toFile warnings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
pkgs.replaceVarswithpkgs.substituteAllfor hydrate scripts inconfig/ccsandconfig/openclaw—replaceVarsusesbuiltins.toFileat eval time which drops store path context, whilesubstituteAllruns as a proper build-time derivationmanual.manpages.enable = false) to suppress theoptions.jsoncontext warningTest plan
nix buildcompletes without the twobuiltins.derivationcontext warnings@var@placeholders correctly at activation time🤖 Generated with Claude Code
Summary by cubic
Suppress Nix derivation context warnings by moving hydrate script substitution to build time with
pkgs.writeText, and disabling thehome-managermanual. Nix 2.18+ builds now complete without the two warnings and remain compatible aftersubstituteAllremoval.Bug Fixes
config/ccs, replacepkgs.replaceVarswithpkgs.writeText+builtins.replaceStringsto preserve store path context and avoidbuiltins.toFilewarnings.home-manager, setmanual.manpages.enable = falseto prevent theoptions.jsoncontext warning.Refactors
treefmt.Written for commit 5c8b6b2. Summary will update on new commits.