{ config, lib, pkgs, tokyo-night-sddm-src, ... }:
let
  tokyo-night-sddm = pkgs.stdenv.mkDerivation {
    name = "tokyo-night-sddm";
    src = tokyo-night-sddm-src;
    installPhase = ''
        cp -f ${./tokyo-night-sddm/theme.conf} ./theme.conf
        cp -f ${../assets/background/bg_lock.png} Backgrounds/background.png
        mkdir -p $out/share/sddm/themes/tokyo-night-sddm
        mv * $out/share/sddm/themes/tokyo-night-sddm
      '';
  };
in lib.mkIf (config.machine != "air") {
  environment.systemPackages = with pkgs.libsForQt5; [
    tokyo-night-sddm # Theme
    qtbase
    qtsvg
    qtquickcontrols2
    qtgraphicaleffects
  ];

  services.displayManager.defaultSession = "hyprland";
  services.displayManager.sddm = {
    enable = true;
    wayland.enable = true;
    theme = "tokyo-night-sddm";
  };
}
