Packaging a windows directx12 game?

hello,

i’ve been playing cho-ren-sha-68k with steam as a non-steam game,
but it bothers me that i don’t know how to package it with nix.

is there an example of packaging a windows directx12 game with nix?

if not, then no big deal.
can still use steam to play it.

thanks.

um,
this feels bad,
but it runs (for me for now):

package.nix
# TODO: .desktop
{ lib
, fetchurl
, unzip
, winetricks
, wineWowPackages
, writeShellApplication
}:
let
  name = "cho-ren-sha-68k";
  version = "1.10.15";
  src = fetchurl {
    url = "https://github.com/yosshin4004/yosshin4004.github.io/releases/download/crs68k_110/crs68k_110_build20250119_wip15.zip";
    hash = "sha256-SrfkoXZXOlhcA8y/7iF5KmsbpEBkQhm5ughgZ7wq8Eo=";
  };
in
writeShellApplication {
  inherit name;
  runtimeInputs = [
    unzip
    winetricks
    wineWowPackages.full
  ];
  text = ''
    DUMP_DIR="$HOME/.crs68k-${version}"
    export WINEPREFIX="$DUMP_DIR/wine"
    if [[ ! -d "$DUMP_DIR" ]]; then
      unzip ${src} -d "$DUMP_DIR"
      winetricks vkd3d
      winetricks dxvk
    fi
    wine "$DUMP_DIR/crs68k/cho_ren_sha_68k.exe"
  '';
  meta = {
    description = "1995 vertically scrolling doujin shoot'em up video game";
    homepage = "https://yosshin4004.github.io/x68k/crs68k/official/index.html";
    license = lib.licenses.unfree; # freeware
  };
}

if there is a more proper solution,
then please do share.

peace :v:.

2 Likes