ci-root: rework to using linkFarm derivation

This commit is contained in:
Luke Granger-Brown 2020-05-09 11:14:07 +01:00
parent 5b96c181b2
commit fc8e2e7419
2 changed files with 12 additions and 5 deletions

View file

@ -5,8 +5,8 @@ nixCache:
- "cp ${OPS_SECRETS_DEFAULT_NIX} ops/secrets/default.nix" - "cp ${OPS_SECRETS_DEFAULT_NIX} ops/secrets/default.nix"
- "test -d cache || mkdir cache" - "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-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 'file://cache' ./result"
- "nix copy --to 's3://lukegb-nix-cache?endpoint=storage.googleapis.com' -f ./ci-root.nix" - "nix copy --to 's3://lukegb-nix-cache?endpoint=storage.googleapis.com' ./result"
cache: cache:
key: one-key-to-rule-them-all key: one-key-to-rule-them-all
paths: paths:

View file

@ -1,3 +1,10 @@
with (import ./default.nix {}); [ let
ops.nixos 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