Autoupdate swayimg
This commit is contained in:
parent
4c08a978e0
commit
ab2ae28c47
|
@ -2,15 +2,18 @@
|
||||||
, makeDesktopItem, wayland, wayland-protocols, json_c, libxkbcommon, fontconfig
|
, makeDesktopItem, wayland, wayland-protocols, json_c, libxkbcommon, fontconfig
|
||||||
, giflib, libjpeg, libjxl, libpng, librsvg, libwebp, libheif, libtiff, libexif
|
, giflib, libjpeg, libjxl, libpng, librsvg, libwebp, libheif, libtiff, libexif
|
||||||
, bash-completion, ... }:
|
, bash-completion, ... }:
|
||||||
|
let
|
||||||
stdenv.mkDerivation rec {
|
vals = builtins.fromJSON (builtins.readFile ../../sources/swayimg.json);
|
||||||
|
version = vals.version;
|
||||||
|
url = vals.url;
|
||||||
|
hash = vals.hash;
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
pname = "swayimg";
|
pname = "swayimg";
|
||||||
version = "1.11";
|
inherit version;
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url =
|
inherit url;
|
||||||
"https://github.com/artemsen/swayimg/archive/refs/tags/v${version}.tar.gz";
|
inherit hash;
|
||||||
hash = "sha256-t4U0F8rzySgZUQdkTfMbqAqQb8PsyhgNsoQau/rCdzY=";
|
|
||||||
name = "${pname}-${version}.tar.gz";
|
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