Skip to content

Commit 80af98f

Browse files
committed
WIP: Add macos.yml workflow
1 parent 14fd9bf commit 80af98f

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/macos.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: NixOS Lima on macOS
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
nixos-sample:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [macos-14]
16+
fail-fast: false
17+
env:
18+
HOST_ARCH: "aarch64"
19+
LIMA_VERSION: "v1.0.2" # Manually set and only used for cache key
20+
LIMA_USER: "lima"
21+
name: NixOS Lima on ${{ matrix.os }}
22+
steps:
23+
- name: Check out code
24+
uses: actions/checkout@v4
25+
26+
- name: Install Nix
27+
uses: cachix/install-nix-action@v30
28+
with:
29+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Install Lima with Nix
32+
run: nix profile install nixpkgs#lima
33+
34+
- name: "Cache ~/.cache/lima"
35+
uses: actions/cache@v4
36+
with:
37+
path: ~/.cache/lima
38+
key: lima-${{ env.LIMA_VERSION }}
39+
40+
- name: "Start an instance of NixOS"
41+
run: |
42+
set -eux
43+
limactl start --name=nixsample --network=lima:user-v2 --set '.user.name = "${{ env.LIMA_USER }}"' nixos.yaml
44+
45+
- name: "Initialize Home Manager"
46+
run: |
47+
set -eux
48+
./setup-home-manager.sh ${{ env.LIMA_USER }}
49+
50+
- name: "Update and Rebuild NixOS"
51+
if: false # Disable for now because this step is timing out
52+
run: |
53+
set -eux
54+
./setup-rebuild-nixos.sh ${{ env.LIMA_USER }}
55+
56+
- name: Upload artifacts
57+
uses: actions/upload-artifact@v4
58+
if: always()
59+
with:
60+
name: artifacts-${{ matrix.os }}-lima-errlog
61+
path: ~/.lima/nixsample/*.log
62+

0 commit comments

Comments
 (0)