feat(ci): add the ci devshell with the Gitea runner tool set
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:
oqyude committed 2026-10-20 15:11:23 +03:00
1 parent 78c50dee87
commit 665f38a501
3 files changed
+60 -11

No files matched your search

+23
View File
@@ -18,6 +18,29 @@ let
in
{
devShells.${system} = {
# `nix develop .#ci` -> the tool set a Gitea Actions job on sapphira
# needs. Same list as the runner's hostPackages (lib/ci-tools.nix), so a
# workflow can get the tools it needs without a nixos-rebuild:
#
# nix develop /etc/nixos#ci --command bash -c 'echo $PATH'
#
# The runner's own PATH is fixed in the systemd unit at activation time,
# and changing it needs `nixos-rebuild switch` on the host. The workflows
# in oqyude/winos therefore take the PATH from this devshell instead --
# jq (scripts/update-manifest.sh) and pwsh (scripts/update-kvrt.ps1) are
# not in the runner's default set, and `nix-shell -p` is not a fallback
# on sapphira (empty nix registry, no channels).
ci = pkgs.mkShell {
name = "gitea-ci-devshell";
buildInputs = import ../lib/ci-tools.nix { inherit pkgs; };
shellHook = ''
echo "[ci-devshell] jq: $(command -v jq || echo MISSING)"
echo "[ci-devshell] pwsh: $(command -v pwsh || echo MISSING)"
'';
};
# `nix develop .#vtimeline` -> shell for testing the VeeamTimelineView
# project (Playwright + ESLint + Prettier over a vanilla-JS frontend).
vtimeline = pkgs.mkShell {
+32
View File
@@ -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
]
+5 -11
View File
@@ -91,17 +91,11 @@ in
container.options = "";
};
# Default set (bash, coreutils, curl, gawk, gitMinimal, gnused,
# nodejs, wget) plus what ZeroQ workflows are most likely to need.
hostPackages = 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 the runner's PATH is exactly this list.
jq
];
# The PATH of every host-mode job. One shared list (lib/ci-tools.nix) with
# the `ci` devshell in devshells/default.nix, so the runner and the
# devshell cannot drift apart: a workflow can get the same tools through
# `nix develop /etc/nixos#ci` without waiting for a rebuild.
hostPackages = import ../../lib/ci-tools.nix { inherit pkgs; };
};
# ----- Workspace directory on tmpfs ---------------------------------------