当我突然尝试运行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项目的名称。它的default.nix是is here的,非常简单,所以我不明白为什么这会导致这些错误。
发布于 2020-03-25 16:43:11
看起来像是cabal2nix
在沙箱中调用了一个Nix命令。这是不允许的,可能是在NIX_PATH
的Nixpkgs版本中错误地发生的。我可以用来构建这个项目
nix-build -I nixpkgs=channel:nixos-unstable
离题:支持递归nix调用will,但对结果的纯洁性和密封性有一些限制。
https://stackoverflow.com/questions/60838230
复制相似问题