Issues with impermanence module

I’m new to NixOS so I’m having some issues, specifically about making the impermanent setup work. I get this problem on boot and it fails on stage 1:

loading module btrfs...
loading module dm_mod...
running udev...
Starting systemd-udevd version 254.10
starting device mapper and LVM...
Scanning for Btrfs filesystems...
mounting none on /...
mounting/dev/disk/by-uuid/37b33d90-8daf-4236-9f15-7fcb5a76d1ce on /mnt-root/persistent failed: invalid argument

And this is my hardware config and impermanence setup, it’s bare bones:

{ config, lib, pkgs, modulesPath, ... }:

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ];

  boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
  boot.initrd.kernelModules = [ ];
  boot.kernelModules = [ "kvm-amd" ];
  boot.extraModulePackages = [ ];

  fileSystems."/" =
    { device = "none";
      fsType = "tmpfs";
      options = [ "size=25%" "mode=755" ];
    };

  fileSystems."/home/me" =
    { device = "none";
      fsType = "tmpfs";
      options = [ "size=4G" "mode=755" ];
    };

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/D3F1-4B01";
      fsType = "vfat";
    };

  fileSystems."/nix" = {
      device = "/dev/disk/by-uuid/37b33d90-8daf-4236-9f15-7fcb5a76d1ce";
      fsType = "btrfs";
      options = [ "subvol=nix" ];
  };

  fileSystems."/persistent" = {
      device = "/dev/disk/by-uuid/37b33d90-8daf-4236-9f15-7fcb5a76d1ce";
      neededForBoot = true;
      fsType = "btrfs";
      options = [ "subvol=persistent" ];
  };

  swapDevices = [ ];
  networking.useDHCP = lib.mkDefault true;
  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

The impermanence module:

{ config, pkgs, ... }:

let
  impermanence = builtins.fetchTarball "https://github.com/nix-community/impermanence/archive/master.tar.gz";
in
{
  imports = [ "${impermanence}/nixos.nix" ];

  environment.persistence."/persistent" = {
    hideMounts = true;
    directories = [
      "/var/log"
      "/var/lib/bluetooth"
      "/var/lib/nixos"
      "/var/lib/systemd"
      "/etc/NetworkManager/system-connections"
      "/etc/nixos"
      "/home/me/.Pronto"
      "/home/me/.mozilla"
    ];
    files = [
      "/etc/machine-id"
      "/home/me/complete.txt"
      "/home/me/.zshrc"
      "/home/me/.zsh_history"
      "/home/me/.bash_history"

    ];
  };
}

What is the issue?

might journalctl --merge give you extra info on what happened? or was this already from there?

It’s the boot screen output summarized, I can only:

  • reboot immediately
    or
  • continue while ignoring errors

if I continue, stage 2 fails and I get a kernel panic:

mount: can't find /mnt-root/var/log in /proc/mounts
stage 2 init script (/mnt-root/nix/store/kcqbf17qam091ga179mc923mhk3byvs7-nixos-system-nixos-23.11.7071.71bae31b7dbc/init) not found 

I can’t really do much else, it looks to be an issue with mounting?.

do you have an earlier build that works still so as to check logs?
otherwise, given a primary suspect here seems impermanence, it might be worth filing a thread at their github issues as well.