如何使用 Nix 包管理器禁用“私有挂载命名空间”沙箱?

问题描述

我正在尝试在 repl.it 上使用 nix。我正在使用来自 https://matthewbauer.us/blog/static-nix.html 的 static-nix。如果我运行以下代码:

mkdir -p "$HOME/.cache/nix/"
curl https://matthewbauer.us/nix > "$HOME/.cache/nix/nix.exe"
cat "$HOME/.cache/nix/nix.exe" | bash -s run --no-sandbox --store "$HOME/.cache/nix/store" -f channel:nixpkgs-unstable bash graphviz -c sh -c 'dot --help'

我收到此错误:

error: setting up a private mount namespace: Operation not permitted

我尝试了 --no-sandbox--option sandbox false--option build-use-sandbox false,这些都对错误没有任何影响。

这是在我无法更改内核设置的机器上以非 root 身份执行的。

这是一个重现问题的 REPL(它在显示错误之前运行了一小段时间):https://repl.it/@suzannesoy/AgonizingWittyCoding#main.sh

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)