Fediversity/fediversity/default.nix

58 lines
1.2 KiB
Nix
Raw Normal View History

2024-09-17 17:31:58 +02:00
{ lib, config, ... }:
let
2024-09-17 17:31:58 +02:00
inherit (builtins) toString;
inherit (lib) mkOption;
inherit (lib.types) types;
in {
imports = [
./garage.nix
./mastodon.nix
./pixelfed.nix
./peertube.nix
];
options = {
fediversity = {
enable = mkOption {
type = types.bool;
default = false;
};
2024-09-17 17:31:58 +02:00
garage = mkOption {
type = types.anything;
};
domain = mkOption {
type = types.string;
};
mastodon.enable = mkOption { type = types.bool; default = false; };
pixelfed.enable = mkOption { type = types.bool; default = false; };
peertube.enable = mkOption { type = types.bool; default = false; };
};
};
2024-09-17 17:31:58 +02:00
config.fediversity = {
garage = {
api = rec {
domain = "s3.garage.${config.fediversity.domain}";
port = 3900;
url = "http://${domain}:${toString port}";
};
rpc = rec {
port = 3901;
};
web = rec {
rootDomain = "web.garage.${config.fediversity.domain}";
port = 3902;
rootDomainAndPort = "${rootDomain}:${toString port}";
urlFor = bucket: "http://${bucket}.${rootDomainAndPort}";
};
};
};
}