main
 1#!/usr/bin/env bash
 2
 3set -euo pipefail
 4
 5repo_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
 6bootstrap="$repo_root/imperative/sakhalin/bootstrap.sh"
 7generator="$repo_root/systems/sakhalin/gen-configs.nix"
 8
 9[[ -x "$bootstrap" ]]
10# shellcheck disable=SC2016 # Literal shell fragments are intentional assertions.
11grep -q 'SYSTEM_CONFIG="${SYSTEM_CONFIG:-sakhalin}"' "$bootstrap"
12# shellcheck disable=SC2016 # Literal shell fragments are intentional assertions.
13grep -q 'fedoraConfigs.${SYSTEM_CONFIG}' "$bootstrap"
14# shellcheck disable=SC2016 # Literal shell fragments are intentional assertions.
15grep -q 'home-manager -- switch --flake ".#vincent@${SYSTEM_CONFIG}" -b backup' "$bootstrap"
16grep -q 'systemctl enable wg-quick@wg0.service' "$bootstrap"
17if grep -q 'enable --now wg-quick@wg0' "$bootstrap"; then
18  exit 1
19fi
20
21grep -q '"vincent@sakhalin"' "$repo_root/flake.nix"
22grep -q 'import ./systems/sakhalin/gen-configs.nix' "$repo_root/flake.nix"
23grep -q '# sakhalin = libx.mkHost' "$repo_root/flake.nix"
24if grep -q 'nmDispatcher' "$generator"; then
25  exit 1
26fi
27grep -q 'host/sakhalin/build' "$repo_root/Makefile"
28grep -q 'host/sakhalin/switch' "$repo_root/Makefile"
29
30cd "$repo_root"
31nix eval --raw '.#homeConfigurations."vincent@sakhalin".activationPackage.drvPath' >/dev/null
32nix build .#fedoraConfigs.sakhalin --dry-run >/dev/null