mirror of
https://github.com/versia-pub/activitypub.git
synced 2025-12-06 14:48:19 +01:00
chore: format
This commit is contained in:
parent
22547e64ce
commit
32ba6d0d1e
10
flake.nix
10
flake.nix
|
|
@ -17,12 +17,12 @@
|
||||||
inputs.flake-parts.lib.mkFlake { inherit inputs self; } {
|
inputs.flake-parts.lib.mkFlake { inherit inputs self; } {
|
||||||
systems = import inputs.systems;
|
systems = import inputs.systems;
|
||||||
flake = {
|
flake = {
|
||||||
nixosModules = {
|
nixosModules = {
|
||||||
default = {
|
default = {
|
||||||
imports = [ ./module.nix ];
|
imports = [ ./module.nix ];
|
||||||
nixpkgs.overlays = [ self.overlays.default ];
|
nixpkgs.overlays = [ self.overlays.default ];
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
imports = [
|
imports = [
|
||||||
inputs.treefmt-nix.flakeModule
|
inputs.treefmt-nix.flakeModule
|
||||||
|
|
|
||||||
45
module.nix
45
module.nix
|
|
@ -43,30 +43,31 @@ let
|
||||||
ensureDatabases = lib.singleton cfg.settings.db.dbname;
|
ensureDatabases = lib.singleton cfg.settings.db.dbname;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
nginxConfig = lib.mkIf cfg.nginx.enable {
|
nginxConfig = lib.mkIf cfg.nginx.enable {
|
||||||
services.nginx = let
|
services.nginx =
|
||||||
ip = if cfg.address == "0.0.0.0" then "127.0.0.1" else cfg.address;
|
let
|
||||||
in
|
ip = if cfg.address == "0.0.0.0" then "127.0.0.1" else cfg.address;
|
||||||
{
|
in
|
||||||
enable = true;
|
{
|
||||||
virtualHosts.${cfg.domain} = {
|
enable = true;
|
||||||
locations."/".proxyPass =
|
virtualHosts.${cfg.domain} = {
|
||||||
if cfg.serviceScale == 1 then
|
locations."/".proxyPass =
|
||||||
"http://${ip}:${toString cfg.port}"
|
if cfg.serviceScale == 1 then
|
||||||
else "http://upstream-invidious";
|
"http://${ip}:${toString cfg.port}"
|
||||||
|
else "http://upstream-invidious";
|
||||||
|
|
||||||
enableACME = lib.mkDefault true;
|
enableACME = lib.mkDefault true;
|
||||||
forceSSL = lib.mkDefault true;
|
forceSSL = lib.mkDefault true;
|
||||||
|
};
|
||||||
|
upstreams = lib.mkIf (cfg.serviceScale > 1) {
|
||||||
|
"upstream-invidious".servers = builtins.listToAttrs (builtins.genList
|
||||||
|
(scaleIndex: {
|
||||||
|
name = "${ip}:${toString (cfg.port + scaleIndex)}";
|
||||||
|
value = { };
|
||||||
|
})
|
||||||
|
cfg.serviceScale);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
upstreams = lib.mkIf (cfg.serviceScale > 1) {
|
|
||||||
"upstream-invidious".servers = builtins.listToAttrs (builtins.genList
|
|
||||||
(scaleIndex: {
|
|
||||||
name = "${ip}:${toString (cfg.port + scaleIndex)}";
|
|
||||||
value = { };
|
|
||||||
})
|
|
||||||
cfg.serviceScale);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
assertions = [{
|
assertions = [{
|
||||||
assertion = cfg.domain != null;
|
assertion = cfg.domain != null;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue