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 +++++++++++++++++++++++++++++++++++++++++++++++++++----- lib/const.nix | 2 +- lib/packages.nix | 3 +++ 3 files changed, 57 insertions(+), 6 deletions(-) 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 diff --git a/lib/const.nix b/lib/const.nix index 0accd17..ce1f11b 100644 --- a/lib/const.nix +++ b/lib/const.nix @@ -1,5 +1,5 @@ { - fontSize = 16; + fontSize = 14; homedir = builtins.getEnv "HOME"; gpgid = "66A6AD150399D970DCA4C4E6C8218B7D0BFDECCD"; } diff --git a/lib/packages.nix b/lib/packages.nix index 2037054..8540382 100644 --- a/lib/packages.nix +++ b/lib/packages.nix @@ -58,6 +58,8 @@ in { #exercism fd file + fira-code + #fira-code-nerdfont font-awesome_5 forgit gcal @@ -77,6 +79,7 @@ in { ncdu nmap ncmpc + nerdfonts nix-index nix-prefetch-scripts nixos-generators -- cgit v1.2.3