nix-community / nixGL

A wrapper tool for nix OpenGL application [maintainer=@guibou]
628 stars 76 forks source link

nixGL fails with assertion error on nvidia #154

Closed tehmatt closed 5 months ago

tehmatt commented 5 months ago

I'm using nixGL@HEAD and nixpkgs-unstable@HEAD with home-manager. Running home-manager switch fails with the assertion assert useSettings -> !libsOnly;.

A recent PR (https://github.com/NixOS/nixpkgs/pull/278915) looks like it caused this. My uninformed guess is that nixGL should be explicitly setting useSettings to false near https://github.com/nix-community/nixGL/blob/489d6b095ab9d289fe11af0219a9ff00fe87c7c5/nixGL.nix#L87.

Raw stack-trace:

error:
       … while calling the 'derivationStrict' builtin

         at //builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'home-manager-generation'
         whose name attribute is located at /nix/store/g16z4fs1mrbkxc4x6wm8xbrh13nc7aw4-source/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'buildCommand' of derivation 'home-manager-generation'

         at /nix/store/g16z4fs1mrbkxc4x6wm8xbrh13nc7aw4-source/pkgs/build-support/trivial-builders/default.nix:98:16:

           97|         enableParallelBuilding = true;
           98|         inherit buildCommand name;
             |                ^
           99|         passAsFile = [ "buildCommand" ]

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: assertion '(useSettings -> (! libsOnly))' failed

       at /nix/store/g16z4fs1mrbkxc4x6wm8xbrh13nc7aw4-source/pkgs/os-specific/linux/nvidia-x11/generic.nix:61:1:

           60|
           61| assert useSettings -> !libsOnly;
             | ^
           62| assert !libsOnly -> kernel != null;
andreaswolf commented 5 months ago

@tehmatt FYI I just tested your approach locally and it does not work:

error: anonymous function at /nix/store/4g5j0mzm3razs9gxv9ijnaw5swvpfjgl-nixpkgs-src/pkgs/os-specific/linux/nvidia-x11/generic.nix:30:1 called with unexpected argument 'useSettings'

AFAICS the problem is that useSettings is part of the "outer" function in https://github.com/NixOS/nixpkgs/edit/master/pkgs/os-specific/linux/nvidia-x11/generic.nix, while we're calling the "inner" function in that file in nixGL.nix.

CleverCompiler commented 5 months ago

I'm getting the same error on my xps-9650. I had to remove the Nvidia driver to rebuild.

khlopkov commented 5 months ago

I'm getting the same error since yesterday. Seems it been reverted in nixpkgs:master, however nix-channel --update && nix-env -u does not help for me. Both nix-env -iA nixgl.auto.nixGLDefault and home-manager switch shows the same error.

My nix-channel --list is:

home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
nixgl https://github.com/guibou/nixGL/archive/main.tar.gz

UPD:

Fixed that by explicitly adding nixpkgs-unstable channel. Works fine with the following channels:

home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
nixgl https://github.com/guibou/nixGL/archive/main.tar.gz
nixpkgs https://nixos.org/channels/nixpkgs-unstable

Also works with the following flake inputs:

{
  ...
  inputs = {
    # Specify the source of Home Manager and Nixpkgs.
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    nixgl.url = "github:guibou/nixGL"; 
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
  ...
}
tehmatt commented 5 months ago

Fixed upstream.

nixos-discourse commented 5 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/home-manager-selective-update-of-packages-possible/39199/1