This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

games: add haunted-ps1-demo-disc-2021 package

Add games/ folder with legacyPackages.games exposure.
Uses umu-launcher with GE-Proton for Windows game compatibility.

+127
+1
flake.nix
··· 172 172 ./keys/flake-module.nix 173 173 ./wrapperModules/flake-module.nix 174 174 ./skills/flake-module.nix 175 + ./games/flake-module.nix 175 176 ] 176 177 ++ ( 177 178 # Auto-import all flake-module.nix files from tools subdirectories
+29
games/flake-module.nix
··· 1 + { 2 + inputs, 3 + lib, 4 + self, 5 + ... 6 + }: 7 + { 8 + perSystem = 9 + { pkgs, ... }: 10 + let 11 + gameDirs = builtins.attrNames ( 12 + lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./.) 13 + ); 14 + 15 + buildGame = name: 16 + let 17 + result = builtins.tryEval (pkgs.callPackage ./${name} { }); 18 + in 19 + if result.success then result.value else null; 20 + 21 + games = lib.filterAttrs (_: v: v != null) ( 22 + lib.genAttrs gameDirs buildGame 23 + ); 24 + in 25 + { 26 + # Expose via legacyPackages so `nix run .#games.haunted-ps1-demo-disc-2021` works 27 + legacyPackages.games = games; 28 + }; 29 + }
+97
games/haunted-ps1-demo-disc-2021/default.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + requireFile, 5 + unzip, 6 + makeWrapper, 7 + umu-launcher, 8 + makeDesktopItem, 9 + copyDesktopItems, 10 + }: 11 + 12 + let 13 + pname = "haunted-ps1-demo-disc-2021"; 14 + version = "1.0"; 15 + 16 + # Download from: https://hauntedps1.itch.io/demodisc2021 17 + # You need an itch.io account (free) to download 18 + # After downloading, add to nix store with: 19 + # nix-store --add-fixed sha256 ~/Downloads/demodisc2021-win.zip 20 + src = requireFile { 21 + name = "demodisc2021-win.zip"; 22 + sha256 = "0392n5pgilpk0lgwr35w6jl6hq9h800y8lkpb729vjhw4c7ywsmm"; 23 + message = '' 24 + To use this package, you need to download the Haunted PS1 Demo Disc 2021. 25 + 26 + 1. Go to https://hauntedps1.itch.io/demodisc2021 27 + 2. Create a free itch.io account or log in 28 + 3. Click the "Download" button for "Demo Disc 2021 [Windows]" (4.7 GB) 29 + 4. Once downloaded, add it to the Nix store: 30 + 31 + nix-store --add-fixed sha256 ~/Downloads/demodisc2021-win.zip 32 + 33 + Then try building again. 34 + ''; 35 + }; 36 + 37 + desktopItem = makeDesktopItem { 38 + name = pname; 39 + desktopName = "Haunted PS1 Demo Disc 2021"; 40 + comment = "A collection of PS1-style horror game demos"; 41 + exec = pname; 42 + icon = pname; 43 + categories = [ "Game" ]; 44 + }; 45 + 46 + in 47 + stdenv.mkDerivation { 48 + inherit pname version src; 49 + 50 + nativeBuildInputs = [ 51 + unzip 52 + makeWrapper 53 + copyDesktopItems 54 + ]; 55 + 56 + desktopItems = [ desktopItem ]; 57 + 58 + dontBuild = true; 59 + 60 + unpackPhase = '' 61 + runHook preUnpack 62 + unzip -q "$src" 63 + runHook postUnpack 64 + ''; 65 + 66 + installPhase = '' 67 + runHook preInstall 68 + 69 + # Install all game files 70 + mkdir -p "$out/share/${pname}" 71 + cp -r * "$out/share/${pname}/" 72 + 73 + # Create wrapper script using umu-run (Proton launcher) 74 + mkdir -p "$out/bin" 75 + cat > "$out/bin/${pname}" <<'WRAPPER' 76 + #!/bin/sh 77 + export WINEPREFIX="''${WINEPREFIX:-$HOME/.local/share/haunted-ps1-demo-disc-2021/prefix}" 78 + export GAMEID="haunted-ps1-demo-disc-2021" 79 + export PROTONPATH="GE-Proton" 80 + exec UMUPATH "$out/share/haunted-ps1-demo-disc-2021/HauntedDemoDisc2021.exe" "$@" 81 + WRAPPER 82 + substituteInPlace "$out/bin/${pname}" \ 83 + --replace-fail "UMUPATH" "${umu-launcher}/bin/umu-run" \ 84 + --replace-fail '$out' "$out" 85 + chmod +x "$out/bin/${pname}" 86 + 87 + runHook postInstall 88 + ''; 89 + 90 + meta = { 91 + description = "A collection of 25 PS1-style horror game demos from the Haunted PS1 community"; 92 + homepage = "https://hauntedps1.itch.io/demodisc2021"; 93 + license = lib.licenses.unfree; 94 + platforms = [ "x86_64-linux" ]; 95 + mainProgram = pname; 96 + }; 97 + }