diff --git a/nixos/modules/services/web-apps/goupile.nix b/nixos/modules/services/web-apps/goupile.nix index 0cb986e1c7f4..2472cc3588a5 100644 --- a/nixos/modules/services/web-apps/goupile.nix +++ b/nixos/modules/services/web-apps/goupile.nix @@ -60,7 +60,8 @@ in hostName = lib.mkOption { type = lib.types.str; - default = "goupile"; + default = config.networking.fqdnOrHostName; + defaultText = lib.literalExpression "config.networking.fqdnOrHostName"; description = "Nginx service name for goupile service."; }; }; @@ -70,7 +71,7 @@ in services.nginx = { enable = lib.mkDefault true; virtualHosts.${cfg.hostName} = { - locations."/".proxyPass = "http://${cfg.hostName}:${builtins.toString cfg.settings.HTTP.Port}"; + locations."/".proxyPass = "http://127.0.0.1:${builtins.toString cfg.settings.HTTP.Port}"; }; }; } diff --git a/nixos/tests/web-apps/goupile/default.nix b/nixos/tests/web-apps/goupile/default.nix index 6826e46b7f7a..06c5ea9dc535 100644 --- a/nixos/tests/web-apps/goupile/default.nix +++ b/nixos/tests/web-apps/goupile/default.nix @@ -73,7 +73,6 @@ in #systemd.services.goupile.environment.DEFAULT_SECCOMP_ACTION = "Log"; # Block|Log|Kill networking = { firewall.allowedTCPPorts = [ config.services.nginx.defaultHTTPListenPort ]; - hostName = "goupile"; domain = "local"; }; @@ -108,7 +107,7 @@ in machine.wait_for_open_port(${port}) machine.succeed("curl -q http://localhost:${port}") - machine.succeed("curl -q http://goupile.local") + machine.succeed("curl -q http://machine.local") machine.succeed("curl -q http://localhost") machine.succeed("run-goupile-test")