我如何解决nix-shell错误“错误:创建目录'/ nix / var':权限被拒绝”?

问题描述 投票:0回答:1

尝试突然运行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非常简单,所以我不明白为什么这会导致这些错误。

nix
1个回答
0
投票

[[0]似乎正在沙箱中调用Nix命令。 cabal2nix中的Nixpkgs版本不允许这样做,并且可能是由于错误而发生的。我能够使用

建立项目
NIX_PATH

主题外:支持递归nix调用nix-build -I nixpkgs=channel:nixos-unstable ,但对结果的纯度和密封性有一些限制。

© www.soinside.com 2019 - 2024. All rights reserved.