1# This contains default configurations for set of programs
2# and configuration, but does not enable many things on it's own.
3{
4 pkgs,
5 lib,
6 config,
7 user,
8 host,
9 mainHomeImports,
10 ...
11}:
12let
13 cfg = config.programs;
14in
15{
16 imports = mainHomeImports ++ [
17 ./macos/sketchybar.nix
18 ];
19 options = {
20 programs.ghostty.shader = lib.mkOption {
21 type = lib.types.str;
22 default = "";
23 description = "set the ghostty shader, relative to 'files/ghostty'";
24 };
25 programs.android-sdk.enable = lib.mkOption {
26 type = lib.types.bool;
27 default = false;
28 description = "enable android sdk stuff";
29 };
30 };
31 config = {
32 android-sdk = {
33 enable = config.programs.android-sdk.enable;
34 packages =
35 sdk:
36 with sdk;
37 [
38 build-tools-36-0-0
39 cmdline-tools-latest
40 emulator
41 platform-tools
42 platforms-android-36
43 sources-android-36
44 ndk-27-1-12297006
45 cmake-3-22-1
46 ]
47 ++ lib.optionals host.darwin [
48 system-images-android-35-google-apis-arm64-v8a
49 system-images-android-35-google-apis-playstore-arm64-v8a
50 ]
51 ++ lib.optionals host.linux [
52 system-images-android-36-google-apis-x86-64
53 system-images-android-36-google-apis-playstore-x86-64
54 ];
55 };
56 xdg = {
57 enable = true;
58 };
59 home.shell = {
60 enableShellIntegration = true;
61 };
62 home.sessionPath = [
63 "$HOME/.local/bin"
64 "$HOME/.opencode/bin"
65 "$HOME/.vite-plus/bin"
66 "$HOME/bin"
67 ];
68 programs = {
69 home-manager.enable = true;
70 nix-index.enable = true;
71
72 direnv = {
73 nix-direnv.enable = config.programs.direnv.enable;
74 };
75
76 git = {
77 enable = true;
78 settings.user = {
79 name = lib.mkDefault user.name;
80 email = lib.mkDefault user.email;
81 };
82 ignores = [
83 (lib.mkIf host.darwin ".DS_Store") # When using Finder
84 (lib.mkIf host.darwin "._*") # When using non-APFS drives
85 # ViM and Neovim
86 ".*.swp"
87 ".nvimlog"
88 ".jj"
89 ];
90 };
91
92 atuin = {
93 daemon.enable = cfg.atuin.enable;
94 };
95
96 bat = {
97 extraPackages = with pkgs.bat-extras; [
98 batdiff
99 batman
100 # batgrep
101 batwatch
102 batpipe
103 prettybat
104 ];
105 };
106 hyfetch = {
107 settings = {
108 backend = "fastfetch";
109 preset = user.sexuality;
110 mode = "rgb";
111 light_dark = "dark";
112 lightness = {
113 };
114 color_align = {
115 mode = "horizontal";
116 };
117 };
118 };
119 fastfetch.enable = cfg.hyfetch.enable;
120
121 fish = {
122 plugins = [
123 {
124 name = "tide";
125 inherit (pkgs.fishPlugins.tide) src;
126 }
127 {
128 name = "!!";
129 inherit (pkgs.fishPlugins.bang-bang) src;
130 }
131 ];
132 shellInit = ''
133 if type -q batman
134 batman --export-env | source
135 end
136 test -r "$HOME"'/.opam/opam-init/init.fish' && source "$HOME"'/.opam/opam-init/init.fish' > /dev/null 2> /dev/null; or true
137 '';
138 };
139 zsh = {
140 enableCompletion = true;
141 autosuggestion.enable = true;
142 syntaxHighlighting.enable = true;
143 autocd = true;
144 history.size = 10000;
145 };
146 jujutsu = {
147 settings = {
148 user = {
149 inherit (config.programs.git.settings.user) name email;
150 };
151 signing = lib.mkIf (config.programs.git.signing.format != null) {
152 backend = config.programs.git.signing.format;
153 key = "~/.ssh/id_ed25519.pub";
154 # signatures are slow, compute them on push instead of on change.
155 behavior = "drop";
156 };
157 git = {
158 colocate = false;
159 sign-on-push = config.programs.git.signing.key != null;
160 };
161 remotes.origin = {
162 auto-track-bookmarks = "glob:*";
163 };
164 ui = {
165 default-command = "log";
166 diff-formatter = [
167 "${pkgs.difftastic}/bin/difft"
168 "--color=always"
169 "$left"
170 "$right"
171 ];
172 pager = "${pkgs.bat}/bin/bat --style=plain";
173 };
174 };
175 };
176
177 ghostty.settings.custom-shader = lib.mkIf (
178 cfg.ghostty.shader != null
179 ) "${../../files/ghostty}/${cfg.ghostty.shader}";
180 };
181 };
182}