Add goplaces toolchain + Linux-safe config checks

- add goplaces to extended tools and update nix-steipete-tools pin
- default goplaces plugin to Darwin + drop linux-first-party enablement
- resolve config validation module from hashed dist bundles

Tests: nix flake check --option max-jobs 1 --option cores 1 (root@djtbot-1)
This commit is contained in:
DJTBOT 2026-02-03 13:19:15 -08:00
parent 232e13fc53
commit 2ba0b0c92f
6 changed files with 47 additions and 12 deletions

6
flake.lock generated
View File

@ -43,11 +43,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1770140282,
"narHash": "sha256-Wxit1TpmOMh1ALcEckjbFRwYv91nJ6MEngTY+yQeAgk=",
"lastModified": 1770153405,
"narHash": "sha256-MUtqu/euqZxuCR2zmWC/vN8dZfK9CY40IwwqaZyh/1I=",
"owner": "openclaw",
"repo": "nix-steipete-tools",
"rev": "1ff8775a9d19aa8a623ee228ce3c115a7dfd6e01",
"rev": "5735675f95ea866815eefb4cc87d82e57c792f58",
"type": "github"
},
"original": {

View File

@ -19,7 +19,6 @@ let
linuxFirstParty = [
"summarize"
"gogcli"
"goplaces"
"camsnap"
"sonoscli"
"sag"

View File

@ -19,8 +19,8 @@ let
generatedConfigOptions = import ../../../generated/openclaw-config-options.nix { lib = lib; };
firstPartySources = let
stepieteRev = "1ff8775a9d19aa8a623ee228ce3c115a7dfd6e01";
stepieteNarHash = "sha256-Wxit1TpmOMh1ALcEckjbFRwYv91nJ6MEngTY+yQeAgk=";
stepieteRev = "5735675f95ea866815eefb4cc87d82e57c792f58";
stepieteNarHash = "sha256-MUtqu/euqZxuCR2zmWC/vN8dZfK9CY40IwwqaZyh/1I=";
stepiete = tool:
"github:openclaw/nix-steipete-tools?dir=tools/${tool}&rev=${stepieteRev}&narHash=${stepieteNarHash}";
in {

View File

@ -156,7 +156,7 @@ in {
};
goplaces.enable = lib.mkOption {
type = lib.types.bool;
default = true;
default = pkgs.stdenv.hostPlatform.isDarwin;
description = "Enable the goplaces plugin (first-party).";
};
bird.enable = lib.mkOption {

View File

@ -16,16 +16,51 @@ if (!srcRoot) {
process.exit(1);
}
const validationPath = path.join(srcRoot, "dist", "config", "validation.js");
if (!fs.existsSync(validationPath)) {
console.error(`Missing validation module: ${validationPath}`);
const legacyValidationPath = path.join(srcRoot, "dist", "config", "validation.js");
const distDir = path.join(srcRoot, "dist");
let validateConfigObject = null;
if (fs.existsSync(legacyValidationPath)) {
const moduleUrl = pathToFileURL(legacyValidationPath).href;
const legacyModule = await import(moduleUrl);
validateConfigObject = legacyModule.validateConfigObject;
} else if (fs.existsSync(distDir)) {
const candidates = fs.readdirSync(distDir)
.filter((name) => name.startsWith("config-") && name.endsWith(".js"));
for (const candidate of candidates) {
const candidatePath = path.join(distDir, candidate);
const contents = fs.readFileSync(candidatePath, "utf8");
if (!contents.includes("validateConfigObject")) {
continue;
}
if (contents.includes("./entry.js")) {
continue;
}
const candidateModule = await import(pathToFileURL(candidatePath).href);
if (typeof candidateModule.validateConfigObject === "function") {
validateConfigObject = candidateModule.validateConfigObject;
break;
}
const match = contents.match(/validateConfigObject as ([A-Za-z0-9_$]+)/);
if (match && typeof candidateModule[match[1]] === "function") {
validateConfigObject = candidateModule[match[1]];
break;
}
}
}
if (typeof validateConfigObject !== "function") {
console.error(`Missing validation module: ${legacyValidationPath}`);
process.exit(1);
}
const raw = fs.readFileSync(configPath, "utf8");
const parsed = JSON.parse(raw);
const moduleUrl = pathToFileURL(validationPath).href;
const { validateConfigObject } = await import(moduleUrl);
const result = validateConfigObject(parsed);
if (!result.ok) {

View File

@ -50,6 +50,7 @@ let
"oracle"
"qmd"
"nano-pdf"
"goplaces"
];
toolNamesBase = if toolNamesOverride != null then toolNamesOverride else baseNames ++ extraNames;
toolNames = builtins.filter (name: !builtins.elem name excludeToolNames) toolNamesBase;