Skip to content

Commit

Permalink
build nix-darwin in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Sep 14, 2024
1 parent b9a3d30 commit 113bd4a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 78 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,14 @@ jobs:
- uses: cachix/install-nix-action@v27
- uses: DeterminateSystems/magic-nix-cache-action@v8
- run: nix build '.#nixosConfigurations."${{ matrix.machine }}.nixos.org".config.system.build.toplevel'
nix-darwin:
runs-on: macos-latest
strategy:
matrix:
# Doesn't seem that x86_64 is still in use?
machine: [arm64]
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
- uses: DeterminateSystems/magic-nix-cache-action@v8
- run: nix build '.#darwinConfigurations."${{ matrix.machine }}".config.system.build.toplevel'
7 changes: 7 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";

darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};

flake-utils.url = "github:numtide/flake-utils";
treefmt-nix.url = "github:numtide/treefmt-nix";

Expand Down Expand Up @@ -54,6 +60,7 @@
./checks/flake-module.nix
./terraform/flake-module.nix
./non-critical-infra/flake-module.nix
./macs/flake-module.nix
];
};
}
17 changes: 17 additions & 0 deletions macs/flake-module.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ inputs, ... }:
{
flake.darwinConfigurations =
let
mac =
system:
inputs.darwin.lib.darwinSystem {
inherit system;

modules = [ ./nix-darwin.nix ];
};
in
{
arm64 = mac "aarch64-darwin";
x86_64 = mac "x86_64-darwin";
};
}
48 changes: 0 additions & 48 deletions macs/flake.lock

This file was deleted.

30 changes: 0 additions & 30 deletions macs/flake.nix

This file was deleted.

0 comments on commit 113bd4a

Please sign in to comment.