mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
lunar-client: add updateScript
This commit is contained in:
parent
03b2c6cec8
commit
539466804b
@ -10,7 +10,7 @@ let
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://launcherupdates.lunarclientcdn.com/Lunar%20Client-${version}.AppImage";
|
||||
hash = "sha256-6OAGNkMyHOZI5wh92OtalnvUVFWNAS9PvkFS0e4YXhk=";
|
||||
hash = "sha512-YUddAvsPbuuOvhJZsWDvgF/7yghABU6Av7DcKNX1bKZqE3BzMAAQADJuNuNL4+UydoTaHetXvRO8oJCbrqgtAQ==";
|
||||
};
|
||||
|
||||
appimageContents = appimageTools.extract { inherit pname version src; };
|
||||
@ -30,6 +30,8 @@ appimageTools.wrapType2 rec {
|
||||
--replace 'Icon=launcher' 'Icon=lunar-client'
|
||||
'';
|
||||
|
||||
passthru.updateScript = ./update.sh;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Free Minecraft client with mods, cosmetics, and performance boost.";
|
||||
homepage = "https://www.lunarclient.com/";
|
||||
|
12
pkgs/by-name/lu/lunar-client/update.sh
Executable file
12
pkgs/by-name/lu/lunar-client/update.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl yq
|
||||
set -eu -o pipefail
|
||||
|
||||
target="$(dirname "$(readlink -f "$0")")/package.nix"
|
||||
host="https://launcherupdates.lunarclientcdn.com"
|
||||
metadata=$(curl "$host/latest-linux.yml")
|
||||
version=$(echo "$metadata" | yq .version -r)
|
||||
sha512=$(echo "$metadata" | yq .sha512 -r)
|
||||
|
||||
sed -i "s@version = .*;@version = \"$version\";@g" "$target"
|
||||
sed -i "s@hash.* = .*;@hash = \"sha512-$sha512\";@g" "$target"
|
Loading…
Reference in New Issue
Block a user