Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 505d7bea3af4
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 22750b36fdd9
Choose a head ref
  • 2 commits
  • 6 files changed
  • 1 contributor

Commits on Feb 19, 2017

  1. Copy the full SHA
    f6eedf0 View commit details
  2. nvidia: support application profiles

    Closes #22666.
    abbradar committed Feb 19, 2017
    Copy the full SHA
    22750b3 View commit details
4 changes: 4 additions & 0 deletions nixos/modules/hardware/video/nvidia.nix
Original file line number Diff line number Diff line change
@@ -49,6 +49,10 @@ in
Option "RandRRotation" "on"
'';

environment.etc."nvidia/nvidia-application-profiles-rc" = mkIf nvidia_x11.useProfiles {
source = "${nvidia_x11.bin}/share/nvidia/nvidia-application-profiles-rc";
};

hardware.opengl.package = nvidiaPackage nvidia_x11 pkgs;
hardware.opengl.package32 = nvidiaPackage nvidia_libs32 pkgs_i686;

7 changes: 7 additions & 0 deletions pkgs/os-specific/linux/nvidia-x11/builder.sh
Original file line number Diff line number Diff line change
@@ -68,6 +68,13 @@ installPhase() {
nuke-refs $i
cp $i $bin/lib/modules/$kernelVersion/misc/
done

# Install application profiles.
if [ "$useProfiles" = "1" ]; then
mkdir -p $bin/share/nvidia
cp nvidia-application-profiles-*-rc $bin/share/nvidia/nvidia-application-profiles-rc
cp nvidia-application-profiles-*-key-documentation $bin/share/nvidia/nvidia-application-profiles-key-documentation
fi
fi

# All libs except GUI-only are installed now, so fixup them.
1 change: 1 addition & 0 deletions pkgs/os-specific/linux/nvidia-x11/default.nix
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@ in
settingsSha256 = "0q92xw4fr9p5nbhj1plynm50d32881861daxfwrisywszqijhmlf";
persistencedSha256 = null;
useGLVND = false;
useProfiles = false;
};

legacy_173 = callPackage ./legacy173.nix { };
3 changes: 2 additions & 1 deletion pkgs/os-specific/linux/nvidia-x11/generic.nix
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
, settingsSha256
, persistencedSha256
, useGLVND ? true
, useProfiles ? true
, preferGtk2 ? false
}:

@@ -41,7 +42,7 @@ let
}
else throw "nvidia-x11 does not support platform ${stdenv.system}";

inherit version useGLVND;
inherit version useGLVND useProfiles;
inherit (stdenv) system;

outputs = [ "out" ] ++ optional (!libsOnly) "bin";
1 change: 1 addition & 0 deletions pkgs/os-specific/linux/nvidia-x11/legacy173.nix
Original file line number Diff line number Diff line change
@@ -42,6 +42,7 @@ stdenv.mkDerivation {
settings = null;
persistenced = null;
useGLVND = false;
useProfiles = false;
};

meta = {
14 changes: 11 additions & 3 deletions pkgs/os-specific/linux/nvidia-x11/settings.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
nvidia_x11: sha256:

{ stdenv, lib, fetchurl, pkgconfig, m4, jansson, gtk2, gtk3, libXv, libXrandr, libvdpau
, librsvg, wrapGAppsHook
, withGtk2 ? false, withGtk3 ? true
}:

@@ -15,13 +16,18 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ pkgconfig m4 ];

buildInputs = [ jansson gtk2 gtk3 libXv libXrandr libvdpau nvidia_x11 ];
buildInputs = [ jansson libXv libXrandr libvdpau nvidia_x11 gtk2 ]
++ lib.optionals withGtk3 [ gtk3 librsvg wrapGAppsHook ];

NIX_LDFLAGS = [ "-lvdpau" "-lXrandr" "-lXv" "-lnvidia-ml" ];

makeFlags = [ "NV_USE_BUNDLED_LIBJANSSON=0" ];
installFlags = [ "PREFIX=$(out)" ];

postPatch = lib.optionalString nvidia_x11.useProfiles ''
sed -i 's,/usr/share/nvidia/,${nvidia_x11.bin}/share/nvidia/,g' src/gtk+-2.x/ctkappprofile.c
'';

preBuild = ''
if [ -e src/libXNVCtrl/libXNVCtrl.a ]; then
( cd src/libXNVCtrl
@@ -39,9 +45,11 @@ stdenv.mkDerivation rec {
''}
'';

binaryName = if withGtk3 then ".nvidia-settings-wrapped" else "nvidia-settings";

postFixup = ''
patchelf --set-rpath "$(patchelf --print-rpath $out/bin/nvidia-settings):$out/lib" \
$out/bin/nvidia-settings
patchelf --set-rpath "$(patchelf --print-rpath $out/bin/$binaryName):$out/lib" \
$out/bin/$binaryName
'';

meta = with stdenv.lib; {