mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 07:23:20 +00:00
Merge pull request #136247 from lovesegfault/nvidia-fixes
This commit is contained in:
commit
5abb70031c
@ -143,6 +143,15 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
hardware.nvidia.nvidiaSettings = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
description = ''
|
||||
Whether to add nvidia-settings, NVIDIA's GUI configuration tool, to
|
||||
systemPackages.
|
||||
'';
|
||||
};
|
||||
|
||||
hardware.nvidia.nvidiaPersistenced = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
@ -279,7 +288,8 @@ in
|
||||
hardware.opengl.extraPackages = optional offloadCfg.enable nvidia_x11.out;
|
||||
hardware.opengl.extraPackages32 = optional offloadCfg.enable nvidia_x11.lib32;
|
||||
|
||||
environment.systemPackages = [ nvidia_x11.bin nvidia_x11.settings ]
|
||||
environment.systemPackages = [ nvidia_x11.bin ]
|
||||
++ optionals nvidiaSettings [ nvidia_x11.settings ]
|
||||
++ optionals nvidiaPersistencedEnabled [ nvidia_x11.persistenced ];
|
||||
|
||||
systemd.packages = optional cfg.powerManagement.enable nvidia_x11.out;
|
||||
|
@ -17,10 +17,8 @@ buildPhase() {
|
||||
# Create the module.
|
||||
echo "Building linux driver against kernel: $kernel";
|
||||
cd kernel
|
||||
sysSrc=$(echo $kernel/lib/modules/$kernelVersion/source)
|
||||
sysOut=$(echo $kernel/lib/modules/$kernelVersion/build)
|
||||
unset src # used by the nv makefile
|
||||
make IGNORE_PREEMPT_RT_PRESENCE=1 NV_BUILD_SUPPORTS_HMM=1 SYSSRC=$sysSrc SYSOUT=$sysOut module -j$NIX_BUILD_CORES
|
||||
make $makeFlags -j $NIX_BUILD_CORES module
|
||||
|
||||
cd ..
|
||||
fi
|
||||
|
@ -75,6 +75,13 @@ let
|
||||
kernel = if libsOnly then null else kernel.dev;
|
||||
kernelVersion = if libsOnly then null else kernel.modDirVersion;
|
||||
|
||||
makeFlags = optionals (!libsOnly) (kernel.makeFlags ++ [
|
||||
"IGNORE_PREEMPT_RT_PRESENCE=1"
|
||||
"NV_BUILD_SUPPORTS_HMM=1"
|
||||
"SYSSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
|
||||
"SYSOUT=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
||||
]);
|
||||
|
||||
hardeningDisable = [ "pic" "format" ];
|
||||
|
||||
dontStrip = true;
|
||||
|
@ -21,6 +21,8 @@ stdenv.mkDerivation rec {
|
||||
nativeBuildInputs = [ m4 ];
|
||||
buildInputs = [ libtirpc ];
|
||||
|
||||
inherit (nvidia_x11) makeFlags;
|
||||
|
||||
installFlags = [ "PREFIX=$(out)" ];
|
||||
|
||||
postFixup = ''
|
||||
|
@ -24,7 +24,7 @@ let
|
||||
cd src/libXNVCtrl
|
||||
'';
|
||||
|
||||
makeFlags = [
|
||||
makeFlags = nvidia_x11.makeFlags ++ [
|
||||
"OUTPUTDIR=." # src/libXNVCtrl
|
||||
];
|
||||
|
||||
@ -51,7 +51,7 @@ stdenv.mkDerivation {
|
||||
++ lib.optionals withGtk3 [ gtk3 librsvg wrapGAppsHook ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
makeFlags = [ "NV_USE_BUNDLED_LIBJANSSON=0" ];
|
||||
makeFlags = nvidia_x11.makeFlags ++ [ "NV_USE_BUNDLED_LIBJANSSON=0" ];
|
||||
installFlags = [ "PREFIX=$(out)" ];
|
||||
|
||||
postPatch = lib.optionalString nvidia_x11.useProfiles ''
|
||||
@ -61,7 +61,7 @@ stdenv.mkDerivation {
|
||||
preBuild = ''
|
||||
if [ -e src/libXNVCtrl/libXNVCtrl.a ]; then
|
||||
( cd src/libXNVCtrl
|
||||
make
|
||||
make $makeFlags
|
||||
)
|
||||
fi
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user