{
  pkgs,
  namespace,
  config,
  ...
}:
let
  theme = config.mjallen.theme.palette;
  shellAliases = {
    update-boot = "sudo nixos-rebuild boot --max-jobs 10 --build-host admin@10.0.1.3";
    update-switch = "sudo nixos-rebuild switch --max-jobs 10 --build-host admin@10.0.1.3";
    update-flake = "nix flake update mac-nixpkgs mac-nixos-apple-silicon mac-home-manager mac-impermanence mac-sops-nix --flake /etc/nixos";
    update-nas = "nixos-rebuild switch --use-remote-sudo --target-host admin@10.0.1.3 --build-host admin@10.0.1.3 --flake ~/nix-config#jallen-nas";
  };
  fontName = "JetBrainsMono NFM";
  fontPackage = pkgs.nerd-fonts.jetbrains-mono;
  # Displays
  display = {
    input = "eDP-1";
    resolution = "3456x2234";
    refreshRate = "60.00000";
  };
in
{

  home.username = "matt";
  home.homeDirectory = "/home/matt";
  home.stateVersion = "23.11";

  ${namespace} = {
    programs.hyprland = {
      enable = true;
      primaryDisplay = "eDP-1";

      monitorv2 = [
        {
          name = display.input;
          mode = "${display.resolution}@${display.refreshRate}";
          position = "0x0";
          scale = 1.25;
          extra = [
            "bitdepth"
            "10"
            "cm"
            "hdr"
            "sdrbrightness"
            "1.2"
            "sdrsaturation"
            "0.98"
          ];
        }
      ];

      workspace = [
        "name:firefox, monitor:${display.input}, default:false, special, class:(.*firefox.*)"
        "name:discord, monitor:${display.input}, default:true, special, title:(.*vesktop.*), title:(.*Apple Music.*)"
        "name:steam, monitor:${display.input}, default:false, special, class:(.*[Ss]team.*)"
      ];

      windowRule = [
        "size 2160 3356, tag:horizonrdp"
      ];

      hyprpaper = {
        wallpaperPath = "/run/wallpaper.jpg";
      };

      keybinds = {
        bind = [
          "$mod, A, exec, chromium --app=\"https://music.apple.com\""
        ];
      };

      defaultApps = {
        browser = pkgs.firefox;
      };
    };
    programs = {
      btop.enable = true;
      kitty = {
        enable = true;
        font = {
          name = fontName;
          package = fontPackage;
        };
      };
      mako = {
        enable = true;
        fontName = fontName;
      };
      nwg-dock.enable = true;
      nwg-drawer.enable = true;
      nwg-panel = {
        enable = true;
        defaultApps = {
          browser = pkgs.firefox;
        };
      };
      waybar = {
        enable = true;

        layer = "bottom";

        temperature = {
          cpu.enable = true;
          gpu.enable = true;
        };

        extraModules = {
          "custom/lights" = {
            tooltip = false;
            exec = "waybar-hass --get_light light.living_room_lights";
            interval = "once";
            format = "{text}"; # "󱉓";
            on-click = "waybar-hass --toggle_light light.living_room_lights";
            return-type = "json";
          };
        };

        extraModulesStyle = ''
          #custom-lights {
            color: ${theme.frost.nord8};
            background-color: ${theme.polarNight.nord0};
            ${theme.defaultOpacity}
            ${theme.borderLeft}
          }

          #custom-lights:hover {
            background: ${theme.polarNight.nord3};
          }
        '';

        windowOffset = 75;
      };
      wlogout.enable = true;
      wofi.enable = true;
    };
  };

  home.packages = with pkgs; [
    pkgs.${namespace}.bolt-launcher
    pkgs.${namespace}.librepods

    iw
    iwd
    orca-slicer
    vscodium
  ];

  programs = {
    password-store.enable = true;

    zsh.shellAliases = shellAliases;
  };
}
