From 3791ca79e432b702ff8c5f1530177710c25e3c3c Mon Sep 17 00:00:00 2001 From: Shun Kakinoki Date: Thu, 19 Mar 2026 13:34:28 +0000 Subject: [PATCH 1/4] fix: suppress nix derivation context warnings 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) --- config/ccs/default.nix | 3 ++- config/openclaw/default.nix | 3 ++- home-manager/default.nix | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config/ccs/default.nix b/config/ccs/default.nix index a3db8671b..81cdec6a0 100644 --- a/config/ccs/default.nix +++ b/config/ccs/default.nix @@ -8,7 +8,8 @@ let dotfilesDir = "${config.home.homeDirectory}/dotfiles"; # Hydration script for CCS provider settings - hydrateScript = pkgs.replaceVars ./hydrate.sh { + hydrateScript = pkgs.substituteAll { + src = ./hydrate.sh; sed = "${pkgs.gnused}/bin/sed"; }; in diff --git a/config/openclaw/default.nix b/config/openclaw/default.nix index 7e5129dce..456e5afce 100644 --- a/config/openclaw/default.nix +++ b/config/openclaw/default.nix @@ -11,8 +11,9 @@ let mode = if host.isKyber then "gateway" else "client"; - hydrateScript = pkgs.replaceVars ./hydrate.sh ( + hydrateScript = pkgs.substituteAll ( { + src = ./hydrate.sh; sed = "${pkgs.gnused}/bin/sed"; template = ./openclaw.template.json; inherit mode; diff --git a/home-manager/default.nix b/home-manager/default.nix index 6f207375b..7e3cf0ac8 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -36,6 +36,9 @@ in home.packages = packages; home.stateVersion = "24.11"; + # Suppress home-manager manual options.json generation warning. + manual.manpages.enable = false; + accounts.email.accounts = { Gmail = { primary = true; From c91b60b336f05f888b9d9f5a741248298eb0c2a0 Mon Sep 17 00:00:00 2001 From: Shun Kakinoki Date: Thu, 19 Mar 2026 13:45:36 +0000 Subject: [PATCH 2/4] fix: use writeText instead of substituteAll (removed from nixpkgs) 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) --- config/ccs/default.nix | 11 +++++---- config/openclaw/default.nix | 47 +++++++++++++++++++++---------------- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/config/ccs/default.nix b/config/ccs/default.nix index 81cdec6a0..1d90b6f2a 100644 --- a/config/ccs/default.nix +++ b/config/ccs/default.nix @@ -8,10 +8,13 @@ let dotfilesDir = "${config.home.homeDirectory}/dotfiles"; # Hydration script for CCS provider settings - hydrateScript = pkgs.substituteAll { - src = ./hydrate.sh; - sed = "${pkgs.gnused}/bin/sed"; - }; + # Use writeText instead of replaceVars to avoid builtins.toFile context warnings + hydrateScript = pkgs.writeText "hydrate.sh" ( + builtins.replaceStrings + [ "@sed@" ] + [ "${pkgs.gnused}/bin/sed" ] + (builtins.readFile ./hydrate.sh) + ); in { # CCS (Claude Code Switcher) account registry diff --git a/config/openclaw/default.nix b/config/openclaw/default.nix index 456e5afce..5d5797b1b 100644 --- a/config/openclaw/default.nix +++ b/config/openclaw/default.nix @@ -11,26 +11,33 @@ let mode = if host.isKyber then "gateway" else "client"; - hydrateScript = pkgs.substituteAll ( - { - src = ./hydrate.sh; - sed = "${pkgs.gnused}/bin/sed"; - template = ./openclaw.template.json; - inherit mode; - } - // ( - if host.isKyber then - { - chromium = pkgs.chromium; - openclaw = "${homeDir}/.bun"; - } - else - { - chromium = "/unused"; - openclaw = "/unused"; - } - ) - ); + # Use writeText instead of replaceVars to avoid builtins.toFile context warnings + hydrateScript = + let + vars = { + sed = "${pkgs.gnused}/bin/sed"; + template = "${./openclaw.template.json}"; + inherit mode; + } // ( + if host.isKyber then + { + chromium = "${pkgs.chromium}"; + openclaw = "${homeDir}/.bun"; + } + else + { + chromium = "/unused"; + openclaw = "/unused"; + } + ); + names = builtins.attrNames vars; + in + pkgs.writeText "hydrate.sh" ( + builtins.replaceStrings + (map (n: "@${n}@") names) + (map (n: builtins.toString vars.${n}) names) + (builtins.readFile ./hydrate.sh) + ); in { # Hydrate OpenClaw config from .env secrets From c0445bd9e2e83d379661dc3b90216bf484b00fca Mon Sep 17 00:00:00 2001 From: Shun Kakinoki Date: Thu, 19 Mar 2026 14:19:04 +0000 Subject: [PATCH 3/4] style: fix nix formatting for treefmt Co-Authored-By: Claude Opus 4.6 (1M context) --- config/openclaw/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/openclaw/default.nix b/config/openclaw/default.nix index 5d5797b1b..c9bde9be1 100644 --- a/config/openclaw/default.nix +++ b/config/openclaw/default.nix @@ -18,7 +18,8 @@ let sed = "${pkgs.gnused}/bin/sed"; template = "${./openclaw.template.json}"; inherit mode; - } // ( + } + // ( if host.isKyber then { chromium = "${pkgs.chromium}"; @@ -33,10 +34,9 @@ let names = builtins.attrNames vars; in pkgs.writeText "hydrate.sh" ( - builtins.replaceStrings - (map (n: "@${n}@") names) - (map (n: builtins.toString vars.${n}) names) - (builtins.readFile ./hydrate.sh) + builtins.replaceStrings (map (n: "@${n}@") names) (map (n: builtins.toString vars.${n}) names) ( + builtins.readFile ./hydrate.sh + ) ); in { From 5c8b6b25444038dac0f58fdcc965e10bd123f2e8 Mon Sep 17 00:00:00 2001 From: Shun Kakinoki Date: Thu, 19 Mar 2026 22:47:30 +0000 Subject: [PATCH 4/4] chore: format nix files Co-Authored-By: Claude Opus 4.6 (1M context) --- config/ccs/default.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/config/ccs/default.nix b/config/ccs/default.nix index 1d90b6f2a..c74ef78e8 100644 --- a/config/ccs/default.nix +++ b/config/ccs/default.nix @@ -10,10 +10,7 @@ let # Hydration script for CCS provider settings # Use writeText instead of replaceVars to avoid builtins.toFile context warnings hydrateScript = pkgs.writeText "hydrate.sh" ( - builtins.replaceStrings - [ "@sed@" ] - [ "${pkgs.gnused}/bin/sed" ] - (builtins.readFile ./hydrate.sh) + builtins.replaceStrings [ "@sed@" ] [ "${pkgs.gnused}/bin/sed" ] (builtins.readFile ./hydrate.sh) ); in {