system/users/jan/shell/zsh.nix

52 lines
1 KiB
Nix
Raw Normal View History

{ 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
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 ];
programs.zsh = {
enable = true;
enableAutosuggestions = true;
2022-07-03 13:44:20 +03:00
enableCompletion = true;
defaultKeymap = "viins";
dotDir = ".config/zsh";
history = {
path = "${config.xdg.dataHome}/zsh/zsh_history";
expireDuplicatesFirst = true;
ignorePatterns = [
"rm *"
"kill *"
];
};
oh-my-zsh = {
enable = true;
2022-08-31 18:26:01 +03:00
theme = mkIf (!config.shell.prompt.starship.enable) "robbyrussell";
};
initExtra = ''
2022-08-24 14:02:45 +03:00
any-nix-shell zsh --info-right | source /dev/stdin
eval "$(cat $HOME/repos/tas/shell/zsh)"
2022-08-28 04:54:03 +03:00
eval $(kubectl completion zsh)
'';
};
};
}