Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/nix-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: nix-build-and-cache

on:
pull_request:
paths:
- "flake.nix"
- "flake.lock"
- "hosts/**"
- "modules/**"
- "profiles/**"
- "overlays/**"
- ".github/workflows/nix-cache.yml"
push:
branches:
- main
paths:
- "flake.nix"
- "flake.lock"
- "hosts/**"
- "modules/**"
- "profiles/**"
- "overlays/**"
- ".github/workflows/nix-cache.yml"
workflow_dispatch:

concurrency:
group: nix-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
host:
- x1g9
- x1g13-wsl
- x1g13
- monitor
- dev-1
- service-1

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Install Nix
uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
extra_nix_config: |
accept-flake-config = true

- name: Setup Cachix for PR
if: github.event_name == 'pull_request'
uses: cachix/cachix-action@v17
with:
name: moons-dotfiles
skipPush: true

- name: Setup Cachix for main push
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: cachix/cachix-action@v17
with:
name: moons-dotfiles
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

- name: Build host
run: |
nix build -L .#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
!/overlays/

!renovate.json

!.github/
Loading
Loading