尝试突然运行nix-shell时遇到了错误。它曾经可以正常工作,但后来我没有错,开始出现以下错误:
jon@jon-laptop ~/D/C/D/0/color-word-analyzer (master)> nix-shell
building '/nix/store/02szzrd1w7wqmnkh9is5qlx64m7r6f1z-cabal2nix-color-word-analyzer.drv'...
installing
error: creating directory '/nix/var': Permission denied
error: creating directory '/nix/var': Permission denied
** need a revision for VCS when the hash is given. skipping.
** need a revision for VCS when the hash is given. skipping.
** need a revision for VCS when the hash is given. skipping.
** need a revision for VCS when the hash is given. skipping.
cabal2nix: user error (Failed to fetch source. Does this source exist? Source {sourceUrl = "/nix/store/fvka3nd7slnqgjvfkjg649v77y10lc89-color-word-analyzer", sourceRevision = "", sourceHash = Guess "", sourceCabalDir = ""})
builder for '/nix/store/02szzrd1w7wqmnkh9is5qlx64m7r6f1z-cabal2nix-color-word-analyzer.drv' failed with exit code 1
error: build of '/nix/store/02szzrd1w7wqmnkh9is5qlx64m7r6f1z-cabal2nix-color-word-analyzer.drv' failed
颜色词分析器是我正在开发的Haskell项目的名称。 is here的default.nix非常简单,所以我不明白为什么这会导致这些错误。
答案 0 :(得分:1)
cabal2nix
似乎正在沙箱中调用Nix命令。在您的NIX_PATH
中的Nixpkgs版本中,这是不允许的,并且可能是错误地发生的。我能够用
nix-build -I nixpkgs=channel:nixos-unstable
离题:递归nix调用will受结果纯度和密封性的限制。