nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.04k stars 1.82k forks source link

bug: nixGLNvidia: No such file or directory #6035

Open punkfairie opened 5 days ago

punkfairie commented 5 days ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

I am trying to use the new NixGL integration with the proprietary Nvidia drivers on Arch Linux. I am getting the following error when trying to run Wezterm with a wrapper:

/nix/store/mf134rlg5b0sy7apqxm11whnc3gkswv0-nixGLCombinedWrapper-Nvidia/bin/nixGLCombinedWrapper-Nvidia: line 2: /nix/store/p13zc1ai6a9c2djr2nki7bf9xg2a681i-nixGLNvidia-565.57.01/bin/nixGLNvidia: No such file or directory

The file which actually exists includes the version number:

/nix/store/p13zc1ai6a9c2djr2nki7bf9xg2a681i-nixGLNvidia-565.57.01/bin/nixGLNvidia-565.57.01

The relevant configuration using flakes:

# Input defined as
# nixgl.url = "github:nix-community/nixGL";

# Within home-manager output:
nixGL.packages = nixgl.packages;
nixGL.defaultWrapper = "nvidia";
nixGL.installScripts = [ "nvidia" ];

programs.wezterm.package = (config.lib.nixGL.wrap pkgs.wezterm);

The wrapper is being created correctly, it's just referencing the wrong NixGL script. As far as I can tell my configuration is correct but if it isn't let me know.

Maintainer CC

@Smona

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.11.6-arch1-1, Arch Linux, noversion, rolling`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.25.0pre20240920_ca3fc169`
 - nixpkgs: `/home/marley/.nix-defexpr/channels/nixpkgs`
Smona commented 5 days ago

Hey @punkfairie, can you you post the revision of nixGL that you're using?

Also CC @exzombie in case they have time to look into this before I do.

exzombie commented 4 days ago

I can't reproduce this. In my case, the generated wrapper correctly refers to the versioned NixGL NVidia wrapper. I also tried switching from nixos-24.05 to nixos-unstable to see if there's any change. The versions I tested with:

'github:NixOS/nixpkgs/7ffd9ae656aec493492b44d0ddfb28e79a1ea25d' (2024-11-02)
'github:nix-community/home-manager/8f6ca7855d409aeebe2a582c6fd6b6a8d0bf5661' (2024-11-03)
'github:guibou/nixGL/310f8e49a149e4c9ea52f1adf70cdc768ec53f8a' (2024-04-19)

As expected, I get

❯ less ./result/home-path/bin/wezterm
#! /nix/store/mm0pa3z7kk6jh1i9rkxqxjqmd8h1qpxf-bash-5.2p37/bin/bash -e
exec -a "wezterm" "/nix/store/n0mlyblzsaz3j11yijbgjqclxplx9zfv-nixGLCombinedWrapper-Nvidia/bin/nixGLCombinedWrapper-Nvidia"  /nix/store/ps9ipfzjlp97v4kh4gdrcpnrqsrr80r4-wezterm-20240203-110809-5046fc22/bin/wezterm "$@"
❯ less /nix/store/n0mlyblzsaz3j11yijbgjqclxplx9zfv-nixGLCombinedWrapper-Nvidia/bin/nixGLCombinedWrapper-Nvidia
#!/nix/store/mm0pa3z7kk6jh1i9rkxqxjqmd8h1qpxf-bash-5.2p37/bin/bash
exec /nix/store/n0lwgw8wvk907kvs9slzx1vr7wnbyywi-nixGLNvidia-560.35.03/bin/nixGLNvidia-560.35.03  "$@"

What's funny is that my Nvidia version is 560.35.03; @punkfairie, how did you get 565.57.01?

punkfairie commented 4 days ago

Strange. My Nvidia driver version is 565.57.01 according to the settings panel - the driver was installed through Pacman and that's the version number I see in the package repo as well.

I tried completely removing all references to NixGL, running home-manager switch --refresh, garbage collecting, then adding NixGL back in and running home-manager switch --refresh again. The result is the same.

It's very possible that this is just some strange alchemy of Arch Linux & Nix - I do plan to switch to NixOS eventually so if this is only a me problem I can live without NixGL and use the Pacman version of those packages that require it for now >.<

punkfairie commented 4 days ago

Hey @punkfairie, can you you post the revision of nixGL that you're using?

Sorry - just realized there was a reply above exzombie's.

My flake.lock lists

"rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a"

Is that what you're after?

exzombie commented 4 days ago

🤦

Of course, how silly of me. The version of the Nvidia driver comes from the OS. I was confused by the fact that NixGL also installs it from nixpkgs, but it naturally has to match the OS version.