Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion infrastructure/nixos/modules/deploy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let
# Notify via the notification service
${pkgs.curl}/bin/curl -s -X POST http://localhost:9001/event \
-H "Content-Type: application/json" \
-d "{\"type\":\"deploy.nixos-changed\",\"title\":\"NixOS config changed in $SHA\",\"status\":\"warning\",\"details\":\"Manual apply required: bun run cli nixos apply\"}" \
-d "{\"type\":\"deploy.nixos-changed\",\"title\":\"NixOS config changed in $SHA\",\"status\":\"failure\",\"details\":\"Manual apply required: bun run cli nixos apply\"}" \
|| true
else
echo "No NixOS config changes"
Expand Down
4 changes: 2 additions & 2 deletions scripts/smoke-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ const checks: Check[] = [
},
},
{
name: 'Auth guard protects /projects',
name: 'Auth guard protects /new',
async run() {
const res = await fetch(`${baseUrl}/projects`, { redirect: 'manual' })
const res = await fetch(`${baseUrl}/new`, { redirect: 'manual' })
if (res.status !== 302) throw new Error(`Expected 302, got ${res.status}`)
const location = res.headers.get('Location') ?? ''
if (!location.includes('/auth/signin'))
Expand Down
3 changes: 3 additions & 0 deletions src/entrypoints/cli/commands/nixos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ export async function nixos(args: string[]): Promise<number> {
`git config --global --add safe.directory ${worktree} 2>/dev/null || true`,
`cd ${worktree}`,
`nixos-rebuild switch --flake ./infrastructure/nixos#${flakeTarget}`,
// Record the applied config in /etc/nixos: forms-lab-deploy-main
// diffs against it to decide whether a manual apply is pending.
`cp -rT ./infrastructure/nixos /etc/nixos`,
].join(' && '),
)

Expand Down
Loading