Help running partydeck on nixos

Hey, im having some trouble trying to run partydeck on my machine, anyone also tried it?

here is the repo: GitHub - wunnr/partydeck: A split-screen game launcher for Linux/SteamOS

I tried with steam-run but it seems that some libaries are missing
partydeck: error while loading shared libraries: libSDL2-2.0.so.0: cannot open shared object file: No such file or directory

It’s a rust program, I highly recommend packaging it properly instead. Rust is usually easy to package.

Start with nix-init, and refine using https://nixos.org/manual/nixpkgs/unstable/#rust. If you have some code then ask here further especially if you’re stuck.

1 Like

i was actually thinking on packaging it after testing and seeing it work, thanks

I’m not talking about nixpkgs. You need to package it locally at least.

https://nix.dev/tutorials/callpackage

If you do decide to package it you should know that the MSRV for the package is 1.88 due its use of let-chains (so 25.05 won’t build it), and it depends on openssl / libarchive / sdl2 so those need to live in buildInputs and you’ll need pkg-config in nativeBuildInputs. Other than that you can basically follow the manual on autopilot.

1 Like

Actually… it’s a bit more complicated than that. I got this working while taking in my weekly podcast. It seems like it needs xwayland because sdl2-compat only seems to have an x11 driver, but winit detects wayland so it actually needs to be linked against wayland to work.

let
  sources = import ./npins;
  pkgs = import sources.nixpkgs { overlays = [ (import sources.rust-overlay) ]; };
  toolchain = pkgs.rust-bin.fromRustupToolchain {
    channel = "1.88";
    targets = [
      "x86_64-unknown-linux-gnu"
    ];
    profile = "default";
  };
  package =
    {
      autoPatchelfHook,
      lib,
      libarchive,
      libGL,
      libxkbcommon,
      openssl,
      pkg-config,
      rustPlatform,
      sdl2-compat,
      stdenv,
      wayland,
    }:
    stdenv.mkDerivation rec {
      pname = "partydeck";
      version = lib.removePrefix src.release_prefix src.revision;
      src = sources.partydeck;
      nativeBuildInputs = [
        autoPatchelfHook
        pkg-config
        toolchain
      ]
      ++ (lib.attrValues {
        inherit (rustPlatform)
          cargoSetupHook
          cargoBuildHook
          cargoInstallHook
          ;
      });
      buildInputs = [
        libarchive
        openssl
        sdl2-compat
      ];
      runtimeDependencies = [
        wayland
        libGL
        libxkbcommon
      ];
      cargoBuildType = "release";
      cargoDeps = rustPlatform.importCargoLock { lockFile = src + "/Cargo.lock"; };
    };
in
pkgs.callPackage package { }

using npins run with the following

npins init --bare
npins add --name nixpkgs channel nixos-25.05
npins add github --branch master oxalica rust-overlay
npins add --name partydeck github --release-prefix v wunnr PartyDeck

then build it and run it with DISPLAY=:0 with xwayland running.

1 Like