2022-04-27 01:17:51 +03:00
|
|
|
{ lib, config, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.shell.zsh;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.shell.zsh = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Add z shell";
|
|
|
|
};
|
|
|
|
};
|
2022-08-29 15:40:41 +03:00
|
|
|
|
2022-04-27 01:17:51 +03:00
|
|
|
config = mkIf cfg.enable {
|
2022-08-31 18:26:01 +03:00
|
|
|
# fish and zsh support for nix-shell
|
2022-08-24 14:02:45 +03:00
|
|
|
home.packages = with pkgs; [ any-nix-shell ];
|
|
|
|
|
2022-04-27 01:17:51 +03:00
|
|
|
programs.zsh = {
|
|
|
|
enable = true;
|
|
|
|
enableAutosuggestions = true;
|
2022-07-03 13:44:20 +03:00
|
|
|
enableCompletion = true;
|
2022-04-27 01:17:51 +03:00
|
|
|
defaultKeymap = "viins";
|
|
|
|
dotDir = ".config/zsh";
|
|
|
|
|
|
|
|
history = {
|
|
|
|
path = "${config.xdg.dataHome}/zsh/zsh_history";
|
|
|
|
expireDuplicatesFirst = true;
|
|
|
|
ignorePatterns = [
|
|
|
|
"rm *"
|
|
|
|
"kill *"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
oh-my-zsh = {
|
2022-08-28 04:56:05 +03:00
|
|
|
enable = true;
|
2022-08-31 18:26:01 +03:00
|
|
|
theme = mkIf (!config.shell.prompt.starship.enable) "robbyrussell";
|
2022-04-27 01:17:51 +03:00
|
|
|
};
|
|
|
|
|
2022-08-19 16:37:18 +03:00
|
|
|
initExtra = ''
|
2022-08-24 14:02:45 +03:00
|
|
|
any-nix-shell zsh --info-right | source /dev/stdin
|
|
|
|
|
2022-08-19 16:37:18 +03:00
|
|
|
eval "$(cat $HOME/repos/tas/shell/zsh)"
|
2022-08-28 04:54:03 +03:00
|
|
|
|
|
|
|
eval $(kubectl completion zsh)
|
2022-08-19 16:37:18 +03:00
|
|
|
'';
|
2022-04-27 01:17:51 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|