From 2e346d1de79f2ee12f2be00f362410f5ef57e26f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=E2=80=9CNiols=E2=80=9D=20Jeannerod?= <nicolas.jeannerod@moduscreate.com> Date: Tue, 25 Feb 2025 11:52:06 +0100 Subject: [PATCH] Move test machines configuration to `test-machines` directory --- infra/flake-part.nix | 76 +-------------------------- infra/test-machines/configuration.nix | 74 ++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 75 deletions(-) create mode 100644 infra/test-machines/configuration.nix diff --git a/infra/flake-part.nix b/infra/flake-part.nix index 4c4e7f3a..784f0941 100644 --- a/infra/flake-part.nix +++ b/infra/flake-part.nix @@ -125,81 +125,7 @@ let "fedi201" ]; - testMachineConfigurations = - let - ## NOTE: All of these secrets are publicly available in this source file - ## and will end up in the Nix store. We don't care as they are only ever - ## used for testing anyway. - mastodonS3KeyConfig = - { pkgs, ... }: - { - s3AccessKeyFile = pkgs.writeText "s3AccessKey" "GK3515373e4c851ebaad366558"; - s3SecretKeyFile = pkgs.writeText "s3SecretKey" "7d37d093435a41f2aab8f13c19ba067d9776c90215f56614adad6ece597dbb34"; - }; - peertubeS3KeyConfig = - { pkgs, ... }: - { - s3AccessKeyFile = pkgs.writeText "s3AccessKey" "GK1f9feea9960f6f95ff404c9b"; - s3SecretKeyFile = pkgs.writeText "s3SecretKey" "7295c4201966a02c2c3d25b5cea4a5ff782966a2415e3a196f91924631191395"; - }; - pixelfedS3KeyConfig = - { pkgs, ... }: - { - s3AccessKeyFile = pkgs.writeText "s3AccessKey" "GKb5615457d44214411e673b7b"; - s3SecretKeyFile = pkgs.writeText "s3SecretKey" "5be6799a88ca9b9d813d1a806b64f15efa49482dbe15339ddfaf7f19cf434987"; - }; - - in - { - test01 = - { pkgs, ... }: - { - fediversity = { - domain = "abundos.eu"; - garage.enable = true; - pixelfed = pixelfedS3KeyConfig { inherit pkgs; }; - mastodon = mastodonS3KeyConfig { inherit pkgs; }; - peertube = peertubeS3KeyConfig { inherit pkgs; }; - }; - }; - - test02 = - { pkgs, ... }: - { - fediversity = { - domain = "abundos.eu"; - mastodon = mastodonS3KeyConfig { inherit pkgs; } // { - enable = true; - }; - - temp.cores = 1; # FIXME: should come from NixOps4 eventually - }; - }; - - test03 = - { pkgs, ... }: - { - fediversity = { - domain = "abundos.eu"; - peertube = peertubeS3KeyConfig { inherit pkgs; } // { - enable = true; - ## NOTE: Only ever used for testing anyway. - secretsFile = pkgs.writeText "secret" "574e093907d1157ac0f8e760a6deb1035402003af5763135bae9cbd6abe32b24"; - }; - }; - }; - - test04 = - { pkgs, ... }: - { - fediversity = { - domain = "abundos.eu"; - pixelfed = pixelfedS3KeyConfig { inherit pkgs; } // { - enable = true; - }; - }; - }; - }; + testMachineConfigurations = import ./test-machines/configuration.nix; in { diff --git a/infra/test-machines/configuration.nix b/infra/test-machines/configuration.nix new file mode 100644 index 00000000..e1a52b5a --- /dev/null +++ b/infra/test-machines/configuration.nix @@ -0,0 +1,74 @@ +let + ## NOTE: All of these secrets are publicly available in this source file + ## and will end up in the Nix store. We don't care as they are only ever + ## used for testing anyway. + mastodonS3KeyConfig = + { pkgs, ... }: + { + s3AccessKeyFile = pkgs.writeText "s3AccessKey" "GK3515373e4c851ebaad366558"; + s3SecretKeyFile = pkgs.writeText "s3SecretKey" "7d37d093435a41f2aab8f13c19ba067d9776c90215f56614adad6ece597dbb34"; + }; + peertubeS3KeyConfig = + { pkgs, ... }: + { + s3AccessKeyFile = pkgs.writeText "s3AccessKey" "GK1f9feea9960f6f95ff404c9b"; + s3SecretKeyFile = pkgs.writeText "s3SecretKey" "7295c4201966a02c2c3d25b5cea4a5ff782966a2415e3a196f91924631191395"; + }; + pixelfedS3KeyConfig = + { pkgs, ... }: + { + s3AccessKeyFile = pkgs.writeText "s3AccessKey" "GKb5615457d44214411e673b7b"; + s3SecretKeyFile = pkgs.writeText "s3SecretKey" "5be6799a88ca9b9d813d1a806b64f15efa49482dbe15339ddfaf7f19cf434987"; + }; + +in +{ + test01 = + { pkgs, ... }: + { + fediversity = { + domain = "abundos.eu"; + garage.enable = true; + pixelfed = pixelfedS3KeyConfig { inherit pkgs; }; + mastodon = mastodonS3KeyConfig { inherit pkgs; }; + peertube = peertubeS3KeyConfig { inherit pkgs; }; + }; + }; + + test02 = + { pkgs, ... }: + { + fediversity = { + domain = "abundos.eu"; + mastodon = mastodonS3KeyConfig { inherit pkgs; } // { + enable = true; + }; + + temp.cores = 1; # FIXME: should come from NixOps4 eventually + }; + }; + + test03 = + { pkgs, ... }: + { + fediversity = { + domain = "abundos.eu"; + peertube = peertubeS3KeyConfig { inherit pkgs; } // { + enable = true; + ## NOTE: Only ever used for testing anyway. + secretsFile = pkgs.writeText "secret" "574e093907d1157ac0f8e760a6deb1035402003af5763135bae9cbd6abe32b24"; + }; + }; + }; + + test04 = + { pkgs, ... }: + { + fediversity = { + domain = "abundos.eu"; + pixelfed = pixelfedS3KeyConfig { inherit pkgs; } // { + enable = true; + }; + }; + }; +}