diff options
author | Minijackson <minijackson@riseup.net> | 2020-12-03 16:45:06 +0100 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2020-12-03 16:45:06 +0100 |
commit | 3f0e83cb4816e637d8c916fb77217e1c5824dbe5 (patch) | |
tree | 65b48ffe6e82459cde97b8ee61a597402ba2617b /common/commandline/zsh.nix | |
download | nixos-config-reborn-3f0e83cb4816e637d8c916fb77217e1c5824dbe5.tar.gz nixos-config-reborn-3f0e83cb4816e637d8c916fb77217e1c5824dbe5.zip |
initial commit: most of previous configuration reworked
Diffstat (limited to 'common/commandline/zsh.nix')
-rw-r--r-- | common/commandline/zsh.nix | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/common/commandline/zsh.nix b/common/commandline/zsh.nix new file mode 100644 index 0000000..3376321 --- /dev/null +++ b/common/commandline/zsh.nix | |||
@@ -0,0 +1,59 @@ | |||
1 | { config, lib, pkgs, ... }: | ||
2 | |||
3 | with import ../../lib/theme.nix { inherit lib; }; | ||
4 | let | ||
5 | dominantEscapeCode = fgEscapeCode config.theme.colors.dominant; | ||
6 | in | ||
7 | { | ||
8 | programs.zsh = { | ||
9 | enable = true; | ||
10 | |||
11 | interactiveShellInit = with lib; | ||
12 | '' | ||
13 | source "${pkgs.grml-zsh-config}/etc/zsh/zshrc" | ||
14 | is4 && xsource "${pkgs.grml-zsh-config}/etc/zsh/keephack" | ||
15 | |||
16 | PATH="${pkgs.pazi}/bin:$PATH" | ||
17 | eval "$(pazi init zsh)" | ||
18 | |||
19 | source "${pkgs.zsh-history-substring-search}/share/zsh-history-substring-search/zsh-history-substring-search.zsh" | ||
20 | |||
21 | function () { | ||
22 | local dominant_escape_code="${dominantEscapeCode}" | ||
23 | local dim_fg_escape_code="${fgEscapeCode config.theme.colors.dimForeground}" | ||
24 | |||
25 | ${builtins.readFile ../../dotfiles/zshrc} | ||
26 | } | ||
27 | |||
28 | # Grml's ZSH config overrides less variables | ||
29 | export ${concatStringsSep " " | ||
30 | (mapAttrsToList | ||
31 | (variable: value: "${variable}=\"${value}\"") | ||
32 | config.programs.less.envVariables)} | ||
33 | |||
34 | #eval "$(${pkgs.starship}/bin/starship init zsh)" | ||
35 | ''; | ||
36 | |||
37 | # otherwise it'll override the grml prompt | ||
38 | promptInit = ""; | ||
39 | # Grml handles that, and supports cache (faster!!!) | ||
40 | enableGlobalCompInit = false; | ||
41 | |||
42 | syntaxHighlighting = { | ||
43 | enable = true; | ||
44 | highlighters = [ "main" "brackets" "line" ]; | ||
45 | }; | ||
46 | |||
47 | shellAliases = { | ||
48 | e = "\${(z)EDITOR}"; | ||
49 | }; | ||
50 | |||
51 | setOptions = [ | ||
52 | "HIST_IGNORE_DUPS" "SHARE_HISTORY" "HIST_FCNTL_LOCK" | ||
53 | "NO_CLOBBER" | ||
54 | "NO_CASE_GLOB" | ||
55 | ]; | ||
56 | }; | ||
57 | |||
58 | users.defaultUserShell = pkgs.zsh; | ||
59 | } | ||