Skip to content

Commit

Permalink
ci(cachix): build nix env and cache results in cachix
Browse files Browse the repository at this point in the history
  • Loading branch information
EdenEast committed Oct 5, 2023
1 parent 64869cc commit b116add
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Nix qmk env
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "**.nix"
- "flake.lock"
- "firmware/*"

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubunto-latest
target: x86_64-linux
- os: macos-latest
target: x86_64-darwin
runs-on: ${{ matrix.os }}
steps:
- name: Setup | Checkout
uses: actions/checkout@v4

- name: Setup | Install nix
uses: cachix/install-nix-action@v23
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Setup | Install cachix
uses: cachix/cachix-action@12
with:
name: edeneast
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

- name: Build | Environment
run: nix build .#devShells.${{ matrix.target }}.default
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
firmware/
external/
result/
result
wiki/
9 changes: 9 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
};
};

nixConfig = {
extra-substituters = [
"https://edeneast-qmk-firmware.cachix.org"
];
extra-trusted-public-keys = [
"edeneast-qmk-firmware.cachix.org-1:lZ1aALkZD5qlipgrCqrJbYUAmwm6ED04fAnG23QqQaQ="
];
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
Expand Down

0 comments on commit b116add

Please sign in to comment.