summary refs log tree commit diff
path: root/pkgs/games/itch
diff options
context:
space:
mode:
authorPasquale <p3dimaria@hotmail.it>2022-02-03 01:27:24 +0100
committerPasquale <p3dimaria@hotmail.it>2022-02-07 15:51:49 +0100
commit21b809d3d2ee93b2c578c19e300f7a21f1630456 (patch)
tree2af300d6b1d55b1a51408d707cfd68c1e9731fe7 /pkgs/games/itch
parent6c7fd66b5b60df3411a23b0df1de766d24df701d (diff)
downloadnixpkgs-21b809d3d2ee93b2c578c19e300f7a21f1630456.tar
nixpkgs-21b809d3d2ee93b2c578c19e300f7a21f1630456.tar.gz
nixpkgs-21b809d3d2ee93b2c578c19e300f7a21f1630456.tar.bz2
nixpkgs-21b809d3d2ee93b2c578c19e300f7a21f1630456.tar.lz
nixpkgs-21b809d3d2ee93b2c578c19e300f7a21f1630456.tar.xz
nixpkgs-21b809d3d2ee93b2c578c19e300f7a21f1630456.tar.zst
nixpkgs-21b809d3d2ee93b2c578c19e300f7a21f1630456.zip
itch: init at 25.5.1
Diffstat (limited to 'pkgs/games/itch')
-rw-r--r--pkgs/games/itch/default.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/games/itch/default.nix b/pkgs/games/itch/default.nix
new file mode 100644
index 00000000000..a8cfe8f24d7
--- /dev/null
+++ b/pkgs/games/itch/default.nix
@@ -0,0 +1,64 @@
+{ lib
+, stdenvNoCC
+, fetchurl
+, libnotify
+, nss
+, gtk3
+, fetchFromGitHub
+, makeDesktopItem
+, itch-setup
+, runtimeShell
+}:
+stdenvNoCC.mkDerivation rec{
+  pname = "itch";
+  version = "25.5.1";
+
+  src = fetchFromGitHub {
+    owner = "itchio";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-Pi3l3uK4kr+N3p7fGQuqckYIzycRqJHDVX00reoSbp4=";
+  };
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = pname;
+      exec = pname;
+      icon = pname;
+      desktopName = pname;
+      mimeType = "x-scheme-handler/itchio;x-scheme-handler/itch";
+      comment = "Install and play itch.io games easily";
+      extraDesktopEntries = {
+        TryExec = "itch %U";
+        Categories = "Game;";
+      };
+    })
+  ];
+
+  itchBin = ''
+    #!${runtimeShell}
+    exec ${itch-setup}/bin/itch-setup --prefer-launch -- "$@"
+  '';
+
+  passAsFile = [ "itchBin" ];
+
+  # as taken from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=itch
+  installPhase = ''
+    install -Dm0777 $itchBinPath $out/bin/itch
+    for icon in release/images/itch-icons/icon*.png
+    do
+      iconsize="''${icon#release/images/itch-icons/icon}"
+      iconsize="''${iconsize%.png}"
+      icondir="$out/share/icons/hicolor/''${iconsize}x''${iconsize}/apps/"
+      install -Dm644 "$icon" "$icondir/itch.png"
+    done
+  '';
+
+  meta = with lib; {
+    description = "The best way to play itch.io games";
+    homepage = "https://github.com/itchio/itch";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ pasqui23 ];
+  };
+}