diff --git a/flake.nix b/flake.nix index 72090f33..35afa03a 100644 --- a/flake.nix +++ b/flake.nix @@ -252,6 +252,7 @@ art-lotte art-lotte-bgs-nsfw art-lotte-bgs-sfw + kodi-joyn kodi-pydes package-updater ; diff --git a/packages/default.nix b/packages/default.nix index 67879a66..ba1bca8a 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -2,6 +2,7 @@ self: super: { art-lotte = self.callPackage ./art/lotte { }; art-lotte-bgs-nsfw = self.callPackage ./art/lotte/bgs-nsfw.nix { }; art-lotte-bgs-sfw = self.callPackage ./art/lotte/bgs-sfw.nix { }; + kodi-joyn = self.kodiPackages.callPackage ./kodi/joyn { }; kodi-pydes = self.kodiPackages.callPackage ./kodi/pydes { }; package-updater = self.callPackage ./updater.nix { }; } diff --git a/packages/kodi/joyn/default.nix b/packages/kodi/joyn/default.nix new file mode 100644 index 00000000..953327e7 --- /dev/null +++ b/packages/kodi/joyn/default.nix @@ -0,0 +1,32 @@ +{ + buildKodiAddon, + fetchFromGitHub, + inputstream-adaptive, + inputstreamhelper, + kodi-pydes, + lib, + simplejson, +}: +let + srcInfo = lib.importJSON ./source.json; +in +buildKodiAddon { + pname = "Joyn"; + namespace = "plugin.video.joyn"; + version = "2.3.1.10"; + src = fetchFromGitHub { + owner = "knaerzche"; + repo = "plugin.video.joyn"; + inherit (srcInfo) rev sha256; + }; + propagatedBuildInputs = [ + inputstream-adaptive + inputstreamhelper + kodi-pydes + simplejson + ]; + meta = { + license = lib.licenses.gpl2; + description = "Watch VOD content und Live TV provided by Joyn"; + }; +} diff --git a/packages/kodi/joyn/source.json b/packages/kodi/joyn/source.json new file mode 100644 index 00000000..44d3a57b --- /dev/null +++ b/packages/kodi/joyn/source.json @@ -0,0 +1,12 @@ +{ + "url": "https://github.com/knaerzche/plugin.video.joyn", + "rev": "0954c40d20fe4c956c45519993f0dfdc0debade2", + "date": "2020-09-04T17:17:52+02:00", + "path": "/nix/store/1c49y966arnakcna3nb55fpfik0rsysq-plugin.video.joyn", + "sha256": "1wkn03j0mwlbnnl0zzr74pw3z4z2r76130rana7jdmc79fqxld53", + "hash": "sha256-ozTasUuH1SaPsiqDEczJ4pM/+CUn/w+otYvyCuQAdvI=", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} \ No newline at end of file diff --git a/packages/kodi/joyn/updater.nix b/packages/kodi/joyn/updater.nix new file mode 100644 index 00000000..bc1e40e0 --- /dev/null +++ b/packages/kodi/joyn/updater.nix @@ -0,0 +1,19 @@ +{ + nix-prefetch-git, + curl, + jq, + lib, +}: +let + srcInfo = lib.importJSON ./source.json; +in +'' + echo "kodi-joyn: Checking for updates" + CURRENT_COMMIT=$(${curl}/bin/curl https://api.github.com/repos/knaerzche/plugin.video.joyn/commits | ${jq}/bin/jq -r '.[0].sha') + KNOWN_COMMIT=${srcInfo.rev} + if [ $CURRENT_COMMIT != $KNOWN_COMMIT ]; then + echo "kodi-joyn: Updating from $KNOWN_COMMIT to $CURRENT_COMMIT" + ${nix-prefetch-git}/bin/nix-prefetch-git https://github.com/knaerzche/plugin.video.joyn | ${jq}/bin/jq > packages/kodi/joyn/source.json + fi + echo "kodi-joyn: Done" +'' diff --git a/packages/kodi/updater.nix b/packages/kodi/updater.nix index f9a89292..e8273008 100644 --- a/packages/kodi/updater.nix +++ b/packages/kodi/updater.nix @@ -2,4 +2,7 @@ lib, callPackage, }: -lib.concatMapStringsSep "\n" (f: callPackage "${f}/updater.nix" { }) [ ./pydes ] +lib.concatMapStringsSep "\n" (f: callPackage "${f}/updater.nix" { }) [ + ./joyn + ./pydes +] diff --git a/programs/desktop/kodi/default.nix b/programs/desktop/kodi/default.nix index 95905494..80bbbc31 100644 --- a/programs/desktop/kodi/default.nix +++ b/programs/desktop/kodi/default.nix @@ -9,6 +9,7 @@ kodiPkgs: with kodiPkgs; [ jellyfin jellycon + pkgs.kodi-joyn ] )) ];