diff --git a/applications/postbuildstepper/src/main.rs b/applications/postbuildstepper/src/main.rs index 48fa012..c7d89eb 100644 --- a/applications/postbuildstepper/src/main.rs +++ b/applications/postbuildstepper/src/main.rs @@ -52,7 +52,15 @@ fn main() -> anyhow::Result<()> { // copy the store path util::nix_cmd_helper( - ["copy", "--verbose", "--to", ©_destination, &store_path], + [ + "copy", + "--verbose", + "--verbose", + "--verbose", + "--to", + ©_destination, + &store_path, + ], copy_envs.iter().map(|(k, v)| (k, v.path().as_os_str())), )?; info!("successfully pushed store path {store_path}"); diff --git a/modules/flake-parts/packages.postbuildstepper/default.nix b/modules/flake-parts/packages.postbuildstepper/default.nix index 652fefc..d987c10 100644 --- a/modules/flake-parts/packages.postbuildstepper/default.nix +++ b/modules/flake-parts/packages.postbuildstepper/default.nix @@ -2,7 +2,6 @@ # System independent arguments. self, inputs, - lib, ... }: { @@ -11,6 +10,7 @@ # Arguments specific to the `perSystem` context. pkgs, self', + lib, ... }: { @@ -69,7 +69,7 @@ SECRET_cacheHoloHost2secret="testing-2:CoS7sAPcH1M+LD+D/fg9sc1V3uKk88VMHZ/MvAJHsuMSasehxxlUKNa0LUedGgFfA1wlRYF74BNcAldRxX2g8A==" \ SECRET_awsSharedCredentialsFile="~/.aws/credentials" \ PROP_out_path="${pkgs.hello}" \ - nix run .\#postbuildstepper + ${pkgs.lib.getExe' self.packages.${system}.postbuildstepper "postbuildstepper"} ''; }; @@ -98,8 +98,8 @@ { networking.hosts = { "127.0.0.1" = [ - "cache.holo.host" - "s3.wasabisys.com" + s3.bucket + s3.endpoint ]; }; @@ -111,23 +111,36 @@ services.minio = { enable = true; browser = false; - listenAddress = "127.0.0.1:80"; + listenAddress = "127.0.0.1:9000"; rootCredentialsFile = pkgs.writeText "creds" '' MINIO_ROOT_USER=${s3.key} MINIO_ROOT_PASSWORD=${s3.secret} ''; }; + + services.caddy.enable = true; + services.caddy.globalConfig = '' + auto_https off + ''; + services.caddy.virtualHosts.":80" = { + hostName = s3.endpoint; + extraConfig = '' + reverse_proxy http://${config.services.minio.listenAddress} + ''; + }; + + environment.systemPackages = [ pkgs.hello ]; }; }; testScript = '' machine.start() machine.wait_for_unit("minio.service") + machine.wait_for_unit("caddy.service") # TODO: insert credentials and pass them to the test as well machine.succeed("${lib.getExe self'.packages.postbuildstepper-test}", timeout = 10) ''; - }; }; };