Nix configurations for my personal machines (Linux & macOS)
1{
2 delib,
3 pkgs,
4 ...
5}:
6delib.module {
7 name = "programs.fish";
8
9 # TODO: custom fifc rules (nix shell, nix run, ...)
10 # TODO: how to customise fifc pane
11 home.always.programs.fish = {
12 enable = true;
13 interactiveShellInit = ''
14 set fish_greeting
15 set fzf_diff_highlighter delta --paging=never --width=20
16 set fzf_preview_dir_cmd eza --all --color=always
17 set fzf_fd_opts --hidden --exclude=.git --exclude=node_modules
18
19 # Because I use the Colemak input source on MacOS, using Alt/Option in
20 # keybinds is a no-go, due to problems in Alacritty/iTerm's
21 # (and probably others) input handler, which uses key position codes
22 # instead of the actual value of the key. For some reason this doesn't
23 # cause problems in keybinds using only Ctrl.
24
25 fzf_configure_bindings --directory=\cf --git_log=\cl --git_status=\cs --processes=\cp
26
27 nix-your-shell fish | source
28
29 if test -d /opt/homebrew/bin;
30 fish_add_path /opt/homebrew/bin
31 end;
32
33 # Docker compose alias that switches to if the standalone binary is present.
34 if which docker-compose &> /dev/null;
35 alias dc docker-compose;
36 else;
37 alias dc "docker compose";
38 end;
39 '';
40
41 shellAbbrs = {
42 # code = "codium";
43 ga = "git add";
44 gaa = "git add -A";
45 gc = {
46 setCursor = "%";
47 expansion = "git commit -m \"%\"";
48 };
49 gca = "git commit --amend";
50 gco = "git checkout";
51 gd = "git diff HEAD";
52 gl = "git log";
53 gp = "git pull";
54 gr = "git rebase";
55 gs = "git status";
56 jctl = {
57 position = "anywhere";
58 expansion = "journalctl";
59 };
60 mctl = {
61 position = "anywhere";
62 expansion = "machinectl";
63 };
64 sctl = {
65 position = "anywhere";
66 expansion = "systemctl";
67 };
68 };
69
70 shellAliases = {
71 cat = "bat";
72 ls = "eza";
73 hm = "home-manager";
74 ncg = "nix-collect-garbage";
75 yws = "yarn workspace";
76 ywss = "yarn workspaces";
77 ze = "zellij";
78 };
79
80 plugins = [
81 {
82 name = "fzf.fish";
83 src = pkgs.fetchFromGitHub {
84 owner = "PatrickF1";
85 repo = "fzf.fish";
86 rev = "8920367cf85eee5218cc25a11e209d46e2591e7a";
87 hash = "sha256-T8KYLA/r/gOKvAivKRoeqIwE2pINlxFQtZJHpOy9GMM=";
88 };
89 }
90 {
91 name = "fifc";
92 src = pkgs.fetchFromGitHub {
93 owner = "gazorby";
94 repo = "fifc";
95 rev = "a01650cd432becdc6e36feeff5e8d657bd7ee84a";
96 hash = "sha256-Ynb0Yd5EMoz7tXwqF8NNKqCGbzTZn/CwLsZRQXIAVp4=";
97 };
98 }
99 {
100 name = "lumin";
101 src = pkgs.fetchFromGitHub {
102 owner = "ovyerus";
103 repo = "lumin";
104 rev = "dc0b8f57f5b2a58a289ea6088843bd56f8633aa6";
105 hash = "sha256-wzL6+RnzfSpuJAISQdTZx2XIBDD2bXh1ejwtpgNzUYE=";
106 };
107 }
108 {
109 name = "nix.fish";
110 src = pkgs.fetchFromGitHub {
111 owner = "kidonng";
112 repo = "nix.fish";
113 rev = "ad57d970841ae4a24521b5b1a68121cf385ba71e";
114 hash = "sha256-GMV0GyORJ8Tt2S9wTCo2lkkLtetYv0rc19aA5KJbo48=";
115 };
116 }
117 {
118 name = "autopair.fish";
119 src = pkgs.fetchFromGitHub {
120 owner = "jorgebucaran";
121 repo = "autopair.fish";
122 rev = "4d1752ff5b39819ab58d7337c69220342e9de0e2";
123 hash = "sha256-qt3t1iKRRNuiLWiVoiAYOu+9E7jsyECyIqZJ/oRIT1A=";
124 };
125 }
126 ];
127 };
128}