feat(ci): add the ci devshell with the Gitea runner tool set
test-runner / smoke (push) Successful in 1s
test-runner / smoke (push) Successful in 1s
Раннер на 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.
This commit is contained in:
1 parent
78c50dee87
commit
665f38a501
3 files changed
+60
-11
No files matched your search
@@ -0,0 +1,32 @@
|
||||
# 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
|
||||
]
|
||||
Reference in new issue
Block a user