summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2024-10-27 22:47:37 +0100
committerMinijackson <minijackson@riseup.net>2024-10-27 22:47:37 +0100
commit943dd97f99e535d2aa90682848ab6c4909a849b4 (patch)
treeacdc116dac5bd1c63c9303686c2aa1104312b960
parent0b084b2e9367613b1e68bb46a0f7c1280e648da0 (diff)
downloadnixos-config-reborn-943dd97f99e535d2aa90682848ab6c4909a849b4.tar.gz
nixos-config-reborn-943dd97f99e535d2aa90682848ab6c4909a849b4.zip
common/zsh: use starship by default
-rw-r--r--common/commandline/starship-plain-text-symbols.toml18
-rw-r--r--common/commandline/starship.nix13
-rw-r--r--common/commandline/zsh.nix30
3 files changed, 31 insertions, 30 deletions
diff --git a/common/commandline/starship-plain-text-symbols.toml b/common/commandline/starship-plain-text-symbols.toml
index 32126a0..b6412b4 100644
--- a/common/commandline/starship-plain-text-symbols.toml
+++ b/common/commandline/starship-plain-text-symbols.toml
@@ -73,6 +73,9 @@ symbol = "gcp "
73[git_branch] 73[git_branch]
74symbol = "git " 74symbol = "git "
75 75
76[gleam]
77symbol = "gleam "
78
76[golang] 79[golang]
77symbol = "go " 80symbol = "go "
78 81
@@ -106,6 +109,9 @@ symbol = "memory "
106[meson] 109[meson]
107symbol = "meson " 110symbol = "meson "
108 111
112[nats]
113symbol = "nats "
114
109[nim] 115[nim]
110symbol = "nim " 116symbol = "nim "
111 117
@@ -119,7 +125,9 @@ symbol = "ml "
119symbol = "opa " 125symbol = "opa "
120 126
121[os.symbols] 127[os.symbols]
128AIX = "aix "
122Alpaquita = "alq " 129Alpaquita = "alq "
130AlmaLinux = "alma "
123Alpine = "alp " 131Alpine = "alp "
124Amazon = "amz " 132Amazon = "amz "
125Android = "andr " 133Android = "andr "
@@ -136,6 +144,7 @@ Garuda = "garu "
136Gentoo = "gent " 144Gentoo = "gent "
137HardenedBSD = "hbsd " 145HardenedBSD = "hbsd "
138Illumos = "lum " 146Illumos = "lum "
147Kali = "kali "
139Linux = "lnx " 148Linux = "lnx "
140Mabox = "mbox " 149Mabox = "mbox "
141Macos = "mac " 150Macos = "mac "
@@ -154,11 +163,14 @@ Pop = "pop "
154Raspbian = "rasp " 163Raspbian = "rasp "
155Redhat = "rhl " 164Redhat = "rhl "
156RedHatEnterprise = "rhel " 165RedHatEnterprise = "rhel "
166RockyLinux = "rky "
157Redox = "redox " 167Redox = "redox "
158Solus = "sol " 168Solus = "sol "
159SUSE = "suse " 169SUSE = "suse "
160Ubuntu = "ubnt " 170Ubuntu = "ubnt "
171Ultramarine = "ultm "
161Unknown = "unk " 172Unknown = "unk "
173Void = "void "
162Windows = "win " 174Windows = "win "
163 175
164[package] 176[package]
@@ -182,6 +194,9 @@ symbol = "purs "
182[python] 194[python]
183symbol = "py " 195symbol = "py "
184 196
197[quarto]
198symbol = "quarto "
199
185[raku] 200[raku]
186symbol = "raku " 201symbol = "raku "
187 202
@@ -209,6 +224,9 @@ symbol = "sudo "
209[swift] 224[swift]
210symbol = "swift " 225symbol = "swift "
211 226
227[typst]
228symbol = "typst "
229
212[terraform] 230[terraform]
213symbol = "terraform " 231symbol = "terraform "
214 232
diff --git a/common/commandline/starship.nix b/common/commandline/starship.nix
index 1683765..5983d2e 100644
--- a/common/commandline/starship.nix
+++ b/common/commandline/starship.nix
@@ -2,20 +2,21 @@ inputs: {lib, ...}: {
2 home-manager.users.minijackson = { 2 home-manager.users.minijackson = {
3 programs.starship = { 3 programs.starship = {
4 enable = true; 4 enable = true;
5 enableZshIntegration = false; 5 enableZshIntegration = true;
6 6
7 settings = lib.mkMerge [ 7 settings = lib.mkMerge [
8 { 8 {
9 directory = { 9 directory = {
10 fish_style_pwd_dir_length = 2; 10 fish_style_pwd_dir_length = 2;
11 style = "bold blue"; 11 repo_root_style = "bold cyan";
12 style = "bold white";
13 truncate_to_repo = false;
12 }; 14 };
15
13 jobs.symbol = "+ "; 16 jobs.symbol = "+ ";
17
14 nix_shell.style = "bold blue"; 18 nix_shell.style = "bold blue";
15 package = { 19 package.style = "bold green";
16 disabled = true;
17 style = "bold green";
18 };
19 rust.style = "bold dimmed yellow"; 20 rust.style = "bold dimmed yellow";
20 } 21 }
21 22
diff --git a/common/commandline/zsh.nix b/common/commandline/zsh.nix
index f2a052b..8f818dc 100644
--- a/common/commandline/zsh.nix
+++ b/common/commandline/zsh.nix
@@ -13,14 +13,11 @@ in
13 programs.zsh = { 13 programs.zsh = {
14 enable = true; 14 enable = true;
15 15
16 interactiveShellInit = '' 16 interactiveShellInit = lib.mkBefore ''
17 # Use cache file as is, to speed-up start time 17 # Use cache file as is, to speed-up start time
18 # This does mean we have to run once in a while: 18 # This does mean we have to run once in a while:
19 # compinit -d .config/zsh/.zcompdump 19 # compinit -d .config/zsh/.zcompdump
20 zstyle ':grml:completion:compinit' arguments -C 20 autoload -U compinit && compinit -C
21
22 source "${pkgs.grml-zsh-config}/etc/zsh/zshrc"
23 is4 && xsource "${pkgs.grml-zsh-config}/etc/zsh/keephack"
24 21
25 source "${pkgs.zsh-history-substring-search}/share/zsh-history-substring-search/zsh-history-substring-search.zsh" 22 source "${pkgs.zsh-history-substring-search}/share/zsh-history-substring-search/zsh-history-substring-search.zsh"
26 23
@@ -29,22 +26,14 @@ in
29 local dim_fg_escape_code="${fgEscapeCode config.theme.colors.dimForeground}" 26 local dim_fg_escape_code="${fgEscapeCode config.theme.colors.dimForeground}"
30 27
31 ${builtins.readFile ../../dotfiles/zshrc} 28 ${builtins.readFile ../../dotfiles/zshrc}
32
33 autoload -Uz shmart-prompt-dir
34 zstyle -e ':prompt:grml*:*:items:path' token shmart-prompt-dir
35 }
36
37 # Grml's ZSH config overrides less variables
38 export ${
39 lib.concatStringsSep " " (
40 lib.mapAttrsToList (variable: value: "${variable}=\"${value}\"") config.programs.less.envVariables
41 )
42 } 29 }
43 ''; 30 '';
44 31
45 # otherwise it'll override the grml prompt 32 # not needed, since we're using starship
46 promptInit = ""; 33 promptInit = "";
47 # Grml handles that, and supports cache (faster!!!) 34 # Use cache file as is, to speed-up start time
35 # This does mean we have to run once in a while:
36 # compinit -d .config/zsh/.zcompdump
48 enableGlobalCompInit = false; 37 enableGlobalCompInit = false;
49 38
50 syntaxHighlighting = { 39 syntaxHighlighting = {
@@ -94,13 +83,6 @@ in
94 dotDir = ".config/zsh"; 83 dotDir = ".config/zsh";
95 history.path = "${config.xdg.dataHome}/zsh/zsh_history"; 84 history.path = "${config.xdg.dataHome}/zsh/zsh_history";
96 85
97 plugins = [
98 {
99 name = "shmart-prompt-dir";
100 src = inputs.shmart-prompt-dir;
101 file = "none";
102 }
103 ];
104 }; 86 };
105 } 87 }
106 ) 88 )