main
 1#!/usr/bin/env bash
 2
 3set -euo pipefail
 4
 5repo_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
 6bootstrap="$repo_root/imperative/nagoya/bootstrap.sh"
 7
 8[[ -x "$bootstrap" ]]
 9grep -q 'install.determinate.systems/nix' "$bootstrap"
10grep -q "nix run home-manager -- switch --flake \".#vincent@\${SYSTEM_CONFIG}\" -b backup" "$bootstrap"
11grep -q 'git clone' "$bootstrap"
12grep -q '127.0.0.1 localhost nagoya' "$repo_root/systems/nagoya/gen-configs.nix"
13if grep -qE '\b(apt|systemctl|wg|wireguard)\b' "$bootstrap"; then
14	exit 1
15fi
16
17cd "$repo_root"
18nix eval --raw '.#homeConfigurations."vincent@nagoya".activationPackage.drvPath' >/dev/null
19nix build .#hostConfigs.nagoya --dry-run >/dev/null