Hi,
thanks for the tips, but I still have some doubts.
I tried installing NixOS from liveusb but failed, so I’m trying to install it to another partition side-to-side with my current installation (Fedora 31).
My major problem is that I’m not sure how to mount the boot partitions (EFI system, GPT). In the current Fedora installation, the situation is this:
/dev/sda1 mounted in /boot/efi
/dev/sda2 mounted in /boot
/dev/sda3 is a LVM physical volume with 3 logical volumes:
/dev/VolumeGroup/swap
/dev/VolumeGroup/root mounted to / in fedora
/dev/VolumeGroup/nixos that should be mounted as / in nixos
The objective is to have nixos and fedora side-to-side, selectable in GRUB.
I prepared the /dev/VolumeGroup/nixos partition, but I’m not sure if I should mount the boot partitions as fedora is doing or not. Before installing, should I run
# mount /dev/VolumeGroup/nixos /mnt
# mount /dev/sda2 /mnt/boot
# mount /dev/sda1 /mnt/boot/efi
or should I run
# mount /dev/VolumeGroup/nixos /mnt
# mount /dev/sda1 /mnt/boot
Which one? I don’t know what the installer would do, so I can’t chose and I would like to get it right and not break the current system.
Also, I am not sure about the GRUB configuration. My current setup is:
boot.loader.grub.useOSProber = true;
but I’m unsure if this is enough or I should have explicitly
The confusing part is Fedora on UEFI has two partitions mounted under boot, one for the EFI images that should be mounted at /boot/efi (where Fedora’ grub is contained in /boot/efi/EFI/fedora/grubx64.cfg) and one partition for /boot which contains the kernel. T
The above should allow the system to boot. Change your uuid’s of course (include --root in the grub override). Note, this chainload’s Fedora’s grub, so you’ll be forwarded from the nix grub into fedora grub. I find this is more robust (although if anyone’s gotten auto-updating fedora kernels in nix grub please let me know.
I added 2 entries just to see the various results.
In the first case, “Fedora ONE” (configfile), the system just reboots,
while in the second case “Fedora TWO” (chainloader), I get a grub> prompt, but I couldn’t manage to use it.
Not sure how to fix this, even if I can boot, so it’s not really a problem.
Yes, I also tried that, but without prefixing ($root) to the chainload path I get a not found error.
Regarding the nodev: what’s the point of it? I get that nodev will change grub config, without installing grub. From my understanding, grub is already there due to fedora installation, so nix is updating the config but the grub I see is the one from fedora, so I don’t really need to unset nodev.
This being said, unsetting it will probably reinstall it over the existing one, which is not really a problem.
Is that correct?
Now, I thought I might try with no grub altogether, so I’ll just use the UEFI boot menu instead
Not really a fix, but still good for me.
@wmertens May I ask if you could help me? I’d like to try your technique but I’ve not worked out how to get the install scripts…
Background is that the NixOS .iso’s using dd will not boot on my Thinkpad X1 Tablet 2nd gen. Ubuntu ones and others do… and I’ve done it 100s of times before so that’s odd.
Sorry for missing this! If the ISO doesn’t work that’s definitely an issue that should be tracked. In any case, the kexec approach works well. It’s reasonably straightforward, you first pass it the command line arguments and then you tell it to switch, at which point it instantly loads the kernel and it’s as if you booted regularly.
This thread was a great help to me. I think nixos-remote and Colmena are on my list to learn more, what I have done to get me going on bare metal is this:
However, for someone new to Nix but familiar with an existing distribution and happy their hardware-configuration might like to start installing their known linux and install NixOS from there.