-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 1.55 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check
run: |
nix flake check ./dev
build:
strategy:
matrix:
os:
- macos-14
template:
- templates/minimal
- templates/simple-macos
- templates/expose-configuration
runs-on: ${{ matrix.os }}
env:
NIX_CONFIG: extra-access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- name: Build ${{ matrix.template }}
shell: zsh {0}
run: |
cd ${{ matrix.template }}
# Substitute in the build runner's configuration.
nix run nixpkgs#sd 'nix-machine.url = "github:squirmy/nix-machine"' 'nix-machine.url = "github:squirmy/nix-machine/${{ github.sha }}"' flake.nix
nix run nixpkgs#sd 'username = "username"' 'username = "runner"' flake.nix
nix run nixpkgs#sd 'homeDirectory = "/Users/username"' 'homeDirectory = "/Users/runner"' flake.nix
sudo -i mv /etc/nix/nix.conf /etc/nix/nix.conf.before-nix-darwin
sudo -i mv /etc/shells /etc/shells.before-nix-darwin
nix run nix-darwin --extra-experimental-features "nix-command flakes" -- switch --flake .#hostname
source /etc/zshenv
fortune