- Use official ghcr.io/openclaw/openclaw image - configure via JSON config file - containerized for better isolation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
58 lines
1.3 KiB
Nix
58 lines
1.3 KiB
Nix
# OpenClaw Podman Module
|
|
# Provides: AI Agent with Discord integration running in a container
|
|
#
|
|
# Usage:
|
|
# myModules.openclaw-podman = {
|
|
# enable = true;
|
|
# port = 18789;
|
|
# domain = "openclaw.example.com";
|
|
# };
|
|
|
|
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.myModules.openclaw-podman;
|
|
in
|
|
{
|
|
options.myModules.openclaw-podman = {
|
|
enable = lib.mkEnableOption "OpenClaw AI Agent (Podman)";
|
|
|
|
port = lib.mkOption {
|
|
type = lib.types.port;
|
|
default = 18789;
|
|
description = "Gateway port for OpenClaw";
|
|
};
|
|
|
|
domain = lib.mkOption {
|
|
type = lib.types.str;
|
|
example = "openclaw.example.com";
|
|
description = "Public domain for OpenClaw";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
# Enable podman
|
|
myModules.podman.enable = true;
|
|
|
|
# OpenClaw container
|
|
virtualisation.oci-containers.containers."openclaw" = {
|
|
image = "ghcr.io/openclaw/openclaw:latest";
|
|
ports = [ "127.0.0.1:${toString cfg.port}:8080" ];
|
|
environmentFiles = [
|
|
config.sops.templates."openclaw.env".path
|
|
];
|
|
volumes = [
|
|
"${config.sops.templates."openclaw_config.json".path}:/root/.openclaw/config.json:ro"
|
|
"openclaw-data:/root/.openclaw"
|
|
];
|
|
extraOptions = [
|
|
"--network=host"
|
|
];
|
|
};
|
|
};
|
|
}
|