{ self, inputs, ... }:
{
  flake.homeModules.zed = { pkgs, lib, ... }: {
    programs.zed-editor = {
      enable = true;
      extensions = [
        # Config language
        "nix"

        # Programing language extensions
        "rust"
        "typescript"
        "javascript"
        "html"
        "css"
        "go"
        "python"
        "json"
        "yaml"
        "toml"
        "markdown"

        # Themes
        "rosé pine"
        "catppuccin blur"

        # Discord
        "zed-discord-presence"
      ];

      extraPackages = [ pkgs.nixd ];
      userSettings = {
        theme = lib.mkDefault {
          mode = "system";
          dark = "Catppuccin Frappé (Blur)";
          light = "Rosé Pine Dawn";
        };
        hour_format = "hour24";
        tab_size = 2;

        lsp = {
          discord_presence = {
            initialization_options = {
              application_id = "1263505205522337886";
              base_icons_url = "https://raw.githubusercontent.com/xhyrom/zed-discord-presence/main/assets/icons/";

              state = "Working on {filename}";
              details = "In {workspace}";

              large_image = "{base_icons_url}/{language:lo}.png";
              large_text = "{language:u}";

              small_image = "{base_icons_url}/zed.png";
              small_text = "Zed";

              idle = {
                timeout = 300; # 5 mins
                action = "change_activity";

                state = "Thinking...";
                details = "In Zed";

                large_image = "{base_icons_url}/zed.png";
                large_text = "Zed";

                small_image = "{base_icons_url}/idle.png";
                small_text = "Idle";
              };

              git_integration = true;
            };
          };
        };
      };
    };
  };

}
