{
  lib,
  pkgs,
  inputs,
  ...
}: {
  imports = with inputs; [
    catppuccin.homeManagerModules.catppuccin
    chaotic.homeManagerModules.default
    hyprland.homeManagerModules.default
    nix-colors.homeManagerModules.default
    nix-index-database.hmModules.nix-index

    ./hyprland
    ./screenshot
  ];

  snowfallorg.user = {
    enable = true;
    name = "marshall";
  };

  colorScheme = inputs.nix-colors.colorSchemes.catppuccin-mocha;

  wayland.windowManager.river = {
    enable = true;
    systemd.enable = true;
    xwayland.enable = true;
  };

  home = {
    packages = with pkgs;
      [
        alacritty
        fuzzel
        alejandra
        beeper
        bitwarden-cli
        bitwarden-desktop
        duf
        eternal-terminal
        ((pkgs.emacsPackagesFor pkgs.emacs30-pgtk).emacsWithPackages (epkgs:
          builtins.attrValues {
            inherit (epkgs.treesit-grammars) with-all-grammars;
          }))
        (callPackage "${inputs.nixpkgs}/pkgs/applications/editors/vscode/generic.nix" rec {
          commandLineArgs = "";
          version = "1.0.5";
          pname = "windsurf";

          executableName = "windsurf";
          longName = "Windsurf";
          shortName = "windsurf";

          src = fetchurl {
            url = "https://windsurf-stable.codeiumdata.com/linux-x64/stable/d33d40f6cd3a4d7e451b22e94359230a4aa8c161/Windsurf-linux-x64-${version}.tar.gz";
            sha256 = "11ibfbijlww91k533dg5b267rrdqafm95aj8md1hpa0b3x4nzzzq";
          };

          sourceRoot = "Windsurf";

          tests = nixosTests.vscodium;

          updateScript = "nil";

          meta = {
            description = "The first agentic IDE, and then some";
          };
        })
        emacs-lsp-booster
        equibop
        glow
        grc
        jamesdsp
        jdk21
        killall
        libnotify
        lm_sensors
        loupe
        mullvad-vpn
        nodejs
        playerctl
        prismlauncher
        (python312.withPackages
          (p:
            with p; [
              epc
              orjson
              sexpdata
              six
              setuptools
              paramiko
              rapidfuzz
            ]))
        slack
        telegram-desktop
        xdotool
        (xwinwrap.overrideAttrs {
          src = fetchFromGitHub {
            owner = "camonater62";
            repo = "xwinwrap";
            rev = "ec74e730072225ffa740bf5076a1dd0a343bb113";
            sha256 = "0vfwbcx5y1aphiaix2zps1bl7lhbhdvm6vhys2m0kwvl6igy0cc8";
          };

          buildPhase = ''
            make all
          '';

          installPhase = ''
            mkdir -p $out/bin
            mv xwinwrap $out/bin
          '';
        })
        youki
      ]
      ++ (with jetbrains; [
        clion
        rust-rover
        phpstorm
        webstorm
        idea-ultimate
      ])
      ++ (with inputs; [
        nixvim.packages.${pkgs.system}.default
        zen-browser.packages.${pkgs.system}.specific
        chaotic.packages.${pkgs.system}.distrobox_git
        chaotic.packages.${pkgs.system}.zed-editor_git
      ]);

    stateVersion = "24.05";
  };

  dconf.settings = {
    "org/virt-manager/virt-manager/connections" = {
      autoconnect = ["qemu:///system"];
      uris = ["qemu:///system"];
    };
  };

  xdg.enable = true;

  catppuccin = {
    enable = true;
    pointerCursor.enable = true;
    flavor = "mocha";
    accent = "green";
  };

  gtk = let
    gradiencePreset = pkgs.fetchurl {
      url = "https://raw.githubusercontent.com/GradienceTeam/Community/next/official/catppuccin-macchiato.json";
      hash = "sha256-FgQvmK/Pjn980o+UVc2a70kGa6sGse045zPS9hzCs14=";
    };

    gradienceBuild = pkgs.stdenv.mkDerivation {
      name = "gradience-build";
      phases = ["buildPhase" "installPhase"];
      nativeBuildInputs = [pkgs.gradience];
      buildPhase = ''
        shopt -s nullglob
        export HOME=$TMPDIR
        mkdir -p $HOME/.config/presets
        gradience-cli apply -p ${gradiencePreset} --gtk both
      '';
      installPhase = ''
        mkdir -p $out
        cp -r .config/gtk-4.0 $out/
        cp -r .config/gtk-3.0 $out/
      '';
    };
  in {
    enable = false;
    theme.name = "adw-gtk3-dark";
    theme.package = pkgs.adw-gtk3;

    gtk3 = {
      extraCss = builtins.readFile "${gradienceBuild}/gtk-3.0/gtk.css";
      extraConfig = {
        gtk-application-prefer-dark-theme = 1;
      };
    };

    gtk4 = {
      extraCss = builtins.readFile "${gradienceBuild}/gtk-4.0/gtk.css";
      extraConfig = {
        gtk-application-prefer-dark-theme = 1;
      };
    };
  };

  qt = {
    enable = true;
    platformTheme.name = "kvantum";
    style.name = "kvantum";
    style.catppuccin.enable = true;
  };

  programs = {
    rio = {
      enable = true;

      catppuccin.enable = true;
    };
    xmobar.enable = true;

    wezterm.extraConfig = builtins.readFile ./wezterm.lua;

    git = {
      extraConfig.credential.helper = "libsecret";
      signing.key = "0FF5B8826803F895";
    };

    mpv = {
      enable = true;
      scripts = [pkgs.mpvScripts.uosc];
      catppuccin.enable = true;
    };
  };

  services = {
    picom = {
      enable = true;
      backend = "glx";
      fadeDelta = 5;
      fade = true;
      shadow = true;
      vSync = true;

      shadowExclude = [
        "class_g = 'firefox' && argb"
        "class_g *?= 'slop'"
      ];

      settings = {
        corner-radius = 10;

        blur-background-exclude = [
          "class_g = 'slop'"
        ];

        rounded-corners-exclude = [
          "window_type = 'dock'"
          "window_type = 'desktop'"
        ];

        blur = {
          method = "gaussian";
          size = 10;
          deviation = 5.0;
        };
      };
    };

    dunst = {
      enable = true;
      settings.global = {
        corner_radius = 10;
        offset = "18x53";
        frame_width = 2;
        font = "SN Pro 12";
        frame_color = lib.mkForce "#a6e3a1";
      };
      catppuccin.enable = true;
    };
  };

  systemd.user.startServices = "sd-switch";
}
