@cryptotaxi247 / infra / commits / d994cea3

macs: configure cores/jobs per profile

Martin Weinelt committed Jan 16, 2025 at 02:09 UTC d994cea3248fb5eb62cd44ac36d7d95606201edd
5 files changed +24 -10
.github/workflows/ci.yml
+1 -2
@@ -38,8 +38,7 @@ jobs:
38 runs-on: macos-latest
39 strategy:
40 matrix:
41 - # Doesn't seem that x86_64 is still in use?
42 - machine: [arm64]
41 + machine: [m1, m2-large]
42 steps:
43 - uses: actions/checkout@v4
44 - uses: cachix/install-nix-action@v30
macs/common.nix renamed
-4
@@ -48,10 +48,6 @@ in
48 patches = oldAttrs.patches or [ ] ++ [ ./disable-chroot.patch ];
49 });
50 settings = {
51 - # 8C/16G machines means 2C/4G per job on average
52 - cores = 2;
53 - max-jobs = 4;
54 -
51 extra-experimental-features = [
52 "nix-command"
53 "flakes"
macs/flake-module.nix
+7 -4
@@ -3,15 +3,18 @@
3 flake.darwinConfigurations =
4 let
5 mac =
6 - system:
6 + system: entrypoint:
7 inputs.darwin.lib.darwinSystem {
8 inherit system;
9
10 - modules = [ ./nix-darwin.nix ];
10 + modules = [
11 + ./common.nix
12 + entrypoint
13 + ];
14 };
15 in
16 {
14 - arm64 = mac "aarch64-darwin";
15 - x86_64 = mac "x86_64-darwin";
17 + m1 = mac "aarch64-darwin" ./profiles/m1.nix;
18 + m2-large = mac "aarch64-darwin" ./profiles/m2.large.nix;
19 };
20 }
macs/profiles/m1.nix new
+8
@@ -0,0 +1,8 @@
1 +{
2 + # 8 Cores, 16 GB RAM, 256 GB Disk
3 + # split into 4 jobs with 2C/4G
4 + nix.settings = {
5 + cores = 2;
6 + max-jobs = 4;
7 + };
8 +}
macs/profiles/m2.large.nix new
+8
@@ -0,0 +1,8 @@
1 +{
2 + # 8 Cores, 24 GB RAM, 1 TB Disk
3 + # split into 2 jobs with 4C/12G
4 + nix.settings = {
5 + cores = 4;
6 + max-jobs = 2;
7 + };
8 +}