{ pkgs, lib, config, ... }:
{
imports = [
  ../../../base/zfs.nix
];

# The 32-bit host id of the machine, formatted as 8 hexadecimal characters.
# You should try to make this id unique among your machines.
# Manually generated with : head -c4 /dev/urandom | od -A none -t x4 | cut -d ' ' -f 2
networking.hostId = "69c40b03";

/*
# Enable the (OpenSolaris-compatible) ZFS auto-snapshotting service.
services.zfs.autoSnapshot = {
  enable   = true;
  frequent = ;
  hourly   = ;
  daily    = ;
  weekly   = ;
  monthly  = ;
};
*/

boot.loader.grub.devices = [
  #"/dev/disk/by-id/nvme-Samsung_SSD_970_EVO_Plus_250GB_S4EUNJ0N211426T"
  #"/dev/disk/by-id/usb-Generic-_Multi-Card_20071114173400000-0:0"
  "/dev/disk/by-id/mmc-SB32G_0xdb5e2237"
];

fileSystems."/boot" =
  { device = "/dev/disk/by-partlabel/losurdo_sd_boot";
    fsType = "ext2";
  };

fileSystems."/boot/efi" =
  { device = "/dev/disk/by-partlabel/losurdo_sd_efi";
    fsType = "vfat";
  };

swapDevices =
  [ { device = "/dev/disk/by-partlabel/losurdo_nvme_swap";
      randomEncryption = {
        enable = true;
        cipher = "aes-xts-plain64";
        source = "/dev/urandom";
      };
    }
  ];

fileSystems."/" =
  { device = "losurdo_nvme/root";
    fsType = "zfs";
  };

fileSystems."/home" =
  { device = "losurdo_nvme/home";
    fsType = "zfs";
  };

fileSystems."/nix" =
  { device = "losurdo_nvme/nix";
    fsType = "zfs";
  };

fileSystems."/var" =
  { device = "losurdo_nvme/var";
    fsType = "zfs";
  };

fileSystems."/var/cache" =
  { device = "losurdo_nvme/var/cache";
    fsType = "zfs";
  };

fileSystems."/var/log" =
  { device = "losurdo_nvme/var/log";
    fsType = "zfs";
  };

fileSystems."/var/tmp" =
  { device = "losurdo_nvme/var/tmp";
    fsType = "zfs";
  };
}