about summary refs log tree commit diff
path: root/pkgs/applications/misc/ArchiSteamFarm/web-ui/update.sh
diff options
context:
space:
mode:
authorlegendofmiracles2021-11-24 09:54:57 -0600
committerlegendofmiracles2022-01-05 14:09:24 -0600
commit98ccbafb0597848e4cb90688c4f7d679b5242a6a (patch)
treec946e1a561c69914328eaba97d1c242f61e08993 /pkgs/applications/misc/ArchiSteamFarm/web-ui/update.sh
parentbf30cd48ed498bafa56831f687299cba0a94e0eb (diff)
ASF-ui: init
Diffstat (limited to 'pkgs/applications/misc/ArchiSteamFarm/web-ui/update.sh')
-rwxr-xr-xpkgs/applications/misc/ArchiSteamFarm/web-ui/update.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/pkgs/applications/misc/ArchiSteamFarm/web-ui/update.sh b/pkgs/applications/misc/ArchiSteamFarm/web-ui/update.sh
new file mode 100755
index 000000000000..05d546006216
--- /dev/null
+++ b/pkgs/applications/misc/ArchiSteamFarm/web-ui/update.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env nix-shell
+#! nix-shell -i bash -p nodePackages.node2nix jq curl
+
+version=$(nix-instantiate --strict --eval -A ArchiSteamFarm.version | jq -r)
+ui=$(curl https://api.github.com/repos/JustArchiNET/ArchiSteamFarm/contents/ASF-ui?ref=${version} | jq -r .sha)
+
+pushd $(dirname "$0")
+
+# update-source-version doesn't work for some reason
+sed -i "s/rev\\s*=\\s*.*/rev = \"$ui\";/" default.nix
+sed -i "s/sha256\\s*=\\s*.*/sha256 = \"$(nix-prefetch-url --unpack https://github.com/JustArchiNET/ASF-ui/archive/$ui.tar.gz)\";/" default.nix
+
+curl https://raw.githubusercontent.com/JustArchiNET/ASF-ui/${ui}/package-lock.json -o package-lock.json
+curl https://raw.githubusercontent.com/JustArchiNET/ASF-ui/${ui}/package.json -o package.json
+
+
+node2nix \
+  --nodejs-14 \
+  --development \
+  --lock package-lock.json \
+  --node-env ../../../../development/node-packages/node-env.nix \
+  --output node-packages.nix \
+  --composition node-composition.nix \
+
+popd
+rm package.json package-lock.json