-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (28 loc) · 1.02 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
build:
strategy:
matrix:
os:
- macos-latest
template:
- templates/minimal
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build ${{ matrix.template }}
run: |
cd ${{ matrix.template }}
# Substitute in the build runner's configuration.
nix run nixpkgs#sd 'username = "username"' 'username = "runner"' flake.nix
nix run nixpkgs#sd 'homeDirectory = "/Users/username"' 'homeDirectory = "/Users/runner"' flake.nix
nix run nixpkgs#sd 'nixpkgs.hostPlatform = "aarch64-darwin"' 'nixpkgs.hostPlatform = "x86_64-darwin"' flake.nix
sudo -i mv /etc/nix/nix.conf /etc/nix/nix.conf.before-nix-darwin
nix run nix-darwin --extra-experimental-features "nix-command flakes" -- switch --flake .#hostname