{ lib, config, ... }: let inherit (lib) mkOption mkEnableOption mkForce; inherit (lib.types) types; in { imports = [ ./garage ./mastodon ./pixelfed.nix ./peertube ]; options = { fediversity = { enable = mkEnableOption "the collection of services bundled under Fediversity"; domain = mkOption { type = types.str; 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`. ''; }; pixelfed.enable = mkEnableOption "default Fediversity Pixelfed configuration"; temp = mkOption { description = "options that are only used while developing; should be removed eventually"; default = { }; type = types.submodule { options = { cores = mkOption { description = "number of cores; should be obtained from NixOps4"; type = types.int; }; }; }; }; internal = mkOption { description = "options that are only meant to be used internally; change at your own risk"; default = { }; type = types.submodule { options = { ## 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 pixelfed.domain = mkOption { type = types.str; default = "pixelfed.${config.fediversity.domain}"; }; }; }; }; }; }; 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"; # defaults.server = "https://acme-staging-v02.api.letsencrypt.org/directory"; }; ## NOTE: For a one-machine deployment, this removes the need to provide an ## `s3.garage.` domain. However, this will quickly stop working once ## we go to multi-machines deployment. fediversity.garage.api.domain = mkForce "s3.garage.localhost"; }; }