-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nix search path entry does not exist #28
Comments
It looks like you do not have a valid NIX_PATH set and/or or nix-channels is not set up in the VM. If you don't to set up one each time you can use one of the following methods: $ export NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixpkgs-unstable.tar.gz
$ nix-build or $ nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixpkgs-unstable.tar.gz There is probably also a way on how to do this declarative in the NixOS configuration of the VM. |
I'm thinking this might also be due to my permsissions? When I create a different user in the vm.nix file, in the wheel group, and try to use sudo, I get the following error:
My NIX_PATH does is valid for the user karel, but not root:
For context, here is the configuration file:
|
Or am I not supposed to use users different from root with nixos-shell? |
I have not tested this with different users but when I log into the vm and run as root
I see a channel being created. |
Hmmm, I'll have a look at this more this weekend. We were hoping to use nixos-shell as dev environments, with services running etc; so running everything as root should work, although our security guy was not too happy ;) |
It should also work without root. I just have not tried it. You need to create a different channel anyway afterwards. Instead of channels you can also set NIX_PATH globally in the vm using this nixos configuration. { pkgs, ... }: {
nix.nixPath = [
"nixpkgs=${pkgs.path}"
];
} |
I'm getting the following error:
Any advice on how to use
nix build
inside the vm?The text was updated successfully, but these errors were encountered: