@@ -0,0 +1,43 @@
1+{lib, rustPlatform, fetchFromGitHub, fetchurl, SDL2, makeWrapper, makeDesktopItem}:
2+
3+let
4+ desktopFile = makeDesktopItem {
5+ name = "system-syzygy";
6+ exec = "%out%/bin/syzygy";
7+ comment = "A puzzle game";
8+ desktopName = "System Syzygy";
9+ categories = "Game;";
10+ };
11+in
12+rustPlatform.buildRustPackage rec {
13+ pname = "system-syzygy";
14+ version = "1.0.1";
15+
16+ src = fetchFromGitHub {
17+ owner = "mdsteele";
18+ repo = "syzygy";
19+ rev = "5ba148fed7aae14bf35108d7303e4194e8ffe5e8";
20+ sha256 = "07mzwx8ql33q865snnw4gm3dgf0mnm60lnq1f5fgas2yjy9g9vwa";
21+ };
22+
23+ nativeBuildInputs = [ makeWrapper ];
24+ buildInputs = [ SDL2 ];
25+
26+ cargoSha256 = "03724z33dqxbbrzpvz172qh45qrgnyb801algjdcm32v8xsx81qg";
27+
28+ postInstall = ''
29+ mkdir -p $out/share/syzygy/
30+ cp -r ${src}/data/* $out/share/syzygy/
31+ wrapProgram $out/bin/syzygy --set SYZYGY_DATA_DIR $out/share/syzygy
32+ mkdir -p $out/share/applications
33+ substituteAll ${desktopFile}/share/applications/system-syzygy.desktop $out/share/applications/system-syzygy.desktop
34+ '';
35+
36+
37+ meta = with lib; {
38+ description = "A story and a puzzle game, where you solve a variety of puzzle";
39+ homepage = "https://mdsteele.games/syzygy";
40+ license = licenses.gpl3Plus;
41+ maintainers = [ maintainers.marius851000 ];
42+ };
43+}