From 0387f7cba4d9d2cc1993cc79b1da5750403d555c Mon Sep 17 00:00:00 2001 From: emilylange Date: Sun, 10 Aug 2025 20:48:17 +0200 Subject: [PATCH] matrix-authentication-service: fix `http_listener_assets_path_default()` to point to `$out/share/$pname/assets/` instead of `./share/assets/`. This allows one to omit `path =` in ~~~nix { http.listeners = [{ resources = [{ name = "assets"; path = "${pkgs.matrix-authentication-service}/share/matrix-authentication-service/assets"; }]; }]; } ~~~ so it looks like ~~~nix { http.listeners = [{ resources = [ { name = "assets"; } ]; }]; } ~~~ The cause for this was probably just a typo, as we replaced the string in `#[cfg(not(any(feature = "docker", feature = "dist")))]` despite building with `#[cfg(feature = "dist")]`. See https://github.com/element-hq/matrix-authentication-service/blob/v0.20.0/crates/config/src/sections/http.rs#L39-L52 --- pkgs/by-name/ma/matrix-authentication-service/package.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ma/matrix-authentication-service/package.nix b/pkgs/by-name/ma/matrix-authentication-service/package.nix index c7da57cc5d64..d3ea2b2bf12a 100644 --- a/pkgs/by-name/ma/matrix-authentication-service/package.nix +++ b/pkgs/by-name/ma/matrix-authentication-service/package.nix @@ -63,7 +63,7 @@ rustPlatform.buildRustPackage (finalAttrs: { postPatch = '' substituteInPlace crates/config/src/sections/http.rs \ - --replace-fail ./frontend/dist/ "$out/share/$pname/assets/" + --replace-fail ./share/assets/ "$out/share/$pname/assets/" substituteInPlace crates/config/src/sections/templates.rs \ --replace-fail ./share/templates/ "$out/share/$pname/templates/" \ --replace-fail ./share/translations/ "$out/share/$pname/translations/" \ @@ -77,9 +77,10 @@ rustPlatform.buildRustPackage (finalAttrs: { (cd "$npmRoot" && npm run build) ''; - # Adopted from https://github.com/element-hq/matrix-authentication-service/blob/main/Dockerfile + # Adapted from https://github.com/element-hq/matrix-authentication-service/blob/v0.20.0/.github/workflows/build.yaml#L75-L84 postInstall = '' install -Dm444 -t "$out/share/$pname" "policies/policy.wasm" + install -Dm444 -t "$out/share/$pname" "$npmRoot/dist/manifest.json" install -Dm444 -t "$out/share/$pname/assets" "$npmRoot/dist/"* cp -r templates "$out/share/$pname/templates" cp -r translations "$out/share/$pname/translations"