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?