[Nix-dev] Best practices for replacing channels with my own package set?

Jeffrey David Johnson jefdaj at gmail.com
Tue Jun 2 08:56:59 CEST 2015


Hmm I have that too but it doesn't work. Is yours like this (with myhead
for mypkgs)?

$ ls ~/.nix-defexpr/ -al
...
lrwxrwxrwx  1 jefdaj users   22 Apr 17 10:46 mypkgs -> /path/to/mypkgs
...

I think I found the other/main problem: `NIX_PATH` isn't
sticking during `nixos-rebuild` because I put it in
`environment.variables` instead of `environment.sessionVariables`. I
guess it's normally set in both and `sessionVariables` takes priority?
If I set it in the shell with `export NIX_PATH=...` then `nix-env`
works again. It also works when placed in `sessionVariables` as Herwig
said, but that causes other havoc (messing up the locale etc.):

with import <mypkgs>;
{
  ...
  environment.sessionVariables = lib.mkForce {
    "NIX_PATH" = "/path/to/mypkgs";
  };
  ...
}

Am I looking for a way to union that with the defaults or maybe
`mkForce` a single attribute?
Jeff

On Mon, 1 Jun 2015 21:37:01 -0700
James Cook <james.cook at utoronto.ca> wrote:

> I have a symlink from ~/.nix-defexpr/myhead to the nixpkgs tree I want to use.
> 
> James
> 
> On 1 June 2015 at 17:35, Jeffrey David Johnson <jefdaj at gmail.com> wrote:
> > Nevermind, that sets NIX_PATH but nix-env still errors out with:
> >
> > nix-env: src/libexpr/eval.hh:57: void nix::Bindings::push_back(const nix::Attr&): Assertion `size_ < capacity' failed.
> > Aborted
> >
> > Unless explicitly given the -f option.
> > Jeff
> >
> > On Tue, 2 Jun 2015 00:31:35 +0200
> > Herwig Hochleitner <hhochleitner at gmail.com> wrote:
> >
> >> I set NIX_PATH in environment.sessionVariables (with an mkForce, to
> >> override the builtin one). nix-env and everything else should pick it up,
> >> that way, since that's the location it's predefined.
> > _______________________________________________
> > nix-dev mailing list
> > nix-dev at lists.science.uu.nl
> > http://lists.science.uu.nl/mailman/listinfo/nix-dev


More information about the nix-dev mailing list