36 lines
1001 B
Nix
36 lines
1001 B
Nix
{ pkgs ? import <nixpkgs> {} }:
|
|
pkgs.stdenv.mkDerivation {
|
|
pname = "modrinth-nvidia";
|
|
version = "0.1.0";
|
|
src = null;
|
|
dontUnpack = true;
|
|
dontBuild = true;
|
|
dontConfigure = true;
|
|
|
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
# Copy the original binary
|
|
cp ${pkgs.modrinth-app}/bin/ModrinthApp $out/bin/modrinth-nvidia-real
|
|
chmod +x $out/bin/modrinth-nvidia-real
|
|
|
|
# Wrap the binary with makeWrapper, producing a new script at 'modrinth-nvidia'
|
|
makeWrapper $out/bin/modrinth-nvidia-real $out/bin/modrinth-nvidia \
|
|
--set WEBKIT_DISABLE_DMABUF_RENDERER 1 \
|
|
--set WEBKIT_DISABLE_COMPOSITING_MODE 1
|
|
|
|
mkdir -p $out/share/applications
|
|
cat > $out/share/applications/modrinth-nvidia.desktop <<EOF
|
|
[Desktop Entry]
|
|
Name=Modrinth (NVIDIA)
|
|
Comment=Launch Modrinth with environment variables tuned for NVIDIA systems
|
|
Exec=$out/bin/modrinth-nvidia
|
|
Icon=modrinth-app
|
|
Terminal=false
|
|
Type=Application
|
|
Categories=Game;
|
|
EOF
|
|
'';
|
|
}
|