gpt in affine
runner nix smoke / nix label and flake smoke (push) Failing after 1m12s

This commit is contained in:
2026-11-01 11:21:28 +00:00
parent e935abd0c3
commit 50c4efc09b
30 changed files with 4280 additions and 336 deletions
+41 -5
View File
@@ -67,6 +67,8 @@ in {
inherit inputs;
system = pkgs.stdenv.hostPlatform.system;
nodejs = pkgs.nodejs_22;
# Baseline bundle intentionally excludes independently deployed picker patches.
frontendPatches = [ (flake + "/package/affine/gitea-document-typography.patch") ];
};
defaultText = lib.literalExpression "pkgs.callPackage ./package/affine { ...; }";
description = ''
@@ -78,6 +80,15 @@ in {
'';
};
frontendPackage = lib.mkOption {
type = lib.types.nullOr lib.types.package;
default = null;
description = ''
Optional source-built AFFiNE web, admin, and mobile static assets to
bind over the native server's bundled frontend.
'';
};
environmentFile = lib.mkOption {
type = lib.types.path;
description = ''
@@ -133,10 +144,33 @@ in {
};
config = lib.mkIf cfg.enable {
assertions = [{
assertion = pkgs.stdenv.hostPlatform.system == "x86_64-linux";
message = "hectic.services.affine currently supports only x86_64-linux.";
}];
assertions = [
{
assertion = pkgs.stdenv.hostPlatform.system == "x86_64-linux";
message = "hectic.services.affine currently supports only x86_64-linux.";
}
{
assertion = cfg.frontendPackage == null || (
cfg.package ? version &&
cfg.frontendPackage ? version &&
cfg.frontendPackage.version == cfg.package.version
);
message = "hectic.services.affine.frontendPackage version must match hectic.services.affine.package version.";
}
{
assertion = cfg.frontendPackage == null || (
cfg.package ? frontendStatic &&
cfg.package.frontendStatic ? revision &&
builtins.isString cfg.package.frontendStatic.revision &&
cfg.package.frontendStatic.revision != "" &&
cfg.frontendPackage ? revision &&
builtins.isString cfg.frontendPackage.revision &&
cfg.frontendPackage.revision != "" &&
cfg.frontendPackage.revision == cfg.package.frontendStatic.revision
);
message = "hectic.services.affine.frontendPackage revision must be a non-empty string matching package.frontendStatic.revision.";
}
];
users.groups.affine-native = {};
users.users.affine-native = {
@@ -167,12 +201,14 @@ in {
wantedBy = [ "multi-user.target" ];
environment = commonEnvironment;
preStart = prepareState;
restartTriggers = [ cfg.package initialConfig ];
restartTriggers = [ cfg.package initialConfig ] ++ lib.optional (cfg.frontendPackage != null) cfg.frontendPackage;
serviceConfig = commonServiceConfig // {
Type = "simple";
ExecStart = "${cfg.package}/bin/affine-server";
Restart = "on-failure";
RestartSec = "5s";
BindReadOnlyPaths = lib.optional (cfg.frontendPackage != null)
"${cfg.frontendPackage}:${cfg.package}/share/affine/static";
};
};
};