]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - systems/eldiron/websites/tools/landing.nix
Squash changes containing private information
[perso/Immae/Config/Nix.git] / systems / eldiron / websites / tools / landing.nix
diff --git a/systems/eldiron/websites/tools/landing.nix b/systems/eldiron/websites/tools/landing.nix
new file mode 100644 (file)
index 0000000..f5d851e
--- /dev/null
@@ -0,0 +1,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 = "bb60c5b869931f305f15c5bfa9cdb3f68702f01f";
+    narHash = "sha256-xBIBUJhQ7KPY0d92pW9ErA9OvGafWcxyuGkbHShF4Bs=";
+  };
+  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
+    '';
+  }