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
1 change: 1 addition & 0 deletions pkgs/deploy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ let
fleetPkgs = callPackage ../fleet { inherit sourceRev; };
definitions = import ./services.nix {
inherit (fleetPkgs) fleet;
laptopAgent = callPackage ../laptop-agent/package.nix { };
mcpx = callPackage ../mcpx/package.nix { };
routeProxy = callPackage ./route-proxy.nix { };
# The existing Cloudflare deploy apps (issue #5767, phase 1) — the
Expand Down
36 changes: 35 additions & 1 deletion pkgs/deploy/services.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# service (systemd / launchd / cloudflare / sandbox / container).
{
fleet,
laptopAgent,
mcpx,
routeProxy,
idMailDeploy,
Expand All @@ -28,10 +29,16 @@
];
environment = {
PORT = "4801"; # PORT_QUEUE_BROKER, pkgs/fleet/crates/fleet-config
# Live since the Turso cutover (#6741): matches the
# 30-turso-queue.conf drop-in the running unit carries.
QUEUE_BROKER_BACKEND = "turso";
};
# Names only — values are resolved by the secrets broker at
# activation time (later slice); a definition never carries a value.
secrets = [ "supabase.muse-dev2.service-role-key" ];
secrets = [
"turso.fleet-queue-rw-token" # the Turso backend token, by name
"supabase.muse-dev2.service-role-key" # legacy Postgres backend
];
user = "user";
ports = [ 4801 ];
restart = "on-failure";
Expand Down Expand Up @@ -59,6 +66,33 @@
class = "systemd";
};

laptop-agent = {
package = laptopAgent;
entryPoint = "bin/laptop-agent";
args = [ ];
environment = {
LAPTOP_AGENT_HOST = "100.99.113.103";
LAPTOP_AGENT_PORT = "4799";
};
# The daemon token is a local file (~/.config/laptop-agent/token)
# the daemon reads itself at startup; no broker-resolved secrets.
secrets = [ ];
user = "user";
ports = [ 4799 ];
# The hand-written unit this replaces ran Restart=always: the
# 2026-11-16 daemon-death episode (code#2879) showed on-failure
# does not restart a clean (SIGTERM/success) exit.
restart = "always";
# No unauthenticated health endpoint exists: /health requires the
# daemon token (401 without it), which the deploy probe cannot
# present, so healthCheck stays null (the session-proxy/mcpx
# shape) and health is verified through the authenticated client
# (laptop-agent.py health) after activation - issue #5769.
healthCheck = null;
targets = [ "laptop" ];
class = "systemd";
};

session-proxy = {
package = fleet;
entryPoint = "bin/fleet";
Expand Down