diff --git a/nix/gitlab-ci/default.nix b/nix/gitlab-ci/default.nix index d24550578c..ac67348745 100644 --- a/nix/gitlab-ci/default.nix +++ b/nix/gitlab-ci/default.nix @@ -4,7 +4,19 @@ { depot, lib, pkgs, ... }: let - cfg = { + cfg = let + macOS = system: { + stage = "build"; + image = "nixos/nix:latest"; + script = [ + "nix run -f ./ third_party.nixpkgs.bash -c ./hack/populate_secrets.sh" + "nix build -v -f ./ci-root.nix --argstr system ${system} --substituters \"https://cache.nixos.org/ s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1\"" + "nix copy -v --to 's3://lukegb-nix-cache?endpoint=storage.googleapis.com' ./result" + ]; + allow_failure = true; + tags = [ "macos" ]; + }; + in { stages = [ "build" "deploy" ]; nixCache = { @@ -23,17 +35,8 @@ let tags = [ "cacher" ]; }; - nixCacheMacOS = { - stage = "build"; - image = "nixos/nix:latest"; - script = [ - "nix run -f ./ third_party.nixpkgs.bash -c ./hack/populate_secrets.sh" - "nix build -v -f ./ci-root.nix --substituters \"https://cache.nixos.org/ s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1\"" - "nix copy -v --to 's3://lukegb-nix-cache?endpoint=storage.googleapis.com' ./result" - ]; - allow_failure = true; - tags = [ "macos" ]; - }; + nixCacheMacOSIntel = macOS "x86_64-darwin"; + nixCacheMacOSARM = macOS "aarch64-darwin"; } // (lib.mapAttrs deployStage deployMachs); deployMachs = lib.filterAttrs (name: cfg: cfg.config.my.deploy.enable) depot.ops.nixos.systemConfigs;