affine fix styles
runner nix smoke / nix label and flake smoke (push) Failing after 1m55s

This commit is contained in:
2026-10-29 21:43:33 +00:00
parent f52861ffb8
commit e935abd0c3
11 changed files with 666 additions and 15 deletions
+37
View File
@@ -3,6 +3,7 @@
...
}: {
pkgs,
lib,
...
}: let
affineDomain = "affine.${domain}";
@@ -129,7 +130,23 @@
});
compose = "${pkgs.docker-compose}/bin/docker-compose --project-name affine --env-file ${environmentFile} --file ${composeFile}";
frontendStatic = pkgs.hectic.affine-frontend-static;
frontendOverride = (pkgs.formats.yaml {}).generate "affine-frontend-compose.yaml" {
services.affine.volumes = [ "${frontendStatic}:/app/static:ro" ];
};
frontendCompose = "${compose} --file ${frontendOverride}";
in {
assertions = [
{
assertion = lib.hasPrefix "ghcr.io/toeverything/affine:${frontendStatic.version}@sha256:" affineImage;
message = "AFFiNE frontend assets and the deployed backend image must use the same release.";
}
{
assertion = frontendStatic.revision == "b4c8548c09da21b2898443559a5b846f0ccf5dd8";
message = "AFFiNE frontend source revision must match the pinned 0.27.4 backend.";
}
];
systemd.tmpfiles.rules = [
"d ${stateDirectory} 0750 root root -"
"d ${stateDirectory}/data 0750 root root -"
@@ -185,6 +202,26 @@ in {
};
};
# Reconcile only the application container; leave the database and migration job alone.
systemd.services.affine-frontend = {
description = "Source-built AFFiNE frontend assets";
wantedBy = [ "multi-user.target" ];
requires = [ "affine.service" ];
after = [ "affine.service" ];
partOf = [ "affine.service" ];
reloadIfChanged = true;
restartIfChanged = false;
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${frontendCompose} up --detach --no-deps --force-recreate affine";
ExecReload = "${frontendCompose} up --detach --no-deps --force-recreate affine";
ExecStop = "${compose} up --detach --no-deps --force-recreate affine";
TimeoutStartSec = "5min";
TimeoutStopSec = "5min";
};
};
systemd.services.affine-bootstrap = {
description = "Prepare AFFiNE pilot basic authentication";
requiredBy = [ "nginx.service" ];