forked from nullclaw/nullclaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
75 lines (69 loc) · 2.01 KB
/
Copy pathflake.nix
File metadata and controls
75 lines (69 loc) · 2.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
{
description = "nullclaw";
inputs = {
zig2nix.url = "github:Cloudef/zig2nix";
treefmt-nix.url = "github:numtide/treefmt-nix";
};
outputs =
{ zig2nix, treefmt-nix, ... }:
let
flake-utils = zig2nix.inputs.flake-utils;
in
(flake-utils.lib.eachDefaultSystem (
system:
let
env = zig2nix.outputs.zig-env.${system} {
zig = zig2nix.outputs.packages.${system}.zig-latest;
};
pkgs = env.pkgs;
project = "nullclaw";
mkPackage =
{
optimize ? "ReleaseSmall",
}:
env.package {
pname = project;
src = ./.;
zigBuildZonLock = ./build.zig.zon2json-lock;
zigBuildFlags = [ "-Doptimize=${optimize}" ];
nativeBuildInputs = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [ pkgs.autoPatchelfHook ];
meta = with pkgs.lib; {
mainProgram = project;
description = "Fastest, smallest, and fully autonomous AI assistant infrastructure written in Zig ";
homepage = "https://github.com/nullclaw/nullclaw";
license = licenses.mit;
maintainers = [
{
name = "Igor Somov";
github = "DonPrus";
}
{
name = "psynyde";
github = "psynyde";
}
];
platforms = platforms.all;
};
};
in
{
packages.default = pkgs.lib.makeOverridable mkPackage { };
devShells.default = env.mkShell {
name = project;
packages = with pkgs; [
zls
];
shellHook = ''
echo -e '(¬_¬") Entered ${project} :D'
'';
};
formatter = treefmt-nix.lib.mkWrapper pkgs {
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
zig.enable = true;
};
};
}
));
}