From b8ce09548903b303bf467d259a28ce19d67d65a3 Mon Sep 17 00:00:00 2001 From: Poby <87608318+smg1024@users.noreply.github.com> Date: Sat, 14 Mar 2026 16:54:34 +0900 Subject: [PATCH] feat: wezterm and starship config --- home/starship.nix | 221 +++++++++++++++++++++++++++++++++++++++++++++- home/terminal.nix | 1 + home/wezterm.lua | 33 +++++++ home/zsh.nix | 4 +- 4 files changed, 255 insertions(+), 4 deletions(-) create mode 100644 home/wezterm.lua diff --git a/home/starship.nix b/home/starship.nix index 2b977ab..9af15a1 100755 --- a/home/starship.nix +++ b/home/starship.nix @@ -1,3 +1,4 @@ +{ lib, ... }: { programs.starship = { enable = true; @@ -5,9 +6,225 @@ enableBashIntegration = true; settings = { + add_newline = true; + continuation_prompt = "[▸▹ ](dimmed white)"; + + format = lib.concatStrings [ + "($nix_shell$container$fill\n)$cmd_duration" + "$hostname" + "$localip" + "$shell" + "$env_var" + "$jobs" + "$sudo" + "$username" + "$character" + ]; + + right_format = lib.concatStrings [ + "$directory" + "$git_branch" + "$git_commit" + "$git_state" + "$git_status" + "$docker_context" + "$c" + "$cpp" + "$deno" + "$helm" + "$java" + "$kotlin" + "$gradle" + "$lua" + "$nodejs" + "$python" + "$ruby" + "$rust" + "$terraform" + "$conda" + "$pixi" + ]; + + fill = { + symbol = " "; + }; + + line_break = { + disabled = false; + }; + character = { - success_symbol = "[›](bold green)"; - error_symbol = "[›](bold red)"; + format = "$symbol "; + success_symbol = "[◎](bold italic bright-yellow)"; + error_symbol = "[○](italic purple)"; + vimcmd_symbol = "[■](italic dimmed green)"; + }; + + env_var.VIMSHELL = { + format = "[$env_value]($style)"; + style = "green italic"; + }; + + sudo = { + format = "[$symbol]($style)"; + style = "bold italic bright-purple"; + symbol = "⋈┈"; + disabled = false; + }; + + username = { + style_user = "bright-yellow bold italic"; + style_root = "purple bold italic"; + format = "[⭘ $user]($style) "; + disabled = false; + show_always = false; + }; + + directory = { + home_symbol = "⌂"; + truncation_length = 2; + truncation_symbol = "□ "; + read_only = " ◈"; + use_os_path_sep = true; + style = "italic blue"; + format = "[$path]($style)[$read_only]($read_only_style)"; + repo_root_style = "bold blue"; + repo_root_format = "[$before_root_path]($before_repo_root_style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) [△](bold bright-blue)"; + }; + + cmd_duration = { + format = "[◄ $duration ](italic white)"; + }; + + jobs = { + format = "[$symbol$number]($style) "; + style = "white"; + symbol = "[▶](blue italic)"; + }; + + localip = { + ssh_only = true; + format = " ◯[$localipv4](bold magenta)"; + disabled = false; + }; + + git_branch = { + format = " [$branch(:$remote_branch)]($style)"; + symbol = "[△](bold italic bright-blue)"; + style = "italic bright-blue"; + truncation_symbol = "⋯"; + truncation_length = 11; + ignore_branches = [ + "main" + "master" + ]; + only_attached = true; + }; + + git_metrics = { + format = "([▴$added]($added_style))([▿$deleted]($deleted_style))"; + added_style = "italic dimmed green"; + deleted_style = "italic dimmed red"; + ignore_submodules = true; + disabled = false; + }; + + git_status = { + style = "bold italic bright-blue"; + format = "([⎪$ahead_behind$staged$modified$untracked$renamed$deleted$conflicted$stashed⎥]($style))"; + conflicted = "[◪◦](italic bright-magenta)"; + ahead = "[▴│[\${count}](bold white)│](italic green)"; + behind = "[▿│[\${count}](bold white)│](italic red)"; + diverged = "[◇ ▴┤[\${ahead_count}](regular white)│▿┤[\${behind_count}](regular white)│](italic bright-magenta)"; + untracked = "[◌◦](italic bright-yellow)"; + stashed = "[◃◈](italic white)"; + modified = "[●◦](italic yellow)"; + staged = "[▪┤[$count](bold white)│](italic bright-cyan)"; + renamed = "[◎◦](italic bright-blue)"; + deleted = "[✕](italic red)"; + }; + + deno = { + format = " [deno](italic) [∫ $version](green bold)"; + version_format = "\${raw}"; + }; + + lua = { + format = " [lua](italic) [\${symbol}\${version}]($style)"; + version_format = "\${raw}"; + symbol = "⨀ "; + style = "bold bright-yellow"; + }; + + nodejs = { + format = " [node](italic) [◫ ($version)](bold bright-green)"; + version_format = "\${raw}"; + detect_files = [ + "package-lock.json" + "yarn.lock" + ]; + detect_folders = [ "node_modules" ]; + detect_extensions = [ ]; + }; + + python = { + format = " [py](italic) [\${symbol}\${version}]($style)"; + symbol = "[⌉](bold bright-blue)⌊ "; + version_format = "\${raw}"; + style = "bold bright-yellow"; + }; + + ruby = { + format = " [rb](italic) [\${symbol}\${version}]($style)"; + symbol = "◆ "; + version_format = "\${raw}"; + style = "bold red"; + }; + + rust = { + format = " [rs](italic) [$symbol$version]($style)"; + symbol = "⊃ "; + version_format = "\${raw}"; + style = "bold red"; + }; + + c = { + symbol = "ℂ "; + format = " [$symbol($version(-$name))]($style)"; + }; + + cpp = { + symbol = "ℂ "; + format = " [$symbol($version(-$name))]($style)"; + }; + + conda = { + symbol = "◯ "; + format = " conda [$symbol$environment]($style)"; + }; + + pixi = { + symbol = "■ "; + format = " pixi [$symbol$version ($environment )]($style)"; + }; + + docker_context = { + symbol = "◧ "; + format = " docker [$symbol$context]($style)"; + }; + + java = { + symbol = "∪ "; + format = " java [\${symbol}(\${version} )]($style)"; + }; + + nix_shell = { + style = "bold italic dimmed blue"; + symbol = "✶"; + format = "[$symbol nix⎪$state⎪]($style) [$name](italic dimmed white)"; + impure_msg = "[⌽](bold dimmed red)"; + pure_msg = "[⌾](bold dimmed green)"; + unknown_msg = "[◌](bold dimmed yellow)"; }; }; }; diff --git a/home/terminal.nix b/home/terminal.nix index 89c3118..f6dffc4 100644 --- a/home/terminal.nix +++ b/home/terminal.nix @@ -4,5 +4,6 @@ enableZshIntegration = true; enableBashIntegration = true; # TODO wezterm config + extraConfig = builtins.readFile ./wezterm.lua; }; } diff --git a/home/wezterm.lua b/home/wezterm.lua new file mode 100644 index 0000000..f369e24 --- /dev/null +++ b/home/wezterm.lua @@ -0,0 +1,33 @@ +local wezterm = require("wezterm") + +config = wezterm.config_builder() + +config = { + -- Windows + automatically_reload_config = true, + enable_tab_bar = false, + window_close_confirmation = "NeverPrompt", + window_decorations = "RESIZE", -- disable title bar, enable resize + default_cursor_style = "BlinkingBar", + + -- Appearance + color_scheme = "Tokyo Night", + font = wezterm.font("D2CodingLigature Nerd Font"), + font_size = 16, + background = { + { + source = { Color = "#282c35" }, + width = "100%", + height = "100%", + opacity = 0.95, + }, + }, + window_padding = { + left = 2, + right = 2, + top = 0, + bottom = 0, + }, +} + +return config diff --git a/home/zsh.nix b/home/zsh.nix index c9e2d73..9e58e71 100755 --- a/home/zsh.nix +++ b/home/zsh.nix @@ -19,8 +19,8 @@ shellAliases = { poby = "echo my name is poby"; - drs = "sudo darwin-rebuild switch --flake ~/nix-darwin#$(hostname)"; # TODO change to just script - drt = "sudo darwin-rebuild test --flake ~/nix-darwin#$(hostname)"; # TODO change to just script + nixconfig = "cd ~/nix-darwin && vim flake.nix"; + just-darwin = "cd ~/nix-darwin && just darwin"; }; sessionVariables = {