From 3c1ab7cfe41f45ff247b183ac5cf729c6c70c13d Mon Sep 17 00:00:00 2001 From: EdenEast Date: Thu, 5 Oct 2023 16:29:20 -0400 Subject: [PATCH] ci(cachix): build nix env and cache results in cachix --- .github/workflows/nix.yml | 39 +++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + flake.nix | 9 +++++++++ 3 files changed, 49 insertions(+) create mode 100644 .github/workflows/nix.yml diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 0000000..e5e927a --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,39 @@ +name: Nix qmk env +on: + workflow_dispatch: + push: + branches: + - main + paths: + - "**.nix" + - "flake.lock" + - "firmware/*" + +jobs: + build: + strategy: + fail-fast: false + matrix: + - 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-actions@23 + 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 diff --git a/.gitignore b/.gitignore index f9884a6..597f9cc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ firmware/ external/ result/ +result wiki/ diff --git a/flake.nix b/flake.nix index dae2bc4..cdd2cb3 100644 --- a/flake.nix +++ b/flake.nix @@ -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