nix-community / nixGL

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

nixpkgs was not found #94

Open techflashYT opened 2 years ago

techflashYT commented 2 years ago

When I try to do anything with it, when I get to the part where you need to run nix-env, it gives this:

error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)

    at /home/XXXXX/nixGL/default.nix:18:17:

        17|    # able to access the nvidia drivers.
        18|    pkgs ? import <nixpkgs>  {
            |
        19|       config = { allowUnfree = true; };
(use '--show-trace' to show detailed information)

I tried a lot of different things, and it just doesn't seem to work. Any ideas?

SuperSandro2000 commented 2 years ago

You either need to input pkgs or have a channel named nixpkgs.

MOIS3Y commented 2 years ago

Hello! I had the same problem Void Linux x86_64 5.15.36_1.

nix-channel --list
nixgl https://github.com/guibou/nixGL/archive/main.tar.gz
nixpkgs https://nixos.org/channels/nixpkgs-unstable

I added and updated the channel according to the instructions: nix-channel --add https://github.com/guibou/nixGL/archive/main.tar.gz nixgl && nix-channel --update But I was getting an error

nix-env -iA nixgl.auto.nixGLNvidia
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I), at /nix/store/kxmvibl3clfjm4fj726y9rf710dayqan-nixgl/nixgl/default.nix:18:17

The solution to the problem was to check the variable: echo $NIX_PATH If it's empty. Just export it export NIX_PATH=$HOME/.nix-defexpr/channels