me like nix
1{ inputs, ... }:
2
3let
4 zjctl = pkgs: import ../packages/zjctl.nix { inherit pkgs; };
5 zrpc-wasm = pkgs: import ../packages/zrpc-wasm.nix { inherit pkgs; };
6 harpoon-wasm = pkgs: import ../packages/harpoon-wasm.nix { inherit pkgs; };
7in
8{
9 flake.modules.homeManager.shell =
10 { pkgs, config, ... }:
11 {
12 home.packages = with pkgs; [
13 yazi
14 fd
15 ripgrep
16 rsync
17 zoxide
18 (zjctl pkgs)
19 ];
20
21 programs.direnv.enable = true;
22
23 programs.atuin = {
24 enable = true;
25 enableFishIntegration = true;
26 daemon.enable = true;
27 settings = {
28 filter_mode_shell_up_key_binding = "session";
29 };
30 };
31
32 programs.zellij = {
33 enable = true;
34 settings = {
35 keybinds = {
36 unbind = [
37 "Ctrl q"
38 "Ctrl o"
39 ];
40 normal = {
41 "bind \"Ctrl m\"" = {
42 SwitchToMode = "Session";
43 };
44 };
45 "shared_except \"locked\"" = {
46 "bind \"Ctrl y\"" = {
47 "LaunchOrFocusPlugin \"file:~/.config/zellij/plugins/harpoon.wasm\"" = {
48 floating = true;
49 move_to_focused_tab = true;
50 };
51 };
52 };
53 };
54 load_plugins = {
55 "\"file:~/.config/zellij/plugins/zrpc.wasm\"" = { };
56 };
57 pane_frames = false;
58 show_startup_tips = false;
59 ui = {
60 pane_frames.hide_session_name = true;
61 };
62 };
63 };
64
65 xdg.configFile."zellij/plugins/zrpc.wasm".source = "${zrpc-wasm pkgs}/zrpc.wasm";
66 xdg.configFile."zellij/plugins/harpoon.wasm".source = "${harpoon-wasm pkgs}/harpoon.wasm";
67
68 xdg.configFile."zellij/layouts/split.kdl".text = ''
69 layout {
70 tab {
71 pane size="50%"
72 pane split_direction="vertical" size="50%" {
73 pane
74 pane
75 }
76 }
77 }
78 '';
79
80 programs.zoxide = {
81 enable = true;
82 enableFishIntegration = true;
83 };
84
85 programs.fish = {
86 enable = true;
87 shellAliases = {
88 agenix = "agenix -i ~/.config/agenix/yubikey-identity.txt";
89 };
90 interactiveShellInit = ''
91 set fish_greeting
92 # Prefer forwarded agents inside SSH sessions. Otherwise use the
93 # local 1Password GUI agent when available.
94 if set -q SSH_CONNECTION; or set -q SSH_CLIENT
95 set forwarded_sock (tr '\0' '\n' < /proc/$PPID/environ 2>/dev/null | sed -n 's/^SSH_AUTH_SOCK=//p' | head -n1)
96 if test -n "$forwarded_sock"; and test -S "$forwarded_sock"
97 set -gx SSH_AUTH_SOCK "$forwarded_sock"
98 end
99 else if test -S ${config.home.homeDirectory}/.1password/agent.sock
100 set -gx SSH_AUTH_SOCK ${config.home.homeDirectory}/.1password/agent.sock
101 end
102 # Load 1Password CLI plugins
103 if test -f ~/.config/op/plugins.sh
104 source ~/.config/op/plugins.sh
105 end
106 # Auto-launch zellij if not already inside a session
107 # Use systemd-run to escape niri's session scope so the server
108 # survives logout
109 if not set -q ZELLIJ
110 systemd-run --user --scope zellij
111 else
112 fastfetch --logo small
113 end
114
115 function y
116 set tmp (mktemp -t "yazi-cwd.XXXXXX")
117 yazi $argv --cwd-file="$tmp"
118 if read -z cwd < "$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
119 builtin cd -- "$cwd"
120 end
121 rm -f -- "$tmp"
122 end
123 '';
124 functions = {
125 s3edit = ''
126 set file (basename $argv[1])
127 set tmpfile /tmp/$file
128 aws s3 cp $argv[1] $tmpfile
129 and $EDITOR $tmpfile
130 and aws s3 cp $tmpfile $argv[1]
131 '';
132 };
133 };
134
135 programs.starship = {
136 enable = true;
137 enableFishIntegration = true;
138 };
139
140 programs.alacritty = {
141 enable = true;
142 settings = {
143 terminal.shell.program = "fish";
144 window = {
145 decorations = "none";
146 opacity = 0.9;
147 };
148 font = {
149 normal = {
150 family = "BerkeleyMono Nerd Font";
151 style = "Regular";
152 };
153 size = 12.0;
154 };
155 };
156 };
157 };
158}