{ pkgs, hostName, ... }:
{
  imports = [
    ../../nixos/profiles/hardware/E5500.nix
    ../../nixos/profiles/zfs.nix
    ../../nixos/profiles/zramSwap.nix
  ];

  # Setting the machine-id avoids to reencrypt all credentials
  # when reinstalling NixOS on a new drive.
  # Manually generated with : uuidgen | tr -d -
  environment.etc.machine-id.source = ./machine-id.clear;

  # The 32-bit host id of the host, formatted as 8 hexadecimal characters.
  # You should try to make this id unique among your hosts.
  # Manually generated with : uuidgen | head -c8
  networking.hostId = "e53001b7";

  boot.loader = {
    grub = {
      enable = true;
      memtest86.enable = true;
      mirroredBoots = [
        { path = "/boot1"; devices = [ "/dev/disk/by-id/ata-CT250MX500SSD1_2004E2849DD5" ]; }
      ];
      # Roughly 25MiB (initrd) + 9MiB (kernel) per configuration
      configurationLimit = 6;

      #zfsSupport = true;
      #efiSupport = true;
      #enableCryptodisk = true;
    };
  };
  boot.zfs.requestEncryptionCredentials = [ "${hostName}/root" ];

  hardware.enableRedistributableFirmware = true;

  fileSystems."/boot1" =
    {
      device = "/dev/disk/by-partlabel/${hostName}_ssd1_boot";
      fsType = "vfat";
      options = [ "rw" "noexec" "nodev" "nofail" "X-mount.mkdir" "iocharset=iso8859-1" ];
    };
  swapDevices = [
    {
      device = "/dev/disk/by-partlabel/${hostName}_ssd1_swap";
      randomEncryption = {
        enable = true;
        cipher = "aes-xts-plain64";
        source = "/dev/urandom";
      };
    }
  ];

  boot.supportedFilesystems = [ "ntfs" "vfat" ];

  fileSystems."/" =
    {
      device = "${hostName}/root";
      fsType = "zfs";
      options = [ "zfsutil" ];
    };
  fileSystems."/nix" =
    {
      device = "${hostName}/root/nix";
      fsType = "zfs";
      options = [ "X-mount.mkdir" "zfsutil" ];
    };
  fileSystems."/var" =
    {
      device = "${hostName}/root/var";
      fsType = "zfs";
      options = [ "X-mount.mkdir" "zfsutil" ];
    };

  services.pipewire.jack.enable = true;

}