From 9c0d4c944bc3392af84dbbd208f0a1177b84000a Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 17 Apr 2024 10:56:39 -0400 Subject: enable starship with nerdfonts --- lib/common.nix | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 5 deletions(-) (limited to 'lib/common.nix') diff --git a/lib/common.nix b/lib/common.nix index f81d0d6..5a7dc03 100644 --- a/lib/common.nix +++ b/lib/common.nix @@ -61,11 +61,61 @@ in { }; }; + fonts.fontconfig.enable = true; + programs = { home-manager = { enable = true; }; + starship = { + # export PS1='$(printf "%3.*s" $? $?)ϟ ' + enable = true; + settings = { + format = lib.concatStrings [ + #"$username" + "$hostname" + "$directory" + "$git_branch" + "$git_state" + "$git_status" + "$cmd_duration" + "$line_break" + "$character" + ]; + directory.style = "blue"; + character = { + success_symbol = "[ϟ](white)"; + error_symbol = "[ϟ](red)"; + }; + git_branch = { + format = "[$branch]($style)"; + style = "bright-black"; + }; + git_status = { + format = + ''[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)''; + style = "cyan"; + conflicted = "​"; + untracked = "​"; + modified = "​"; + staged = "​"; + renamed = "​"; + deleted = "​"; + stashed = "≡"; + }; + git_state = { + format = "\([$state( $progress_current/$progress_total)]($style)\) "; + style = "bright-black"; + }; + + cmd_duration = { + format = "[$duration]($style) "; + style = "yellow"; + }; + }; + }; + readline = { enable = true; variables = { @@ -163,7 +213,6 @@ in { annotate = "yes"; cccmd = "git-contacts"; }; - }; }; @@ -251,10 +300,11 @@ in { ]; }; - urxvt = let font = size: "xft:Fira Mono:size=${toString size}:ant"; in { + urxvt = let font = name: size: "xft:${name}:size=${toString size}:ant"; in { enable = true; fonts = [ - (font (fontSize / 2)) + (font "Fira Code" fontSize) + (font "FiraCodeNerdfont" fontSize) "xft:Noto Emoji" ]; #keybindings = { @@ -362,8 +412,6 @@ in { gawk 'match($0,/'$1'/, ary) {print ary['\$\{2:-'0'}']}'; } - export PS1='$(printf "%3.*s" $? $?)ϟ ' - # kill a process with fzf fkill() { local pid -- cgit v1.2.3