首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何修复nix-shell错误“错误:创建目录'/nix/var':权限被拒绝”?

如何修复nix-shell错误“错误:创建目录'/nix/var':权限被拒绝”?
EN

Stack Overflow用户
提问于 2020-03-25 03:46:09
回答 1查看 979关注 0票数 0

当我突然尝试运行nix-shell时,我得到了奇怪的错误。它过去工作得很好,但后来由于不是我自己的错,我开始收到以下错误:

代码语言:javascript
复制
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的,非常简单,所以我不明白为什么这会导致这些错误。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-03-25 16:43:11

看起来像是cabal2nix在沙箱中调用了一个Nix命令。这是不允许的,可能是在NIX_PATH的Nixpkgs版本中错误地发生的。我可以用来构建这个项目

代码语言:javascript
复制
nix-build -I nixpkgs=channel:nixos-unstable

离题:支持递归nix调用will,但对结果的纯洁性和密封性有一些限制。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60838230

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档