forked from zeroclaw-labs/zeroclaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
105 lines (102 loc) · 3.79 KB
/
Copy pathflake.nix
File metadata and controls
105 lines (102 loc) · 3.79 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
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "nixpkgs/nixos-unstable";
};
outputs = { flake-utils, fenix, nixpkgs, ... }:
let
nixosModule = { pkgs, ... }: {
nixpkgs.overlays = [ fenix.overlays.default ];
environment.systemPackages = [
(pkgs.fenix.stable.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
])
pkgs.rust-analyzer
];
};
in
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ fenix.overlays.default ];
};
rustToolchain = pkgs.fenix.stable.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
];
nixosModuleEvalTests = import ./nix/eval-tests.nix {
inherit nixpkgs system;
};
# >>> generated:flake-packages by `cargo generate installers` - do not edit <<<
# Default feature set: canonical lean Dist.
# Override with `packages.zeroclaw.override { features = [ ... ]; }`.
zeroclawDefaultFeatures = [ "acp-bridge" "agent-runtime" "channel-acp-server" "channel-discord" "channel-email" "channel-filesystem" "channel-lark" "channel-matrix" "channel-telegram" "channel-webhook" "gateway" "observability-prometheus" "schema-export" "whatsapp-web" ];
buildZeroclaw = { pname, cargoPkg, features ? zeroclawDefaultFeatures }:
(pkgs.makeRustPlatform {
cargo = rustToolchain;
rustc = rustToolchain;
}).buildRustPackage {
inherit pname;
version = "0.8.3";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = builtins.fromJSON (builtins.readFile ./nix/hashes.json);
};
cargoBuildFlags =
[ "-p" cargoPkg "--no-default-features" ]
++ pkgs.lib.optionals (features != [])
[ "--features" (pkgs.lib.concatStringsSep "," features) ];
doCheck = false;
buildInputs = [ pkgs.stdenv.cc.cc ];
};
# >>> end generated:flake-packages <<<
in {
packages.zeroclaw = buildZeroclaw { pname = "zeroclaw"; cargoPkg = "zeroclawlabs"; };
packages.zerocode = buildZeroclaw { pname = "zerocode"; cargoPkg = "zerocode"; };
packages.default = buildZeroclaw { pname = "zeroclaw"; cargoPkg = "zeroclawlabs"; };
checks = pkgs.lib.optionalAttrs pkgs.stdenv.isLinux {
nixos-module-eval = pkgs.writeText "zeroclaw-nixos-module-eval" (
builtins.toJSON nixosModuleEvalTests
);
};
devShells.default = pkgs.mkShell {
packages = [
rustToolchain
pkgs.rust-analyzer
pkgs.nix-prefetch-git
pkgs.jq
];
};
}) // {
# The `services.zeroclaw` NixOS module (multi-instance; see nix/module.nix
# and nix/README.md). Exposed as the default so `nixosModules.default` can
# be imported directly into a system configuration.
nixosModules.default = import ./nix/module.nix;
# Toolchain test systems used to evaluate the dev-shell module on both
# supported Linux architectures; not a deployment target. The `checks`
# output evaluates these in CI.
nixosConfigurations = {
nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ nixosModule ];
};
nixos-aarch64 = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [ nixosModule ];
};
};
};
}