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