Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
154 lines (137 loc) · 4.14 KB
/
Copy pathflake.nix
File metadata and controls
154 lines (137 loc) · 4.14 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
{
description = "OpenSpecUI - Visual interface for spec-driven development";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ self, nixpkgs }:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
in
{
packages = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) lib;
in
{
default = pkgs.stdenv.mkDerivation (finalAttrs: {
pname = "openspecui";
version = (builtins.fromJSON (builtins.readFile ./packages/cli/package.json)).version;
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
./package.json
./pnpm-lock.yaml
./pnpm-workspace.yaml
./tsconfig.base.json
./packages/ai-provider
./packages/cli
./packages/core
./packages/search
./packages/server
./packages/web
./packages/xterm-input-panel
];
};
pnpmDeps = pkgs.fetchPnpmDeps {
inherit (finalAttrs) pname version src;
pnpm = pkgs.pnpm_10;
fetcherVersion = 3;
hash = "sha256-PiGbK2qQm5LsKuYnJV4bJdjPJSCO0fcxzufyoob7zlA=";
};
nativeBuildInputs = with pkgs; [
nodejs_24
npmHooks.npmInstallHook
pnpmConfigHook
pnpm_10
python3
pkg-config
];
buildPhase = ''
runHook preBuild
pnpm run build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/lib
mv node_modules $out/lib/
mv packages $out/lib/
mkdir -p $out/bin
cat > $out/bin/openspecui <<'EOF'
#!${pkgs.runtimeShell}
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
exec ${pkgs.nodejs_24}/bin/node "$SCRIPT_DIR/../lib/packages/cli/dist/cli.mjs" "$@"
EOF
chmod +x $out/bin/openspecui
runHook postInstall
'';
dontNpmBuild = true;
dontNpmPrune = true;
dontStrip = true;
dontPatchShebangs = true;
strictDeps = true;
meta = with pkgs.lib; {
description = "Visual interface for spec-driven development";
homepage = "https://github.com/jixoai/openspecui";
license = licenses.mit;
maintainers = [ ];
mainProgram = "openspecui";
};
});
}
);
apps = forAllSystems (system: {
default = {
type = "app";
program = "${self.packages.${system}.default}/bin/openspecui";
};
openspecui = {
type = "app";
program = "${self.packages.${system}.default}/bin/openspecui";
};
});
checks = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
openspecui = self.packages.${system}.default;
in
{
openspecui-version = pkgs.runCommand "openspecui-version-check" { nativeBuildInputs = [ openspecui ]; } ''
openspecui --version >/dev/null
touch $out
'';
}
);
devShells = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.mkShell {
buildInputs = with pkgs; [
nodejs_24
pnpm_10
bun
];
shellHook = ''
echo "OpenSpecUI development environment"
echo "Node version: $(node --version)"
echo "pnpm version: $(pnpm --version)"
echo "bun version: $(bun --version)"
'';
};
}
);
};
}