diff --git a/deployment/default.nix b/deployment/default.nix index 370c2dd6..7c7d89c6 100644 --- a/deployment/default.nix +++ b/deployment/default.nix @@ -30,13 +30,10 @@ ## partially applied only until here. ## Information on the specific deployment that we request. This is the -## information that will come from the FediPanel. -{ - domain, - enableMastodon, - enablePeertube, - enablePixelfed, -}: +## information coming from the FediPanel. +## +## FIXME: lock step the interface with the definitions in the FediPanel +panelConfig: let inherit (lib) mkMerge mkIf; @@ -106,12 +103,12 @@ in mkMerge [ - (mkIf (enableMastodon || enablePeertube || enablePixelfed) { + (mkIf (panelConfig.mastodon.enable || panelConfig.peertube.enable || panelConfig.pixelfed.enable) { garage-configuration = makeConfigurationResource garageConfigurationResource ( { pkgs, ... }: { fediversity = { - inherit domain; + inherit (panelConfig) domain; garage.enable = true; pixelfed = pixelfedS3KeyConfig { inherit pkgs; }; mastodon = mastodonS3KeyConfig { inherit pkgs; }; @@ -121,12 +118,12 @@ in ); }) - (mkIf enableMastodon { + (mkIf panelConfig.mastodon.enable { mastodon-configuration = makeConfigurationResource mastodonConfigurationResource ( { pkgs, ... }: { fediversity = { - inherit domain; + inherit (panelConfig) domain; mastodon = mastodonS3KeyConfig { inherit pkgs; } // { enable = true; }; @@ -137,12 +134,12 @@ in ); }) - (mkIf enablePeertube { + (mkIf panelConfig.peertube.enable { peertube-configuration = makeConfigurationResource peertubeConfigurationResource ( { pkgs, ... }: { fediversity = { - inherit domain; + inherit (panelConfig) domain; peertube = peertubeS3KeyConfig { inherit pkgs; } // { enable = true; ## NOTE: Only ever used for testing anyway. @@ -155,12 +152,12 @@ in ); }) - (mkIf enablePixelfed { + (mkIf panelConfig.pixelfed.enable { pixelfed-configuration = makeConfigurationResource pixelfedConfigurationResource ( { pkgs, ... }: { fediversity = { - inherit domain; + inherit (panelConfig) domain; pixelfed = pixelfedS3KeyConfig { inherit pkgs; } // { enable = true; }; diff --git a/infra/test-machines/configuration.json b/infra/test-machines/configuration.json index 3b2cc6dd..133b7a70 100644 --- a/infra/test-machines/configuration.json +++ b/infra/test-machines/configuration.json @@ -1,6 +1,6 @@ { "domain": "abundos.eu", - "enableMastodon": false, - "enablePeertube": false, - "enablePixelfed": false + "mastodon": { "enable": false }, + "peertube": { "enable": false }, + "pixelfed": { "enable": false } }