/*
{pkgs, ...}: let
  image = ../assets/wallpaper/bocchi-lockscreen.png;
in
  pkgs.stdenv.mkDerivation {
    name = "sddm";
    src = pkgs.fetchFromGitHub {
      owner = "rototrash";
      repo = "tokyo-night-sddm";
      rev = "320c8e74ade1e94f640708eee0b9a75a395697c6";
      sha256 = "sha256-JRVVzyefqR2L3UrEK2iWyhUKfPMUNUnfRZmwdz05wL0=";
    };
    installPhase = ''
      mkdir -p $out
      cp -R ./* $out/
      cd $out/
      [ -f Backgrounds/win11.png ] && rm Backgrounds/win11.png
      cp -r ${image} $out/Backgrounds/win11.png
    '';
  }
*/
{pkgs, ...}: let
  sddm-astronaut = pkgs.sddm-astronaut.override {
    embeddedTheme = "pixel_sakura_static";
  };
in {
  services.displayManager = {
    sddm = {
      package = pkgs.kdePackages.sddm;
      extraPackages = with pkgs.kdePackages; [
        # sddm-astronaut
        qtsvg
        qtmultimedia
        qtvirtualkeyboard
      ];
      enable = true;
      wayland.enable = false;
      autoNumlock = true;
      enableHidpi = false;
      theme = "sddm-astronaut-theme";
    };
  };
  environment.systemPackages = [sddm-astronaut];
  # Prevent getting stuck at shutdown
  systemd.settings.Manager = {
    DefaultTimeoutStopSec = "10s";
  };
}
