[Nix-dev] Shared packages list and collision errors

Dario Bertini berdario at gmail.com
Thu Mar 19 17:05:39 CET 2015


I have this inside my configuration.nix

environment.systemPackages = (import <common>);

and this is my NIX_PATH:

/nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs:nixos-config=/etc/nixos/configuration.nix:nixtrunk=/home/dario/nixpkgs:common=/home/dario/.dotfiles/packages.nix

these are the contents of /home/dario/.dotfiles/packages.nix

with (import <nixpkgs> {}).pkgs;
[
  gcc
  clang
]


When I run either

sudo -E nixos-rebuild switch

or

nix-env -f packages.nix -i

I get a collision, a warning in the former case, and an error in the latter:

http://nixpaste.noip.me/uajF2oOg?nix

but if I change my environment.systemPackages to what it was before, i.e.:

environment.systemPackages = with pkgs; [gcc clang];

I don't get any errors.

Can someone point me to an explanation/docs for this behavior?

(My use case btw is to do this:
https://nixos.org/wiki/FAQ#How_can_I_manage_software_with_nix-env_like_with_configuration.nix.3F
while at the same time being able to use that same list inside my
configuration.nix)


Thank you


More information about the nix-dev mailing list