iac/.forgejo/workflows/nixos.yaml
Sergei Poljanski 29dcc8915a
All checks were successful
nixos / nixos (push) Successful in 21s
ci: evaluate only, comin deploys
comin on each host pulls main and switches, so the CI deploy job, its
SSH configuration and the known_hosts it used go. CI keeps evaluating
every host on every push and no longer holds a key to the servers;
SSH_DEPLOY_KEY can be removed from the repository secrets.

Assisted-by: Claude:opus-5-5
2026-11-17 11:39:40 +04:00

40 lines
1.1 KiB
YAML

name: nixos
# Every push: evaluate every host, so a broken config never reaches main.
# Deploying is not CI's job: each host pulls main itself (comin,
# nixos/modules/comin.nix). CI holds no credentials for the servers.
run-name: "evaluate: ${{ github.ref_name }}"
on:
push:
paths:
- 'nixos/**'
- '.forgejo/workflows/nixos.yaml'
workflow_dispatch:
jobs:
nixos:
runs-on: nix-latest
env:
NIX_CONFIG: |
experimental-features = nix-command flakes
build-users-group =
sandbox = false
steps:
- name: Prepare container for actions
run: nix-env -iA nixpkgs.nodejs_22
- name: Checkout
uses: actions/checkout@v7.0.1
# Job containers are unprivileged, so Nix cannot sandbox builds in
# them. Evaluating catches config errors; the build itself happens
# on each server.
- name: Evaluate
working-directory: nixos
run: |
for host in asxpio-ops asxpio-services; do
nix eval --raw ".#nixosConfigurations.$host.config.system.build.toplevel.drvPath"
echo
done