mirror of
https://github.com/versia-pub/activitypub.git
synced 2025-12-06 06:38:20 +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; } {
|
||||
systems = import inputs.systems;
|
||||
flake = {
|
||||
nixosModules = {
|
||||
default = {
|
||||
imports = [ ./module.nix ];
|
||||
nixpkgs.overlays = [ self.overlays.default ];
|
||||
};
|
||||
nixosModules = {
|
||||
default = {
|
||||
imports = [ ./module.nix ];
|
||||
nixpkgs.overlays = [ self.overlays.default ];
|
||||
};
|
||||
};
|
||||
};
|
||||
imports = [
|
||||
inputs.treefmt-nix.flakeModule
|
||||
|
|
|
|||
45
module.nix
45
module.nix
|
|
@ -43,30 +43,31 @@ let
|
|||
ensureDatabases = lib.singleton cfg.settings.db.dbname;
|
||||
};
|
||||
};
|
||||
nginxConfig = lib.mkIf cfg.nginx.enable {
|
||||
services.nginx = let
|
||||
ip = if cfg.address == "0.0.0.0" then "127.0.0.1" else cfg.address;
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
virtualHosts.${cfg.domain} = {
|
||||
locations."/".proxyPass =
|
||||
if cfg.serviceScale == 1 then
|
||||
"http://${ip}:${toString cfg.port}"
|
||||
else "http://upstream-invidious";
|
||||
nginxConfig = lib.mkIf cfg.nginx.enable {
|
||||
services.nginx =
|
||||
let
|
||||
ip = if cfg.address == "0.0.0.0" then "127.0.0.1" else cfg.address;
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
virtualHosts.${cfg.domain} = {
|
||||
locations."/".proxyPass =
|
||||
if cfg.serviceScale == 1 then
|
||||
"http://${ip}:${toString cfg.port}"
|
||||
else "http://upstream-invidious";
|
||||
|
||||
enableACME = lib.mkDefault true;
|
||||
forceSSL = lib.mkDefault true;
|
||||
enableACME = 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 = [{
|
||||
assertion = cfg.domain != null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue