1
我正在努力学习编写Nix表达式,并且我想要做我自己非常简单的“Hello World!”。 (如传统)。nix-build:bash权限被拒绝
所以,我有我的目录,只有这样default.nix
文件:
{pkgs ? import <nixpkgs> {}}:
derivation {
system = "x86_64-linux";
name = "simple-bash-derivation-helloworld";
builder = pkgs.bash;
args = [ "-c" "echo 'Hello World' > $out" ];
}
这里是我所得到的,当我尝试构建它:
nix-build
these derivations will be built:
/nix/store/3grmahx3ih4c50asj84p7xnpqpj32n5s-simple-bash-derivation-helloworld.drv
building path(s) ‘/nix/store/6psl3rc92311w37c1n6nj0a6jac16hv1-simple-bash-derivation-helloworld’
while setting up the build environment: executing ‘/nix/store/wb34dgkpmnssjkq7yj4qbjqxpnapq0lw-bash-4.4-p12’: Permission denied
builder for ‘/nix/store/3grmahx3ih4c50asj84p7xnpqpj32n5s-simple-bash-derivation-helloworld.drv’ failed with exit code 1
error: build of ‘/nix/store/3grmahx3ih4c50asj84p7xnpqpj32n5s-simple-bash-derivation-helloworld.drv’ failed
卸下args
线产生同样的问题。
为什么我会遇到许可问题? 什么是正确的方法来做一个简单的派生只是做一个bash回声?
请注意,这是一个学习练习:例如,我不想在此使用stdenv.mkDerivation
。
我在Ubuntu 16.04系统上运行nix-env (Nix) 1.11.9
。
在此先感谢。
确实,非常感谢你! 有没有什么地方记录这类事情? 我希望有一个nix IDE具有某种自动完成功能。 – HectorJ
http://nixos.org/nix/manual/ –
@DavidGrayson该手册没有详细说明软件包的内容 – HectorJ