Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
71 lines (63 loc) · 2.6 KB
/
Copy pathflake.nix
File metadata and controls
71 lines (63 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
description = "OpenClaw Dashboard — real-time bot monitoring UI (Go)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
runtimeDeps = [ pkgs.bash pkgs.git ];
in {
packages = {
# Go binary (default) — single binary, zero runtime deps
default = pkgs.buildGoModule {
pname = "openclaw-dashboard";
version = "2026.4.8";
src = ./.;
vendorHash = null; # no external deps
subPackages = [ "cmd/openclaw-dashboard" ];
ldflags = [ "-s" "-w" ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postInstall = ''
mkdir -p $out/share/openclaw-dashboard/examples
cp ${./assets/runtime/refresh.sh} $out/share/openclaw-dashboard/refresh.sh
cp ${./assets/runtime/themes.json} $out/share/openclaw-dashboard/themes.json
cp ${./assets/runtime/config.json} $out/share/openclaw-dashboard/config.json
cp ${./VERSION} $out/share/openclaw-dashboard/VERSION
cp ${./examples/config.minimal.json} $out/share/openclaw-dashboard/examples/config.minimal.json
cp ${./examples/config.full.json} $out/share/openclaw-dashboard/examples/config.full.json
chmod +x $out/share/openclaw-dashboard/refresh.sh
wrapProgram $out/bin/openclaw-dashboard \
--prefix PATH : ${pkgs.lib.makeBinPath runtimeDeps}
'';
meta = {
description = "OpenClaw real-time bot monitoring dashboard (Go)";
license = pkgs.lib.licenses.mit;
platforms = pkgs.lib.platforms.unix;
mainProgram = "openclaw-dashboard";
};
};
};
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.go
pkgs.bash pkgs.git
];
shellHook = ''
echo "OpenClaw Dashboard dev shell"
echo ""
echo " Go: go run ./cmd/openclaw-dashboard --port 8080"
echo " Build: go build -ldflags='-s -w' -o openclaw-dashboard ./cmd/openclaw-dashboard"
echo " Test: go test -race -v -count=1 ./..."
'';
};
apps = {
default = flake-utils.lib.mkApp {
drv = self.packages.${system}.default;
exePath = "/bin/openclaw-dashboard";
};
};
});
}