From 9f3f01a65b750cb89ac608979f42b4e38367c815 Mon Sep 17 00:00:00 2001 From: binmohm Date: Tue, 9 Jun 2026 15:27:59 +0800 Subject: [PATCH 01/11] feat(profile-development): add git-bug to home.packages --- nix/profiles/development.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/profiles/development.nix b/nix/profiles/development.nix index f217cde9..4e0e1303 100644 --- a/nix/profiles/development.nix +++ b/nix/profiles/development.nix @@ -33,6 +33,7 @@ in { pkgs, ... }: { home.packages = with pkgs; [ + git-bug ddgr gh ripgrep From 90d10fc9c0594eb4479292db7315656e51c0997c Mon Sep 17 00:00:00 2001 From: binmohm Date: Tue, 9 Jun 2026 15:55:50 +0800 Subject: [PATCH 02/11] feat(ssh-config): add ssh key to ssh-agent on login --- nix/modules/ssh-config.nix | 40 +++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/nix/modules/ssh-config.nix b/nix/modules/ssh-config.nix index 7c47cd36..0bfaa0a8 100644 --- a/nix/modules/ssh-config.nix +++ b/nix/modules/ssh-config.nix @@ -18,8 +18,26 @@ in enable = true; extraConfig = renderSettings settings; }; + home-manager.sharedModules = [ + ( + { config, ... }: + { + launchd.agents.ssh-add = { + enable = true; + config = { + ProgramArguments = [ + "/bin/sh" + "-c" + "ssh-add ${config.home.homeDirectory}/.ssh/id_ed25519" + ]; + RunAtLoad = true; + KeepAlive = false; + }; + }; + } + ) + ]; }; - config.flake.modules.nixos.ssh-config = { primaryUser, ... }: { @@ -28,5 +46,25 @@ in inherit settings; }; users.users.root.openssh.authorizedKeys.keys = primaryUser.sshAuthorizedKeys; + home-manager.sharedModules = [ + ( + { pkgs, config, ... }: + { + systemd.user.services.ssh-add = { + Unit = { + Description = "Add SSH key to agent on login"; + After = [ "ssh-agent.service" ]; + }; + Service = { + Type = "oneshot"; + ExecStart = "${pkgs.openssh}/bin/ssh-add ${config.home.homeDirectory}/.ssh/id_ed25519"; + RemainAfterExit = true; + }; + Install.WantedBy = [ "default.target" ]; + }; + } + ) + ]; }; + } From 7f77260437aeb465fec3ba45fccf142b1e2326cc Mon Sep 17 00:00:00 2001 From: binmohm Date: Tue, 9 Jun 2026 16:04:16 +0800 Subject: [PATCH 03/11] feat(profile-development): add git-bug tui alias --- nix/profiles/development.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/profiles/development.nix b/nix/profiles/development.nix index 4e0e1303..d4ddc90f 100644 --- a/nix/profiles/development.nix +++ b/nix/profiles/development.nix @@ -40,6 +40,7 @@ in ]; home.shellAliases = { cd = "echo \"Please use z\""; + gb = "git-bug termui"; gc = "git commit"; gcam = "git commit -am"; gcamend = "git commit -a --amend --no-edit"; From 70b54d51f71c5681f5f37691cc72228798ad3a80 Mon Sep 17 00:00:00 2001 From: binmohm Date: Tue, 9 Jun 2026 17:01:57 +0800 Subject: [PATCH 04/11] feat(starship): add git-bug status to prompt --- nix/profiles/development.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nix/profiles/development.nix b/nix/profiles/development.nix index d4ddc90f..8e3c8d84 100644 --- a/nix/profiles/development.nix +++ b/nix/profiles/development.nix @@ -69,7 +69,7 @@ in settings = { add_newline = false; format = lib.strings.concatStrings [ - "$hostname$directory$git_branch$git_status$git_state" + "$hostname$directory$git_branch$git_status$git_state\${custom.git-bug}" "$fill" "$nix_shell" "$time" @@ -90,6 +90,17 @@ in shlvl.disabled = false; username.disabled = true; fill.symbol = " "; + custom.git-bug = { + when = '' + git for-each-ref --count=1 refs/bugs/ > /dev/null 2>&1 || exit 1 + l=$(git for-each-ref refs/bugs/ --format="%(objectname) %(refname:lstrip=2)" 2>/dev/null | sort) + r=$(git for-each-ref refs/remotes/origin/bugs/ --format="%(objectname) %(refname:lstrip=4)" 2>/dev/null | sort) + [ "$l" != "$r" ] + ''; + command = "true"; + format = "[ 🐛]($style)"; + shell = [ "${lib.getExe pkgs.bash}" ]; + }; }; }; zoxide.enable = true; From 147d0a02519acfc20c4d6a24e2227be1b3d74633 Mon Sep 17 00:00:00 2001 From: binmohm Date: Tue, 9 Jun 2026 17:04:11 +0800 Subject: [PATCH 05/11] enhancement(profile-dev): add git-bug push to gu alias --- nix/profiles/development.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/profiles/development.nix b/nix/profiles/development.nix index 8e3c8d84..37a59249 100644 --- a/nix/profiles/development.nix +++ b/nix/profiles/development.nix @@ -52,7 +52,7 @@ in gds = "git diff --staged"; grc = "git rebase --continue"; gs = "git status"; - gu = "git push"; + gu = "git push && git-bug push"; v = "$EDITOR"; e = "fish -c 'set -e var; set var (sk); test -n \"$var\"; and $EDITOR $var'"; }; From f4e32c28e9fada2ebc365a858fc58babd556cccd Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Wed, 10 Jun 2026 18:36:25 +0800 Subject: [PATCH 06/11] fix(ssh-config): start the ssh agent for nixos --- nix/modules/ssh-config.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/modules/ssh-config.nix b/nix/modules/ssh-config.nix index 0bfaa0a8..87fc202a 100644 --- a/nix/modules/ssh-config.nix +++ b/nix/modules/ssh-config.nix @@ -46,6 +46,7 @@ in inherit settings; }; users.users.root.openssh.authorizedKeys.keys = primaryUser.sshAuthorizedKeys; + programs.ssh.startAgent = true; home-manager.sharedModules = [ ( { pkgs, config, ... }: From 2a824ec5fd3e5c95dca73285eca09e617c57b0f9 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Wed, 10 Jun 2026 18:53:37 +0800 Subject: [PATCH 07/11] ssh-config: move ssh-agent configuration to development profile --- nix/modules/ssh-config.nix | 41 +--------------------------------- nix/profiles/development.nix | 43 ++++++++++++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/nix/modules/ssh-config.nix b/nix/modules/ssh-config.nix index 87fc202a..7c47cd36 100644 --- a/nix/modules/ssh-config.nix +++ b/nix/modules/ssh-config.nix @@ -18,26 +18,8 @@ in enable = true; extraConfig = renderSettings settings; }; - home-manager.sharedModules = [ - ( - { config, ... }: - { - launchd.agents.ssh-add = { - enable = true; - config = { - ProgramArguments = [ - "/bin/sh" - "-c" - "ssh-add ${config.home.homeDirectory}/.ssh/id_ed25519" - ]; - RunAtLoad = true; - KeepAlive = false; - }; - }; - } - ) - ]; }; + config.flake.modules.nixos.ssh-config = { primaryUser, ... }: { @@ -46,26 +28,5 @@ in inherit settings; }; users.users.root.openssh.authorizedKeys.keys = primaryUser.sshAuthorizedKeys; - programs.ssh.startAgent = true; - home-manager.sharedModules = [ - ( - { pkgs, config, ... }: - { - systemd.user.services.ssh-add = { - Unit = { - Description = "Add SSH key to agent on login"; - After = [ "ssh-agent.service" ]; - }; - Service = { - Type = "oneshot"; - ExecStart = "${pkgs.openssh}/bin/ssh-add ${config.home.homeDirectory}/.ssh/id_ed25519"; - RemainAfterExit = true; - }; - Install.WantedBy = [ "default.target" ]; - }; - } - ) - ]; }; - } diff --git a/nix/profiles/development.nix b/nix/profiles/development.nix index 37a59249..92df8495 100644 --- a/nix/profiles/development.nix +++ b/nix/profiles/development.nix @@ -14,7 +14,26 @@ in pi-agent yazi ]; - home-manager.sharedModules = [ cfg.modules.homeManager.profile-development ]; + home-manager.sharedModules = [ + cfg.modules.homeManager.profile-development + ( + { config, ... }: + { + launchd.agents.ssh-add = { + enable = true; + config = { + ProgramArguments = [ + "/bin/sh" + "-c" + "ssh-add ${config.home.homeDirectory}/.ssh/id_ed25519" + ]; + RunAtLoad = true; + KeepAlive = false; + }; + }; + } + ) + ]; }; nixos.profile-development = { imports = with cfg.modules.nixos; [ @@ -27,7 +46,27 @@ in yazi ]; networking.networkmanager.enable = true; - home-manager.sharedModules = [ cfg.modules.homeManager.profile-development ]; + programs.ssh.startAgent = true; + home-manager.sharedModules = [ + cfg.modules.homeManager.profile-development + ( + { pkgs, config, ... }: + { + systemd.user.services.ssh-add = { + Unit = { + Description = "Add SSH key to agent on login"; + After = [ "ssh-agent.service" ]; + }; + Service = { + Type = "oneshot"; + ExecStart = "${pkgs.openssh}/bin/ssh-add ${config.home.homeDirectory}/.ssh/id_ed25519"; + RemainAfterExit = true; + }; + Install.WantedBy = [ "default.target" ]; + }; + } + ) + ]; }; homeManager.profile-development = { pkgs, ... }: From 4cbe695a293f0bbad031bd80f381a1d91efb89dc Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Wed, 10 Jun 2026 18:55:03 +0800 Subject: [PATCH 08/11] aliases: add gy for git and git-bug pull --- nix/profiles/development.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/profiles/development.nix b/nix/profiles/development.nix index 92df8495..6ebf37ed 100644 --- a/nix/profiles/development.nix +++ b/nix/profiles/development.nix @@ -92,6 +92,7 @@ in grc = "git rebase --continue"; gs = "git status"; gu = "git push && git-bug push"; + gy = "git pull && git-bug pull"; v = "$EDITOR"; e = "fish -c 'set -e var; set var (sk); test -n \"$var\"; and $EDITOR $var'"; }; From 1c89f428a746acf1c4ed001916279029e5b0030e Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Wed, 10 Jun 2026 19:32:18 +0800 Subject: [PATCH 09/11] build(flake.lock): bump inputs --- flake.lock | 86 +++++++++++++++++++++++++++--------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/flake.lock b/flake.lock index 334c3ee5..92746c99 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ ] }, "locked": { - "lastModified": 1778857089, - "narHash": "sha256-TclWRW2SdFeETLaiTG4BA8C8C4m/LppQEldncqyTzAQ=", + "lastModified": 1780756231, + "narHash": "sha256-tXQxKdG5716uB9/LIkLQqQwHKf5mRSpHoZhz3lyI2Cg=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "ab2b0af63fbc9fb779d684f19149b790978be8a8", + "rev": "6ecde03f47172753fe5a2f334f9d3facfb7e6784", "type": "github" }, "original": { @@ -36,16 +36,16 @@ "brew-src": { "flake": false, "locked": { - "lastModified": 1778427648, - "narHash": "sha256-pt9KaDGsMyYWB9JeHs4XGHs870f1lOZe3vx9LpVIhUE=", + "lastModified": 1779646357, + "narHash": "sha256-rnnAaESXxItX4D9xCMGvs3hfDBjbbTYht7OluRcvT8k=", "owner": "Homebrew", "repo": "brew", - "rev": "6f293daa9f9f5832e13b497976335e90509886d7", + "rev": "10a163ac127624caa80cc5cc5a705e97f3615b0e", "type": "github" }, "original": { "owner": "Homebrew", - "ref": "5.1.11", + "ref": "5.1.14", "repo": "brew", "type": "github" } @@ -191,11 +191,11 @@ ] }, "locked": { - "lastModified": 1779678629, - "narHash": "sha256-gHcIFg0mm+KFsg7iZQt67kni3+qR5U3PhEC9P7vKlZ4=", + "lastModified": 1781064232, + "narHash": "sha256-+7cIaqM6ucKf5fDyMnkwehxG8tBdaU51TZOMtxacXmI=", "owner": "nix-community", "repo": "home-manager", - "rev": "612bbe3b405ad5f71d7bf9edecc04b678a061652", + "rev": "1ffdc28076a1809ee7c0cf08f06af18f31c480cd", "type": "github" }, "original": { @@ -207,11 +207,11 @@ "homebrew-cask": { "flake": false, "locked": { - "lastModified": 1779681583, - "narHash": "sha256-cPAKJQdwR+GS3f7F6fDVHwe/J8u6QJOerEq/01jAtX0=", + "lastModified": 1781089933, + "narHash": "sha256-su8VL1w109s+Tvw015wuHQnB+mPZeIVwo4X47HGFDiQ=", "owner": "homebrew", "repo": "homebrew-cask", - "rev": "f1273f530c2830975b90bfebdac6fc0e75d84c8f", + "rev": "f925d8e7f0d31fee0abce0dd6293a8ce832b81f2", "type": "github" }, "original": { @@ -223,11 +223,11 @@ "homebrew-core": { "flake": false, "locked": { - "lastModified": 1779679307, - "narHash": "sha256-CRlUa0j4UHjiKhWEmBTfl0BOgfhm2rXI/kkkAVP/hFU=", + "lastModified": 1781090111, + "narHash": "sha256-N7VcN4QQOoD7+V+WHoBFtecNzyiWRL5jKgnYIe4toZw=", "owner": "homebrew", "repo": "homebrew-core", - "rev": "433f5b6d821fe3b8527bc3a83a1d6b6995971d81", + "rev": "deba7d8203b66841b1b10dd7a37607bfbe8ad191", "type": "github" }, "original": { @@ -313,11 +313,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1779622215, - "narHash": "sha256-Xct/RO79Cx0ySpjBX9Wc6ofx9jU+Y188NBvzv8Lsa88=", + "lastModified": 1781082294, + "narHash": "sha256-iYWA5nv9+em9s51UVGCPOOQkDRpHn2gPPdhCucW9ciw=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "2dcb10a4c03a4d2ae96eb74b74209419020e0ba7", + "rev": "2acc906538b756311fbe947880fd66a2d4c57dc6", "type": "github" }, "original": { @@ -490,11 +490,11 @@ ] }, "locked": { - "lastModified": 1779475241, - "narHash": "sha256-Nw4DN0A5krWNcPBvuWe5Gz2yuxsUUPiDgtu6SVPJQeU=", + "lastModified": 1780251518, + "narHash": "sha256-fG9xbb1SOAAJ+2kJRakp3ch+BmA/3dEg/K3PoAZTKkw=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "3cd3972b2ee658a14d2610d8494e09259e530124", + "rev": "40ede2e7bdec80ba5d4c443160d905e9f841ae5f", "type": "github" }, "original": { @@ -602,11 +602,11 @@ ] }, "locked": { - "lastModified": 1779036909, - "narHash": "sha256-zXcwYQGCT6pzinK+1dBB2ekTVtfxGZAapb3Evdcu4fY=", + "lastModified": 1780795403, + "narHash": "sha256-AkWx4Zt9pQbD/f82Z8N57+d0HGLN/rV3gdMKJTpBPKs=", "owner": "nix-darwin", "repo": "nix-darwin", - "rev": "56c666e108467d87d13508936aade6d567f2a501", + "rev": "6a771120d607dcccb279a27d227650e324815c35", "type": "github" }, "original": { @@ -621,11 +621,11 @@ "brew-src": "brew-src" }, "locked": { - "lastModified": 1778851564, - "narHash": "sha256-p8wzcnpB2Iys+QzAKM9/Eyw/pUyqCO3sw/NCnDH4dTE=", + "lastModified": 1780492467, + "narHash": "sha256-zMEJwtQPmsPPgPczFkyjWHgd1z0HagOPS2Wt2WDYLJY=", "owner": "zhaofengli", "repo": "nix-homebrew", - "rev": "b3a87b4793205cc111f3c61e25e018ffac3b8039", + "rev": "562332f97de9f5ba51aa647d70462e88222b2988", "type": "github" }, "original": { @@ -641,11 +641,11 @@ ] }, "locked": { - "lastModified": 1779604987, - "narHash": "sha256-ZQ5z+fVhxYKtIFwtqGp5O0PD84BM1riASvqDaN5Xs+s=", + "lastModified": 1780816331, + "narHash": "sha256-0BYqs8yKWkOz2Q7+SP18N5E5gmDKSo6LSxIVIa0wWes=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "8fba98c80b48fa013820e0163c5096922fea4ddd", + "rev": "1a2ea89c917781e88508d9fd2b507f2d2a0e173c", "type": "github" }, "original": { @@ -697,11 +697,11 @@ ] }, "locked": { - "lastModified": 1779677199, - "narHash": "sha256-ZtesULV0qNbNrK5h4eWAkGlQSMntPrPU7UT04kRjk5U=", + "lastModified": 1781059511, + "narHash": "sha256-RKnSBJYUGV2HpVpuo2nQwSHw25SrcaRaTWFIO1tLmyM=", "owner": "bandithedoge", "repo": "nixpkgs-firefox-darwin", - "rev": "151de1e02d12d545a963d42acaa83761051dd9f1", + "rev": "9336eb9a336bee09904157e37a19ae41435e67b5", "type": "github" }, "original": { @@ -775,11 +775,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1779508470, - "narHash": "sha256-Ap9KJX+5xHIn3bPIpfNgT6MEXdAECECwo4/rmlQD74M=", + "lastModified": 1780749050, + "narHash": "sha256-3av0pIjlOWQ6rDbNOmpUSvbNnJkGORQKKjb4LtCZsIY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "29916453413845e54a65b8a1cf996842300cd299", + "rev": "a799d3e3886da994fa307f817a6bc705ae538eeb", "type": "github" }, "original": { @@ -838,11 +838,11 @@ ] }, "locked": { - "lastModified": 1777944972, - "narHash": "sha256-VfGRo1qTBKOe3s2gOv8LSoA6Fk19PvBlwQ1ECN0Evn8=", + "lastModified": 1780547341, + "narHash": "sha256-Gq8KNx5A7hBB3uGJaj6eQfLDIz5YdLu92gqBcvHvoUo=", "owner": "Mic92", "repo": "sops-nix", - "rev": "c591bf665727040c6cc5cb409079acb22dcce33c", + "rev": "9ed65852b6257fbeae4355bc24ecfea307ca759a", "type": "github" }, "original": { @@ -980,11 +980,11 @@ ] }, "locked": { - "lastModified": 1778265244, - "narHash": "sha256-8jlPtGSsv/CQY6tVVyLF4Jjd0gnS+Zbn9yk/V13A9nM=", + "lastModified": 1780133819, + "narHash": "sha256-0YPKIY3dlnR7SPq7Z8ekFVvzFsfeiAtEj+QUI3KHrlI=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "813ea5ca9a1702a9a2d1f5836bc00172ef698968", + "rev": "4a170c0ba96fd37374f93d8f91c9ed91814828ac", "type": "github" }, "original": { From ea5a2e2ef0f9d47aeb1d6b67ac0f59723f842675 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Wed, 10 Jun 2026 19:33:10 +0800 Subject: [PATCH 10/11] pi-agent: use home-manager module --- nix/modules/pi-agent.nix | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/nix/modules/pi-agent.nix b/nix/modules/pi-agent.nix index c49400a5..901d95b6 100644 --- a/nix/modules/pi-agent.nix +++ b/nix/modules/pi-agent.nix @@ -10,13 +10,18 @@ in darwin.pi-agent = osModule; nixos.pi-agent = osModule; homeManager.pi-agent = - { pkgs, ... }: - let - package = pkgs.pi-coding-agent; - in + { pkgs, config, ... }: { - home = { - file.".pi/agent/AGENTS.md".text = '' + programs.pi-coding-agent = { + enable = true; + extraPackages = [ pkgs.nodejs_22 ]; + settings = { + lastChangelogVersion = lib.getVersion config.programs.pi-coding-agent.package; + packages = [ "npm:@vanillagreen/pi-claude-bridge" ]; + defaultProvider = "claude-bridge"; + defaultModel = "claude-sonnet-4-6"; + }; + context = '' # Global pi instructions - If a command is missing, use comma: `, [args...]` @@ -34,25 +39,6 @@ in - `nix flake metadata --json | jq '.locks.nodes | keys'` - `nix eval --impure --raw --expr '(builtins.getFlake (toString ./.)).inputs..outPath'` ''; - file.".pi/agent/settings.json".text = builtins.toJSON { - lastChangelogVersion = lib.getVersion package; - packages = [ "npm:@vanillagreen/pi-claude-bridge" ]; - defaultProvider = "claude-bridge"; - defaultModel = "claude-sonnet-4-6"; - }; - packages = [ - (pkgs.symlinkJoin { - inherit (package) meta; - name = "${lib.getName package}-wrapped-${lib.getVersion package}"; - paths = [ package ]; - preferLocalBuild = true; - nativeBuildInputs = [ pkgs.makeWrapper ]; - postBuild = '' - wrapProgram $out/bin/pi \ - --suffix PATH : ${lib.makeBinPath [ pkgs.nodejs_22 ]} - ''; - }) - ]; }; }; }; From 3a5830c1095594e82e06caa0c8951160e2c517ca Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Wed, 10 Jun 2026 19:33:35 +0800 Subject: [PATCH 11/11] ssh-add: set SSH_AUTH_SOCK to %t/ssh-agent --- nix/profiles/development.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nix/profiles/development.nix b/nix/profiles/development.nix index 6ebf37ed..b996cd26 100644 --- a/nix/profiles/development.nix +++ b/nix/profiles/development.nix @@ -55,10 +55,12 @@ in systemd.user.services.ssh-add = { Unit = { Description = "Add SSH key to agent on login"; + Wants = [ "ssh-agent.service" ]; After = [ "ssh-agent.service" ]; }; Service = { Type = "oneshot"; + Environment = "SSH_AUTH_SOCK=%t/ssh-agent"; ExecStart = "${pkgs.openssh}/bin/ssh-add ${config.home.homeDirectory}/.ssh/id_ed25519"; RemainAfterExit = true; };