diff options
Diffstat (limited to 'systems/eldiron/websites/tools/landing.nix')
-rw-r--r-- | systems/eldiron/websites/tools/landing.nix | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/systems/eldiron/websites/tools/landing.nix b/systems/eldiron/websites/tools/landing.nix new file mode 100644 index 0000000..f5d851e --- /dev/null +++ b/systems/eldiron/websites/tools/landing.nix | |||
@@ -0,0 +1,38 @@ | |||
1 | { stdenv, yarn2nix-moretea, nodejs_16 }: | ||
2 | let | ||
3 | source = builtins.fetchGit { | ||
4 | url = "https://git.immae.eu/github/bastienwirtz/homer.git"; | ||
5 | ref = "gitolite_local/local_changes"; | ||
6 | rev = "bb60c5b869931f305f15c5bfa9cdb3f68702f01f"; | ||
7 | narHash = "sha256-xBIBUJhQ7KPY0d92pW9ErA9OvGafWcxyuGkbHShF4Bs="; | ||
8 | }; | ||
9 | yarnModules = yarn2nix-moretea.mkYarnModules rec { | ||
10 | nodejs = nodejs_16; | ||
11 | name = "landing"; | ||
12 | pname = name; | ||
13 | version = "v1.0.0"; | ||
14 | packageJSON = "${source}/package.json"; | ||
15 | yarnLock = "${source}/yarn.lock"; | ||
16 | yarnNix = ./landing/yarn-packages.nix; | ||
17 | }; | ||
18 | in | ||
19 | stdenv.mkDerivation rec { | ||
20 | pname = "landing"; | ||
21 | version = "v1.0.0"; | ||
22 | src = source; | ||
23 | |||
24 | buildInputs = [ yarnModules yarn2nix-moretea.yarn ]; | ||
25 | configurePhase = '' | ||
26 | ln -s ${yarnModules}/node_modules . | ||
27 | ''; | ||
28 | buildPhase = '' | ||
29 | # See https://stackoverflow.com/questions/74548318/how-to-resolve-error-error0308010cdigital-envelope-routinesunsupported-no | ||
30 | export NODE_OPTIONS=--openssl-legacy-provider | ||
31 | yarn build | ||
32 | ''; | ||
33 | installPhase = '' | ||
34 | cp -a dist $out | ||
35 | cp ${./landing}/*.php $out/ | ||
36 | ln -s service-worker.js $out/worker.js | ||
37 | ''; | ||
38 | } | ||