summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-26 14:06:33 +0100
committerRory& <root@rory.gay>2025-12-26 14:06:33 +0100
commita191dac72278639427cca9d3f294435e6ae945f6 (patch)
treeca882dd3e9db2c71fe00def35b4094f519107259
parentIgnore empty ASN type/ID in register (diff)
downloadserver-ts-a191dac72278639427cca9d3f294435e6ae945f6.tar.xz
Nix: expose CDN path option
-rw-r--r--nix/modules/default/default.nix22
1 files changed, 17 insertions, 5 deletions
diff --git a/nix/modules/default/default.nix b/nix/modules/default/default.nix

index 2c8594f5..73acadc4 100644 --- a/nix/modules/default/default.nix +++ b/nix/modules/default/default.nix
@@ -71,6 +71,10 @@ in apiEndpoint = mkEndpointOptions "api.sb.localhost" 3001; gatewayEndpoint = mkEndpointOptions "gateway.sb.localhost" 3003; cdnEndpoint = mkEndpointOptions "cdn.sb.localhost" 3003; + cdnPath = lib.mkOption { + type = lib.types.nullOr lib.types.str; + description = "Path to store CDN files."; + }; extraEnvironment = lib.mkOption { default = { }; @@ -154,7 +158,7 @@ in UMask = "077"; # WorkingDirectory = "/var/lib/spacebarchat-server/"; } - // lib.optionalAttrs (cfg.databaseFile != null) { EnvironmentFile = cfg.databaseFile; }; + // lib.optionalAttrs (cfg.databaseFile != null) { EnvironmentFile = cfg.databaseFile; }; } conf) { } @@ -162,10 +166,10 @@ in in { assertions = [ -# { -# assertion = !((cfg.extraEnvironment.THREADS > 1) && !config.services.rabbitmq.enable); -# message = "Make sure you've setup RabbitMQ when using more than one thread with Spacebar"; -# } + # { + # assertion = !((cfg.extraEnvironment.THREADS > 1) && !config.services.rabbitmq.enable); + # message = "Make sure you've setup RabbitMQ when using more than one thread with Spacebar"; + # } ]; systemd.tmpfiles.rules = [ "d /run/spacebarchat 0750 spacebar spacebar" ]; @@ -224,6 +228,14 @@ in CONFIG_PATH = configFile; CONFIG_READONLY = 1; } + // ( + if cfg.cdnPath != null then + { + CDN_PATH = cfg.cdnPath; + } + else + { } + ) ); serviceConfig = { ExecStart = "${cfg.package}/bin/start-cdn";