{
  config,
  lib,
  ...
}: {
  config = {
    pim = {
      cinnamon.enable = true;
      sops-nix.usersWithSopsKeys = ["pim"];
    };

    facter.reportPath = ./facter.json;
    home-manager.users.pim.imports = [./pim.home.nix];
    programs.steam.enable = true;
    system.stateVersion = "24.05";

    users.users = {
      root.openssh.authorizedKeys.keys = config.pim.ssh.keys.pim;

      pim = {
        isNormalUser = true;
        extraGroups = ["autologin"];
        openssh.authorizedKeys.keys = config.pim.ssh.keys.pim;
      };
    };

    deployment = {
      targetHost = "gamepc";
      targetUser = "root";
      tags = ["desktop"];
    };

    services = {
      openssh.enable = true;

      ollama = {
        enable = true;
        rocmOverrideGfx = "10.3.0";
        loadModels = ["deepseek-r1:32b" "hf.co/mradermacher/DeepSeek-R1-Distill-Qwen-32B-Uncensored-GGUF:Q4_K_M"];
        acceleration = "rocm";
      };

      xserver.displayManager.lightdm.extraSeatDefaults = ''
        autologin-user=pim
      '';

      sunshine = {
        enable = true;
        openFirewall = true;

        settings = {
          sunshine_name = config.networking.hostName;
          origin_web_ui_allowed = "wan";
          credentials_file = "/home/pim/.config/sunshine/sunshine_credentials.json";
        };
      };
    };

    boot.loader.grub = {
      enable = true;
      efiSupport = true;
      efiInstallAsRemovable = true;
    };

    disko.devices.disk = lib.genAttrs ["0" "1"] (name: {
      type = "disk";
      device = "/dev/nvme${name}n1";
      content = {
        type = "gpt";
        partitions = {
          boot = {
            size = "1M";
            type = "EF02"; # for grub MBR
          };
          ESP = {
            size = "500M";
            type = "EF00";
            content = {
              type = "mdraid";
              name = "boot";
            };
          };
          mdadm = {
            size = "100%";
            content = {
              type = "mdraid";
              name = "raid0";
            };
          };
        };
      };
    });

    disko.devices.mdadm = {
      boot = {
        type = "mdadm";
        level = 1;
        metadata = "1.0";
        content = {
          type = "filesystem";
          format = "vfat";
          mountpoint = "/boot";
        };
      };
      raid0 = {
        type = "mdadm";
        level = 0;
        content = {
          type = "gpt";
          partitions = {
            primary = {
              end = "-4G";
              content = {
                type = "filesystem";
                format = "ext4";
                mountpoint = "/";
              };
            };
            swap = {
              size = "100%";
              content = {
                type = "swap";
              };
            };
          };
        };
      };
    };
  };
}