www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit ae5bc98bb7b1cbec930fd146e25ae033a440df00
parent 237b47397fe52e9fe61cb3be88100edf7b164ff2
Author: Guillaume Bouchard <guillaum.bouchard@gmail.com>
Date:   Sun, 26 Apr 2020 20:10:32 +0200

Remove the need for an overlay

nvidia_x11 was overrode in an overlay. It is no longer the case and the
override is now explicit.

This will allows the creation of a `nixGL.nix` file callable with
`callPackage`. This change is a preliminary work for inclusion in
`nixpkgs`, as requested in #16.

It will also highly improve the use on nixGL in other project because
user won't have to pass a non initialized `nixpkgs`.

Diffstat:
Mdefault.nix | 36++++++++++++++----------------------
1 file changed, 14 insertions(+), 22 deletions(-)

diff --git a/default.nix b/default.nix @@ -39,26 +39,7 @@ let name = oldAttrs.name + "-${_nvidiaVersion}"; }); - overlay = self: super: - { - linuxPackages = super.linuxPackages // - { - nvidia_x11 = (super.linuxPackages.nvidia_x11.override { - }).overrideAttrs(oldAttrs: rec { - name = "nvidia-${_nvidiaVersion}"; - src = let url ="http://download.nvidia.com/XFree86/Linux-x86_64/${_nvidiaVersion}/NVIDIA-Linux-x86_64-${_nvidiaVersion}.run"; - in if nvidiaHash != null - then super.fetchurl { - inherit url; - sha256 = nvidiaHash; - } else - builtins.fetchurl url; - useGLVND = true; - }); - }; - }; - - nixpkgs = pkgs { overlays = [overlay]; config = {allowUnfree = true;};}; + nixpkgs = pkgs {config = {allowUnfree = true;};}; writeExecutable = { name, text } : nixpkgs.writeTextFile { inherit name text; @@ -81,7 +62,18 @@ let in with nixpkgs; rec { - nvidia = linuxPackages.nvidia_x11; + nvidia = (linuxPackages.nvidia_x11.override { + }).overrideAttrs(oldAttrs: rec { + name = "nvidia-${_nvidiaVersion}"; + src = let url ="http://download.nvidia.com/XFree86/Linux-x86_64/${_nvidiaVersion}/NVIDIA-Linux-x86_64-${_nvidiaVersion}.run"; + in if nvidiaHash != null + then fetchurl { + inherit url; + sha256 = nvidiaHash; + } else + builtins.fetchurl url; + useGLVND = true; + }); nvidiaLibsOnly = nvidia.override { libsOnly = true; @@ -93,7 +85,7 @@ rec { text = '' #!/usr/bin/env sh export LD_LIBRARY_PATH=${lib.makeLibraryPath [nvidia]}:$LD_LIBRARY_PATH - ${bumblebee}/bin/optirun --ldpath ${lib.makeLibraryPath ([libglvnd nvidia] ++ lib.optionals enable32bits [nvidia.lib32 pkgsi686Linux.libglvnd])} "$@" + ${bumblebee.override {nvidia_x11 = nvidia; nvidia_x11_i686 = nvidia.lib32;}}/bin/optirun --ldpath ${lib.makeLibraryPath ([libglvnd nvidia] ++ lib.optionals enable32bits [nvidia.lib32 pkgsi686Linux.libglvnd])} "$@" ''; });