| ... | @@ -1,4 +1,9 @@ | ... | @@ -1,4 +1,9 @@ |
| 1 | { pkgs, host, ... }: | 1 | { |
| | 2 | config, |
| | 3 | pkgs, |
| | 4 | host, |
| | 5 | ... |
| | 6 | }: |
| 2 | let | 7 | let |
| 3 | hostServer = false; | 8 | hostServer = false; |
| 4 | in | 9 | in |
| ... | @@ -16,18 +21,15 @@ in | ... | @@ -16,18 +21,15 @@ in |
| 16 | nh | 21 | nh |
| 17 | autofmt | 22 | autofmt |
| 18 | gnupg | 23 | gnupg |
| | 24 | nodejs_24 |
| 19 | ]; | 25 | ]; |
| 20 | # packages to install for desktop environments (non-server) | 26 | # packages to install for desktop environments (non-server) |
| 21 | desktop = [ | 27 | desktop = [ |
| 22 | lazygit | | |
| 23 | jjui | | |
| 24 | ]; | 28 | ]; |
| 25 | # packages to install on all servers | 29 | # packages to install on all servers |
| 26 | server = [ ]; | 30 | server = [ ]; |
| 27 | # packages to install on macOS desktops | 31 | # packages to install on macOS desktops |
| 28 | darwin = [ | 32 | darwin = [ ]; |
| 29 | raycast | | |
| 30 | ]; | | |
| 31 | # packages to install on linux desktops | 33 | # packages to install on linux desktops |
| 32 | linux = [ | 34 | linux = [ |
| 33 | ]; | 35 | ]; |
| ... | @@ -59,6 +61,7 @@ in | ... | @@ -59,6 +61,7 @@ in |
| 59 | # zsh is the shell i use | 61 | # zsh is the shell i use |
| 60 | zsh = { | 62 | zsh = { |
| 61 | enable = true; | 63 | enable = true; |
| | 64 | dotDir = "${config.xdg.configHome}/zsh"; |
| 62 | shellAliases = { | 65 | shellAliases = { |
| 63 | switch = "~/config/switch"; | 66 | switch = "~/config/switch"; |
| 64 | | 67 | |
| ... | @@ -66,8 +69,7 @@ in | ... | @@ -66,8 +69,7 @@ in |
| 66 | jf = "jj git fetch"; | 69 | jf = "jj git fetch"; |
| 67 | e = "jj edit"; | 70 | e = "jj edit"; |
| 68 | d = "jj desc"; | 71 | d = "jj desc"; |
| 69 | bup = "jj b m --from 'parents(@)' --to '@'"; | 72 | bup = "jj b m --from 'heads(::@- & bookmarks())' --to '@'"; |
| 70 | push = "jj git push"; | | |
| 71 | moveself = "jj rebase -r @ -d"; | 73 | moveself = "jj rebase -r @ -d"; |
| 72 | logall = "jj log -r 'all()'"; | 74 | logall = "jj log -r 'all()'"; |
| 73 | cherry = "jj git fetch && jj split -i -p -m 'SPLIT_CHANGES' && jj edit -r 'description(\"SPLIT_CHANGES\")' && jj desc -m '' --edit"; | 75 | cherry = "jj git fetch && jj split -i -p -m 'SPLIT_CHANGES' && jj edit -r 'description(\"SPLIT_CHANGES\")' && jj desc -m '' --edit"; |
| ... | @@ -83,28 +85,42 @@ in | ... | @@ -83,28 +85,42 @@ in |
| 83 | uv run --project "$dirname" "$@" | 85 | uv run --project "$dirname" "$@" |
| 84 | } | 86 | } |
| 85 | | 87 | |
| 86 | function pr() { | 88 | function bun() { |
| 87 | message=$(jj log -r '@' -T 'description' --no-graph) | 89 | if [[ "$1" = "build" ]]; then |
| 88 | if [[ -z "$message" ]] || [[ "$message" = "WIP:"* ]]; then | 90 | command bun run "$@" |
| 89 | jj desc | 91 | elif [[ "$1" = "bundle" ]]; then |
| | 92 | shift |
| | 93 | command bun build "$@" |
| | 94 | else |
| | 95 | command bun "$@" |
| 90 | fi | 96 | fi |
| 91 | if [ -n "$1" ]; then | 97 | } |
| 92 | jj git push --named "clo/$1"=@ | 98 | |
| 93 | branch="clo/$1" | 99 | function jj() { |
| | 100 | if [[ "$*" = "git push"* ]] && [[ "$*" != *"--dry-run"* ]]; then |
| | 101 | command jj "$@" --dry-run |
| | 102 | printf "Press any key to continue... " |
| | 103 | read -r |
| | 104 | command jj "$@" |
| 94 | else | 105 | else |
| 95 | branch="$(jj log -r '@' -T '"clo/push-" ++ change_id.short()' --no-graph)" | 106 | command jj "$@" |
| 96 | jj git push -c @ | | |
| 97 | fi | 107 | fi |
| 98 | open "$(git remote get-url origin | sed 's/git@github\.com:/https:\/\/github.com\//' | sed 's/\.git$//')/compare/master...$branch" | | |
| 99 | } | 108 | } |
| 100 | ''; | 109 | ''; |
| 101 | }; | 110 | }; |
| 102 | | 111 | |
| 103 | # use a git-specific email | 112 | git = { |
| 104 | git.userEmail = "git@paperclover.net"; | 113 | # use a git-specific email |
| 105 | git.signing = { | 114 | settings.user.email = "git@paperclover.net"; |
| 106 | signByDefault = true; | 115 | settings.gpg.ssh.allowedSignersFile = "${pkgs.writeText "allowed_signers" '' |
| 107 | key = "C0D577FD799F9D11"; | 116 | git@paperclover.net ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAVa1aq1LEj/VXHJYlR5HJpK65lS/9jOL/dAB9ZS1chd |
| | 117 | ''}"; |
| | 118 | # signing |
| | 119 | signing = { |
| | 120 | signByDefault = true; |
| | 121 | key = "~/.ssh/id_ed25519"; |
| | 122 | format = "ssh"; |
| | 123 | }; |
| 108 | }; | 124 | }; |
| 109 | | 125 | |
| 110 | jujutsu = { | 126 | jujutsu = { |
| ... | @@ -175,137 +191,39 @@ in | ... | @@ -175,137 +191,39 @@ in |
| 175 | }; | 191 | }; |
| 176 | # ui.graph.style = "square"; | 192 | # ui.graph.style = "square"; |
| 177 | revsets = { | 193 | revsets = { |
| 178 | log = "ancestors(description(regex:\"^(WIP:|\\\\s+$)\"):: | working_copies() | bookmarks(\"master\")::remote_bookmarks(\"master\") | bookmarks(glob:\"clo/*\")::, 5)"; | | |
| 179 | short-prefixes = "(trunk()..@)::"; | 194 | short-prefixes = "(trunk()..@)::"; |
| 180 | }; | 195 | }; |
| 181 | # templates.log = "hl_wip(self)"; | 196 | aliases = { |
| 182 | | 197 | "ab" = [ "abandon" ]; |
| 183 | template-aliases = { | 198 | # "ai" = [ |
| 184 | # log template, highlighting the WIP commits by making everything else faded out | 199 | # "util" |
| 185 | "hl_wip(commit)" = '' | 200 | # "exec" |
| 186 | if(commit.root(), format_root_commit(commit), | 201 | # "--" |
| 187 | label("__commit__", | 202 | # "~/jj-ai-sync.sh" |
| 188 | format_short_commit_header(commit) ++ "\n" ++ | 203 | # ]; |
| 189 | format_commit_description(commit) | | |
| 190 | ) | | |
| 191 | ) | | |
| 192 | ''; | | |
| 193 | | | |
| 194 | "format_commit_description(commit)" = '' | | |
| 195 | label("desc", format_commit_firstline(commit.description().first_line())) ++ | | |
| 196 | "\n" ++ if( | | |
| 197 | commit.description().starts_with("WIP:") || commit.current_working_copy(), | | |
| 198 | commit.description().remove_prefix(commit.description().first_line()).remove_prefix("\n").trim_end() ++ "\n ", | | |
| 199 | if(commit.description().remove_prefix(commit.description().first_line()).trim().len() > 0, | | |
| 200 | label("muted", lines_collapsed(commit.description().lines().filter(|x| x.trim().len() > 0).len() - 1)), | | |
| 201 | " " | | |
| 202 | ) | | |
| 203 | ) | | |
| 204 | ''; | | |
| 205 | "lines_collapsed(count)" = | | |
| 206 | ''("[" ++ stringify(count ++ " line" ++ if(count == 1, "", "s")) ++ " collapsed]\n")''; | | |
| 207 | "format_commit_firstline(line)" = '' | | |
| 208 | if(line.starts_with("WIP:"), | | |
| 209 | label("cc_wip", " WIP ") ++ " " ++ format_commit_firstline_a_wip(line.remove_prefix("WIP:").trim()), | | |
| 210 | format_commit_firstline_a_wip(line) | | |
| 211 | ) | | |
| 212 | ''; | | |
| 213 | "format_commit_firstline_a_wip(line)" = '' | | |
| 214 | if(line.starts_with("feat:") || line.starts_with("feat("), | | |
| 215 | label("cc_feat", "feat") ++ format_commit_firstline_a_cc_type(line.remove_prefix("feat")), | | |
| 216 | if(line.starts_with("fix:") || line.starts_with("fix("), | | |
| 217 | label("cc_fix", "fix") ++ format_commit_firstline_a_cc_type(line.remove_prefix("fix")), | | |
| 218 | if(line.starts_with("hotfix:") || line.starts_with("hotfix("), | | |
| 219 | label("cc_hotfix", "hotfix") ++ format_commit_firstline_a_cc_type(line.remove_prefix("hotfix")), | | |
| 220 | if(line.starts_with("chore:") || line.starts_with("chore("), | | |
| 221 | label("cc_chore", "chore") ++ format_commit_firstline_a_cc_type(line.remove_prefix("chore")), | | |
| 222 | if(line.starts_with("test:") || line.starts_with("test("), | | |
| 223 | label("cc_other", "test") ++ format_commit_firstline_a_cc_type(line.remove_prefix("test")), | | |
| 224 | if(line.starts_with("refactor:") || line.starts_with("refactor("), | | |
| 225 | label("cc_other", "refactor") ++ format_commit_firstline_a_cc_type(line.remove_prefix("refactor")), | | |
| 226 | if(line.starts_with("perf:") || line.starts_with("perf("), | | |
| 227 | label("cc_other", "perf") ++ format_commit_firstline_a_cc_type(line.remove_prefix("perf")), | | |
| 228 | if(line.starts_with("lib:") || line.starts_with("lib("), | | |
| 229 | label("cc_other", "lib") ++ format_commit_firstline_a_cc_type(line.remove_prefix("lib")), | | |
| 230 | label("cc_header", line) | | |
| 231 | )))))))) | | |
| 232 | ''; | | |
| 233 | "format_commit_firstline_a_cc_type(rest)" = '' | | |
| 234 | if(rest.starts_with("(") && rest.contains(")"), | | |
| 235 | format_firstline_cc_scope(rest, index_of_close_paren(rest)), | | |
| 236 | format_firstline_a_cc(rest)) | | |
| 237 | ''; | | |
| 238 | "format_firstline_cc_scope(rest, index)" = '' | | |
| 239 | label("cc_scope", rest.substr(0, index)) ++ format_firstline_a_cc(rest.substr(index, rest.len())) | | |
| 240 | ''; | | |
| 241 | "format_firstline_a_cc(rest)" = '' | | |
| 242 | if(rest.starts_with(":"), | | |
| 243 | label("muted", ":") ++ label("cc_header", rest.remove_prefix(":")), | | |
| 244 | label("cc_header", rest) | | |
| 245 | ) | | |
| 246 | ''; | | |
| 247 | # sorry! | | |
| 248 | "index_of_close_paren(line)" = '' | | |
| 249 | stringify(if(line.substr(1, 2) == ")", "A", | | |
| 250 | if(line.substr(2, 3) == ")", "AA", | | |
| 251 | if(line.substr(3, 4) == ")", "AAA", | | |
| 252 | if(line.substr(4, 5) == ")", "AAAA", | | |
| 253 | if(line.substr(5, 6) == ")", "AAAAA", | | |
| 254 | if(line.substr(6, 7) == ")", "AAAAAA", | | |
| 255 | if(line.substr(7, 8) == ")", "AAAAAAA", | | |
| 256 | if(line.substr(8, 9) == ")", "AAAAAAAA", | | |
| 257 | if(line.substr(9, 10) == ")","AAAAAAAAA", | | |
| 258 | if(line.substr(10, 11) == ")", "AAAAAAAAAA", | | |
| 259 | if(line.substr(11, 12) == ")", "AAAAAAAAAAA", | | |
| 260 | if(line.substr(12, 13) == ")", "AAAAAAAAAAAA", | | |
| 261 | if(line.substr(13, 14) == ")", "AAAAAAAAAAAAA", | | |
| 262 | if(line.substr(14, 15) == ")", "AAAAAAAAAAAAAA", | | |
| 263 | if(line.substr(15, 16) == ")", "AAAAAAAAAAAAAAA", | | |
| 264 | if(line.substr(16, 17) == ")", "AAAAAAAAAAAAAAAA", | | |
| 265 | if(line.substr(17, 18) == ")", "AAAAAAAAAAAAAAAAA", | | |
| 266 | if(line.substr(18, 19) == ")", "AAAAAAAAAAAAAAAAAA", | | |
| 267 | if(line.substr(19, 20) == ")", "AAAAAAAAAAAAAAAAAAA", | | |
| 268 | if(line.substr(20, 21) == ")", "AAAAAAAAAAAAAAAAAAAA", | | |
| 269 | "AAAAAAAAAAAAAAAAAAAAA" | | |
| 270 | ))))))))))))))))))))).len() + 1 | | |
| 271 | ''; | | |
| 272 | | | |
| 273 | "format_short_signature(signature)" = "signature.name()"; | | |
| 274 | "format_timestamp(timestamp)" = "timestamp.ago()"; | | |
| 275 | "format_short_commit_header(commit)" = '' | | |
| 276 | separate(" ", | | |
| 277 | if(commit.current_working_copy(), label("active_marker", " ACTIVE ")), | | |
| 278 | if(commit.conflict(), label("conflict_marker", " CONFLICT ")), | | |
| 279 | format_short_change_id_with_hidden_and_divergent_info(commit), | | |
| 280 | format_short_signature(commit.author()), | | |
| 281 | label("muted", "|"), | | |
| 282 | if(commit.description().trim().len() > 0, label("muted", format_timestamp(commit_timestamp(commit)))), | | |
| 283 | commit.bookmarks(), | | |
| 284 | commit.tags(), | | |
| 285 | commit.working_copies(), | | |
| 286 | label("muted", "(") ++ | | |
| 287 | format_short_commit_id(commit.commit_id()) ++ | | |
| 288 | label("muted", ")"), | | |
| 289 | if(config("ui.show-cryptographic-signatures").as_boolean(), | | |
| 290 | format_short_cryptographic_signature(commit.signature())), | | |
| 291 | ) | | |
| 292 | ''; | | |
| 293 | }; | 204 | }; |
| 294 | | | |
| 295 | }; | 205 | }; |
| 296 | }; | 206 | }; |
| 297 | | 207 | |
| 298 | ssh = { | 208 | ssh = { |
| 299 | enable = true; | 209 | enable = true; |
| | 210 | enableDefaultConfig = false; |
| 300 | extraConfig = '' | 211 | extraConfig = '' |
| | 212 | Include ~/.orbstack/ssh/config* |
| | 213 | |
| 301 | SetEnv TERM=xterm-256color | 214 | SetEnv TERM=xterm-256color |
| 302 | ''; | 215 | ''; |
| 303 | matchBlocks = rec { | 216 | matchBlocks = rec { |
| | 217 | "*" = { }; |
| 304 | zenith = { | 218 | zenith = { |
| 305 | user = "clo"; | 219 | user = "clo"; |
| 306 | port = 222; | 220 | port = 22; |
| | 221 | }; |
| | 222 | "git.paperclover.net" = zenith; |
| | 223 | "paperclover.net" = { |
| | 224 | user = "clo"; |
| | 225 | port = 22; |
| 307 | }; | 226 | }; |
| 308 | "nas.paperclover.net" = zenith; | | |
| 309 | }; | 227 | }; |
| 310 | }; | 228 | }; |
| 311 | }; | 229 | }; |