diff --git a/flake.nix b/flake.nix index cdaeb4c..6a5bd50 100644 --- a/flake.nix +++ b/flake.nix @@ -80,11 +80,15 @@ $NIX_EXTRA_CONF " echo -e "\\e[0Ksection_end:`date +%s`:nix_setup\\r\\e[0K" - - echo -e "\\e[0Ksection_start:`date +%s`:nix_deps[collapsed=true]\\r\\e[0KFetching deps for job" - nix build .#gitlab-ci-job-deps:$1 - source $(readlink -f result) - echo -e "\\e[0Ksection_end:`date +%s`:nix_deps\\r\\e[0K" + ${ + "" # load the job's deps only if the name was passed + } + if [[ ! -z $1 ]]; then + echo -e "\\e[0Ksection_start:`date +%s`:nix_deps[collapsed=true]\\r\\e[0KFetching deps for job" + nix build .#gitlab-ci-job-deps:$1 + source $(readlink -f result) + echo -e "\\e[0Ksection_end:`date +%s`:nix_deps\\r\\e[0K" + fi ''; finalizeScript = push_command: pkgs.writeShellScriptBin "finalize_nix_ci" '' diff --git a/gitlab-ci.yml b/gitlab-ci.yml index a96107b..66f9699 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -10,14 +10,15 @@ stages: nix-ci:build: stage: build image: registry.gitlab.com/technofab/nix-gitlab-ci/nix-ci:${NIX_CI_IMAGE_TAG} + before_script: + - source setup_nix_ci script: # build the generated-gitlab-ci.yml - nix build .#gitlab-ci-config - install result generated-gitlab-ci.yml after_script: # upload to binary cache - - echo $(nix-store --query --references result) - # TODO: upload deps using cachix or attic + - finalize_nix_ci artifacts: paths: - generated-gitlab-ci.yml