NixOS를 재구축하려고 했을 때 기반이 될 수 없어서 실패했습니다 NIX_PATH
. nixos-unstable
채널 전환을 시도하다가 23.11
실수로 채널을 추가했다가 nixpkgs-unstable
제거했기 때문에 이런 일이 일어났습니다. 채널을 다시 추가해도 오류가 변경되지 않았습니다.
여기에 문제가 있나요?
디렉터리에는 /nix/var/nix/profiles/per-user/root/channels
파일이 하나만 포함되어 있으며 디렉터리를 포함하여 더 많은 파일을 포함하는 manifest.nix
형제 디렉터리가 존재합니다 .channel-2-link
channels-1-link
nixos
NIX_PATH
, 내 채널과 전체 버그 보고서는 여기에 있습니다.
~> $env.NIX_PATH
nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
~> sudo nix-channel --list
nixos https://nixos.org/channels/nixos-unstable
~> sudo nixos-rebuild switch --upgrade
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error:
… <borked>
at «none»:0: (source not available)
… while calling the 'import' builtin
at «string»:1:6:
1| with import <nixpkgs/nixos> {}; config.system.build.nixos-rebuild
| ^
(stack trace truncated; use '--show-trace' to show the full trace)
error: file 'nixpkgs/nixos' was not found in the Nix search path (add it using $NIX_PATH or -I)
at «none»:0: (source not available)
building Nix...
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs/nixos' was not found in the Nix search path (add it using $NIX_PATH or -I)
at «none»:0: (source not available)
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)
at «none»:0: (source not available)
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs/nixos/modules/installer/tools/nix-fallback-paths.nix' was not found in the Nix search path (add it using $NIX_PATH or -I)
at «none»:0: (source not available)
/tmp/nixos-rebuild.TFvl5H/nix
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)
at «none»:0: (source not available)
building the system configuration...
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs/nixos' was not found in the Nix search path (add it using $NIX_PATH or -I)
at «none»:0: (source not available)
답변1
아직 정확히 무엇이 잘못되었는지는 모르지만 다음과 같이 읽었습니다.수동nix-channel
이를 실행하여 sudo nix-channel --rollback
Nix 채널을 이전의 올바른 상태로 되돌릴 수 있습니다. 이것은 내 문제를 해결했습니다.