我想在本地运行nixpkgs测试,我找到了本手册,但它不起作用
$ cd my/nixpkgs
$ nix-build --show-trace nixos/tests/login.nix
error: while evaluating the attribute ‘buildCommand’ of the derivation ‘vm-test-run-login’ at /home/bjorn/projects/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute ‘buildCommand’ of the derivation ‘nixos-test-driver-login’ at /home/bjorn/projects/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute ‘buildCommand’ of the derivation ‘nixos-vm’ at /home/bjorn/projects/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute ‘text’ of the derivation ‘run-nixos-vm’ at /home/bjorn/projects/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating anonymous function at /home/bjorn/projects/nixpkgs/pkgs/build-support/closure-info.nix:9:1, called from /home/bjorn/projects/nixpkgs/nixos/modules/virtualisation/qemu-vm.nix:105:13:
assertion failed at /home/bjorn/projects/nixpkgs/pkgs/build-support/closure-info.nix:11:1因为这个断言
assert builtins.langVersion >= 5;如何更新langVersion?
$ nix-repl
Welcome to Nix version 1.11.16. Type :? for help.
nix-repl> builtins.langVersion
3
nix-repl>发布于 2018-03-25 11:44:03
如果您想在17.09上多呆一段时间,可以使用以下NixOS配置升级Nix:
{ pkgs, ... }: {
nix.package = pkgs.nixUnstable;
}否则,你可能更喜欢切换到18.03,而不是不稳定。如果你要使用不稳定,确保你使用的是不稳定的,而不是不稳定的。请参阅https://nixos.wiki/wiki/Nixpkgs#Channels
发布于 2018-03-25 06:40:20
给大卫·格雷森
我不得不将nixos更新为不稳定(sudo nix-channel很重要)
sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos
sudo nixos-rebuild switch --upgrade
nix-instantiate --eval -E '(import <nixos> {}).lib.nixpkgsVersion'
nix-instantiate --eval -E 'builtins.langVersion'https://stackoverflow.com/questions/49469661
复制相似问题