nix-community/nixos-anywhere

Unable to install system with with impermanence.

Closed this issue · 2 comments

My disko config:

disko.devices.disk.vda = {
  type = "disk";
  device = "/dev/vda";
  content = {
    type = "table";
    format = "gpt";
    partitions = [
      {
        name = "boot";
        start = "0";
        end = "1M";
        flags = ["bios_grub"];
      }
      {
        name = "NIXBOOT";
        start = "1M";
        end = "512M";
        bootable = true;
        content = {
          type = "filesystem";
          format = "vfat";
          mountpoint = "/boot";
        };
      }
      {
        name = "NIXROOT";
        start = "512M";
        end = "-5G";
        content = {
          type = "filesystem";
          format = "ext4";
          mountpoint = "/nix";
        };
      }
      {
        name = "TMPFS";
        start = "-5G";
        end = "-2G";
        content = {
          type = "filesystem";
          format = "ext4";
          mountpoint = "/tmp";
        };
      }
      {
        name = "SWAP";
        start = "-2G";
        end = "100%";
        part-type = "primary";
        content = {
          type = "swap";
          randomEncryption = true;
        };
      }
    ];
  };
};
disko.devices.nodev."/" = {
  fsType = "tmpfs";
  mountOptions = ["size=1024M" "defaults" "mode=755"];
};

Running nixos-anywhere -f .#mary-aeza --extra-files /tmp/tmp.q0iyLogzdw root@<host>
then, after reboot, NixOS doesn't load (pic)

I was able to install NixOS then by using --stop-after-disko arg and then executing:

nix build .#nixosConfigurations.mary-aeza.config.system.build.toplevel
nix copy --to "ssh://root@<host>?remote-store=local?root=/mnt" ./result
nixos-install --no-root-passwd --no-channel-copy --root /mnt --system ${SYSTEM}

Am I doing something wrong?
image

I think problem is because impermanence requires target directory.
Seems like mkdir /nix/persist fixes the issue. However, it's impossible to pass this kind of arguments to nixos-anywhere.

I think it could be better if nixos-anywhere targets could be configured through flake outputs like deploy-rs does.

Okay this is effectively a duplicate of nix-community/impermanence#121