Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
};
config-validity = pkgs.callPackage ./nix/checks/openclaw-config-validity.nix {
openclawGateway = packageSetStable.openclaw-gateway;
steipeteToolsInput = nix-steipete-tools;
};
}
// (
Expand All @@ -84,10 +85,14 @@
};
config-options = pkgs.callPackage ./nix/checks/openclaw-config-options.nix {
sourceInfo = sourceInfoStable;
steipeteToolsInput = nix-steipete-tools;
};
default-instance = pkgs.callPackage ./nix/checks/openclaw-default-instance.nix {
steipeteToolsInput = nix-steipete-tools;
};
default-instance = pkgs.callPackage ./nix/checks/openclaw-default-instance.nix { };
hm-activation = import ./nix/checks/openclaw-hm-activation.nix {
inherit pkgs home-manager;
steipeteToolsInput = nix-steipete-tools;
};
}
else
Expand Down Expand Up @@ -121,7 +126,11 @@
// {
overlays.default = overlay;
nixosModules.openclaw-gateway = import ./nix/modules/nixos/openclaw-gateway.nix;
homeManagerModules.openclaw = import ./nix/modules/home-manager/openclaw.nix;
darwinModules.openclaw = import ./nix/modules/darwin/openclaw.nix;
homeManagerModules.openclaw = {
_module.args.steipeteToolsInput = nix-steipete-tools;
imports = [ ./nix/modules/home-manager/openclaw ];
};
darwinModules.openclaw =
import ./nix/modules/darwin/openclaw.nix { inherit nix-steipete-tools; };
};
}
4 changes: 3 additions & 1 deletion nix/checks/openclaw-config-options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
pkgs,
stdenv,
fetchFromGitHub,
steipeteToolsInput,
fetchurl,
nodejs_22,
pnpm_10,
Expand Down Expand Up @@ -76,7 +77,8 @@ let
pluginEval = lib.evalModules {
modules = [
stubModule
../modules/home-manager/openclaw.nix
{ _module.args.steipeteToolsInput = steipeteToolsInput; }
../modules/home-manager/openclaw
(
{ lib, options, ... }:
{
Expand Down
4 changes: 3 additions & 1 deletion nix/checks/openclaw-config-validity.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
stdenv,
nodejs_22,
openclawGateway,
steipeteToolsInput,
}:

let
Expand Down Expand Up @@ -61,7 +62,8 @@ let
moduleEval = lib.evalModules {
modules = [
stubModule
../modules/home-manager/openclaw.nix
{ _module.args.steipeteToolsInput = steipeteToolsInput; }
../modules/home-manager/openclaw
(
{ lib, ... }:
{
Expand Down
4 changes: 3 additions & 1 deletion nix/checks/openclaw-default-instance.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
pkgs,
stdenv,
steipeteToolsInput,
}:

let
Expand Down Expand Up @@ -59,7 +60,8 @@ let
eval = lib.evalModules {
modules = [
stubModule
../modules/home-manager/openclaw.nix
{ _module.args.steipeteToolsInput = steipeteToolsInput; }
../modules/home-manager/openclaw
(
{ lib, ... }:
{
Expand Down
7 changes: 5 additions & 2 deletions nix/checks/openclaw-hm-activation.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{ pkgs, home-manager }:
{ pkgs, home-manager, steipeteToolsInput }:

let
openclawModule = ../modules/home-manager/openclaw.nix;
openclawModule = {
_module.args.steipeteToolsInput = steipeteToolsInput;
imports = [ ../modules/home-manager/openclaw ];
};
testScript = builtins.readFile ../tests/hm-activation.py;

in
Expand Down
8 changes: 7 additions & 1 deletion nix/modules/darwin/openclaw.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{ nix-steipete-tools }:
{ config, lib, ... }:

{
config = lib.mkIf (config ? home-manager) {
home-manager.sharedModules = [ ../home-manager/openclaw.nix ];
home-manager.sharedModules = [
{
_module.args.steipeteToolsInput = nix-steipete-tools;
imports = [ ../home-manager/openclaw ];
}
];
};
}
4 changes: 3 additions & 1 deletion nix/modules/home-manager/openclaw/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
config,
lib,
pkgs,
steipeteToolsInput,
...
}:

let
openclawLib = import ./lib.nix { inherit config lib pkgs; };
openclawLib = import ./lib.nix { inherit config lib pkgs steipeteToolsInput; };
cfg = openclawLib.cfg;
homeDir = openclawLib.homeDir;
appPackage = openclawLib.appPackage;
Expand Down Expand Up @@ -51,6 +52,7 @@ let
pkgs
openclawLib
enabledInstances
steipeteToolsInput
;
};

Expand Down
10 changes: 5 additions & 5 deletions nix/modules/home-manager/openclaw/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
config,
lib,
pkgs,
steipeteToolsInput,
}:

let
Expand All @@ -26,11 +27,10 @@ let

bundledPluginSources =
let
stepieteRev = "c110209720cbc6c87fccb6c1e1c2b79b1d719245";
stepieteNarHash = "sha256-1Vo7rcLGdKaqj39J3HhBKh8IbljSjgCUhinCFJbDPl8=";
stepiete =
tool:
"github:openclaw/nix-steipete-tools?dir=tools/${tool}&rev=${stepieteRev}&narHash=${stepieteNarHash}";
# Use a "bundled:" URI scheme that plugins.nix resolves by importing the
# sub-flake directly from the nix-steipete-tools source tree, avoiding
# builtins.getFlake and its lockfile warnings.
stepiete = tool: "bundled:steipete/${tool}";
in
lib.mapAttrs (_name: plugin: plugin.source or (stepiete plugin.tool)) pluginCatalog;

Expand Down
3 changes: 2 additions & 1 deletion nix/modules/home-manager/openclaw/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
config,
lib,
pkgs,
steipeteToolsInput,
...
}:

let
openclawLib = import ./lib.nix { inherit config lib pkgs; };
openclawLib = import ./lib.nix { inherit config lib pkgs steipeteToolsInput; };
instanceModule = import ./options-instance.nix { inherit lib openclawLib; };
pluginCatalog = import ./plugin-catalog.nix;
mkSkillOption = lib.types.submodule {
Expand Down
23 changes: 22 additions & 1 deletion nix/modules/home-manager/openclaw/plugins.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,37 @@
pkgs,
openclawLib,
enabledInstances,
steipeteToolsInput,
}:

let
resolvePath = openclawLib.resolvePath;
toRelative = openclawLib.toRelative;

# Resolve a "bundled:steipete/<tool>" source by importing the sub-flake
# directly from the steipeteToolsInput source tree instead of calling
# builtins.getFlake with a URL (which requires a committed flake.lock in
# every sub-flake directory to avoid warnings).
resolveBundledFlake =
source:
let
tool = lib.removePrefix "bundled:steipete/" source;
subFlakeNix = import "${steipeteToolsInput}/tools/${tool}/flake.nix";
in
subFlakeNix.outputs {
self = { };
nixpkgs = { inherit lib; };
root = steipeteToolsInput;
};

resolvePlugin =
plugin:
let
flake = builtins.getFlake plugin.source;
flake =
if lib.hasPrefix "bundled:" plugin.source then
resolveBundledFlake plugin.source
else
builtins.getFlake plugin.source;
system = pkgs.stdenv.hostPlatform.system;
openclawPluginRaw =
if flake ? openclawPlugin then
Expand Down