diff --git a/experimental/pi-everything-edition/flake.nix b/experimental/pi-everything-edition/flake.nix index 3aa2be9..0c77294 100644 --- a/experimental/pi-everything-edition/flake.nix +++ b/experimental/pi-everything-edition/flake.nix @@ -78,7 +78,7 @@ ''; }; - pi-everything-edition = pkgs.symlinkJoin { + main = pkgs.symlinkJoin { name = "pi-everything-edition-${upstream.version}"; paths = [ upstream ]; postBuild = '' @@ -106,11 +106,37 @@ description = "${upstream.meta.description} with pi-automode and Gondolin"; }; }; + + use-host = pkgs.symlinkJoin { + name = "pi-everything-edition-use-host-${upstream.version}"; + paths = [ upstream ]; + postBuild = '' + rm "$out/bin/pi" + cat >"$out/bin/pi" <<'EOF' + #!${pkgs.runtimeShell} + + case "''${1-}" in + install|remove|uninstall|update|list|config) + exec ${lib.getExe upstream} "$@" + ;; + esac + + exec ${lib.getExe upstream} \ + --extension ${automode}/extensions/auto-mode.ts \ + --skill ${automode}/skills/automode-diagnostics \ + "$@" + EOF + chmod +x "$out/bin/pi" + ''; + meta = upstream.meta // { + mainProgram = "pi"; + description = "${upstream.meta.description} with pi-automode"; + }; + }; in { - default = pi-everything-edition; - pi = pi-everything-edition; - inherit automode gondolin; + default = main; + inherit main use-host automode gondolin; } ); };