|
3 | 3 | lib, |
4 | 4 | wlib, |
5 | 5 | ... |
6 | | -}: |
7 | | -let |
| 6 | +}: let |
8 | 7 | cfg = config.settings; |
9 | | -in |
10 | | -{ |
| 8 | +in { |
11 | 9 | _class = "wrapper"; |
12 | 10 | options = { |
13 | 11 | settings = { |
|
23 | 21 |
|
24 | 22 | shellAliases = lib.mkOption { |
25 | 23 | type = with lib.types; attrsOf str; |
26 | | - default = { }; |
| 24 | + default = {}; |
27 | 25 | description = "shell aliases (alias -- key=value)"; |
28 | 26 | }; |
29 | 27 |
|
|
62 | 60 | default = config.pkgs.starship; # Or self'.packages.starship, assuming you use flake parts |
63 | 61 | }; |
64 | 62 | }; |
| 63 | + pay-respects = { |
| 64 | + enable = lib.mkEnableOption "pay-respects"; |
| 65 | + package = lib.mkOption { |
| 66 | + type = lib.types.package; |
| 67 | + default = config.pkgs.pay-respects; |
| 68 | + }; |
| 69 | + flags = lib.mkOption { |
| 70 | + type = with lib.types; listOf str; |
| 71 | + default = []; |
| 72 | + }; |
| 73 | + }; |
65 | 74 | zoxide = { |
66 | 75 | enable = lib.mkEnableOption "zoxide"; |
67 | 76 | package = lib.mkOption { |
|
70 | 79 | }; |
71 | 80 | flags = lib.mkOption { |
72 | 81 | type = with lib.types; listOf str; |
73 | | - default = [ ]; |
| 82 | + default = []; |
74 | 83 | }; |
75 | 84 | }; |
76 | 85 | }; |
|
199 | 208 | description = "extra stuff to put in .zshrc, gets appended *after* all of the options"; |
200 | 209 | }; |
201 | 210 |
|
202 | | - ".zshrc" = |
203 | | - let |
204 | | - zoxide-flags = lib.concatStringsSep " " cfg.integrations.zoxide.flags; |
205 | | - ing = cfg.integrations; |
206 | | - in |
| 211 | + ".zshrc" = let |
| 212 | + zoxide-flags = lib.concatStringsSep " " cfg.integrations.zoxide.flags; |
| 213 | + pay-respects-flags = lib.concatStringsSep " " cfg.integrations.pay-respects.flags; |
| 214 | + ing = cfg.integrations; |
| 215 | + in |
207 | 216 | lib.mkOption { |
208 | 217 | type = wlib.types.file config.pkgs; |
209 | 218 | default.content = builtins.concatStringsSep "\n" [ |
210 | 219 | "# KeyMap" |
211 | 220 | ( |
212 | | - if cfg.keyMap == "viins" then |
213 | | - "bindkey -a" |
214 | | - else if cfg.keyMap == "vicmd" then |
215 | | - "bindkey -v" |
216 | | - else |
217 | | - "bindkey -e" |
| 221 | + if cfg.keyMap == "viins" |
| 222 | + then "bindkey -a" |
| 223 | + else if cfg.keyMap == "vicmd" |
| 224 | + then "bindkey -v" |
| 225 | + else "bindkey -e" |
218 | 226 | ) |
219 | 227 | (lib.optionalString cfg.autocd "setopt autocd") |
220 | 228 |
|
|
230 | 238 | "#Autosuggestions" |
231 | 239 | (lib.optionalString cfg.autoSuggestions.enable '' |
232 | 240 | source ${config.pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh |
233 | | - ${lib.optionalString (cfg.autoSuggestions.strategy != [ ]) '' |
234 | | - ZSH_AUTOSUGGEST_STRATEGY=(${lib.concatStringsSep " " cfg.autoSuggestions.strategy}) |
235 | | - ''} |
| 241 | + ${lib.optionalString (cfg.autoSuggestions.strategy != []) '' |
| 242 | + ZSH_AUTOSUGGEST_STRATEGY=(${lib.concatStringsSep " " cfg.autoSuggestions.strategy}) |
| 243 | + ''} |
236 | 244 |
|
237 | 245 | ${lib.optionalString (cfg.autoSuggestions.highlight != null) '' |
238 | 246 | ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=(${cfg.autoSuggestions.highlight}) |
|
244 | 252 | (lib.optionalString ing.atuin.enable ''eval "$(atuin init zsh)"'') |
245 | 253 | (lib.optionalString ing.oh-my-posh.enable ''eval "$(oh-my-posh init zsh)"'') |
246 | 254 | (lib.optionalString ing.zoxide.enable ''eval "$(zoxide init zsh ${zoxide-flags})"'') |
| 255 | + (lib.optionalString ing.pay-respects.enable ''eval "$(pay-respects zsh ${pay-respects-flags})"'') |
247 | 256 | (lib.optionalString ing.starship.enable ''eval "$(starship init zsh)"'') |
248 | 257 |
|
249 | 258 | "# History" |
|
276 | 285 |
|
277 | 286 | config = { |
278 | 287 | package = config.pkgs.zsh; |
279 | | - extraPackages = |
280 | | - let |
281 | | - ing = cfg.integrations; |
282 | | - in |
| 288 | + extraPackages = let |
| 289 | + ing = cfg.integrations; |
| 290 | + in |
283 | 291 | lib.optional ing.fzf.enable ing.fzf.package |
284 | 292 | ++ lib.optional ing.atuin.enable ing.atuin.package |
285 | 293 | ++ lib.optional ing.zoxide.enable ing.zoxide.package |
286 | 294 | ++ lib.optional ing.oh-my-posh.enable ing.oh-my-posh.package |
287 | 295 | ++ lib.optional ing.starship.enable ing.starship.package |
| 296 | + ++ lib.optional ing.pay-respects.enable ing.pay-respects.package |
288 | 297 | ++ lib.optional cfg.completion.enable config.pkgs.nix-zsh-completions |
289 | 298 | ++ lib.optional cfg.completion.extraCompletions config.pkgs.zsh-completions |
290 | 299 | ++ lib.optional cfg.completion.fuzzySearch config.pkgs.zsh-fzf-tab; |
|
0 commit comments