{
  config,
  lib,
  pkgs,
  ...
}:
{
  imports = [
    ./wrapped-disk-config.nix
    ./distributed_build.nix
    ./hardware-configuration.nix
    ./power_management.nix
    ./waybar.nix
  ];

  config = {
    # Generate with `head -c4 /dev/urandom | od -A none -t x4`
    networking.hostId = "47ee7d7c";

    networking.hostName = "quark"; # Define your hostname.

    time.timeZone = "America/New_York";
    i18n.defaultLocale = "en_US.UTF-8";

    me.boot.enable = true;
    me.boot.secure = false;
    me.mountPersistence = true;

    # Toggle to start writing the extlinux config which will be used by zfsbootmenu
    boot.loader.generic-extlinux-compatible.enable = true;
    boot.loader.systemd-boot.enable = lib.mkForce false;

    me.rollback.dataset = [
      "zroot/linux/nix/root@blank"
      "zroot/linux/nix/home@blank"
    ];

    me.optimizations = {
      enable = true;
      arch = "znver4";
      # build_arch = "x86-64-v3";
      system_features = [
        "gccarch-znver4"
        "gccarch-znver5"
        "gccarch-skylake"
        "gccarch-kabylake"
        # "gccarch-alderlake" missing WAITPKG
        "gccarch-x86-64-v3"
        "gccarch-x86-64-v4"
        "benchmark"
        "big-parallel"
        "kvm"
        "nixos-test"
      ];
    };

    # Early KMS
    boot.initrd.kernelModules = [ "amdgpu" ];

    # Mount tmpfs at /tmp
    boot.tmp.useTmpfs = true;

    # Enable TRIM
    # services.fstrim.enable = lib.mkDefault true;

    # Only run nix builders at idle priority for a more responsive system. Do not set on servers, just end-user devices.
    nix.daemonCPUSchedPolicy = "idle";

    # RPCS3 has difficulty with znver5
    me.rpcs3.config.Core."Use LLVM CPU" = "znver4";

    me.alacritty.enable = true;
    me.amd_s2idle.enable = true;
    me.ansible.enable = true;
    me.android.enable = true;
    me.ares.enable = true;
    me.base.enable = true;
    me.bluetooth.enable = true;
    me.build_in_ram.enable = true;
    me.chromecast.enable = true;
    me.chromium.enable = true;
    me.d2.enable = true;
    me.direnv.enable = true;
    me.doas.enable = true;
    me.docker.enable = false;
    me.dont_use_substituters.enable = true;
    me.ecc.enable = true;
    me.emacs_flavor = "full";
    me.emulate_isa.enable = true;
    me.esim.enable = true;
    me.firefox.enable = true;
    me.firewall.enable = true;
    me.flux.enable = true;
    me.font.enable = true;
    me.gcloud.enable = true;
    me.git.config = ../../roles/git/files/gitconfig_home;
    me.git.enable = true;
    me.gnuplot.enable = true;
    me.gpg.enable = true;
    me.graphical = true;
    me.graphics_card_type = "amd";
    me.graphviz.enable = true;
    me.iso_mount.enable = true;
    me.jujutsu.config = ../../roles/jujutsu/files/jujutsu_config_home.toml;
    me.jujutsu.enable = true;
    me.kanshi.enable = false;
    me.kubernetes.enable = true;
    me.latex.enable = true;
    me.launch_keyboard.enable = true;
    me.lvfs.enable = true;
    me.media.enable = true;
    me.memtest.enable = true;
    me.network.enable = true;
    me.nix_index.enable = true;
    me.nix_repl.enable = true;
    me.nix_worker.enable = true;
    me.nixdev.enable = true;
    me.nvme.enable = true;
    me.openpgp_card_tools.enable = true;
    me.pcsx2.enable = true;
    me.podman.enable = true;
    me.postgresql_client.enable = true;
    me.python.enable = true;
    me.qemu.enable = true;
    me.recovery.enable = true;
    me.rpcs3.enable = true;
    me.rust.enable = true;
    me.sequoia.enable = true;
    me.shadps4.enable = false;
    me.shikane.enable = true;
    me.sops.enable = true;
    me.sound.enable = true;
    me.spaghettikart.enable = true;
    me.ssh.enable = true;
    me.sshd.enable = true;
    me.steam.enable = true;
    me.steam_run_free.enable = true;
    me.sway.enable = true;
    me.tekton.enable = true;
    me.terraform.enable = true;
    me.thunderbolt.enable = true;
    me.user.enable = true;
    me.uutils.enable = false;
    me.vnc_client.enable = true;
    me.vscode.enable = true;
    me.wasm.enable = true;
    me.waybar.enable = true;
    me.webcam.enable = true;
    me.wine.enable = false;
    me.wireguard.activated = [
      "drmario"
      "wgh"
      "colo"
    ];
    me.wireguard.deactivated = [ "wgf" ];
    me.yubikey.enable = true;
    me.zfs.enable = true;
    me.zrepl.enable = true;
    me.zsh.enable = true;

    me.sm64ex.enable = true;
    me.shipwright.enable = true;
    me.ship2harkinian.enable = true;
  };
}
