Making a new server to host stuff on, and when I attempted to use impermanence with a zfs rollback I consistently get the error “failed to find the nixos closure”. Not sure what issue I’m running into here on account of the only error message I’m seeing is that some file init in /sysroot (or the nix store?) doesn’t exist. If I don’t use impermanence and the rollback everything works fine. Another clue I found but have no idea what to do with is that the persist, run, and var folders will be left behind after I boot back into the rescue usb. Any idea what I’m missing thats causing these issues?
configuration.nix
{ config, lib, pkgs, ... }:
{
imports = [ ./hardware-configuration.nix ];
nixpkgs.config.allowUnfree = true;
nix = {
package = pkgs.lixPackageSets.latest.lix;
settings = {
experimental-features = [ "nix-command" "flakes" "pipe-operator" ];
auto-optimise-store = true;
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
};
boot = {
kernelParams = [ "nohibernate" "nomodeset" ];
supportedFilesystems = [ "zfs" "exfat" "fat32" ];
zfs.forceImportRoot = false;
kernelModules = [ "zfs" ];
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
initrd = {
supportedFilesystems = [ "zfs" "exfat" "fat32" ];
kernelModules = [ "zfs" ];
systemd = {
emergencyAccess = true;
extraBin = {
"zfs" = "${pkgs.zfs}/sbin/zfs";
};
enable = true;
services.initrd-rollback-root = {
after = [ "zfs-import-zpool.service" "initrd-root-device.target" "local-fs-pre.target" ];
requiredBy = [ "initrd.target" ];
before = [ "sysroot.mount" ];
requires = [ "initrd-root-device.target" ];
unitConfig.DefaultDependencies = false;
serviceConfig = {
Type = "oneshot";
StandardOutput = "journal+console";
StandardError = "journal+console";
};
script = ''
zfs rollback -r zpool/local/root@blank
'';
};
};
};
};
hardware = {
enableRedistributableFirmware = true;
cpu.intel.updateMicrocode = true;
};
networking = {
hostName = "aquaProdServer";
hostId = "0dc92367";
};
systemd = {
sleep.settings.Sleep = {
AllowSuspend = "no";
AllowHibernation = "no";
AllowHybridSleep = "no";
AllowSuspendThenHibernate = "no";
};
network.networks."10-wan" = {
matchConfig.name = "enp1s0f3";
address = [
"192.168.1.222/24"
];
routes = [
{ Gateway = "192.168.1.1"; }
];
linkConfig.RequiredForOnline = "routable";
};
};
users = {
mutableUsers = false;
users = {
aqua = {
enable = true;
isNormalUser = true;
extraGroups = ["wheel"];
hashedPassword = "$y$j9T$njh/t7.//7o3W7vwQPf27/$Ez.x/UfGe8OjC3kYSID9BnHEJjIni2CjxoOLZg3IP84";
};
};
};
services = {
getty.autologinUser = "aqua";
zfs = {
autoScrub.enable = true;
trim.enable = true;
};
xserver.enable = false;
};
fileSystems."/" = {
device = "zpool/local/root";
fsType = "zfs";
};
fileSystems."/persist" = {
device = "zpool/safe/persist";
fsType = "zfs";
neededForBoot = true;
};
environment = {
persistence."/persist" = {
enable = true;
hideMounts = true;
directories = [
"/etc/nixos"
"/var/lib/nixos"
];
};
systemPackages = with pkgs; [
vim
];
};
system.stateVersion = "26.05";
}