I trying to install NixOS containers. My operating system is NixOS.
When I created a new container with incus. I tried with nixos/24.11 and nixos/unstable.
I did the following:
incus exec nixos bash
[root@nixos:~]# nixos-rebuild switch
I get these errors:
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring error: file 'nixpkgs/nixos' was not found in the Nix search path (add it using $NIX_PATH or -I)
The NixOS documentation on Incus does not mention the requirement for the Incus security.nesting flag. You would need to use this flag if the host is not a baremetal system or a virtual machine, but a container. Can you verify that the host is not a container, and that you have followed the steps for NixOS at How to install Incus - Incus documentation ?
When it says NixOS Instances, it means that you are running NixOS in Incus and you want to launch a new instance in there. Either in a container, either in a virtual machine. In the former you enable nested namespaces, in the latter you disable Secure Boot because the NixOS kernel does not have a SecureBoot key.