mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 16:17:46 +00:00
41 lines
810 B
Nix
41 lines
810 B
Nix
{ pkgs, lib, config, ... }:
|
|
let
|
|
cfg = config.mods.server;
|
|
ports = cfg.nginx.ports;
|
|
in with lib; {
|
|
options.mods.server = {
|
|
videos = {
|
|
enable = mkEnableOption {
|
|
default = false;
|
|
description = "enables invidious server";
|
|
};
|
|
};
|
|
|
|
reddit = {
|
|
enable = mkEnableOption {
|
|
default = false;
|
|
description = "enables redlib server";
|
|
};
|
|
};
|
|
};
|
|
|
|
config = {
|
|
services.invidious = mkIf cfg.videos.enable {
|
|
enable = true;
|
|
address = "0.0.0.0";
|
|
port = ports.videos;
|
|
|
|
settings = {
|
|
db.user = "invidious";
|
|
db.dbname = "invidious";
|
|
};
|
|
};
|
|
|
|
services.redlib = mkIf cfg.reddit.enable {
|
|
enable = true;
|
|
openFirewall = true;
|
|
address = "0.0.0.0";
|
|
port = ports.reddit;
|
|
};
|
|
};
|
|
}
|