about summary refs log tree commit diff
path: root/pkgs/by-name/rm/rmfakecloud/webui.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/rm/rmfakecloud/webui.nix')
-rw-r--r--pkgs/by-name/rm/rmfakecloud/webui.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/pkgs/by-name/rm/rmfakecloud/webui.nix b/pkgs/by-name/rm/rmfakecloud/webui.nix
new file mode 100644
index 0000000000000..98c4822a90b3a
--- /dev/null
+++ b/pkgs/by-name/rm/rmfakecloud/webui.nix
@@ -0,0 +1,37 @@
+{ version, src, stdenv, lib, fetchYarnDeps, fixup-yarn-lock, yarn, nodejs }:
+
+stdenv.mkDerivation rec {
+  inherit version src;
+
+  pname = "rmfakecloud-webui";
+
+  yarnOfflineCache = fetchYarnDeps {
+    yarnLock = "${src}/ui/yarn.lock";
+    sha256 = "sha256-JLCrpzytMKejmW+WlM6yybsoIZiimiJdPG5dSIn1L14=";
+  };
+
+  nativeBuildInputs = [ fixup-yarn-lock yarn nodejs ];
+
+  buildPhase = ''
+    export HOME=$(mktemp -d)
+    cd ui
+    fixup-yarn-lock yarn.lock
+    yarn config --offline set yarn-offline-mirror ${yarnOfflineCache}
+    yarn install --offline --frozen-lockfile --ignore-engines --ignore-scripts --no-progress
+    patchShebangs node_modules
+    export PATH=$PWD/node_modules/.bin:$PATH
+    ./node_modules/.bin/react-scripts build
+    mkdir -p $out
+    cd ..
+  '';
+
+  installPhase = ''
+    cp -r ui/build/* $out
+  '';
+
+  meta = with lib; {
+    description = "Only the webui files for rmfakecloud";
+    homepage = "https://ddvk.github.io/rmfakecloud/";
+    license = licenses.agpl3Only;
+  };
+}