feat(qbit): add vuetorrent update script
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-03-28 13:51:07 -04:00
parent 7540add6ee
commit 2f497101fa
3 changed files with 43 additions and 12 deletions

View file

@ -7,19 +7,23 @@
cfg = config.services.qbittorrent; cfg = config.services.qbittorrent;
pkg = pkgs.qbittorrent-nox; pkg = pkgs.qbittorrent-nox;
vue = pkgs.stdenv.mkDerivation { vue = let
name = "vuetorrent"; gen = import ./vuetorrent.nix;
nativeBuildInputs = [pkgs.unzip]; in
buildInputs = [pkgs.unzip]; pkgs.stdenv.mkDerivation {
src = pkgs.fetchurl { name = "vuetorrent";
url = "https://github.com/VueTorrent/VueTorrent/releases/download/v2.7.1/vuetorrent.zip"; inherit (gen) version;
hash = "sha256-/6biiWVgYQF7SpiY3JmcW4NDAvePLwPyD+j12/BqPIE=";
nativeBuildInputs = [pkgs.unzip];
src = pkgs.fetchurl {
inherit (gen) url hash;
};
postInstall = ''
mkdir $out
cp -a ./* $out
'';
}; };
postInstall = ''
mkdir $out
cp -a ./* $out
'';
};
inherit inherit
(lib) (lib)

View file

@ -0,0 +1,6 @@
# This file was autogenerated. DO NOT EDIT!
{
version = "2.7.2";
url = "https://github.com/VueTorrent/VueTorrent/releases/download/v2.7.2/vuetorrent.zip";
hash = "sha256-G7LkoQmTR9ilygPPrip+f/LnpEXaeWcb+xcBWIz98A8=";
}

View file

@ -55,15 +55,36 @@ updateFirefoxAddons() {
) )
} }
updateVuetorrent() {
FILE="$FLAKE/devices/nos/modules/qbittorrent/vuetorrent.nix"
release=$(curl -s https://api.github.com/repos/VueTorrent/VueTorrent/releases/latest)
version=$(echo "$release" | jq -r .tag_name | tr -d v)
url="https://github.com/VueTorrent/VueTorrent/releases/download/v${version}/vuetorrent.zip"
hash="$(nix store prefetch-file --refresh --json \
--hash-type sha256 "$url" --name "escaped" | jq -r .hash)"
{
echo '# This file was autogenerated. DO NOT EDIT!'
echo '{'
echo " version = \"$version\";"
echo " url = \"$url\";"
echo " hash = \"$hash\";"
echo '}'
} >"$FILE"
}
doAll() { doAll() {
updateFFZ updateFFZ
updateFirefoxAddons updateFirefoxAddons
updateVuetorrent
} }
[[ "$1" == "-a" || "$1" == "--all" ]] && doAll [[ "$1" == "-a" || "$1" == "--all" ]] && doAll
[[ "$1" == "-f" || "$1" == "--firefox" ]] && updateFirefoxAddons [[ "$1" == "-f" || "$1" == "--firefox" ]] && updateFirefoxAddons
[[ "$1" == "-ffz" || "$1" == "--frankerfacez" ]] && updateFFZ [[ "$1" == "-ffz" || "$1" == "--frankerfacez" ]] && updateFFZ
[[ "$1" == "-v" || "$1" == "--vuetorrent" ]] && updateVuetorrent
alejandra "$FLAKE" alejandra "$FLAKE"