forked from fediversity/fediversity
- `--store` as per https://blog.kotatsu.dev/posts/2023-04-21-woodpecker-nix-caching/ - `--eval-store` as per https://kevincox.ca/2022/01/02/nix-in-docker-caching/ mount store rm kvm
35 lines
2 KiB
YAML
35 lines
2 KiB
YAML
$schema: https://raw.githubusercontent.com/woodpecker-ci/woodpecker/refs/heads/main/pipeline/frontend/yaml/linter/schema/schema.json
|
|
|
|
when:
|
|
- event: manual
|
|
- event: push
|
|
branch: main
|
|
|
|
## NOTE: NixOps4 does not provide a good “dry run” mode, so we instead check
|
|
## proxies for resources, namely whether their `.#vmOptions.<machine>` and
|
|
## `.#nixosConfigurations.<machine>` outputs evaluate and build correctly, and
|
|
## whether we can dry run `infra/proxmox-*.sh` on them. This will not catch
|
|
## everything, and in particular not issues in how NixOps4 wires up the
|
|
## resources, but that is still something.
|
|
steps:
|
|
- name: check-resources
|
|
image: nixos/nix
|
|
volumes:
|
|
- /nix:/mnt/nix:ro
|
|
commands:
|
|
- echo ==================== [ VM Options ] ====================
|
|
- |
|
|
set -euC
|
|
machines=$(nix eval --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --extra-experimental-features 'nix-command flakes' --impure --raw --expr 'with builtins; toString (attrNames (getFlake (toString ./.)).vmOptions)')
|
|
for machine in $machines; do
|
|
echo ~~~~~~~~~~~~~~~~~~~~~: $machine :~~~~~~~~~~~~~~~~~~~~~
|
|
nix build --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.vmOptions-$machine
|
|
done
|
|
- echo ==================== [ NixOS Configurations ] ====================
|
|
- |
|
|
set -euC
|
|
machines=$(nix eval --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --extra-experimental-features 'nix-command flakes' --impure --raw --expr 'with builtins; toString (attrNames (getFlake (toString ./.)).nixosConfigurations)')
|
|
for machine in $machines; do
|
|
echo ~~~~~~~~~~~~~~~~~~~~~: $machine :~~~~~~~~~~~~~~~~~~~~~
|
|
nix build --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.nixosConfigurations-$machine
|
|
done
|