From fc8e2e74190b70bec8b09da403858e17eba532df Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sat, 9 May 2020 11:14:07 +0100 Subject: [PATCH] ci-root: rework to using linkFarm derivation --- .gitlab-ci.yml | 4 ++-- ci-root.nix | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) 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 +