Skip to content

fix: suppress nix derivation context warnings - #1202

Merged
shunkakinoki merged 5 commits into
mainfrom
fix/nix-derivation-context-warnings
Mar 19, 2026
Merged

fix: suppress nix derivation context warnings#1202
shunkakinoki merged 5 commits into
mainfrom
fix/nix-derivation-context-warnings

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Mar 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace pkgs.replaceVars with pkgs.substituteAll for hydrate scripts in config/ccs and config/openclawreplaceVars uses builtins.toFile at eval time which drops store path context, while substituteAll runs as a proper build-time derivation
  • Disable home-manager manual generation (manual.manpages.enable = false) to suppress the options.json context warning

Test plan

  • Verify nix build completes without the two builtins.derivation context warnings
  • Verify hydrate scripts still substitute @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 the home-manager manual. Nix 2.18+ builds now complete without the two warnings and remain compatible after substituteAll removal.

  • Bug Fixes

    • In config/ccs, replace pkgs.replaceVars with pkgs.writeText + builtins.replaceStrings to preserve store path context and avoid builtins.toFile warnings.
    • In home-manager, set manual.manpages.enable = false to prevent the options.json context warning.
  • Refactors

    • Format Nix files for treefmt.

Written for commit 5c8b6b2. Summary will update on new commits.

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>
Copilot AI review requested due to automatic review settings March 19, 2026 13:34
@mesa-dot-dev

mesa-dot-dev Bot commented Mar 19, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@coderabbitai

coderabbitai Bot commented Mar 19, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Two configuration adjustments: the hydrateScript derivation in the CCS config now uses pkgs.writeText with builtins.replaceStrings for placeholder substitution instead of pkgs.replaceVars, and Home Manager configuration adds a setting to disable manual pages warnings.

Changes

Cohort / File(s) Summary
Script Substitution Refactoring
config/ccs/default.nix
Changed placeholder substitution mechanism for hydrateScript from replaceVars to writeText with explicit replaceStrings, replacing @sed@ token with resolved gnused binary path.
Home Manager Configuration
home-manager/default.nix
Added manual.manpages.enable = false setting to suppress options.json generation warnings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A script once swapped its placeholders with care,
From replaceVars to strings floating through air,
While Home Manager hushed its manual page chatter,
Two tweaks, two changes, both nimble and light—
Configuration flows now, ever more right! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: suppress nix derivation context warnings' directly reflects the main objective of the PR, which is to suppress Nix derivation context warnings through script substitution changes and home-manager configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly describes the changeset, mentioning the replacement of pkgs.replaceVars with pkgs.writeText + builtins.replaceStrings and the disabling of home-manager manual generation, which aligns with the actual file changes.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/nix-derivation-context-warnings
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • Hydration Script Improvement: Replaced pkgs.replaceVars with pkgs.substituteAll in config/ccs and config/openclaw hydration scripts to prevent store path context loss during evaluation.
  • Home-Manager Warning Suppression: Disabled home-manager manual generation (manual.manpages.enable = false) to suppress the options.json context warning.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@shunkakinoki
shunkakinoki enabled auto-merge (squash) March 19, 2026 13:35
@mesa-dot-dev

mesa-dot-dev Bot commented Mar 19, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Suppressed Nix derivation context warnings by refactoring hydrate script substitution in config/ccs to use pkgs.writeText and builtins.replaceStrings instead of pkgs.replaceVars, and by disabling home-manager manual generation in home-manager/default.nix.

What changed?

  • config/ccs/default.nix: Refactored the hydrateScript to use pkgs.writeText and string replacement functions instead of pkgs.replaceVars. This change avoids builtins.toFile context warnings and preserves the embedding of the sed path into hydrate.sh.
  • home-manager/default.nix: Disabled home-manager manual manpage generation by setting manual.manpages.enable = false to resolve a warning related to options.json generation.

Description generated by Mesa. Update settings

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 3 files

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.replaceVars to pkgs.substituteAll in config/ccs and config/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.

Comment thread home-manager/default.nix
Comment on lines +39 to +40
# Suppress home-manager manual options.json generation warning.
manual.manpages.enable = false;
Comment thread config/openclaw/default.nix Outdated
Comment on lines +14 to +16
hydrateScript = pkgs.substituteAll (
{
src = ./hydrate.sh;
shunkakinoki and others added 4 commits March 19, 2026 13:45
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>
@shunkakinoki
shunkakinoki merged commit 12ee0cc into main Mar 19, 2026
37 checks passed
@shunkakinoki
shunkakinoki deleted the fix/nix-derivation-context-warnings branch March 19, 2026 23:51
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