Add OH-addons package
This commit is contained in:
9
openhab-addons.nix
Normal file
9
openhab-addons.nix
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{ fetchurl }:
|
||||||
|
|
||||||
|
let
|
||||||
|
version = builtins.readFile ./version;
|
||||||
|
sha256 = builtins.readFile ./openhab-addons.sha256;
|
||||||
|
in fetchurl {
|
||||||
|
url = "https://github.com/openhab/openhab-distro/releases/download/${version}/openhab-addons-${version}.kar";
|
||||||
|
inherit sha256;
|
||||||
|
}
|
||||||
1
openhab-addons.sha256
Normal file
1
openhab-addons.sha256
Normal file
@@ -0,0 +1 @@
|
|||||||
|
730b96b8acf84f44ed9df46cd58f1bd2e6afd3b498abe62f796da074ca932594
|
||||||
@@ -9,12 +9,15 @@
|
|||||||
stdenv,
|
stdenv,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let
|
||||||
pname = "openhab";
|
|
||||||
version = builtins.readFile ./version;
|
version = builtins.readFile ./version;
|
||||||
|
sha256 = builtins.readFile ./openhab.sha256;
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
|
inherit version;
|
||||||
|
pname = "openhab";
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://github.com/openhab/openhab-distro/releases/download/${version}/openhab-${version}.tar.gz";
|
url = "https://github.com/openhab/openhab-distro/releases/download/${version}/openhab-${version}.tar.gz";
|
||||||
sha256 = builtins.readFile ./sha256;
|
inherit sha256;
|
||||||
};
|
};
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
buildInputs = [ bash ];
|
buildInputs = [ bash ];
|
||||||
|
|||||||
1
openhab.sha256
Normal file
1
openhab.sha256
Normal file
@@ -0,0 +1 @@
|
|||||||
|
551451292ead9ca440b0d224d60d7f68629f9949dcec8874effa7991650e31df
|
||||||
20
update.sh
Executable file
20
update.sh
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#!nix-shell -i bash -p curl jq ripgrep gawk
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
readarray -t RELEASES <<<"$(curl https://api.github.com/repos/openhab/openhab-distro/tags | jq -r '.[].name' | rg '^\d+\.\d+\.\d+*$')"
|
||||||
|
MOST_RECENT=${RELEASES[0]}
|
||||||
|
|
||||||
|
echo -n "$MOST_RECENT" > version
|
||||||
|
curl -L https://github.com/openhab/openhab-distro/releases/download/"$MOST_RECENT"/openhab-"$MOST_RECENT".tar.gz \
|
||||||
|
| sha256sum \
|
||||||
|
| cut -d" " -f1 \
|
||||||
|
| tr -d '\n' \
|
||||||
|
> openhab.sha256
|
||||||
|
|
||||||
|
curl -L https://github.com/openhab/openhab-distro/releases/download/"$MOST_RECENT"/openhab-addons-"$MOST_RECENT".kar \
|
||||||
|
| sha256sum \
|
||||||
|
| cut -d" " -f1 \
|
||||||
|
| tr -d '\n' \
|
||||||
|
> openhab-addons.sha256
|
||||||
Reference in New Issue
Block a user