X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=systems%2Feldiron%2Fwebsites%2Ftools%2Flanding.nix;h=f5d851e2adb5f45e38525e7b9f4994a9a1f6a61e;hb=1a64deeb894dc95e2645a75771732c6cc53a79ad;hpb=fa25ffd4583cc362075cd5e1b4130f33306103f0;p=perso%2FImmae%2FConfig%2FNix.git 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 @@ +{ 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 + ''; + }