forked from byronanthonymartinez-only/union
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsite.nix
More file actions
75 lines (73 loc) · 1.74 KB
/
Copy pathsite.nix
File metadata and controls
75 lines (73 loc) · 1.74 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
_: {
perSystem =
{
pkgs,
mkCi,
ensureAtRepositoryRoot,
buildPnpmPackage,
...
}:
let
deps = with pkgs; [
python3
stdenv.cc
pkg-config
];
in
{
packages = {
site = mkCi false (buildPnpmPackage {
hash = "sha256-QQtlK9xlLoxkTgpEoHFExYcj+/Y+KjU1Uy4tVbnXdeI=";
packageJsonPath = ./package.json;
extraSrcs = [
../site
];
pnpmWorkspaces = [
"site"
];
buildInputs = deps;
nativeBuildInputs = deps;
buildPhase = ''
runHook preBuild
export PUPPETEER_SKIP_DOWNLOAD=1;
export ASTRO_TELEMETRY_DISABLED=1;
export NODE_OPTIONS="--no-warnings";
pnpm --filter=site build
runHook postBuild
'';
installPhase = ''
mkdir -p $out
cp -r ./site/.vercel/output/* $out
'';
doDist = false;
});
};
apps = {
site-dev-server = {
type = "app";
program = pkgs.writeShellApplication {
name = "site-dev-server";
runtimeInputs = deps;
text = ''
${ensureAtRepositoryRoot}
cd site/
export PUPPETEER_SKIP_DOWNLOAD=1
pnpm install
pnpm dev -- --host
'';
};
};
site-check = {
type = "app";
program = pkgs.writeShellApplication {
name = "site-check";
text = ''
${ensureAtRepositoryRoot}
cd site/
npm_config_yes=true npx astro check
'';
};
};
};
};
}