diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f8538364d8..0caee890b2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,8 +5,8 @@ nixCache: - "cp ${OPS_SECRETS_DEFAULT_NIX} ops/secrets/default.nix" - "test -d cache || mkdir cache" - "nix-build ./ci-root.nix --option substituters \"file://$PWD/cache?trusted=1 https://cache.nixos.org s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1\"" - - "nix copy --to 'file://cache' -f ./ci-root.nix" - - "nix copy --to 's3://lukegb-nix-cache?endpoint=storage.googleapis.com' -f ./ci-root.nix" + - "nix copy --to 'file://cache' ./result" + - "nix copy --to 's3://lukegb-nix-cache?endpoint=storage.googleapis.com' ./result" cache: key: one-key-to-rule-them-all paths: diff --git a/ci-root.nix b/ci-root.nix index 89a002fdab..93cdbd6730 100644 --- a/ci-root.nix +++ b/ci-root.nix @@ -1,3 +1,10 @@ -with (import ./default.nix {}); [ - ops.nixos -] +let + depot = (import ./default.nix {}); + pkgs = depot.third_party.nixpkgs; + lib = pkgs.lib; + prefixAttrs = prefix: lib.mapAttrsToList (name: value: { name = "${prefix}-${name}"; path = value; }); + ciMachines = prefixAttrs "machine" depot.ops.nixos; + ciPackages = prefixAttrs "pkg" depot.nix.pkgs; +in +pkgs.linkFarm "ci" ciMachines +