diff --git a/flake.nix b/flake.nix index 044b9ef9..72090f33 100644 --- a/flake.nix +++ b/flake.nix @@ -252,6 +252,7 @@ art-lotte art-lotte-bgs-nsfw art-lotte-bgs-sfw + kodi-pydes package-updater ; }; diff --git a/packages/default.nix b/packages/default.nix index 45d21c67..67879a66 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -2,5 +2,6 @@ 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-pydes = self.kodiPackages.callPackage ./kodi/pydes { }; package-updater = self.callPackage ./updater.nix { }; } diff --git a/packages/kodi/pydes/addon.xml b/packages/kodi/pydes/addon.xml new file mode 100644 index 00000000..96c47bcc --- /dev/null +++ b/packages/kodi/pydes/addon.xml @@ -0,0 +1,15 @@ + + + + + + + + A pure python module which implements the DES and Triple-DES encryption algorithms. + http://twhiteman.netfirms.com/des.html + MIT + all + http://sourceforge.net/projects/pydes/ + + \ No newline at end of file diff --git a/packages/kodi/pydes/default.nix b/packages/kodi/pydes/default.nix new file mode 100644 index 00000000..970e7dd4 --- /dev/null +++ b/packages/kodi/pydes/default.nix @@ -0,0 +1,11 @@ +{ callPackage, buildKodiAddon }: +let + src = callPackage ./source.nix { }; +in +buildKodiAddon { + pname = "pyDes"; + namespace = "script.module.pydes"; + version = "2.0.1"; + inherit src; + inherit (src) meta; +} diff --git a/packages/kodi/pydes/source.json b/packages/kodi/pydes/source.json new file mode 100644 index 00000000..6cd2f6ac --- /dev/null +++ b/packages/kodi/pydes/source.json @@ -0,0 +1,12 @@ +{ + "url": "https://github.com/twhiteman/pyDes", + "rev": "e988a5ffc9abb8010fc75dba54904d1c5dbe83db", + "date": "2019-01-07T17:12:32-08:00", + "path": "/nix/store/avhx558pnxzlzl4ww1xrzkl08qcp19pm-pyDes", + "sha256": "0sic8wbyk5azb4d4m6zbc96lfqcw8s2pzcv9nric5yqc751613ww", + "hash": "sha256-nI9gQjkM+8Jitmmzf4VGnGFHTWLrm0oaWV+V6RdHLGo=", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} \ No newline at end of file diff --git a/packages/kodi/pydes/source.nix b/packages/kodi/pydes/source.nix new file mode 100644 index 00000000..21dda6d9 --- /dev/null +++ b/packages/kodi/pydes/source.nix @@ -0,0 +1,29 @@ +{ + stdenvNoCC, + fetchFromGitHub, + lib, +}: +let + srcInfo = lib.importJSON ./source.json; + src = fetchFromGitHub { + owner = "twhiteman"; + repo = "pyDes"; + inherit (srcInfo) rev sha256; + }; +in +stdenvNoCC.mkDerivation { + pname = "kodi-pydes"; + version = srcInfo.date; + inherit src; + dontUnpack = true; + dontBuild = true; + installPhase = '' + mkdir -p $out/lib + cp $src/pyDes.py $out/lib + cp ${./addon.xml} $out/addon.xml + ''; + meta = { + license = lib.licenses.mit; + description = "A pure python module which implements the DES and Triple-DES encryption algorithms."; + }; +} diff --git a/packages/kodi/pydes/updater.nix b/packages/kodi/pydes/updater.nix new file mode 100644 index 00000000..41457bd0 --- /dev/null +++ b/packages/kodi/pydes/updater.nix @@ -0,0 +1,19 @@ +{ + nix-prefetch-git, + curl, + jq, + lib, +}: +let + srcInfo = lib.importJSON ./source.json; +in +'' + echo "kodi-pydes: Checking for updates" + CURRENT_COMMIT=$(${curl}/bin/curl https://api.github.com/repos/twhiteman/pyDes/commits | ${jq}/bin/jq -r '.[0].sha') + KNOWN_COMMIT=${srcInfo.rev} + if [ $CURRENT_COMMIT != $KNOWN_COMMIT ]; then + echo "kodi-pydes: Updating from $KNOWN_COMMIT to $CURRENT_COMMIT" + ${nix-prefetch-git}/bin/nix-prefetch-git https://github.com/twhiteman/pyDes | ${jq}/bin/jq > packages/kodi/pydes/source.json + fi + echo "kodi-pydes: Done" +'' diff --git a/packages/kodi/updater.nix b/packages/kodi/updater.nix new file mode 100644 index 00000000..f9a89292 --- /dev/null +++ b/packages/kodi/updater.nix @@ -0,0 +1,5 @@ +{ + lib, + callPackage, +}: +lib.concatMapStringsSep "\n" (f: callPackage "${f}/updater.nix" { }) [ ./pydes ] diff --git a/packages/updater.nix b/packages/updater.nix index 1f953ef4..c527247e 100644 --- a/packages/updater.nix +++ b/packages/updater.nix @@ -6,7 +6,10 @@ nix, }: let - script = lib.concatMapStringsSep "\n" (f: callPackage "${f}/updater.nix" { }) [ ./art ]; + script = lib.concatMapStringsSep "\n" (f: callPackage "${f}/updater.nix" { }) [ + ./art + ./kodi + ]; in writeScriptBin "updater" '' #!${bash}/bin/bash diff --git a/programs/desktop/kodi/default.nix b/programs/desktop/kodi/default.nix index d0b61f94..95905494 100644 --- a/programs/desktop/kodi/default.nix +++ b/programs/desktop/kodi/default.nix @@ -9,9 +9,6 @@ kodiPkgs: with kodiPkgs; [ jellyfin jellycon - inputstream-adaptive - inputstreamhelper - simplejson ] )) ];