[Nix-dev] nixos-rebuild and NIX_PATH

Eelco Dolstra eelco.dolstra at logicblox.com
Tue May 22 15:28:58 CEST 2012


Hi,

On 22/05/12 09:15, Alexander Foremny wrote:

> after upgrading nix to version 1.0 I am trying to build my system
> configuration from my custom nixos and nixpkgs repository. I run into
> problems after I deleted /etc/nixos/{nixpkgs,nixos} as if I am not
> mistaken they are not needed anymore.

Only if you added the NixOS channel, i.e.

$ nix-channel --add http://nixos.org/releases/nixos/channels/nixos-unstable
$ nix-channel --update

After this you should have nixos and nixpkgs subdirectories in
/nix/var/nix/profiles/per-user/root/channels/nixos/.

> nixpkgs and nixos are still referenced there. Why is that?

They are there for backwards compatibility (i.e. as a fallback when people
haven't added the channel but do have /etc/nixos/{nixos,nixpkgs}).

> Should I
> remove those references from NIX_PATH? Where would be a good place to
> do that? 

It's not necessary to remove them, but if you really want to you can do

  environment.shellInit =
    ''
      export NIX_PATH=/blabla...
    '';

>> $ nixos-rebuild -I nixos=~/code/nixos -I nixpkgs=~/code/nixpkgs build

This should definitely work.  I use it all the time.

-- 
Eelco Dolstra | LogicBlox, Inc. | http://www.st.ewi.tudelft.nl/~dolstra/


More information about the nix-dev mailing list