Autoupdate swayimg
This commit is contained in:
parent
4c08a978e0
commit
ab2ae28c47
|
@ -2,15 +2,18 @@
|
|||
, makeDesktopItem, wayland, wayland-protocols, json_c, libxkbcommon, fontconfig
|
||||
, giflib, libjpeg, libjxl, libpng, librsvg, libwebp, libheif, libtiff, libexif
|
||||
, bash-completion, ... }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
let
|
||||
vals = builtins.fromJSON (builtins.readFile ../../sources/swayimg.json);
|
||||
version = vals.version;
|
||||
url = vals.url;
|
||||
hash = vals.hash;
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "swayimg";
|
||||
version = "1.11";
|
||||
inherit version;
|
||||
|
||||
src = fetchurl {
|
||||
url =
|
||||
"https://github.com/artemsen/swayimg/archive/refs/tags/v${version}.tar.gz";
|
||||
hash = "sha256-t4U0F8rzySgZUQdkTfMbqAqQb8PsyhgNsoQau/rCdzY=";
|
||||
inherit url;
|
||||
inherit hash;
|
||||
name = "${pname}-${version}.tar.gz";
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"version": "1.11",
|
||||
"url": "https://github.com/artemsen/swayimg/archive/refs/tags/v1.11.tar.gz",
|
||||
"hash": "sha256-t4U0F8rzySgZUQdkTfMbqAqQb8PsyhgNsoQau/rCdzY="
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -exou pipefail
|
||||
|
||||
DIRECTORY=$(realpath "$(dirname "$0")")
|
||||
|
||||
# Update swayimg
|
||||
SWAYIMG_VERSION=$(curl https://api.github.com/repos/artemsen/swayimg/tags | jq -r ".[0].name" | tr -d "v")
|
||||
SWAYIMG_URL="https://github.com/artemsen/swayimg/archive/refs/tags/v$SWAYIMG_VERSION.tar.gz"
|
||||
SWAYIMG_HASH=$(nix-prefetch fetchurl --url "$SWAYIMG_URL" -s)
|
||||
jq --null-input \
|
||||
--arg version "$SWAYIMG_VERSION" \
|
||||
--arg url "$SWAYIMG_URL" \
|
||||
--arg hash "$SWAYIMG_HASH" \
|
||||
'{"version": $version, "url": $url, "hash": $hash}' \
|
||||
> $DIRECTORY/swayimg.json
|
Loading…
Reference in New Issue