{
  config, ...
}: {
  systemd.user.services.waybar = {
    Unit.StartLimitBurst = 30;
    # this fixes fonts for some reason
    Service.Environment = "PATH=${config.home.profileDirectory}/bin";
  };
  programs.waybar = {
    enable = true;
    systemd.enable = true;
    settings = {
      primary = {
        height = 40;
        position = "top";
        margin-top = 10;
        margin-left = 20;
        margin-right = 20;
        modules-left = [
          "hyprland/workspaces"
          "hyprland/submap"
        ];

        modules-center = [
          "cpu"
          "memory"
          "clock"
        ];

        modules-right = [
          "tray"
          "network"
          "pulseaudio"
          "battery"
        ];
      };
    };

    style = let 
      inherit (config.lib.stylix.colors) withHashtag;
    in ''
    * {
      font-family: ${config.fontProfiles.bitmap.family}, ${config.fontProfiles.monospace.family};
      font-size: 12pt;
      padding: 0;
    }

    window#waybar {
      padding: 0;
      border-radius: 0.5em;
    }

    #workspaces {
      transition: background-color .5s, color .5s;
    }

    #workspaces button.active,
    #workspaces button.focused {
      background-color: ${withHashtag.base05};
      color: ${withHashtag.base00};
    }
    '';
  };
}