diff --git a/flake.lock b/flake.lock index 3b6136ded72c615c428ffdb20eb0e3f2809b9eab..2d38f566f70da604f4a5a9d3f7414ba275c5a622 100644 --- a/flake.lock +++ b/flake.lock @@ -14,6 +14,11 @@ "owner": "tadfisher", "repo": "android-nixpkgs", "rev": "7a6a0f7ad4195b792d8c59caf03e877a535ecd4b", + "lastModified": 1767990299, + "narHash": "sha256-Jz+cp9Ln4++1XiKw9KvZEM2dJ9AdOvayk97ybi9g7zc=", + "owner": "tadfisher", + "repo": "android-nixpkgs", + "rev": "449f2cadee7cb7b665aea209a67f8ecf30176653", "type": "github" }, "original": { @@ -465,6 +470,22 @@ } }, "nixpkgs_4": { + "locked": { + "lastModified": 1764242076, + "narHash": "sha256-sKoIWfnijJ0+9e4wRvIgm/HgE27bzwQxcEmo2J/gNpI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2fad6eac6077f03fe109c4d4eb171cf96791faa4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { "locked": { "lastModified": 1762111121, "narHash": "sha256-4vhDuZ7OZaZmKKrnDpxLZZpGIJvAeMtK6FKLJYUtAdw=", @@ -480,7 +501,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1708161998, "narHash": "sha256-6KnemmUorCvlcAvGziFosAVkrlWZGIc6UNT9GUYr0jQ=", @@ -496,7 +517,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1717696253, "narHash": "sha256-1+ua0ggXlYYPLTmMl3YeYYsBXDSCqT+Gw3u6l4gvMhA=", @@ -819,7 +840,7 @@ "inputs": { "flake-compat": "flake-compat_2", "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1770598090, @@ -863,7 +884,7 @@ "flake-utils": "flake-utils_4", "gitignore": "gitignore_2", "langref": "langref", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_7", "zig-overlay": "zig-overlay" }, "locked": { diff --git a/modules/home/default.nix b/modules/home/default.nix index 88d1c66aca0215de23ec9f7d009cae4034edb60f..fc538513d7e2b2bfb7916c71e2a97e1aa8bcc633 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -140,17 +140,19 @@ in jujutsu = { settings = { user = { - email = config.programs.git.userEmail; - name = config.programs.git.userName; + inherit (config.programs.git.settings.user) name email; }; - signing = lib.mkIf (config.programs.git.signing.key != null) { - inherit (config.programs.git.signing) key; - backend = "gpg"; - behavior = "own"; + signing = lib.mkIf (config.programs.git.signing.format != null) { + backend = config.programs.git.signing.format; + key = "~/.ssh/id_ed25519.pub"; + # signatures are slow, compute them on push instead of on change. + behavior = "drop"; }; git = { - sign-on-push = true; - push-new-bookmarks = true; + sign-on-push = config.programs.git.signing.key != null; + }; + remotes.origin = { + auto-track-bookmarks = "glob:*"; }; ui = { default-command = "log"; diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix index 00bdc55f942877eca658ffef86d0c7ec89e8bc04..10be462fb43b8c37da982f4fe3c96ce247a18626 100644 --- a/modules/neovim/default.nix +++ b/modules/neovim/default.nix @@ -82,7 +82,7 @@ servers.nixd.init_options.autoArchive = true; }; treesitter = { - enable = true; + enable = false; addDefaultGrammars = true; }; debugger.nvim-dap = { @@ -91,7 +91,7 @@ }; languages = { enableFormat = true; - enableTreesitter = true; + enableTreesitter = false; enableExtraDiagnostics = true; # enable debug adapter protocol by default enableDAP = true; @@ -109,7 +109,7 @@ zig.enable = true; # sort-lines: off - nix.lsp.servers = "nixd"; + nix.lsp.servers = [ "nixd" ]; }; filetree.neo-tree = { enable = true; diff --git a/users/clover/home.nix b/users/clover/home.nix index 72bcfaec101f041eb4446cb5874a40c9ea3ff74b..7e413bb4c3b2119ee41154823fb239c50d796f50 100644 --- a/users/clover/home.nix +++ b/users/clover/home.nix @@ -1,4 +1,9 @@ -{ pkgs, host, ... }: +{ + config, + pkgs, + host, + ... +}: let hostServer = false; in @@ -16,18 +21,15 @@ in nh autofmt gnupg + nodejs_24 ]; # packages to install for desktop environments (non-server) desktop = [ - lazygit - jjui ]; # packages to install on all servers server = [ ]; # packages to install on macOS desktops - darwin = [ - raycast - ]; + darwin = [ ]; # packages to install on linux desktops linux = [ ]; @@ -59,6 +61,7 @@ in # zsh is the shell i use zsh = { enable = true; + dotDir = "${config.xdg.configHome}/zsh"; shellAliases = { switch = "~/config/switch"; @@ -66,8 +69,7 @@ in jf = "jj git fetch"; e = "jj edit"; d = "jj desc"; - bup = "jj b m --from 'parents(@)' --to '@'"; - push = "jj git push"; + bup = "jj b m --from 'heads(::@- & bookmarks())' --to '@'"; moveself = "jj rebase -r @ -d"; logall = "jj log -r 'all()'"; 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 uv run --project "$dirname" "$@" } - function pr() { - message=$(jj log -r '@' -T 'description' --no-graph) - if [[ -z "$message" ]] || [[ "$message" = "WIP:"* ]]; then - jj desc + function bun() { + if [[ "$1" = "build" ]]; then + command bun run "$@" + elif [[ "$1" = "bundle" ]]; then + shift + command bun build "$@" + else + command bun "$@" fi - if [ -n "$1" ]; then - jj git push --named "clo/$1"=@ - branch="clo/$1" + } + + function jj() { + if [[ "$*" = "git push"* ]] && [[ "$*" != *"--dry-run"* ]]; then + command jj "$@" --dry-run + printf "Press any key to continue... " + read -r + command jj "$@" else - branch="$(jj log -r '@' -T '"clo/push-" ++ change_id.short()' --no-graph)" - jj git push -c @ + command jj "$@" fi - open "$(git remote get-url origin | sed 's/git@github\.com:/https:\/\/github.com\//' | sed 's/\.git$//')/compare/master...$branch" } ''; }; - # use a git-specific email - git.userEmail = "git@paperclover.net"; - git.signing = { - signByDefault = true; - key = "C0D577FD799F9D11"; + git = { + # use a git-specific email + settings.user.email = "git@paperclover.net"; + settings.gpg.ssh.allowedSignersFile = "${pkgs.writeText "allowed_signers" '' + git@paperclover.net ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAVa1aq1LEj/VXHJYlR5HJpK65lS/9jOL/dAB9ZS1chd + ''}"; + # signing + signing = { + signByDefault = true; + key = "~/.ssh/id_ed25519"; + format = "ssh"; + }; }; jujutsu = { @@ -175,137 +191,39 @@ in }; # ui.graph.style = "square"; revsets = { - log = "ancestors(description(regex:\"^(WIP:|\\\\s+$)\"):: | working_copies() | bookmarks(\"master\")::remote_bookmarks(\"master\") | bookmarks(glob:\"clo/*\")::, 5)"; short-prefixes = "(trunk()..@)::"; }; - # templates.log = "hl_wip(self)"; - - template-aliases = { - # log template, highlighting the WIP commits by making everything else faded out - "hl_wip(commit)" = '' - if(commit.root(), format_root_commit(commit), - label("__commit__", - format_short_commit_header(commit) ++ "\n" ++ - format_commit_description(commit) - ) - ) - ''; - - "format_commit_description(commit)" = '' - label("desc", format_commit_firstline(commit.description().first_line())) ++ - "\n" ++ if( - commit.description().starts_with("WIP:") || commit.current_working_copy(), - commit.description().remove_prefix(commit.description().first_line()).remove_prefix("\n").trim_end() ++ "\n ", - if(commit.description().remove_prefix(commit.description().first_line()).trim().len() > 0, - label("muted", lines_collapsed(commit.description().lines().filter(|x| x.trim().len() > 0).len() - 1)), - " " - ) - ) - ''; - "lines_collapsed(count)" = - ''("[" ++ stringify(count ++ " line" ++ if(count == 1, "", "s")) ++ " collapsed]\n")''; - "format_commit_firstline(line)" = '' - if(line.starts_with("WIP:"), - label("cc_wip", " WIP ") ++ " " ++ format_commit_firstline_a_wip(line.remove_prefix("WIP:").trim()), - format_commit_firstline_a_wip(line) - ) - ''; - "format_commit_firstline_a_wip(line)" = '' - if(line.starts_with("feat:") || line.starts_with("feat("), - label("cc_feat", "feat") ++ format_commit_firstline_a_cc_type(line.remove_prefix("feat")), - if(line.starts_with("fix:") || line.starts_with("fix("), - label("cc_fix", "fix") ++ format_commit_firstline_a_cc_type(line.remove_prefix("fix")), - if(line.starts_with("hotfix:") || line.starts_with("hotfix("), - label("cc_hotfix", "hotfix") ++ format_commit_firstline_a_cc_type(line.remove_prefix("hotfix")), - if(line.starts_with("chore:") || line.starts_with("chore("), - label("cc_chore", "chore") ++ format_commit_firstline_a_cc_type(line.remove_prefix("chore")), - if(line.starts_with("test:") || line.starts_with("test("), - label("cc_other", "test") ++ format_commit_firstline_a_cc_type(line.remove_prefix("test")), - if(line.starts_with("refactor:") || line.starts_with("refactor("), - label("cc_other", "refactor") ++ format_commit_firstline_a_cc_type(line.remove_prefix("refactor")), - if(line.starts_with("perf:") || line.starts_with("perf("), - label("cc_other", "perf") ++ format_commit_firstline_a_cc_type(line.remove_prefix("perf")), - if(line.starts_with("lib:") || line.starts_with("lib("), - label("cc_other", "lib") ++ format_commit_firstline_a_cc_type(line.remove_prefix("lib")), - label("cc_header", line) - )))))))) - ''; - "format_commit_firstline_a_cc_type(rest)" = '' - if(rest.starts_with("(") && rest.contains(")"), - format_firstline_cc_scope(rest, index_of_close_paren(rest)), - format_firstline_a_cc(rest)) - ''; - "format_firstline_cc_scope(rest, index)" = '' - label("cc_scope", rest.substr(0, index)) ++ format_firstline_a_cc(rest.substr(index, rest.len())) - ''; - "format_firstline_a_cc(rest)" = '' - if(rest.starts_with(":"), - label("muted", ":") ++ label("cc_header", rest.remove_prefix(":")), - label("cc_header", rest) - ) - ''; - # sorry! - "index_of_close_paren(line)" = '' - stringify(if(line.substr(1, 2) == ")", "A", - if(line.substr(2, 3) == ")", "AA", - if(line.substr(3, 4) == ")", "AAA", - if(line.substr(4, 5) == ")", "AAAA", - if(line.substr(5, 6) == ")", "AAAAA", - if(line.substr(6, 7) == ")", "AAAAAA", - if(line.substr(7, 8) == ")", "AAAAAAA", - if(line.substr(8, 9) == ")", "AAAAAAAA", - if(line.substr(9, 10) == ")","AAAAAAAAA", - if(line.substr(10, 11) == ")", "AAAAAAAAAA", - if(line.substr(11, 12) == ")", "AAAAAAAAAAA", - if(line.substr(12, 13) == ")", "AAAAAAAAAAAA", - if(line.substr(13, 14) == ")", "AAAAAAAAAAAAA", - if(line.substr(14, 15) == ")", "AAAAAAAAAAAAAA", - if(line.substr(15, 16) == ")", "AAAAAAAAAAAAAAA", - if(line.substr(16, 17) == ")", "AAAAAAAAAAAAAAAA", - if(line.substr(17, 18) == ")", "AAAAAAAAAAAAAAAAA", - if(line.substr(18, 19) == ")", "AAAAAAAAAAAAAAAAAA", - if(line.substr(19, 20) == ")", "AAAAAAAAAAAAAAAAAAA", - if(line.substr(20, 21) == ")", "AAAAAAAAAAAAAAAAAAAA", - "AAAAAAAAAAAAAAAAAAAAA" - ))))))))))))))))))))).len() + 1 - ''; - - "format_short_signature(signature)" = "signature.name()"; - "format_timestamp(timestamp)" = "timestamp.ago()"; - "format_short_commit_header(commit)" = '' - separate(" ", - if(commit.current_working_copy(), label("active_marker", " ACTIVE ")), - if(commit.conflict(), label("conflict_marker", " CONFLICT ")), - format_short_change_id_with_hidden_and_divergent_info(commit), - format_short_signature(commit.author()), - label("muted", "|"), - if(commit.description().trim().len() > 0, label("muted", format_timestamp(commit_timestamp(commit)))), - commit.bookmarks(), - commit.tags(), - commit.working_copies(), - label("muted", "(") ++ - format_short_commit_id(commit.commit_id()) ++ - label("muted", ")"), - if(config("ui.show-cryptographic-signatures").as_boolean(), - format_short_cryptographic_signature(commit.signature())), - ) - ''; + aliases = { + "ab" = [ "abandon" ]; + # "ai" = [ + # "util" + # "exec" + # "--" + # "~/jj-ai-sync.sh" + # ]; }; - }; }; ssh = { enable = true; + enableDefaultConfig = false; extraConfig = '' + Include ~/.orbstack/ssh/config* + SetEnv TERM=xterm-256color ''; matchBlocks = rec { + "*" = { }; zenith = { user = "clo"; - port = 222; + port = 22; + }; + "git.paperclover.net" = zenith; + "paperclover.net" = { + user = "clo"; + port = 22; }; - "nas.paperclover.net" = zenith; }; }; }; diff --git a/users/clover/paperback/home.nix b/users/clover/paperback/home.nix index 47d88a2034872f1efc7c06355eef2e3b004436b3..6686bc71ada574880cc557bb0207d2d8cef33c11 100644 --- a/users/clover/paperback/home.nix +++ b/users/clover/paperback/home.nix @@ -12,7 +12,6 @@ }; home.packages = with pkgs; [ deno - nodejs_22 rustup typescript pm2 diff --git a/users/clover/work/home.nix b/users/clover/work/home.nix index 3dcb3ea9c5e53de6b451d59bbcbb3d78a1cff0cf..a6687ddcafbae66923c46d6cd449de1514f6eccc 100644 --- a/users/clover/work/home.nix +++ b/users/clover/work/home.nix @@ -8,6 +8,7 @@ } ''; }; + programs.git.signing.key = "CE485807AE4068AF8508C8DC5CBB21841C7920AD"; home.packages = with pkgs; [ (bun.overrideAttrs (_: rec { version = "1.3.0"; @@ -18,7 +19,6 @@ })) doppler deno - nodejs_24 rustup typescript ssm-session-manager-plugin