From c0a7e5a3ea72e15fee73dcd9d30f73aa039a6ac5 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Mon, 28 Oct 2024 20:09:36 +0100 Subject: common/starship: configure for root, configure hostname module --- common/commandline/starship.nix | 123 +++++++++++++++++++++------------------- 1 file changed, 65 insertions(+), 58 deletions(-) (limited to 'common') diff --git a/common/commandline/starship.nix b/common/commandline/starship.nix index a17f9e8..98b6e36 100644 --- a/common/commandline/starship.nix +++ b/common/commandline/starship.nix @@ -3,68 +3,75 @@ _inputs: { users.extraUsers.minijackson.packages = [ pkgs.sd ]; - home-manager.users.minijackson = { - programs.starship = { - enable = true; - enableZshIntegration = true; + home-manager.sharedModules = [ + { + programs.starship = { + enable = true; + enableZshIntegration = true; - settings = lib.mkMerge [ - { - directory = { - fish_style_pwd_dir_length = 2; - repo_root_style = "bold cyan"; - style = "bold white"; - truncate_to_repo = false; - }; + settings = lib.mkMerge [ + { + directory = { + fish_style_pwd_dir_length = 2; + repo_root_style = "bold cyan"; + style = "bold white"; + truncate_to_repo = false; + }; + + hostname = { + ssh_symbol = "ssh "; + style = "bold blue"; + }; - jobs.symbol = "+ "; + jobs.symbol = "+ "; - nix_shell.style = "bold blue"; - package.style = "bold green"; - rust.style = "bold dimmed yellow"; + nix_shell.style = "bold blue"; + package.style = "bold green"; + rust.style = "bold dimmed yellow"; - custom = { - jj = { - command = '' - jj log -r@ -l1 --ignore-working-copy --no-graph --color always -T ' - separate(" ", - bookmarks.map(|x| if( - x.name().substr(0, 10).starts_with(x.name()), - x.name().substr(0, 10), - x.name().substr(0, 9) ++ "…") - ).join(" "), - tags.map(|x| if( - x.name().substr(0, 10).starts_with(x.name()), - x.name().substr(0, 10), - x.name().substr(0, 9) ++ "…") - ).join(" "), - surround("\"","\"", - if( - description.first_line().substr(0, 24).starts_with(description.first_line()), - description.first_line().substr(0, 24), - description.first_line().substr(0, 23) ++ "…" - ) - ), - if(conflict, "conflict"), - if(divergent, "divergent"), - if(hidden, "hidden"), - ) - ' - ''; - detect_folders = [ ".jj" ]; - symbol = "jj "; - }; - jjstate = { - command = '' - jj log -r@ -n1 --no-graph -T "" --stat | tail -n1 | sd "(\d+) files? changed, (\d+) insertions?\(\+\), (\d+) deletions?\(-\)" ' ''${1}m ''${2}+ ''${3}-' | sd " 0." "" - ''; - detect_folders = [ ".jj" ]; + custom = { + jj = { + command = '' + jj log -r@ -l1 --ignore-working-copy --no-graph --color always -T ' + separate(" ", + bookmarks.map(|x| if( + x.name().substr(0, 10).starts_with(x.name()), + x.name().substr(0, 10), + x.name().substr(0, 9) ++ "…") + ).join(" "), + tags.map(|x| if( + x.name().substr(0, 10).starts_with(x.name()), + x.name().substr(0, 10), + x.name().substr(0, 9) ++ "…") + ).join(" "), + surround("\"","\"", + if( + description.first_line().substr(0, 24).starts_with(description.first_line()), + description.first_line().substr(0, 24), + description.first_line().substr(0, 23) ++ "…" + ) + ), + if(conflict, "conflict"), + if(divergent, "divergent"), + if(hidden, "hidden"), + ) + ' + ''; + detect_folders = [ ".jj" ]; + symbol = "jj "; + }; + jjstate = { + command = '' + jj log -r@ -n1 --no-graph -T "" --stat | tail -n1 | sd "(\d+) files? changed, (\d+) insertions?\(\+\), (\d+) deletions?\(-\)" ' ''${1}m ''${2}+ ''${3}-' | sd " 0." "" + ''; + detect_folders = [ ".jj" ]; + }; }; - }; - } + } - (lib.importTOML ./starship-plain-text-symbols.toml) - ]; - }; - }; + (lib.importTOML ./starship-plain-text-symbols.toml) + ]; + }; + } + ]; } -- cgit v1.2.3