#
# Theming for Nix.
#
# vim: et:ts=2:sw=2:
{ stylix, ... }:
{
  imports = [
    stylix.nixosModules.stylix
    (
      { pkgs, config, ... }:
      {
        stylix = {
          enable = true;
          image = ./sapphic_mountains.png;

          polarity = "dark";
          base16Scheme = "${pkgs.base16-schemes}/share/themes/solarized-dark.yaml";
          fonts.monospace.package = pkgs.callPackage ../../../fonts/monolisa.nix { };
          fonts.monospace.name = "MonoLisa";

          fonts.sansSerif.package = pkgs.ubuntu-sans;
          fonts.sansSerif.name = "Ubuntu Nerd Font";
          fonts.serif = config.stylix.fonts.sansSerif;

          fonts.sizes.applications = 12;
          fonts.sizes.desktop = 12;

          cursor.package = pkgs.phinger-cursors;
          cursor.name = "phinger-cursors-light";
          cursor.size = 24;
        };
      }
    )
  ];

  home-manager.users.deprekated =
    {
      lib,
      pkgs,
      config,
      ...
    }:
    {
      systemd.user.services."swaybg" = {
        Unit = {
          Description = "wallpapers! brought to you by stylix!";
          PartOf = [ "graphical-session.target" ];
          After = [ "graphical-session.target" ];
          Requisite = [ "graphical-session.target" ];
        };
        Service = {
          ExecStart = "${pkgs.swaybg}/bin/swaybg -i ${config.stylix.image}";
          Restart = "on-failure";
        };
      };
    };
}
