My uefi boot deleted by windows

Okay, so Windows and NixOS are sharing the EFI partition on disk 1
I’m not quite sure what you mean by “the 600gb is btrfs with my game inside”, but I’m assuming the 237gb partition is your NixOS ext4 partition (also, btw, you can use WinBtrfs to be able to access that partition from Windows)

okay, so…rebuilding your EFI, you’ll need to use your ISO and boot into the Live media.

  1. open a terminal and run lsblk, which will list your partitions, and you’d want to note which one is the ext4 one (my guess is that it’ll be sdb2 or nvme0n2p2, but those are only educated guesses as I only have one drive in my system).
  2. you’ll also need to note which is the EFI one (probably sdb1 or nvme0n2p1, but again, I’m not sure…if you could post the lsblk output here then I’d be of more help)
  3. now you need to mount these partitions:
    $ mount -o bind /dev/<ext4> /mnt
    $ mkdir /mnt/boot
    $ mount -o bind /dev/<efi> /mnt/boot
    
    where /dev/<ext4> and /dev/<efi> have the bits replaced with the actual partition signifier: e.g. mine is /dev/nvme0np2.
  4. …now you can chroot into your NixOS installation with nixos-enter:
    $ nixos-enter
    
  5. …and then rebuild:
    $ sudo nixos-rebuild switch --option sandbox false
    
  6. This should rebuild your bootloader, at which point it should show up in your computers boot options.

mount it with chroot?

no hold on, ill put in the commands, i accidentally hit ctrl-enter

gimme the clear and kinda-detailed i gonna ss this and try

aight try it out now


now its like this

hm, try without the -o bind?

just sudo mount /dev/nvme0n1p2 /mnt

if that doesn’t work, make sure /mnt is created with sudo mkdir /mnt

if the boot directory already exists, then just proceed with the mount

soo i mount the boot?

yep, it’s /dev/nvme0n1p1

but it’s already mounted what i should do next?

no, just because the folder exists, doesn’t mean it’s mounted

if you ls /mnt/boot does it show a bunch of stuff? if it does, then yeah it’s mounted

next is to run nixos-enter

run it with superuser permissions: sudo nixos-enter

then i rebuild my config?

yes, using this command

oh, well, since you’re already root, i guess just nixos-rebuild switch --option sandbox false should work

(sorry i keep flip-flopping between “add sudo” and “remove sudo” lol)


welp its error to install the bootloader