From c5b09348a6ebb1560646bea695bcbd57c32310f3 Mon Sep 17 00:00:00 2001 From: useranon350 Date: Sun, 2 Jun 2024 17:33:39 -0400 Subject: [PATCH] xfce.xfce4-sensors-plugin: Enable xnvctrl by default Have to be explicitly enabled since this tries to figure out the default based on the existence of a hardcoded `/usr/include/NVCtrl` path, though it looks like `NIX_CFLAGS_COMPILE` is properly (?) set so we don't need to further patch it. Format with nixfmt-rfc-style at the same time. --- pkgs/desktops/xfce/default.nix | 5 ++- .../xfce4-sensors-plugin/default.nix | 37 +++++++++++++++---- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/pkgs/desktops/xfce/default.nix b/pkgs/desktops/xfce/default.nix index 77d783cd9039..c739ac6ea04a 100644 --- a/pkgs/desktops/xfce/default.nix +++ b/pkgs/desktops/xfce/default.nix @@ -1,5 +1,6 @@ { config , lib +, linuxPackages , pkgs , generateSplicesForMkScope , makeScopeWithSplicing' @@ -140,7 +141,9 @@ makeScopeWithSplicing' { xfce4-mpc-plugin = callPackage ./panel-plugins/xfce4-mpc-plugin { }; - xfce4-sensors-plugin = callPackage ./panel-plugins/xfce4-sensors-plugin { }; + xfce4-sensors-plugin = callPackage ./panel-plugins/xfce4-sensors-plugin { + libXNVCtrl = linuxPackages.nvidia_x11.settings.libXNVCtrl; + }; xfce4-systemload-plugin = callPackage ./panel-plugins/xfce4-systemload-plugin { }; diff --git a/pkgs/desktops/xfce/panel-plugins/xfce4-sensors-plugin/default.nix b/pkgs/desktops/xfce/panel-plugins/xfce4-sensors-plugin/default.nix index 4a3148962efd..07445ffb1c99 100644 --- a/pkgs/desktops/xfce/panel-plugins/xfce4-sensors-plugin/default.nix +++ b/pkgs/desktops/xfce/panel-plugins/xfce4-sensors-plugin/default.nix @@ -1,5 +1,20 @@ -{ lib, stdenv, fetchurl, pkg-config, intltool, gtk3, libxfce4ui, - libxfce4util, xfce4-panel, libnotify, lm_sensors, hddtemp, netcat-gnu, gitUpdater +{ + stdenv, + lib, + fetchurl, + pkg-config, + intltool, + gtk3, + libxfce4ui, + libxfce4util, + xfce4-panel, + libnotify, + lm_sensors, + hddtemp, + netcat-gnu, + nvidiaSupport ? true, + libXNVCtrl, + gitUpdater, }: let @@ -7,7 +22,7 @@ let in stdenv.mkDerivation rec { - pname = "xfce4-sensors-plugin"; + pname = "xfce4-sensors-plugin"; version = "1.4.4"; src = fetchurl { @@ -29,14 +44,20 @@ stdenv.mkDerivation rec { lm_sensors hddtemp netcat-gnu - ]; + ] ++ lib.optionals nvidiaSupport [ libXNVCtrl ]; enableParallelBuilding = true; - configureFlags = [ - "--with-pathhddtemp=${hddtemp}/bin/hddtemp" - "--with-pathnetcat=${netcat-gnu}/bin/netcat" - ]; + configureFlags = + [ + "--with-pathhddtemp=${hddtemp}/bin/hddtemp" + "--with-pathnetcat=${netcat-gnu}/bin/netcat" + ] + ++ lib.optionals nvidiaSupport [ + # Have to be explicitly enabled since this tries to figure out the default + # based on the existence of a hardcoded `/usr/include/NVCtrl` path. + "--enable-xnvctrl" + ]; passthru.updateScript = gitUpdater { url = "https://gitlab.xfce.org/panel-plugins/${pname}";