about summary refs log tree commit diff
path: root/home/zsh/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home/zsh/default.nix')
-rw-r--r--home/zsh/default.nix42
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; };
+  };
+}