{
  input,
  lib,
  config,
  ...
}:
with lib; let
  cfg = config.cli.starship;
in {
  options.cli.starship = {
    enable = mkEnableOption {
      default = true;
      description = "starship";
    };
  };
  config = mkIf cfg.enable {
    # starship - an customizable prompt for any shell
    programs.starship = {
      enable = true;
      # custom settings
      enableBashIntegration = false;
      enableZshIntegration = true;
      settings = {
        add_newline = true;
        format = lib.concatStrings [
          "[ÓÇ∂](fg:color_bg3)"
          "[ ](fg:color_fg0 bg:color_bg3)"
          "($container)"
          "$os"
          "$hostname"
          "[ ](fg:color_fg0 bg:color_bg3)"
          "[ Û∞íã ](bold fg:color_bg0 bg:color_orange)"
          "[ÓÇ¥ ](fg:color_orange bg:color_bg3)"
          "$username"
          "$directory"
          "$shell"
          "$sudo"
          "$cmd_duration"
          # "($cmd_duration)"
          "$fill"
          "($nix_shell)"
          "$git_branch"
          "$git_commit"
          "$git_status"
          # "$time"
          "$line_break"
          "$character"
        ];
        palette = "gruvbox_dark";

        palettes.gruvbox_dark = {
          color_fg0 = "#fbf1c7";
          color_bg1 = "#3c3836";
          color_bg0 = "#282828";
          color_bg3 = "#665c54";
          color_blue = "#83a598";
          color_aqua = "#689d6a";
          color_green = "#98971a";
          color_orange = "#d65d0e";
          color_purple = "#b16286";
          color_red = "#cc241d";
          color_yellow = "#d79921";
        };
        azure = {
          format = "[ ÓÇ∂](fg:color_bg3)[ $symbol($subscription)]($style)[ ](bg:color_bg0)[ ÔÉÇ ](fg:color_bg0 bg:color_blue)[ÓÇ¥ ](fg:color_blue)";
          symbol = "Û∞†Ö ";
          style = "bg:color_bg3 fg:color_fg0";
        };

        azure.subscription_aliases = {
          very-long-subscription-name = "vlsn";
        };

        container = {
          format = "[$symbol]($style)";
          symbol = "Ôí∑ ";
          style = "fg:color_fg0 bg:color_bg3";
        };

        time = {
          disabled = false;
          style = "fg:color_fg0 bg:color_bg3";
          format = "[ÓÇ∂](fg:color_orange)[Ôí´ ](bold fg:color_bg0 bg:color_orange)[ $time]($style)[ÓÇ¥](fg:color_bg3)";
        };
        os = {
          format = "[$symbol]($style)";
          style = "fg:color_fg0 bg:color_bg3";
          disabled = false;
        };

        os.symbols = {
          NixOS = "Ôãú ";
          OpenBSD = "üê° ";
          Ubuntu = "Ôåú ";
          Debian = "ÓùΩ ";
          Arch = "ÔåÉ ";
          Alpine = "ÔåÄ ";
          Macos = "ÔÖπ ";
          Fedora = "Ôåã ";
          Redhat = "Ôåñ ";
          Windows = "Óúè ";
        };

        env_var = {
          variable = "CONTAINER_ID";
          symbol = "üì¶ ";
          style = "bold red";
          format = "running on: [$env_value]($style)";
        };

        username = {
          style_user = "bg:color_bg3 fg:color_fg0";
          style_root = "bg:color_bg3 fg:color_fg0";
          format = "[$user ]($style)[ ÔÄá](bold fg:color_bg0 bg:color_blue)[ÓÇ¥](fg:color_blue bg:color_bg3)";
          show_always = false;
          aliases = {
            olafkfreun = "olaf";
          };
        };

        hostname = {
          format = "[$ssh_symbol]($style)[$hostname ]($style)";
          ssh_only = true;
          detect_env_vars = [''!TMUX''];
          style = "fg:color_fg0 bg:color_bg3";
        };

        directory = {
          format = "[ $path]($style)([$read_only]($read_only_style))[ ](bg:color_bg3)[ ÔÅª](bold bg:color_green fg:color_bg0)[ÓÇ¥](fg:color_green bg:color_bg3)";
          style = "fg:color_fg0 bg:color_bg3";
          home_symbol = "Óòó ~";
          read_only = "Û∞âê ";
          truncation_length = 2;
          truncation_symbol = "‚Ä¶/";
        };

        cmd_duration = {
          min_time = 500;
          show_milliseconds = false;
          format = "[ ](bg:color_bg3)[ Ôã≤ ](fg:color_bg0 bg:color_purple)[ÓÇ¥ ](fg:color_purple)";
          style = "fg:color_fg0 bg:color_bg3";
          disabled = true;
        };

        shell = {
          zsh_indicator = " #zsh";
          bash_indicator = " #!bash";
          powershell_indicator = "Ôë†_";
          unknown_indicator = "mystery shell";
          style = "fg:color_fg0 bg:color_bg3";
          disabled = false;
          format = "[$indicator ]($style)[ Óûï](fg:color_bg0 bg:color_yellow)[ÓÇ¥](fg:color_yellow)";
        };

        nix_shell = {
          format = "[ÓÇ∂](fg:color_fg0 bg:color_bg3)[($name \\(develop\\) <- )$symbol]($style)[ÓÇ¥](fg:color_yellow)";
          impure_msg = "devbox";
          symbol = "Ôãú Óµµ ";
          style = "bg:color_fg0 fg:color_bg3";
        };

        fill = {
          symbol = " ";
          disabled = false;
        };

        docker_context = {
          format = "via [üêã $context](blue bold)";
        };

        git_branch = {
          symbol = " ";
          format = "[ ÓÇ∂](fg:color_purple)[ÓúÇ ](bg:color_purple fg:color_bg0)[$symbol$branch(:$remote_branch)]($style)";
          style = "fg:color_fg0 bg:color_bg3";
          truncation_symbol = "...";
        };

        git_commit = {
          format = "[$hash]($style)";
          style = "bg:color_bg3 fg:color_fg0";
          only_detached = true;
          tag_symbol = "üè∑ ";
        };

        git_state = {
          format = "[\($state( $progress_current of $progress_total)\)]($style) ";
          cherry_pick = "[üçí PICKING](bold red)";
          style = "bg:color_bg3 fg:color_fg0";
        };

        git_metrics = {
          added_style = "bold blue";
          format = "[+$added]($added_style)/[-$deleted]($deleted_style) ";
          style = "bg:color_bg3 fg:color_fg0";
        };

        git_status = {
          conflicted = " üè≥";
          ahead = " üèéüí®";
          behind = " üò∞";
          diverged = " üòµ";
          up_to_date = " ‚úì";
          untracked = " ü§∑";
          stashed = " üì¶";
          modified = " üìù";
          staged = "[++\($count\)](fg:color_fg0 bg:color_bg3)";
          renamed = " üëÖ";
          deleted = " üóë";
          format = "[[($all_status$ahead_behind) ](fg:color_fg0 bg:color_bg3)]($style)[ÓÇ¥ ](fg:color_bg3)";
          style = "bg:color_bg3";
        };

        helm = {
          format = "via [‚éà $version](fg:color_fg0 bg:color_bg3) ";
        };

        kubernetes = {
          format = "on [‚õµ ($user on )($cluster in )$context \($namespace\)](dimmed green) ";
          disabled = false;
        };

        kubernetes.context_aliases = {
          "dev.local.cluster.k8s" = "dev";
          ".*/openshift-cluster/.*" = "openshift";
          "gke_.*_(?P<var_cluster>[\w-]+)" = "gke-$var_cluster";
        };

        kubernetes.user_aliases = {
          "dev.local.cluster.k8s" = "dev";
          "root/.*" = "root";
        };

        sudo = {
          style = "fg:color_fg0 bg:color_bg3";
          symbol = "üßô  ";
          disabled = true;
          format = "[ $symbol ](bg:color_bg3)[ Ôã≤ ](fg:color_bg0 bg:color_purple)[ÓÇ¥ ](fg:color_purple)";
        };

        terraform = {
          format = "[üèéüí® $version$workspace]($style) ";
        };

        aws = {
          format = "[ ÓÇ∂](fg:color_blue)[ ÔÉÇ ](bg:color_blue fg:color_bg0)[ $symbol ($profile)(\($region\)) ]($style)[ÓÇ¥ ](fg:color_bg3)";
          style = "bg:color_bg3 fg:color_fg0";
          symbol = "Û∞∏è";
        };

        aws.region_aliases = {
          eu-west-2 = "eu-w2";
          eu-west-1 = "eu-w1";
        };

        character = {
          success_symbol = "[ Û±û© ](bold green)";
          error_symbol = "[ Û±û© ](bold red)";
          vimcmd_symbol = "[ Ôê¥](bold purple)";
          vimcmd_replace_symbol = "[ Ôê¥](bold green)";
          vimcmd_replace_one_symbol = "[ Ôê¥](bold green)";
          vimcmd_visual_symbol = "[ Ôê¥](bold yellow)";
        };

        line_break = {
          disabled = false;
        };

        bun.symbol = "bun ";
        c.symbol = "C ";
        cobol.symbol = "cobol ";
        # conda.symbol = "conda ";
        crystal.symbol = "cr ";
        cmake.symbol = "cmake ";
        daml.symbol = "daml ";
        # dart.symbol = "dart ";
        deno.symbol = "deno ";
        dotnet.symbol = ".NET ";
        # directory.read_only = " ro";
        # elixir.symbol = "exs ";
        # elm.symbol = "elm ";
        # golang.symbol = "go ";
        guix_shell.symbol = "guix ";
        # hg_branch.symbol = "hg ";
        # java.symbol = "java ";
        # julia.symbol = "jl ";
        kotlin.symbol = "kt ";
        lua.symbol = "lua ";
        # nodejs.symbol = "nodejs ";
        memory_usage.symbol = "memory ";
        meson.symbol = "meson ";
        nim.symbol = "nim ";
        ocaml.symbol = "ml ";
        opa.symbol = "opa ";
        conda.symbol = "ÔÑå ";
        dart.symbol = "Óûò ";
        # directory.read_only = "Ô†Ω ";
        docker_context.symbol = "Ôåà ";
        elixir.symbol = "Óâµ ";
        elm.symbol = "Óò¨ ";
        gcloud.symbol = "Óû≤ ";
        golang.symbol = "Óòß ";
        hg_branch.symbol = "Ôêò ";
        java.symbol = "Óâñ ";
        julia.symbol = "Óò§ ";
        # memory_usage.symbol = "Ô°ö ";
        # nim.symbol = "Ôö§ ";
        nodejs.symbol = "Óâè ";
        package.symbol = "pkg ";
        perl.symbol = "Óù© ";
        php.symbol = "Óòà ";
        python.symbol = "ÓòÜ ";
        ruby.symbol = "Óàæ ";
        rust.symbol = "ÔÄì ";
        scala.symbol = "Óú∑ ";
        shlvl.symbol = "ÔÇ´";
        swift.symbol = "ÔØ£ ";
        # terraform.symbol = "Ô®à";
      };
    };
  };
}
