-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
95 lines (79 loc) · 2.57 KB
/
Copy pathflake.nix
File metadata and controls
95 lines (79 loc) · 2.57 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
{
description = "Helios – Cloudflare-native Nix binary cache";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: fn nixpkgs.legacyPackages.${system});
pnpmDepsFor = pkgs: pkgs.fetchPnpmDeps {
pname = "helios";
version = "0.0.0";
src = self;
hash = "sha256-FsWEGFPLmT7jU7QIv2FGqVHOdNMUqvqmnWmog2Wpfuw=";
fetcherVersion = 3;
};
in
{
packages = forAllSystems (pkgs: {
default = pkgs.stdenv.mkDerivation {
pname = "helios";
version = "0.0.0";
src = self;
nativeBuildInputs = [
pkgs.nodejs_22
pkgs.pnpm
pkgs.pnpmConfigHook
pkgs.makeWrapper
];
pnpmDeps = pnpmDepsFor pkgs;
buildPhase = ''
pnpm --filter @helios/cli exec tsc
'';
installPhase = ''
mkdir -p $out/lib/helios $out/bin
# Copy the full workspace structure so pnpm symlinks resolve
cp -r apps $out/lib/helios/apps
cp -r packages $out/lib/helios/packages
cp -r workers $out/lib/helios/workers
cp -r node_modules $out/lib/helios/node_modules
cp package.json $out/lib/helios/package.json
makeWrapper ${pkgs.nodejs_22}/bin/node $out/bin/helios \
--add-flags "$out/lib/helios/apps/cli/dist/main.js" \
--prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.nix pkgs.zstd ]}
'';
};
});
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = [
pkgs.nodejs_22
pkgs.pnpm
pkgs.wrangler
];
};
});
checks = forAllSystems (pkgs: {
default = pkgs.stdenv.mkDerivation {
name = "helios-check";
src = self;
nativeBuildInputs = [
pkgs.nodejs_22
pkgs.pnpm
pkgs.pnpmConfigHook
];
pnpmDeps = pnpmDepsFor pkgs;
buildPhase = ''
# Domain package: full check (tsc + unit tests)
pnpm --filter @helios/cache-domain check
# Worker: type-check only (integration tests need workerd runtime)
pnpm --filter @helios/cache-worker exec tsc --noEmit
'';
installPhase = ''
touch $out
'';
};
});
};
}