nix/gitlab-ci: add separate pipeline steps for Intel/ARM macOS
This commit is contained in:
parent
c705bf788a
commit
3f184e6323
1 changed files with 15 additions and 12 deletions
|
@ -4,7 +4,19 @@
|
||||||
|
|
||||||
{ depot, lib, pkgs, ... }:
|
{ depot, lib, pkgs, ... }:
|
||||||
let
|
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" ];
|
stages = [ "build" "deploy" ];
|
||||||
|
|
||||||
nixCache = {
|
nixCache = {
|
||||||
|
@ -23,17 +35,8 @@ let
|
||||||
tags = [ "cacher" ];
|
tags = [ "cacher" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixCacheMacOS = {
|
nixCacheMacOSIntel = macOS "x86_64-darwin";
|
||||||
stage = "build";
|
nixCacheMacOSARM = macOS "aarch64-darwin";
|
||||||
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" ];
|
|
||||||
};
|
|
||||||
} // (lib.mapAttrs deployStage deployMachs);
|
} // (lib.mapAttrs deployStage deployMachs);
|
||||||
|
|
||||||
deployMachs = lib.filterAttrs (name: cfg: cfg.config.my.deploy.enable) depot.ops.nixos.systemConfigs;
|
deployMachs = lib.filterAttrs (name: cfg: cfg.config.my.deploy.enable) depot.ops.nixos.systemConfigs;
|
||||||
|
|
Loading…
Reference in a new issue