-
-
Notifications
You must be signed in to change notification settings - Fork 156
Expand file tree
/
Copy pathflake.nix
More file actions
127 lines (120 loc) · 4.01 KB
/
flake.nix
File metadata and controls
127 lines (120 loc) · 4.01 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
{
description = "nix-openclaw: declarative OpenClaw packaging";
nixConfig = {
extra-substituters = [ "https://cache.garnix.io" ];
extra-trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nix-steipete-tools.url = "github:openclaw/nix-steipete-tools";
};
outputs =
{
self,
nixpkgs,
flake-utils,
home-manager,
nix-steipete-tools,
}:
let
overlay = import ./nix/overlay.nix;
sourceInfoStable = import ./nix/sources/openclaw-source.nix;
systems = [
"x86_64-linux"
"aarch64-darwin"
];
in
flake-utils.lib.eachSystem systems (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ overlay ];
};
steipetePkgs =
if nix-steipete-tools ? packages && builtins.hasAttr system nix-steipete-tools.packages then
nix-steipete-tools.packages.${system}
else
{ };
packageSetStable = import ./nix/packages {
pkgs = pkgs;
sourceInfo = sourceInfoStable;
steipetePkgs = steipetePkgs;
};
in
{
formatter = pkgs.nixfmt-tree.override {
settings = {
global.excludes = [ "nix/generated/openclaw-config-options.nix" ];
};
};
packages = packageSetStable // {
default = packageSetStable.openclaw;
};
apps = {
openclaw = flake-utils.lib.mkApp { drv = packageSetStable.openclaw-gateway; };
};
checks =
let
baseChecks = {
gateway = packageSetStable.openclaw-gateway;
package-contents = pkgs.callPackage ./nix/checks/openclaw-package-contents.nix {
openclawGateway = packageSetStable.openclaw-gateway;
};
config-validity = pkgs.callPackage ./nix/checks/openclaw-config-validity.nix {
openclawGateway = packageSetStable.openclaw-gateway;
};
}
// (
if pkgs.stdenv.hostPlatform.isLinux then
{
gateway-tests = pkgs.callPackage ./nix/checks/openclaw-gateway-tests.nix {
sourceInfo = sourceInfoStable;
};
config-options = pkgs.callPackage ./nix/checks/openclaw-config-options.nix {
sourceInfo = sourceInfoStable;
};
default-instance = pkgs.callPackage ./nix/checks/openclaw-default-instance.nix { };
hm-activation = import ./nix/checks/openclaw-hm-activation.nix {
inherit pkgs home-manager;
};
}
else
{ }
);
in
baseChecks
// {
# CI aggregator: build the expensive gateway once, then run all checks in the
# same build machine/store to avoid cache-miss races between parallel jobs.
ci = pkgs.symlinkJoin {
name = "nix-openclaw-ci";
paths = [
packageSetStable.openclaw
packageSetStable.openclaw-gateway
packageSetStable.openclaw-tools
]
++ (builtins.attrValues baseChecks);
};
};
devShells.default = pkgs.mkShell {
packages = [
pkgs.git
pkgs.nixfmt-tree
pkgs.nil
];
};
}
)
// {
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;
};
}