nix-community/nixos-anywhere

How can I get a valid configuration after nixos-anywhere?

Opened this issue · 1 comments

After nixos-anywhere, I'm trying to nixos-rebuild, but I don't have a valid configuration, so it's guesswork.

BASHY $ nixos-rebuild switch --fast --flake .#default --target-host root@10.0.0.72 --build-host root@10.0.0.72
building the system configuration...
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
updating GRUB 2 menu...
installing the GRUB 2 boot loader on /dev/disk/by-id/ata-Samsung_SSD_980_1TB_S64ANS0W304164P...
Installing for i386-pc platform.
Installation finished. No error reported.
installing the GRUB 2 boot loader into /boot...
Installing for x86_64-efi platform.
/nix/store/1bfclcsrmv9a4w1mmfk5szn9axiji0ss-grub-2.12-rc1/sbin/grub-install: error: /boot doesn't look like an EFI partition.
/nix/store/75qbm0iq2qdc5kkijmyymf3mzswjivrc-install-grub.pl: installation of GRUB EFI into /boot failed: No such file or directory
warning: error(s) occurred while switching to the new configuration

In my flake, I have

fileSystems."/" =
    { device = "/dev/disk/by-uuid/f2204226-1a14-49f5-ad79-08857f12b59a";
      fsType = "ext4";
    };

  fileSystems."/boot" = {
    device = "/dev/disk/by-label/disk-main-ESP";
    fsType = "vfat";
  };


  boot.loader.grub.enable = true;
  boot.loader.grub.device = "/dev/disk/by-id/ata-Samsung_SSD_980_1TB_S64ANS0W304164P";
  #boot.loader.grub.useOSProber = false;
blkid
/dev/sda3: UUID="f2204226-1a14-49f5-ad79-08857f12b59a" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="disk-main-root" PARTUUID="3b99b026-3294-4c0c-bdb1-24a160d8f1b5"
/dev/sda2: PARTLABEL="disk-main-boot" PARTUUID="ca6bf32c-c209-44f5-afe5-d609afe3d1f2"
/dev/sda1: UUID="AC8D-AAD4" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="disk-main-ESP" PARTUUID="5316ef3b-5869-464e-9f15-78afb71e5ffd"

I'm not really sure where I can copy configuration, to use in a flake?

According to https://github.com/nix-community/nixos-anywhere/blob/main/docs/quickstart.md (see the very bottom), nixos-rebuild should Just Work™. It does for me on one VPS I have.