2023-10-06 13:48:52 +02:00
|
|
|
{ config, ... }: let
|
|
|
|
cfg = config.services.invidious;
|
|
|
|
in {
|
2023-05-08 01:51:02 +02:00
|
|
|
sops.secrets."postgres/invidious" = {
|
|
|
|
restartUnits = [ "invidious.service" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
services.invidious = {
|
|
|
|
enable = true;
|
|
|
|
domain = "yt.nani.wtf";
|
|
|
|
|
|
|
|
port = 19283;
|
|
|
|
|
2023-07-12 23:38:41 +02:00
|
|
|
# This will implicitly use unix socket
|
2023-05-08 01:51:02 +02:00
|
|
|
database = {
|
|
|
|
createLocally = true;
|
|
|
|
passwordFile = config.sops.secrets."postgres/invidious".path;
|
|
|
|
};
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
registration_enabled = false;
|
2023-07-12 02:01:08 +02:00
|
|
|
host_binding = "127.0.0.1";
|
2023-05-08 01:51:02 +02:00
|
|
|
# popular_enabled = false;
|
|
|
|
};
|
|
|
|
};
|
2023-10-06 13:48:52 +02:00
|
|
|
|
|
|
|
local.socketActivation.invidious = {
|
|
|
|
enable = cfg.enable;
|
|
|
|
originalSocketAddress = "${cfg.settings.host_binding}:${toString cfg.port}";
|
|
|
|
newSocketAddress = "/run/invidious.sock";
|
|
|
|
privateNamespace = false;
|
|
|
|
};
|
2023-05-08 01:51:02 +02:00
|
|
|
}
|
|
|
|
|