diff --git a/fediversity/default.nix b/fediversity/default.nix index 768fb377..96a3d5b0 100644 --- a/fediversity/default.nix +++ b/fediversity/default.nix @@ -68,7 +68,7 @@ in { type = types.int; default = 3902; }; - urlFor = mkOption { + urlForBucket = mkOption { type = types.functionTo types.str; default = bucket: "http://${bucket}.${config.fediversity.internal.garage.web.rootDomain}"; }; diff --git a/fediversity/peertube.nix b/fediversity/peertube.nix index 88d26e11..03e9e716 100644 --- a/fediversity/peertube.nix +++ b/fediversity/peertube.nix @@ -74,17 +74,17 @@ lib.mkIf (config.fediversity.enable && config.fediversity.peertube.enable) { web_videos = rec { bucket_name = "peertube-videos"; prefix = ""; - base_url = config.fediversity.internal.garage.web.urlFor bucket_name; + base_url = config.fediversity.internal.garage.web.urlForBucket bucket_name; }; videos = rec { bucket_name = "peertube-videos"; prefix = ""; - base_url = config.fediversity.internal.garage.web.urlFor bucket_name; + base_url = config.fediversity.internal.garage.web.urlForBucket bucket_name; }; streaming_playlists = rec { bucket_name = "peertube-playlists"; prefix = ""; - base_url = config.fediversity.internal.garage.web.urlFor bucket_name; + base_url = config.fediversity.internal.garage.web.urlForBucket bucket_name; }; }; }; diff --git a/fediversity/pixelfed.nix b/fediversity/pixelfed.nix index c9b48a0a..894b99dc 100644 --- a/fediversity/pixelfed.nix +++ b/fediversity/pixelfed.nix @@ -52,7 +52,7 @@ lib.mkIf (config.fediversity.enable && config.fediversity.pixelfed.enable) { nginx = { forceSSL = true; enableACME = true; - # locations."/public/".proxyPass = "${config.fediversity.internal.garage.web.urlFor "pixelfed"}/public/"; + # locations."/public/".proxyPass = "${config.fediversity.internal.garage.web.urlForBucket "pixelfed"}/public/"; }; }; @@ -68,7 +68,7 @@ lib.mkIf (config.fediversity.enable && config.fediversity.pixelfed.enable) { AWS_ACCESS_KEY_ID = snakeoil_key.id; AWS_SECRET_ACCESS_KEY = snakeoil_key.secret; AWS_DEFAULT_REGION = "garage"; - AWS_URL = config.fediversity.internal.garage.web.urlFor "pixelfed"; + AWS_URL = config.fediversity.internal.garage.web.urlForBucket "pixelfed"; AWS_BUCKET = "pixelfed"; AWS_ENDPOINT = config.fediversity.internal.garage.api.url; AWS_USE_PATH_STYLE_ENDPOINT = false; diff --git a/tests/pixelfed-garage.nix b/tests/pixelfed-garage.nix index b25bc66e..f921c77b 100644 --- a/tests/pixelfed-garage.nix +++ b/tests/pixelfed-garage.nix @@ -202,7 +202,7 @@ pkgs.nixosTest { with subtest("Check that image comes from garage"): src = server.succeed("su - selenium -c 'selenium-script-get-src ${email} ${password}'") - if not src.startswith("${nodes.server.fediversity.internal.garage.web.urlFor "pixelfed"}"): + if not src.startswith("${nodes.server.fediversity.internal.garage.web.urlForBucket "pixelfed"}"): raise Exception("image does not come from garage") ''; }