这是我的nixos
版本:
$ nixos-version
16.09pre85931.125ffff (Flounder)
这是我的shell脚本:
$ cat test.nix
{ nixpkgs ? import <nixpkgs> {
}, compiler ? "ghc801" }:
let
inherit (nixpkgs) pkgs;
ghc = pkgs.haskell.packages.${compiler}.ghcWithPackages (ps: with ps; [
diagrams
diagrams-pgf
]);
in
pkgs.stdenv.mkDerivation {
name = "test";
buildInputs = with pkgs; [
ghc
];
shellHook = ''
eval $(egrep ^export ${ghc}/bin/ghc)
'';
}
这是问题所在。请注意,同一包的同一版本的两个实例之间存在冲突:
$ nix-shell --pure test.nix
these derivations will be built:
/nix/store/r6080kvlvdb16c1frz8alnm14xjizkf5-ghc-8.0.1.drv
building path(s) ‘/nix/store/1129nds6xhq6hqawdd2s9z9n6va57jgl-ghc-8.0.1’
collision between `/nix/store/amdnmbd8p52d49bqmphv9f7ly7lf7pkk-active-0.2.0.10/share/doc/x86_64-linux-ghc-8.0.1/active-0.2.0.10/html/Data-Active.html' and `/nix/store/yniw6akz2ldimdlj9yq968ldaf4j18h1-active-0.2.0.10/share/doc/x86_64-linux-ghc-8.0.1/active-0.2.0.10/html/Data-Active.html'
builder for ‘/nix/store/r6080kvlvdb16c1frz8alnm14xjizkf5-ghc-8.0.1.drv’ failed with exit code 255
error: build of ‘/nix/store/r6080kvlvdb16c1frz8alnm14xjizkf5-ghc-8.0.1.drv’ failed
/run/current-system/sw/bin/nix-shell: failed to build all dependencies
我知道如果包有不同的版本,那么我可以这样做:
$ nix-env --set-flag priority 15 <package>-<version>
但是由于包名和版本都是一样的,不知道怎么办。
我怎样才能从中恢复过来?