diff --git a/pkgs/os-specific/linux/nvidia-x11/settings.nix b/pkgs/os-specific/linux/nvidia-x11/settings.nix index e13f3a157b64..6db6644d88fe 100644 --- a/pkgs/os-specific/linux/nvidia-x11/settings.nix +++ b/pkgs/os-specific/linux/nvidia-x11/settings.nix @@ -30,6 +30,14 @@ let inherit sha256; }; + meta = with lib; { + homepage = "https://www.nvidia.com/object/unix.html"; + license = licenses.unfreeRedistributable; + platforms = nvidia_x11.meta.platforms; + mainProgram = "nvidia-settings"; + maintainers = with maintainers; [ abbradar aidalgol ]; + }; + libXNVCtrl = stdenv.mkDerivation { pname = "libXNVCtrl"; version = nvidia_x11.settingsVersion; @@ -62,6 +70,10 @@ let cp NVCtrlLib.h $out/include/NVCtrl cp -P libXNVCtrl.so* $out/lib ''; + + meta = meta // { + description = "NVIDIA NV-CONTROL X extension"; + }; }; in @@ -102,21 +114,20 @@ stdenv.mkDerivation { fi ''; - nativeBuildInputs = [ pkg-config m4 addOpenGLRunpath ]; + nativeBuildInputs = [ pkg-config m4 addOpenGLRunpath ] + ++ lib.optionals withGtk3 [ wrapGAppsHook3 ]; - buildInputs = [ jansson libXv libXrandr libXext libXxf86vm libvdpau nvidia_x11 gtk2 dbus ] - ++ lib.optionals withGtk3 [ gtk3 librsvg wrapGAppsHook3 ]; + buildInputs = [ jansson libXv libXrandr libXext libXxf86vm libvdpau nvidia_x11 dbus ] + ++ lib.optionals (withGtk2 || lib.versionOlder nvidia_x11.settingsVersion "525.53") [ gtk2 ] + ++ lib.optionals withGtk3 [ gtk3 librsvg ]; installFlags = [ "PREFIX=$(out)" ]; - postInstall = '' - ${lib.optionalString (!withGtk2) '' - rm -f $out/lib/libnvidia-gtk2.so.* - ''} - ${lib.optionalString (!withGtk3) '' - rm -f $out/lib/libnvidia-gtk3.so.* - ''} - + postInstall = lib.optionalString (!withGtk2) '' + rm -f $out/lib/libnvidia-gtk2.so.* + '' + lib.optionalString (!withGtk3) '' + rm -f $out/lib/libnvidia-gtk3.so.* + '' + '' # Install the desktop file and icon. # The template has substitution variables intended to be replaced resulting # in absolute paths. Because absolute paths break after the desktop file is @@ -141,12 +152,7 @@ stdenv.mkDerivation { inherit libXNVCtrl; }; - meta = with lib; { - homepage = "https://www.nvidia.com/object/unix.html"; + meta = meta // { description = "Settings application for NVIDIA graphics cards"; - license = licenses.unfreeRedistributable; - platforms = nvidia_x11.meta.platforms; - mainProgram = "nvidia-settings"; - maintainers = with maintainers; [ abbradar aidalgol ]; }; }