Skip to content

Commit 7674723

Browse files
committed
fix(pi): use node backend for wsl
There is a segfault when using bun backend on wsl.
1 parent f7048bc commit 7674723

3 files changed

Lines changed: 33 additions & 10 deletions

File tree

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hosts/rize/home.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
zsh.enable = true;
1919

2020
claude.enable = true;
21-
pi.enable = true;
21+
pi = {
22+
enable = true;
23+
useBun = false;
24+
};
2225
neovim.useNightly = true;
2326

2427
git = {

modules/home/programs/pi/default.nix

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,35 @@
44
inputs,
55
pkgs,
66
...
7-
}: {
7+
}: let
8+
cfg = config.my.home.programs.pi;
9+
in {
810
options.my.home.programs.pi = {
911
enable = lib.mkEnableOption "pi coding agent harness";
12+
useBun = lib.mkOption {
13+
description = "Build with Bun instead of Node";
14+
type = lib.types.bool;
15+
default = true;
16+
};
1017
};
1118

12-
config = lib.mkIf config.my.home.programs.pi.enable {
19+
config = lib.mkIf cfg.enable {
1320
home = {
1421
packages = [
15-
inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.pi
22+
((pkgs.callPackage (inputs.llm-agents + /packages/pi/package.nix) {
23+
inherit (cfg) useBun;
24+
# llm-agents.nix defines this helper in its package scope, but it is
25+
# not exported. The Node build does not need the HOME workaround for
26+
# its version check, so an inert input is enough here.
27+
versionCheckHomeHook = pkgs.emptyFile;
28+
})
29+
.overrideAttrs (_old:
30+
lib.optionalAttrs cfg.useBun {
31+
# Pi 0.82.1's Bun binary no longer prints the package version from
32+
# `--version` or `--help`, so upstream's versionCheckHook fails
33+
# after an otherwise successful build.
34+
doInstallCheck = false;
35+
}))
1636
];
1737

1838
# sessionVariables = {

0 commit comments

Comments
 (0)