blob: 692eaaeaa9f5b12f7644b3d93c507660b53a850a (
plain) (
blame)
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
|
{ stdenv, yarn2nix-moretea, nodejs_16 }:
let
source = builtins.fetchGit {
url = "https://git.immae.eu/github/bastienwirtz/homer.git";
ref = "gitolite_local/local_changes";
rev = "af6db21ee92824ddd9c4b9574018789619326ffc";
narHash = "sha256-TAf2oIPu5ZfRbxahAjOxwQ/z/g82pXmLPU8LhwxRgXs";
};
yarnModules = yarn2nix-moretea.mkYarnModules rec {
nodejs = nodejs_16;
name = "landing";
pname = name;
version = "v1.0.0";
packageJSON = "${source}/package.json";
yarnLock = "${source}/yarn.lock";
yarnNix = ./landing/yarn-packages.nix;
};
in
stdenv.mkDerivation rec {
pname = "landing";
version = "v1.0.0";
src = source;
buildInputs = [ yarnModules yarn2nix-moretea.yarn ];
configurePhase = ''
ln -s ${yarnModules}/node_modules .
'';
buildPhase = ''
# See https://stackoverflow.com/questions/74548318/how-to-resolve-error-error0308010cdigital-envelope-routinesunsupported-no
export NODE_OPTIONS=--openssl-legacy-provider
yarn build
'';
installPhase = ''
cp -a dist $out
cp ${./landing}/*.php $out/
ln -s service-worker.js $out/worker.js
'';
}
|