diff --git a/m/hut/gitlab-runner.nix b/m/hut/gitlab-runner.nix index 3ea83537..fbbe8c22 100644 --- a/m/hut/gitlab-runner.nix +++ b/m/hut/gitlab-runner.nix @@ -39,9 +39,10 @@ # gitlab.bsc.es still uses the old token mechanism registrationConfigFile = config.age.secrets.gitlab-bsc-docker.path; environmentVariables = { - # We don't have hut in hosts yet... - https_proxy = "http://10.0.40.7:23080"; - http_proxy = "http://10.0.40.7:23080"; + # We cannot access the hut local interface from docker, so we connect + # to hut directly via the ethernet one. + https_proxy = "http://hut:23080"; + http_proxy = "http://hut:23080"; }; executor = "docker"; dockerImage = "alpine"; @@ -50,6 +51,10 @@ "/nix/var/nix/db:/nix/var/nix/db:ro" "/nix/var/nix/daemon-socket:/nix/var/nix/daemon-socket:ro" ]; + dockerExtraHosts = [ + # Required to pass the proxy via hut + "hut:10.0.40.7" + ]; dockerDisableCache = true; preBuildScript = pkgs.writeScript "setup-container" '' mkdir -p -m 0755 /nix/var/log/nix/drvs @@ -62,7 +67,6 @@ mkdir -p -m 0755 /nix/var/nix/profiles/per-user/root mkdir -p -m 0700 "$HOME/.nix-defexpr" mkdir -p -m 0700 "$HOME/.ssh" - echo "10.0.40.7 hut" >> /etc/hosts cat > "$HOME/.ssh/config" << EOF Host bscpm03.bsc.es gitlab-internal.bsc.es User git