From 9c8be0b5a57ee4d6efe759b05c5c7d7074eac65c Mon Sep 17 00:00:00 2001 From: Ben Millwood Date: Sat, 27 Jun 2026 15:22:02 +0100 Subject: [PATCH 1/2] nixos/tests/outline: Switch from VM to container --- nixos/tests/outline.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nixos/tests/outline.nix b/nixos/tests/outline.nix index 15abc22270d4..0956d2607f7b 100644 --- a/nixos/tests/outline.nix +++ b/nixos/tests/outline.nix @@ -7,10 +7,7 @@ xanderio ]; - node.pkgsReadOnly = false; - - nodes.outline = { - virtualisation.memorySize = 2 * 1024; + containers.outline = { services.outline = { enable = true; forceHttps = false; From e774dd9ac0b41959856f03343260324be1a2cad1 Mon Sep 17 00:00:00 2001 From: Ben Millwood Date: Sat, 27 Jun 2026 15:28:37 +0100 Subject: [PATCH 2/2] nixos/outline: fix crash from quoted DATABASE_URL default PR #532600 changed DATABASE_URL to be set via "${DATABASE_URL:-default}" so it can be overridden from the environment. But the default is produced by lib.escapeShellArg, which wraps its value in single quotes. Inside a double-quoted ${VAR:-default} expansion the default undergoes parameter expansion but not quote removal, so the literal single quotes ended up in the connection string. outline then failed to parse it ("Failed to parse: 'postgres://localhost/outline?host=/run/postgresql'") and crashed on every start, never opening its port. Only substitute the default when DATABASE_URL is unset, which keeps escapeShellArg in an unquoted assignment context where the shell strips the quotes as intended. Assisted-by: Claude Code, with Claude Opus 4.8 --- nixos/modules/services/web-apps/outline.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/web-apps/outline.nix b/nixos/modules/services/web-apps/outline.nix index 6046b2005858..bb0ab5f2751c 100644 --- a/nixos/modules/services/web-apps/outline.nix +++ b/nixos/modules/services/web-apps/outline.nix @@ -836,12 +836,18 @@ in ${ if (cfg.databaseUrl == "local") then '' - export DATABASE_URL="''${DATABASE_URL:-${lib.escapeShellArg localPostgresqlUrl}}" + if [ -z "''${DATABASE_URL:-}" ]; then + DATABASE_URL=${lib.escapeShellArg localPostgresqlUrl} + fi + export DATABASE_URL export PGSSLMODE="''${PGSSLMODE:-disable}" '' else '' - export DATABASE_URL="''${DATABASE_URL:-${lib.escapeShellArg cfg.databaseUrl}}" + if [ -z "''${DATABASE_URL:-}" ]; then + DATABASE_URL=${lib.escapeShellArg cfg.databaseUrl} + fi + export DATABASE_URL '' }