Fediversity/fediversity/default.nix

59 lines
1.4 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;
2024-09-20 16:34:08 +02:00
inherit (lib) mkOption mkEnableOption;
inherit (lib.types) types;
in {
imports = [
./garage.nix
./mastodon.nix
./pixelfed.nix
./peertube.nix
];
options = {
fediversity = {
2024-09-20 16:34:08 +02:00
enable = mkEnableOption "the collection of services bundled under Fediversity";
2024-09-17 17:31:58 +02:00
garage = mkOption {
type = types.anything;
};
domain = mkOption {
type = types.string;
};
2024-09-20 16:34:08 +02:00
mastodon.enable = mkEnableOption "default Fediversity Mastodon configuration";
pixelfed.enable = mkEnableOption "default Fediversity Pixelfed configuration";
peertube.enable = mkEnableOption "default Fediversity PeerTube configuration";
};
};
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}";
};
};
2024-09-17 17:58:09 +02:00
pixelfed.domain = "pixelfed.${config.fediversity.domain}";
mastodon.domain = "mastdodon.${config.fediversity.domain}";
peertube.domain = "peertube.${config.fediversity.domain}";
2024-09-17 17:31:58 +02:00
};
}