Sergey Mironov <[email protected]> writes: > Hi. Please, also take a look also on the topic "nix-env ignores > NIX_PATH" - it contains some answers on NIX_PATH theme. > > +1 for nix-env/nixos-rebuild -I unification. I think their cmdline > interface is too complicated.
I've read that topic, but no answer there, except for confirmation on nix-env not looking at NIX_PATH. The only way I could get what I want was by adding a symlink to ~/.nix-defexprs. But I would much prefer to be able to do this using only an environment variable or adding an extra switch. for now, just swapping .nix-defexprs works ok Thanks > > 2012/7/6 Mathijs Kwik <[email protected]>: >> On Thu, Jul 5, 2012 at 11:07 PM, Eelco Dolstra >> <[email protected]> wrote: >>> Hi, >>> >>> On 05/07/12 17:02, Mathijs Kwik wrote: >>> >>>>> And a question about NIX_PATH: >>>>> by default it's >>>>> >>>> NIX_PATH='/nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs:nixos=/etc/nixos/nixos:nixos-config=/etc/nixos/configuration.nix:services=/etc/nixos/services' >>>>> >>>>> I understand the name=value pairs give the <name> syntax, but how does a >>>>> plain >>>> dirname (like the channels/nixos dir) get handled? >>> >>> See the description of NIX_PATH in nix-env(1). >> >> Nice, I should read the man pages more :) >> >>> >>>>> I see it contains nixos and nixpkgs, but also a cryptic default.nix >>> >>> The default.nix just includes Nixpkgs so that nix-env can find the Nixpkgs >>> copy >>> in the NixOS channel. >>> >>>>> My local /home/mathijs/nix-dev dir contains nixos and nixpkgs. >>>>> If I want to switch to using those instead of the channel (temporarily), >>>>> can I >>>> just point NIX_PATH there? >>> >>> Yes, or use -I (e.g. "nixos-rebuild switch -I ~mathijs/nix-dev"). >> >> This works for nixos-rebuild, but not for nix-env. >> >> Now, I know I can fiddle with the synlinks below ~/.nix-defexpr, but I >> would prefer not to. >> Say I can normally upgrade a package by >> nix-env -iA nixos.pkgs.xterm >> >> Now I want to do this again, but now using my local ~/nix-dev. >> >> I tried >> nix-env -iA nixos.pkgs.xterm -I ~/nix-dev >> nix-env -iA nixos.pkgs.xterm -f ~/nix-dev >> >> NIX_PATH="~/nix-dev" nix-env -iA nixos.pkgs.xterm >> NIX_PATH="nixpkgs=~/nix-dev/nixpkgs:nixos=~/nix-dev/nixos" nix-env -iA >> nixos.pkgs.xterm >> >> none of these worked. >> >> >>> >>> -- >>> Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/ >>> _______________________________________________ >>> nix-dev mailing list >>> [email protected] >>> http://lists.science.uu.nl/mailman/listinfo/nix-dev >> _______________________________________________ >> nix-dev mailing list >> [email protected] >> http://lists.science.uu.nl/mailman/listinfo/nix-dev _______________________________________________ nix-dev mailing list [email protected] http://lists.science.uu.nl/mailman/listinfo/nix-dev
