Files
nixos/lib/ci-tools.nix
T
oqyude 665f38a501
test-runner / smoke (push) Successful in 1s
feat(ci): add the ci devshell with the Gitea runner tool set
Раннер на sapphira отдаёт job'у PATH, равный своему hostPackages, и он
фиксируется в systemd-юните при активации -- чтобы добавить туда инструмент,
нужен nixos-rebuild switch на хосте. Для workflow'ов в oqyude/winos это тупик:
jq (scripts/update-manifest.sh) и pwsh (scripts/update-kvrt.ps1) в наборе
раннера отсутствуют, а nix-shell -p не запасной путь -- реестр nix на sapphira
пустой, каналов нет, -p не находит nixpkgs.

Что сделано:
- lib/ci-tools.nix -- один список инструментов CI.
- devshells/default.nix: devshell `ci` (nix develop .#ci) с этим списком.
  Workflow может взять PATH devshell'а и получить jq/pwsh без пересборки:
    nix develop /etc/nixos#ci --command bash -c 'echo $PATH'
- modules/server/gitea-runner.nix: hostPackages берёт тот же список, чтобы
  набор раннера и devshell не расходились; в списке теперь ещё и powershell.

Проверка: devshell собирается на sapphira (nix develop /etc/nixos#ci) и
отдаёт jq и pwsh.
2026-10-20 15:11:23 +03:00

33 lines
1.3 KiB
Nix

# The tool set a Gitea Actions job on sapphira needs.
#
# Two consumers, one list, so they cannot drift apart:
#
# * modules/server/gitea-runner.nix -- the runner's `hostPackages`. The
# upstream NixOS module turns that list into the PATH of every host-mode
# job (`path = coreutils ++ optionals wantsHost instance.hostPackages`),
# so a tool that is not listed here does not exist for the job at all.
#
# * devshells/default.nix -- the `ci` devshell. A job (or a developer) can
# enter it and get the same tools without waiting for a nixos-rebuild,
# which is what the workflows in oqyude/winos do:
# nix develop /etc/nixos#ci --command bash -c 'echo $PATH'
#
# Keep the list sorted by purpose: the first group is the default set the
# runner has always had, the rest are tools a specific workflow needs.
{ pkgs }:
with pkgs; [
bash coreutils curl gawk gitMinimal gnused nodejs wget
nix
python3
cacert
# scripts/update-manifest.sh in oqyude/winos hard-requires jq
# ("for dep in curl jq") and calls it a dozen times.
jq
# scripts/update-kvrt.ps1 in oqyude/winos runs under pwsh; the runner has
# no PowerShell otherwise, and `nix-shell -p powershell` is not a fallback
# here: the nix registry on sapphira is empty, so -p cannot resolve nixpkgs.
powershell
]