`nix.nixPath` equivalent outside nixos

nixpkgs reference can be overridden with this flag -I nixpkgs=. Whilst searching for a config based solution I found nix.nixPath which can be used on nixos. I’m unsure what exactly this config does on nixOs but is there a way to achieve the same result on non nixos systems? (i.e. config, through setting env vars or even with home-manager)
If there are docs/code references that explain what that config is doing it’ll also be much appreciated as my shell has no NIX_PATH set (OS: ubuntu with a single user nix installation)

When in doubt, you can check the source code the nixpkgs options search links - documentation to explain implementation details that are obvious from the code will be scarce: nixpkgs/nixos/modules/config/nix-channel.nix at 53a2c32bc66f5ae41a28d7a9a49d321172af621e · NixOS/nixpkgs · GitHub

You can alternatively also use the nix.conf file to set that variable: nix.conf - Nix Reference Manual

1 Like

Thanks, nix-path is exactly what I was after. My own fault for searching nix.path instead on the conf man page. Wonder if there’s a fuzzy search function for man pages