2024-09-17 17:31:58 +02:00
|
|
|
{ lib, config, ... }:
|
2024-09-17 14:30:59 +02:00
|
|
|
|
|
|
|
let
|
2024-09-24 16:42:53 +02:00
|
|
|
inherit (lib) mkOption mkEnableOption mkForce;
|
2024-09-17 14:30:59 +02:00
|
|
|
inherit (lib.types) types;
|
|
|
|
|
2024-11-11 17:25:42 +01:00
|
|
|
in
|
|
|
|
{
|
2024-09-17 14:30:59 +02:00
|
|
|
imports = [
|
2025-02-14 16:13:43 +01:00
|
|
|
./garage
|
2025-02-14 18:37:48 +01:00
|
|
|
./mastodon
|
2024-09-17 14:30:59 +02:00
|
|
|
./pixelfed.nix
|
2025-02-14 18:44:35 +01:00
|
|
|
./peertube
|
2024-09-17 14:30:59 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
options = {
|
|
|
|
fediversity = {
|
2024-09-20 16:34:08 +02:00
|
|
|
enable = mkEnableOption "the collection of services bundled under Fediversity";
|
2024-09-17 14:30:59 +02:00
|
|
|
|
2024-09-17 17:31:58 +02:00
|
|
|
domain = mkOption {
|
2024-09-20 16:35:21 +02:00
|
|
|
type = types.str;
|
2024-09-20 17:13:35 +02:00
|
|
|
description = ''
|
|
|
|
root domain for the Fediversity services
|
|
|
|
|
|
|
|
For instance, if this option is set to `foo.example.com`, then
|
|
|
|
Pixelfed might be under `pixelfed.foo.example.com`.
|
|
|
|
'';
|
2024-09-17 17:31:58 +02:00
|
|
|
};
|
|
|
|
|
2024-09-20 16:34:08 +02:00
|
|
|
pixelfed.enable = mkEnableOption "default Fediversity Pixelfed configuration";
|
2024-09-17 17:31:58 +02:00
|
|
|
|
2024-11-11 16:16:27 +01:00
|
|
|
temp = mkOption {
|
|
|
|
description = "options that are only used while developing; should be removed eventually";
|
2024-11-11 17:25:42 +01:00
|
|
|
default = { };
|
2024-11-11 16:16:27 +01:00
|
|
|
type = types.submodule {
|
|
|
|
options = {
|
|
|
|
cores = mkOption {
|
|
|
|
description = "number of cores; should be obtained from NixOps4";
|
|
|
|
type = types.int;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-09-20 17:13:35 +02:00
|
|
|
internal = mkOption {
|
|
|
|
description = "options that are only meant to be used internally; change at your own risk";
|
2024-11-11 17:25:42 +01:00
|
|
|
default = { };
|
2024-09-20 17:13:35 +02:00
|
|
|
type = types.submodule {
|
|
|
|
options = {
|
2024-09-20 17:20:31 +02:00
|
|
|
## REVIEW: Do we want to recreate options under
|
|
|
|
## `fediversity.internal` or would we rather use the options from
|
|
|
|
## the respective services? See Taeer's comment:
|
|
|
|
## https://git.fediversity.eu/taeer/simple-nixos-fediverse/pulls/22#issuecomment-124
|
2024-09-20 17:13:35 +02:00
|
|
|
pixelfed.domain = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "pixelfed.${config.fediversity.domain}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-09-17 17:31:58 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-09-20 18:51:21 +02:00
|
|
|
|
|
|
|
config = {
|
|
|
|
## FIXME: This should clearly go somewhere else; and we should have a
|
|
|
|
## `staging` vs. `production` setting somewhere.
|
|
|
|
security.acme = {
|
|
|
|
acceptTerms = true;
|
|
|
|
defaults.email = "nicolas.jeannerod+fediversity@moduscreate.com";
|
2024-09-20 18:55:00 +02:00
|
|
|
# defaults.server = "https://acme-staging-v02.api.letsencrypt.org/directory";
|
2024-09-20 18:51:21 +02:00
|
|
|
};
|
2024-09-24 16:42:53 +02:00
|
|
|
|
|
|
|
## NOTE: For a one-machine deployment, this removes the need to provide an
|
|
|
|
## `s3.garage.<domain>` domain. However, this will quickly stop working once
|
|
|
|
## we go to multi-machines deployment.
|
2025-02-14 18:32:08 +01:00
|
|
|
fediversity.garage.api.domain = mkForce "s3.garage.localhost";
|
2024-09-20 18:51:21 +02:00
|
|
|
};
|
2024-09-17 14:30:59 +02:00
|
|
|
}
|