hifile: make overridable

This commit is contained in:
ymstnt
2025-03-24 16:19:11 +01:00
parent d196099d3d
commit 8c30ab9133
2 changed files with 5 additions and 10 deletions
+3 -2
View File
@@ -2,15 +2,16 @@
lib,
appimageTools,
fetchurl,
version ? "0.9.9.19",
hash ? "sha256-WrPNH7N8nYr/zd6RGsX3mL1P+nYUzXMPgIoBtC6tGo0=",
}:
let
version = "0.9.9.19";
pname = "hifile";
src = fetchurl {
url = "https://www.hifile.app/files/HiFile-${version}.AppImage";
hash = "sha256-WrPNH7N8nYr/zd6RGsX3mL1P+nYUzXMPgIoBtC6tGo0=";
inherit hash;
};
appimageContents = appimageTools.extractType2 {
+2 -8
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=./. -i bash -p curl common-updater-scripts
#!nix-shell -I nixpkgs=./. -i bash -p curl nix-update
latestVersion=$(curl -s "https://www.hifile.app/otherdownloads" | grep -A 10 '<h1>All downloads</h1>' | grep -m 1 '<li>.*AppImage.*' | sed -n 's/.*HiFile-\([0-9.]*\)\.AppImage.*/\1/p')
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; hifile.version" | tr -d '"')
@@ -13,10 +13,4 @@ if [[ "$latestVersion" == "$currentVersion" ]]; then
fi
prefetch=$(nix-prefetch-url "https://www.hifile.app/files/HiFile-$latestVersion.AppImage")
hash=$(nix-hash --type sha256 --to-sri "$prefetch")
update-source-version hifile 0 "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" --system="x86_64-linux"
update-source-version hifile "$latestVersion" "$hash" --system="x86_64-linux"
nix-update hifile --version $latestVersion