diff options
author | Franck Cuny <franck@fcuny.net> | 2022-05-15 14:53:30 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-05-15 14:53:30 -0700 |
commit | 52e42f959abb15e425b34ffbd31d7f32a6129636 (patch) | |
tree | 52f7d15a6f6ba821572629e2c28b1536d6c1752d /home/zsh/default.nix | |
parent | home: run abcde in `~/import` (diff) | |
download | world-52e42f959abb15e425b34ffbd31d7f32a6129636.tar.gz |
zsh: switch to zsh as the default shell
`zsh' is available everywhere and is compatible with bash. When using `fish' I need to remember how to do things. While the completion style is nicer, I don't care about the rest. I prefer to have a consistent experience in the shell, no matter where am I. This is an initial configuration, I might need to make a few changes as I go.
Diffstat (limited to 'home/zsh/default.nix')
-rw-r--r-- | home/zsh/default.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/home/zsh/default.nix b/home/zsh/default.nix new file mode 100644 index 0000000..cc19579 --- /dev/null +++ b/home/zsh/default.nix @@ -0,0 +1,42 @@ +{ config, pkgs, lib, ... }: +let cfg = config.my.home.zsh; +in { + options.my.home.zsh = with lib; { + enable = mkEnableOption "zsh configuration"; + }; + + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ zsh-completions ]; + + programs.zsh = { + enable = true; + dotDir = ".config/zsh"; + enableCompletion = true; + + history = { + size = 500000; + save = 500000; + extended = false; + ignoreSpace = true; + ignoreDups = true; + share = false; + path = "${config.xdg.dataHome}/zsh/zsh_history"; + }; + + localVariables = { + # Print timing statistics for everything which takes longer than 5 seconds of + # user + system time. + REPORTTIME = 5; + }; + + defaultKeymap = "emacs"; + initExtra = lib.concatMapStrings builtins.readFile [ + ./completion-style.zsh + ./options.zsh + ./prompt.zsh + ]; + + }; + programs.dircolors = { enable = true; }; + }; +} |