From d639c253a36225a6cd314e65df704ec74cfa7bcb Mon Sep 17 00:00:00 2001 From: William Date: Tue, 1 Apr 2025 19:39:45 -0300 Subject: [PATCH] added plasticity back --- flake.nix | 1 + hosts/modules/programs.nix | 1 + packages/plasticity.nix | 122 +++++++++++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 packages/plasticity.nix diff --git a/flake.nix b/flake.nix index c2b30a0..8fe5b99 100644 --- a/flake.nix +++ b/flake.nix @@ -112,6 +112,7 @@ overlay = final: prev: { }; workstationOverlay = final: prev: { + plasticity = nixpkgs.legacyPackages."x86_64-linux".callPackage ./packages/plasticity.nix { }; }; serverOverlay = final: prev: { }; diff --git a/hosts/modules/programs.nix b/hosts/modules/programs.nix index 5ce0917..c8d8395 100644 --- a/hosts/modules/programs.nix +++ b/hosts/modules/programs.nix @@ -98,6 +98,7 @@ gimp inkscape orca-slicer + plasticity ### Gaming & Entertainment ### clonehero heroic diff --git a/packages/plasticity.nix b/packages/plasticity.nix new file mode 100644 index 0000000..4325e5f --- /dev/null +++ b/packages/plasticity.nix @@ -0,0 +1,122 @@ +{ + alsa-lib, + at-spi2-atk, + autoPatchelfHook, + cairo, + cups, + dbus, + desktop-file-utils, + expat, + fetchurl, + gdk-pixbuf, + gtk3, + gvfs, + hicolor-icon-theme, + lib, + libdrm, + libglvnd, + libnotify, + libsForQt5, + libxkbcommon, + libgbm, + nspr, + nss, + openssl, + pango, + rpmextract, + stdenv, + systemd, + trash-cli, + vulkan-loader, + wrapGAppsHook3, + xdg-utils, + xorg, +}: +stdenv.mkDerivation rec { + pname = "plasticity"; + version = "25.1.8"; + + src = fetchurl { + url = "https://github.com/nkallen/plasticity/releases/download/v${version}/Plasticity-${version}-1.x86_64.rpm"; + hash = "sha256-5PjjEsHchryUhmzqyQ4XqwiycNEVCefmpSW/9jZEzpg="; + }; + + nativeBuildInputs = [ + wrapGAppsHook3 + autoPatchelfHook + rpmextract + libgbm + ]; + + buildInputs = [ + alsa-lib + at-spi2-atk + cairo + cups + dbus + desktop-file-utils + expat + gdk-pixbuf + gtk3 + gvfs + hicolor-icon-theme + libdrm + libnotify + libsForQt5.kde-cli-tools + libxkbcommon + nspr + nss + openssl + pango + (lib.getLib stdenv.cc.cc) + trash-cli + xdg-utils + ]; + + runtimeDependencies = [ + systemd + libglvnd + vulkan-loader # may help with nvidia users + xorg.libX11 + xorg.libxcb + xorg.libXcomposite + xorg.libXdamage + xorg.libXext + xorg.libXfixes + xorg.libXrandr + xorg.libXtst + ]; + + dontUnpack = true; + + # can't find anything on the internet about these files, no clue what they do + autoPatchelfIgnoreMissingDeps = [ + "ACCAMERA.tx" + "AcMPolygonObj15.tx" + "ATEXT.tx" + "ISM.tx" + "RText.tx" + "SCENEOE.tx" + "TD_DbEntities.tx" + "TD_DbIO.tx" + "WipeOut.tx" + ]; + + installPhase = '' + runHook preInstall + + mkdir $out + cd $out + rpmextract $src + mv $out/usr/* $out + rm -r $out/usr + rm -r $out/lib/.build-id + + runHook postInstall + ''; + + #--use-gl=egl for it to use hardware rendering it seems. Otherwise there are terrible framerates + preFixup = '' + gappsWrapperArgs+=(--add-flags "--use-gl=egl") + ''; +}