Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NixOS 24.11 switch-to-configuration broke nixos-infect #225

Open
erdnaxe opened this issue Nov 19, 2024 · 1 comment
Open

NixOS 24.11 switch-to-configuration broke nixos-infect #225

erdnaxe opened this issue Nov 19, 2024 · 1 comment

Comments

@erdnaxe
Copy link

erdnaxe commented Nov 19, 2024

When running nixos-infect on a brand new Contabo VPS running Ubuntu 22.04, I get the following crash:

[...]
deleting unused links...
note: currently hard linking saves -0.00 MiB
174 store paths deleted, 377.98 MiB freed
+ [[ -L /etc/resolv.conf ]]
+ mv -v /etc/resolv.conf /etc/resolv.conf.lnk
renamed '/etc/resolv.conf' -> '/etc/resolv.conf.lnk'
+ cat /etc/resolv.conf.lnk
+ '[' -n '' ']'
+ touch /etc/NIXOS
+ echo etc/nixos
+ echo etc/resolv.conf
+ echo root/.nix-defexpr/channels
+ cd /
+ ls etc/ssh/ssh_host_dsa_key etc/ssh/ssh_host_dsa_key.pub etc/ssh/ssh_host_ecdsa_key etc/ssh/ssh_host_ecdsa_key.pub etc/ssh/ssh_host_ed25519_key etc/ssh/ssh_host_ed25519_key.pub etc/ssh/ssh_host_rsa_key etc/ssh/ssh_host_rsa_key.pub
+ rm -rf /boot.bak
+ isEFI
+ '[' -d /sys/firmware/efi ']'
+ mv -v /boot /boot.bak
mv: cannot move '/boot' to '/boot.bak': Device or resource busy
+ cp -a /boot /boot.bak
+ rm -rf /boot/config-5.15.0-25-generic /boot/config-5.4.0-105-generic /boot/grub /boot/initrd.img /boot/initrd.img-5.15.0-25-generic /boot/initrd.img-5.4.0-105-generic /boot/initrd.img.old /boot/lost+found /boot/System.map-5.15.0-25-generic /boot/System.map-5.4.0-105-generic /boot/vmlinuz /boot/vmlinuz-5.15.0-25-generic /boot/vmlinuz-5.4.0-105-generic /boot/vmlinuz.old
+ umount /boot
+ isEFI
+ '[' -d /sys/firmware/efi ']'
+ /nix/var/nix/profiles/system/bin/switch-to-configuration boot
Error: /run/current-system/sw/bin is missing

Caused by:
    No such file or directory (os error 2)

It seems that NixOS new switch-to-configuration Rust tool expects /run/current-system/sw/bin to exist.

@erdnaxe
Copy link
Author

erdnaxe commented Nov 19, 2024

A dirty fix to circumvent this issue is to run ln -s /nix/var/nix/profiles/system /run/current-system then /nix/var/nix/profiles/system/bin/switch-to-configuration boot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant