Hi, I’m starting with Nix using NixOS, all worked good. Now I have a HP Envy laptop with a Optimus system Intel + Nvidia, so i need to install nvidia drivers. The problem is that i can’t download the nvidia drivers from official site, so i downloaded in other PC and copied to my laptop, so i was searching the method to change the src of nvidia derivation to use my own src. I tried to use this on my nvidia.nix
file:
Nix 22.05
nix-info:
stem: "x86_64-linux", multi-user?: yes, version: nix-env (Nix) 2.8.1, nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
{ config, pkgs, lib, linuxPackages, ... }:
let
nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec -a "$0" "$@"
'';
in
{
environment.systemPackages = [ nvidia-offload ];
hardware.nvidia.package = pkgs.linuxPackages.nvidia_x11.overrideAttrs
(oldAttrs: rec {
src = /home/luis/Downloads/NVIDIA-Linux-x86_64-515.48.07.run;
useGLVND = true;
});
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia.prime = {
offload.enable = true;
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
}
But on nixos-rebuild build
start to work, use that downloaded file, compile and make the derivation, but after that… try again to download the driver from nvidia website…
building Nix...
building the system configuration...
these 14 derivations will be built:
/nix/store/064kgrc5cwjn1228a2qpj8dd20d4cg16-NVIDIA-Linux-x86_64-515.48.07.run.drv
/nix/store/p1zjnk55cbrc6cv3232x6iaxfmxzq744-nvidia-x11-515.48.07-5.15.43.drv
/nix/store/lcpx89kmbjyd3apzhjy43xh3hy4mksn7-nvidia-settings-515.48.07.drv
/nix/store/hiqq8i2yc5d1hdalpw2x6ggz0cxp68mx-system-path.drv
/nix/store/idh5dgkx2s472d7nw5myh4i34xmvq1xz-dbus-1.drv
/nix/store/28s2c0kjnz0bllgg2pav0cvdfbbck4zv-unit-dbus.service.drv
/nix/store/5i40naj4njypx06cbgqqc3wfn5mik8zy-unit-accounts-daemon.service.drv
/nix/store/i5gw2bq6756nvw5hy7qcrmyy9rq10zpq-user-units.drv
/nix/store/iaxw0nkdab90xcgdnki4kar5c0s7vs2l-unit-dbus.service.drv
/nix/store/iyid5hmd1hkq1lsy1ppmlsj1ihlbdgca-unit-systemd-fsck-.service.drv
/nix/store/mpp975qvlg1iydr82njxgswgay8gz32c-unit-polkit.service.drv
/nix/store/jbqhhjk8bwaijb4cxygk2fvdzyd7zvbz-system-units.drv
/nix/store/g8sg644jkvddkixiv692r99kxayprgw9-etc.drv
/nix/store/y5xc6yx6czcanisd0ff6vrji75n0xlaf-nixos-system-envy-22.05.851.dab6df51387.drv
building '/nix/store/064kgrc5cwjn1228a2qpj8dd20d4cg16-NVIDIA-Linux-x86_64-515.48.07.run.drv'...
trying https://us.download.nvidia.com/XFree86/Linux-x86_64/515.48.07/NVIDIA-Linux-x86_64-515.48.07.run
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 345 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 403
error: cannot download NVIDIA-Linux-x86_64-515.48.07.run from any mirror
error: builder for '/nix/store/064kgrc5cwjn1228a2qpj8dd20d4cg16-NVIDIA-Linux-x86_64-515.48.07.run.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/p1zjnk55cbrc6cv3232x6iaxfmxzq744-nvidia-x11-515.48.07-5.15.43.drv' failed to build
error: 1 dependencies of derivation '/nix/store/lcpx89kmbjyd3apzhjy43xh3hy4mksn7-nvidia-settings-515.48.07.drv' failed to build
error: 1 dependencies of derivation '/nix/store/hiqq8i2yc5d1hdalpw2x6ggz0cxp68mx-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/idh5dgkx2s472d7nw5myh4i34xmvq1xz-dbus-1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/5i40naj4njypx06cbgqqc3wfn5mik8zy-unit-accounts-daemon.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mpp975qvlg1iydr82njxgswgay8gz32c-unit-polkit.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/iyid5hmd1hkq1lsy1ppmlsj1ihlbdgca-unit-systemd-fsck-.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/28s2c0kjnz0bllgg2pav0cvdfbbck4zv-unit-dbus.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/iaxw0nkdab90xcgdnki4kar5c0s7vs2l-unit-dbus.service.drv' failed to build
error: 4 dependencies of derivation '/nix/store/jbqhhjk8bwaijb4cxygk2fvdzyd7zvbz-system-units.drv' failed to build
error: 1 dependencies of derivation '/nix/store/i5gw2bq6756nvw5hy7qcrmyy9rq10zpq-user-units.drv' failed to build
error: 4 dependencies of derivation '/nix/store/g8sg644jkvddkixiv692r99kxayprgw9-etc.drv' failed to build
error: 2 dependencies of derivation '/nix/store/y5xc6yx6czcanisd0ff6vrji75n0xlaf-nixos-system-envy-22.05.851.dab6df51387.drv' failed to build