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 theme = "noctalia";
60 theme_dir = "${config.xdg.configHome}/zellij/themes";
61 ui = {
62 pane_frames.hide_session_name = true;
63 };
64 };
65 };
66
67 # Ensure the theme directory exists before noctalia writes its generated theme.
68 xdg.configFile."zellij/themes/.keep".text = "";
69
70 xdg.configFile."zellij/plugins/zrpc.wasm".source = "${zrpc-wasm pkgs}/zrpc.wasm";
71 xdg.configFile."zellij/plugins/harpoon.wasm".source = "${harpoon-wasm pkgs}/harpoon.wasm";
72
73 xdg.configFile."zellij/layouts/split.kdl".text = ''
74 layout {
75 tab {
76 pane size="50%"
77 pane split_direction="vertical" size="50%" {
78 pane
79 pane
80 }
81 }
82 }
83 '';
84
85 programs.zoxide = {
86 enable = true;
87 enableFishIntegration = true;
88 };
89
90 programs.fish = {
91 enable = true;
92 shellAliases = {
93 agenix = "agenix -i ~/.config/agenix/yubikey-identity.txt";
94 };
95 interactiveShellInit = ''
96 set fish_greeting
97 # Prefer forwarded agents inside SSH sessions. Otherwise use the
98 # local 1Password GUI agent when available.
99 if set -q SSH_CONNECTION; or set -q SSH_CLIENT
100 set forwarded_sock (tr '\0' '\n' < /proc/$PPID/environ 2>/dev/null | sed -n 's/^SSH_AUTH_SOCK=//p' | head -n1)
101 if test -n "$forwarded_sock"; and test -S "$forwarded_sock"
102 set -gx SSH_AUTH_SOCK "$forwarded_sock"
103 end
104 else if test -S ${config.home.homeDirectory}/.1password/agent.sock
105 set -gx SSH_AUTH_SOCK ${config.home.homeDirectory}/.1password/agent.sock
106 end
107 # Load 1Password CLI plugins, but keep AWS CLI using agenix-managed
108 # credentials via AWS_SHARED_CREDENTIALS_FILE rather than the 1Password plugin.
109 if test -f ~/.config/op/plugins.sh
110 source ~/.config/op/plugins.sh
111 functions -e aws 2>/dev/null || true
112 end
113 # Auto-launch zellij if not already inside a session
114 # Use systemd-run to escape niri's session scope so the server
115 # survives logout
116 if not set -q ZELLIJ
117 systemd-run --user --scope zellij
118 else
119 fastfetch --logo small
120 end
121
122 function y
123 set tmp (mktemp -t "yazi-cwd.XXXXXX")
124 yazi $argv --cwd-file="$tmp"
125 if read -z cwd < "$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
126 builtin cd -- "$cwd"
127 end
128 rm -f -- "$tmp"
129 end
130 '';
131 functions = {
132 s3edit = ''
133 set file (basename $argv[1])
134 set tmpfile /tmp/$file
135 aws s3 cp $argv[1] $tmpfile
136 and $EDITOR $tmpfile
137 and aws s3 cp $tmpfile $argv[1]
138 '';
139 };
140 };
141
142 programs.starship = {
143 enable = true;
144 enableFishIntegration = true;
145 configPath = "${config.xdg.configHome}/starship/noctalia.toml";
146 };
147
148 xdg.configFile."alacritty/alacritty.toml".force = true;
149
150 programs.alacritty = {
151 enable = true;
152 settings = {
153 general.import = [ "~/.config/alacritty/themes/noctalia.toml" ];
154 terminal.shell.program = "fish";
155 window = {
156 decorations = "none";
157 opacity = 0.9;
158 };
159 font = {
160 normal = {
161 family = "BerkeleyMono Nerd Font";
162 style = "Regular";
163 };
164 size = 12.0;
165 };
166 };
167 };
168 };
169}