nixos/middleman: Serve Paseo web app ourselves
Serve the web app from the Paseo package on `paseo.nul.ie` and point the daemon's pairing links there, so browsers no longer load Paseo's hosted app. It connects through our relay, so the daemon stays on loopback. Move the patched Paseo package into the shared overlay so `middleman` and `slop-cannon` use the same build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,11 @@ let
|
||||
}))
|
||||
];
|
||||
};
|
||||
# Paseo's web app, which connects to daemons through the relay
|
||||
paseoWebUi = pkgs.runCommand "paseo-web-ui-${pkgs.paseo.version}" { } ''
|
||||
cp -r ${pkgs.paseo}/lib/paseo/packages/server/dist/server/web-ui "$out"
|
||||
'';
|
||||
|
||||
wellKnown = {
|
||||
"/.well-known/" = {
|
||||
alias = "${wellKnownRoot}/";
|
||||
@@ -393,6 +398,23 @@ in
|
||||
};
|
||||
useACMEHost = pubDomain;
|
||||
};
|
||||
"paseo.${pubDomain}" = {
|
||||
root = paseoWebUi;
|
||||
extraConfig = ''
|
||||
gzip_static on;
|
||||
brotli_static on;
|
||||
'';
|
||||
locations = {
|
||||
"/".tryFiles = "$uri $uri/ /index.html";
|
||||
"= /index.html".extraConfig = ''
|
||||
add_header Cache-Control "no-store";
|
||||
'';
|
||||
"/_expo/".extraConfig = ''
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
'';
|
||||
};
|
||||
useACMEHost = pubDomain;
|
||||
};
|
||||
|
||||
"md.${pubDomain}" = {
|
||||
locations."/" = {
|
||||
|
||||
@@ -48,12 +48,6 @@ in
|
||||
"Bash(slop-ssh:*)"
|
||||
];
|
||||
|
||||
# TODO: Drop the override once getpaseo/paseo#7673 is fixed. The build runs npm with
|
||||
# `--ignore-scripts`, so the web UI's `postinstall` patch is never applied.
|
||||
paseo = inputs.paseo.packages.${pkgs.stdenv.hostPlatform.system}.default.overrideAttrs (old: {
|
||||
preBuild = (old.preBuild or "") + "\nnpm run postinstall\n";
|
||||
});
|
||||
|
||||
slopClone = pkgs.writeShellApplication {
|
||||
name = "slop-clone";
|
||||
runtimeInputs = with pkgs; [ jujutsu openssh paseo ];
|
||||
@@ -176,7 +170,7 @@ in
|
||||
|
||||
services.paseo = {
|
||||
enable = true;
|
||||
package = paseo;
|
||||
package = pkgs.paseo;
|
||||
user = agentUser;
|
||||
group = agentUser;
|
||||
listenAddress = "127.0.0.1";
|
||||
@@ -193,6 +187,8 @@ in
|
||||
# Rewritten on every start, so changes made from the app don't survive a restart
|
||||
settings = {
|
||||
version = 1;
|
||||
# Pairing links open our copy of the web app (served by `middleman`)
|
||||
app.baseUrl = "https://paseo.${lib.my.c.pubDomain}";
|
||||
daemon = {
|
||||
# Keep agents from changing modes, answering prompts or opening terminals
|
||||
mcp.injectIntoAgents = false;
|
||||
|
||||
@@ -84,6 +84,13 @@ in
|
||||
inputs.copyparty.overlays.default
|
||||
inputs.hass-west-wood.overlays.default
|
||||
# inputs.pi-agent.overlays.default
|
||||
(final: prev: {
|
||||
# TODO: Drop the override once getpaseo/paseo#7673 is fixed. The build runs npm with
|
||||
# `--ignore-scripts`, so the web UI's `postinstall` patch is never applied.
|
||||
paseo = inputs.paseo.packages.${prev.stdenv.hostPlatform.system}.default.overrideAttrs (old: {
|
||||
preBuild = (old.preBuild or "") + "\nnpm run postinstall\n";
|
||||
});
|
||||
})
|
||||
];
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
|
||||
Reference in New Issue
Block a user