[desktop] Add custom package modrinth-nvidia

This commit is contained in:
2024-12-05 21:00:42 -08:00
parent 19531074ca
commit 24f1a64f3c
3 changed files with 40 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
nextcloudTalkDesktop = pkgs.callPackage ./nextcloud-talk-desktop {}; nextcloudTalkDesktop = pkgs.callPackage ./nextcloud-talk-desktop {};
modrinthNvidia = pkgs.callPackage ./modrinth-nvidia {};
} }

View File

@@ -0,0 +1,35 @@
{ 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
'';
}

View File

@@ -5,11 +5,15 @@ with lib;
let let
cfg = config.roles.desktop; cfg = config.roles.desktop;
customPackages = pkgs.callPackage ../../packages {};
basePackages = with pkgs; [ basePackages = with pkgs; [
brightnessctl brightnessctl
mangohud # Should probably get refactored with steam/gamescope out to a gaming role mangohud # Should probably get refactored with steam/gamescope out to a gaming role
modrinth-app modrinth-app
protonup-qt protonup-qt
customPackages.modrinthNvidia
]; ];
x11BasePackages = with pkgs; [ x11BasePackages = with pkgs; [