Skip to content

Commit 8f52e9b

Browse files
kixelatedclaude
andauthored
Fix pub flake to use Cachix cache (#1202)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a2d5ab6 commit 8f52e9b

10 files changed

Lines changed: 43 additions & 37 deletions

File tree

cdn/common/monitor.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ check_health() {
101101
if $ok && [ "$status" = "200" ]; then
102102
if [[ "${HEALTH_STATE[$node]}" == "failing" ]]; then
103103
HEALTH_STATE[$node]="ok"
104-
local msg="Health recovered: ${node}.${HEALTH_DOMAIN}"
104+
local msg="Health recovered: ${node}.${HEALTH_DOMAIN} (from ${HOSTNAME})"
105105
echo "$msg"
106106
send_webhook "$msg"
107107
fi
108108
else
109109
if [[ "${HEALTH_STATE[$node]}" != "failing" ]]; then
110110
HEALTH_STATE[$node]="failing"
111-
local msg="Health check FAILED: ${node}.${HEALTH_DOMAIN} (${status:-timeout})"
111+
local msg="Health check FAILED: ${node}.${HEALTH_DOMAIN} (${status:-timeout}) (from ${HOSTNAME})"
112112
echo "$msg"
113113
send_webhook "$msg"
114114
else

cdn/pub/flake.lock

Lines changed: 9 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cdn/pub/flake.nix

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
{
22
description = "MoQ publisher dependencies";
33

4+
nixConfig = {
5+
extra-substituters = [ "https://kixelated.cachix.org" ];
6+
extra-trusted-public-keys = [ "kixelated.cachix.org-1:CmFcV0lyM6KuVM2m9mih0q4SrAa0XyCsiM7GHrz3KKk=" ];
7+
};
8+
49
inputs = {
5-
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6-
moq = {
7-
# Pin to a release tag via: just pin
8-
url = "github:moq-dev/moq";
9-
inputs.nixpkgs.follows = "nixpkgs";
10-
};
10+
# Pin to a release tag via: just pin
11+
moq.url = "github:moq-dev/moq";
12+
# Don't override nixpkgs — use moq's pin so Cachix cache hits
1113
};
1214

1315
outputs =
14-
{
15-
nixpkgs,
16-
moq,
17-
...
18-
}:
16+
{ moq, ... }:
1917
{
2018
packages.x86_64-linux =
2119
let
2220
system = "x86_64-linux";
23-
pkgs = nixpkgs.legacyPackages.${system};
21+
pkgs = moq.inputs.nixpkgs.legacyPackages.${system};
2422
in
2523
{
2624
default = pkgs.symlinkJoin {

cdn/pub/justfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ pin tag="":
1515
exit 1
1616
fi
1717
echo "Pinning to $TAG..."
18-
nix flake update
19-
nix flake lock --override-input moq "github:moq-dev/moq/$TAG"
18+
nix flake lock --override-input moq "github:moq-dev/moq/$TAG" --update-input moq
2019

2120
# Get the hostname for the publisher
2221
host:
@@ -72,6 +71,12 @@ ssh:
7271
HOST=$(just host)
7372
ssh root@$HOST
7473

74+
restart:
75+
#!/usr/bin/env bash
76+
HOST=$(just host)
77+
echo "=== $HOST ==="
78+
ssh root@$HOST "systemctl restart demo-bbb --no-pager"
79+
7580
# View logs from publisher
7681
logs:
7782
#!/usr/bin/env bash

cdn/relay/flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cdn/relay/justfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ logs node:
8989
#!/usr/bin/env bash
9090
ssh root@$(just host {{node}}) "journalctl -u moq-relay -f"
9191

92+
# Restart
93+
restart node:
94+
#!/usr/bin/env bash
95+
ssh root@$(just host {{node}}) "systemctl restart moq-relay --no-pager"
96+
9297
# Profile moq-relay on a node using perf (built via nix)
9398
perf node *args:
9499
#!/usr/bin/env bash

dev/boy/justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ start rom url='http://localhost:4443/anon':
5555

5656
# Host the web server
5757
web url='http://localhost:4443/anon':
58-
VITE_RELAY_URL="{{url}}" bun run --filter @moq/boy dev --open
58+
VITE_RELAY_URL="{{url}}" bun vite --open
5959

6060
# --- rom.moq.dev (R2 hosting) ---
6161

dev/relay/justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cluster:
1515
"just wait && just leaf1" \
1616
"just wait && just pub bbb http://localhost:4444/demo?jwt=$(cat demo-cli.jwt)" \
1717
"just wait && just pub tos http://localhost:4443/demo?jwt=$(cat demo-cli.jwt)" \
18-
"just wait && env VITE_RELAY_URL=http://localhost:4445/demo?jwt=$(cat demo-web.jwt) bun run --filter @moq/demo dev"
18+
"just wait && VITE_RELAY_URL=http://localhost:4445/demo?jwt=$(cat demo-web.jwt) bun --cwd ../web vite"
1919

2020
# Run a localhost root server, accepting connections from leaf nodes.
2121
root: auth-key

dev/web/justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ default:
66

77
# Run the web server targeting the specified relay.
88
serve url='http://localhost:4443/anon':
9-
VITE_RELAY_URL="{{url}}" bun run --filter @moq/demo dev
9+
VITE_RELAY_URL="{{url}}" bun vite

justfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55

66
mod dev
7+
mod cdn
78

89
# Shortcuts to avoid `dev::` prefix.
910
mod boy 'dev/boy'

0 commit comments

Comments
 (0)