refactor(home): extract pkgs.bun into herdr-runtime.nix, drop duplication
test-runner / smoke (push) Canceled after 0s

Раньше bun для пользовательского shell PATH приходил двумя путями:
на sapphira — через opencode.nix:339 (home.packages=[... pkgs.bun ...]),
на rydiwo — добавлен вручную в home/secondary.nix (commit ffd85dc) для
herdr-web-ui plugin'а, который без bun в PATH скачивает generic-linux
runtime и ломается о NixOS dynamic linker.

Теперь:
  • home/modules/herdr-runtime.nix — единый источник pkgs.bun для
    пользовательского PATH (импортируется и в server.nix, и в
    secondary.nix).
  • home/secondary.nix — добавлен импорт herdr-runtime.nix, убран
    прямой home.packages = with pkgs; [ bun ]; и его 10-строчный
    комментарий-объяснение (переехал в herdr-runtime.nix).
  • home/server.nix — добавлен импорт herdr-runtime.nix.
  • home/modules/opencode.nix — pkgs.bun удалён из home.packages
    (он теперь из herdr-runtime.nix), но ОСТАВЛЕН в
    programs.opencode.extraPackages (line 271) — это другой PATH
    (--suffix PATH внутри opencode-wrapped env), не дубликат.

Результат для обоих хостов:
  - shell PATH: bun из /nix/store/...-bun-*/bin/bun
  - opencode-wrapped env (только sapphira): bun через extraPackages
  - herdr-web-ui plugin auto-install на rydiwo: находит bun в PATH,
    не скачивает generic-linux runtime

После этого оба хоста пересобираются (sapphira: opencode/server.nix;
rydiwo: secondary.nix + новый модуль).
This commit is contained in:
oqyude committed 2026-10-15 15:07:54 +03:00
1 parent ffd85dc7f5
commit 7f301765b5
4 files changed
+38 -11

No files matched your search

+7 -2
View File
@@ -331,12 +331,17 @@ in
xdg.configFile."opencode/oh-my-openagent.json".text = builtins.toJSON ohMyOpenagentConfig;
# Same extras on the user's PATH too, so `omo doctor` and standalone invocations
# of `sg`, `gh`, `bun`, `npm`, `npx` work in the user's shell — not only inside
# of `sg`, `gh`, `npm`, `npx` work in the user's shell — not only inside
# the opencode-wrapped binary.
#
# Note: `pkgs.bun` deliberately NOT included here — it now lives in
# `home/modules/herdr-runtime.nix`, which both `home/server.nix` and
# `home/secondary.nix` import. Avoids a second copy of bun in the
# user's shell PATH (single source of truth) and means the bun-runtime
# fix for the herdr-web-ui plugin on NixOS is one place to grep.
home.packages = [
pkgs.nodejs_22
astGrepWithSg
pkgs.bun
pkgs.gh
];