-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathflake.nix
More file actions
159 lines (146 loc) · 4.27 KB
/
flake.nix
File metadata and controls
159 lines (146 loc) · 4.27 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
{
description = "forge: AI enabled pair programmer for Claude, GPT, O Series, Grok, Deepseek, Gemini and 300+ models";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in
{
formatter = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
in
pkgs.nixfmt-rfc-style
);
packages = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
lib = pkgs.lib;
src = lib.cleanSourceWith {
src = ./.;
filter = path: type:
lib.cleanSourceFilter path type
&& baseNameOf path != "target"
&& baseNameOf path != "result";
};
forge = pkgs.rustPlatform.buildRustPackage {
pname = "forge";
version = "0.1.0-dev";
inherit src;
cargoLock = {
lockFile = ./Cargo.lock;
allowBuiltinFetchGit = true;
};
cargoBuildFlags = [
"-p"
"forge_main"
"--bin"
"forge"
];
cargoInstallFlags = [
"-p"
"forge_main"
"--bin"
"forge"
];
nativeBuildInputs = [
pkgs.cmake
pkgs.nasm
pkgs.perl
pkgs.pkg-config
pkgs.protobuf
];
buildInputs =
[ pkgs.sqlite ]
++ lib.optionals pkgs.stdenv.isLinux [
pkgs.libxkbcommon
pkgs.libx11
pkgs.libxext
pkgs.libxfixes
pkgs.libxcb
pkgs.wayland
]
++ lib.optionals pkgs.stdenv.isDarwin [
pkgs.libiconv
pkgs.apple-sdk
];
PROTOC = "${pkgs.protobuf}/bin/protoc";
PROTOC_INCLUDE = "${pkgs.protobuf}/include";
APP_VERSION = "0.1.0-dev";
doCheck = false;
meta = {
description = "forge: AI enabled pair programmer for Claude, GPT, O Series, Grok, Deepseek, Gemini and 300+ models";
homepage = "https://forgecode.dev";
license = lib.licenses.mit;
mainProgram = "forge";
platforms = lib.platforms.unix;
};
};
in
{
default = forge;
forge = forge;
}
);
apps = forAllSystems (system: {
default = {
type = "app";
program = "${self.packages.${system}.default}/bin/forge";
};
forge = {
type = "app";
program = "${self.packages.${system}.forge}/bin/forge";
};
});
devShells = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
lib = pkgs.lib;
in
{
default = pkgs.mkShell {
packages =
[
pkgs.cargo
pkgs.cargo-insta
pkgs.cargo-llvm-cov
pkgs.clippy
pkgs.cmake
pkgs.nasm
pkgs.perl
pkgs.pkg-config
pkgs.protobuf
pkgs.rust-analyzer
pkgs.rustc
pkgs.rustfmt
pkgs.sqlite
]
++ lib.optionals pkgs.stdenv.isLinux [
pkgs.libxkbcommon
pkgs.libx11
pkgs.libxext
pkgs.libxfixes
pkgs.libxcb
pkgs.wayland
]
++ lib.optionals pkgs.stdenv.isDarwin [
pkgs.libiconv
pkgs.darwin.apple_sdk.frameworks.AppKit
pkgs.darwin.apple_sdk.frameworks.CoreGraphics
pkgs.darwin.apple_sdk.frameworks.Foundation
];
PROTOC = "${pkgs.protobuf}/bin/protoc";
PROTOC_INCLUDE = "${pkgs.protobuf}/include";
APP_VERSION = "0.1.0-dev";
};
});
};
}