{
  lib,
  config,
  system,
  pkgs,
  inputs,
  ...
}: let
  cfg = config.myConfig;
in {
  imports = [./bootloader.nix ./locale.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix ./cups.nix ./gpu/amd.nix ./touch.nix ./cache.nix ./nix.nix ./update.nix ./podman.nix ./qemu.nix ./bluetooth.nix ./network.nix ./nix-ld.nix];

  options.myConfig = {
    enable = lib.mkEnableOption "my custom config";
    desktop = lib.mkEnableOption "custom config with desktop support";
    laptop = lib.mkEnableOption "extra stuff for laptops like wifi";
    user = lib.mkOption {
      default = "max";
      example = "foo";
      description = "The main user working on this machine";
      type = lib.types.nonEmptyStr;
    };
  };

  config = lib.mkIf cfg.enable {
    myConfig = {
      bootloader.enable = true;
      locale.enable = true;
      rebuild.enable = true;
      cache.enable = true;
      autoUpdate.enable = true;
      podman.enable = true;
      qemu.enable = true;
      qemu.kvm = lib.mkIf (system == "x86_64-linux") true;
      network.enable = true;
      nix-ld.enable = true;

      greetd.enable = lib.mkIf cfg.desktop true;
      sway.enable = lib.mkIf cfg.desktop true;
      music.enable = lib.mkIf cfg.desktop true;
      cups.enable = lib.mkIf cfg.desktop true;
      wifi.tray = lib.mkIf cfg.desktop true;

      sway.laptop = lib.mkIf cfg.laptop true;
      wifi.enable = lib.mkIf cfg.laptop true;
      touch.enable = lib.mkIf cfg.laptop true;
      bluetooth.enable = lib.mkIf cfg.laptop true;
    };

    users.users.${cfg.user} = {
      isNormalUser = true;
      description = "Max Känner";
      extraGroups = ["wheel" "dialout"];
      shell = pkgs.zsh;
    };

    home-manager = {
      extraSpecialArgs = {inherit inputs;};
      users.${cfg.user} = import ../../hosts/${cfg.network.hostName}/home.nix;
    };

    programs.ssh.startAgent = true;
    programs.zsh.enable = true;
    programs.steam.enable = true;

    security.polkit.enable = true;
  };
}
