From e7b609a7f71dcd65cc32d756eecae23a9869a355 Mon Sep 17 00:00:00 2001 From: Jo Date: Mon, 26 May 2025 18:41:25 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Add=20install-lix=20action=20and?= =?UTF-8?q?=20build=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/install-lix/action.yml | 17 +++++++++++++ .github/workflows/build.yml | 34 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/actions/install-lix/action.yml create mode 100644 .github/workflows/build.yml diff --git a/.github/actions/install-lix/action.yml b/.github/actions/install-lix/action.yml new file mode 100644 index 0000000..c41afc1 --- /dev/null +++ b/.github/actions/install-lix/action.yml @@ -0,0 +1,17 @@ +# Taken from: https://github.com/isabelroses/dotfiles/blob/9335e5728eaaa9bdcb0d5c3130a5d7c8dddbb6e3/.github/actions/install-lix/action.yml :3 +name: Install Lix +description: "Install Lix for the specified system" + +runs: + using: composite + + steps: + - uses: DeterminateSystems/nix-installer-action@main + with: + source-url: 'https://install.lix.systems/lix/lix-installer-${{ fromJSON(''{"X64":"x86_64","X86":"i686","ARM64":"aarch64","ARM":"armv7l"}'')[runner.arch] }}-${{ fromJSON(''{"Linux":"linux","macOS":"darwin","Windows":"windows"}'')[runner.os] }}' + logger: pretty + diagnostic-endpoint: "" + extra-conf: | + experimental-features = flakes nix-command + substituters = https://nix-community.cachix.org https://catppuccin.cachix.org https://cache.nixos.org/ + trusted-public-keys = nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= catppuccin.cachix.org-1:noG/4HkbhJb+lUAdKrph6LaozJvAeEEZj4N732IysmU= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..89e9108 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: "Nix: build and cache outputs" + +on: + workflow_dispatch: + push: + paths: + - "**.nix" + - "**.lock" + - ".github/workflows/build.yml" + +jobs: + build-flake: + name: Build (x86_64-linux) + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.ref_name }} + persist-credentials: false + + - name: Install Lix + uses: ./.github/actions/install-lix + + - name: Setup Attic cache + uses: ryanccn/attic-action@v0.3.2 + with: + endpoint: https://cache.thevoid.cafe + cache: puzzlevision + token: ${{ secrets.ATTIC_TOKEN }} + + - name: Build flake + run: nix build