summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShubham Saini <ssaini@fispan.com>2023-09-30 03:32:40 +0000
committerShubham Saini <ssaini@fispan.com>2023-09-30 03:32:40 +0000
commitfdb9ba23a2cff4b50a699eb89435aa9a9de77891 (patch)
tree025d7259ddaee08b1d11678ce6f2ba729c10b8cc
parent88a10686f7cd9e15feb8d3464c20749dbd51f7c4 (diff)
nix: trying modules
-rw-r--r--darwin/home.nix54
-rw-r--r--modules/zsh.nix52
2 files changed, 56 insertions, 50 deletions
diff --git a/darwin/home.nix b/darwin/home.nix
index e0b1bb0..5e24a76 100644
--- a/darwin/home.nix
+++ b/darwin/home.nix
@@ -44,6 +44,10 @@
44 }; 44 };
45 }; 45 };
46 46
47 imports = [
48 ../modules/zsh.nix
49 ];
50
47 home.sessionVariables = { 51 home.sessionVariables = {
48 PATH = "$PATH:$HOME/.bin"; 52 PATH = "$PATH:$HOME/.bin";
49 EDITOR = "nvim"; 53 EDITOR = "nvim";
@@ -51,56 +55,6 @@
51 }; 55 };
52 56
53 programs.home-manager.enable = true; 57 programs.home-manager.enable = true;
54 programs.zsh = {
55 enable = true;
56 enableCompletion = true;
57 enableAutosuggestions = true;
58 dotDir = ".zsh";
59 history = {
60 ignoreAllDups = true;
61 path = "$HOME/.zsh/history";
62 };
63 initExtra = ''
64 zstyle ':completion:*' menu select
65 zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
66 zmodload zsh/complist
67 bindkey -M menuselect 'h' vi-backward-char
68 bindkey -M menuselect 'k' vi-up-line-or-history
69 bindkey -M menuselect 'l' vi-forward-char
70 bindkey -M menuselect 'j' vi-down-line-or-history
71 bindkey '^f' autosuggest-accept
72 source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh
73 zvm_after_init_commands+=('source ${pkgs.fzf}/share/fzf/completion.zsh && source ${pkgs.fzf}/share/fzf/key-bindings.zsh')
74 '';
75 shellAliases = {
76 ".." = "cd ..";
77 l = "ls --color -al";
78 ls = "ls --color";
79 v = "nvim";
80 o = "xdg-open";
81 t = "tmux";
82 f = "lf";
83 tf = "terraform";
84 k = "kubectl";
85 gst = "git status --short";
86 ga = "git add";
87 gp = "git push";
88 gl = "git log --oneline --decorate --graph";
89 gc = "git commit -v -S";
90 gd = "git diff --minimal";
91 };
92 plugins = [
93 {
94 name = "pure";
95 src = pkgs.fetchFromGitHub {
96 owner = "sindresorhus";
97 repo = "pure";
98 rev = "v1.22.0";
99 sha256 = "177vabhvgrxdcwvc29rmfmfr96wl75hrkhymnd8qcaky2v4047jd";
100 };
101 }
102 ];
103 };
104 programs.fzf = { 58 programs.fzf = {
105 enable = true; 59 enable = true;
106 enableZshIntegration = false; 60 enableZshIntegration = false;
diff --git a/modules/zsh.nix b/modules/zsh.nix
new file mode 100644
index 0000000..bd7a30f
--- /dev/null
+++ b/modules/zsh.nix
@@ -0,0 +1,52 @@
1{
2 programs.zsh = {
3 enable = true;
4 enableCompletion = true;
5 enableAutosuggestions = true;
6 dotDir = ".zsh";
7 history = {
8 ignoreAllDups = true;
9 path = "$HOME/.zsh/history";
10 };
11 initExtra = ''
12 zstyle ':completion:*' menu select
13 zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
14 zmodload zsh/complist
15 bindkey -M menuselect 'h' vi-backward-char
16 bindkey -M menuselect 'k' vi-up-line-or-history
17 bindkey -M menuselect 'l' vi-forward-char
18 bindkey -M menuselect 'j' vi-down-line-or-history
19 bindkey '^f' autosuggest-accept
20 source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh
21 zvm_after_init_commands+=('source ${pkgs.fzf}/share/fzf/completion.zsh && source ${pkgs.fzf}/share/fzf/key-bindings.zsh')
22 '';
23 shellAliases = {
24 ".." = "cd ..";
25 l = "ls --color -al";
26 ls = "ls --color";
27 v = "nvim";
28 o = "xdg-open";
29 t = "tmux";
30 f = "lf";
31 tf = "terraform";
32 k = "kubectl";
33 gst = "git status --short";
34 ga = "git add";
35 gp = "git push";
36 gl = "git log --oneline --decorate --graph";
37 gc = "git commit -v -S";
38 gd = "git diff --minimal";
39 };
40 plugins = [
41 {
42 name = "pure";
43 src = pkgs.fetchFromGitHub {
44 owner = "sindresorhus";
45 repo = "pure";
46 rev = "v1.22.0";
47 sha256 = "177vabhvgrxdcwvc29rmfmfr96wl75hrkhymnd8qcaky2v4047jd";
48 };
49 }
50 ];
51 };
52}