-
Notifications
You must be signed in to change notification settings - Fork 42
/
static.nix
35 lines (34 loc) · 1018 Bytes
/
static.nix
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
{ stdenv, yarn, nodejs, offlinecache
, cardanoEra ? "byron"
, cardanoNetwork ? "mainnet"
, graphqlApiProtocol ? "https"
, graphqlApiHost ? "localhost"
, graphqlApiPort ? 443
, graphqlApiPath ? "graphql"
, gaTrackingId ? null
, src
}:
stdenv.mkDerivation {
name = "static-export";
inherit src;
buildInputs = [ yarn nodejs ];
CARDANO_ERA = cardanoEra;
CARDANO_NETWORK = cardanoNetwork;
GRAPHQL_API_PROTOCOL = graphqlApiProtocol;
GRAPHQL_API_HOST = graphqlApiHost;
GRAPHQL_API_PORT = graphqlApiPort;
GRAPHQL_API_PATH = graphqlApiPath;
GA_TRACKING_ID = gaTrackingId;
buildCommand = ''
export HOME=$PWD/yarn_home
unpackPhase
cd $sourceRoot
export CYPRESS_INSTALL_BINARY=0
yarn config set yarn-offline-mirror ${offlinecache}
yarn install --offline --frozen-lockfile --ignore-engines --ignore-scripts
export PATH="$PATH:node_modules/.bin"
patchShebangs node_modules/
NODE_ENV=production yarn --offline run build
yarn run next export source --outdir $out
'';
}