feat: add wireguard client module #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from: | |
# https://lgug2z.com/articles/building-and-privately-caching-x86-and-aarch64-nixos-systems-on-github-actions/ | |
name: "build" | |
on: | |
- push | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
# Here we specify the matrix of our hosts and their target platform architectures | |
matrix: | |
machine: | |
- host: bro | |
platform: x86-64-linux | |
- host: hera | |
platform: x86-64-linux | |
- host: phobos | |
platform: x86-64-linux | |
steps: | |
- uses: actions/checkout@v4 | |
# We only run this if we are building an aarch64-linux system | |
- if: matrix.machine.platform == 'aarch64-linux' | |
uses: docker/setup-qemu-action@v3 | |
# We make our netrc file that is used to make authorized requests to Attic | |
# We also make sure that we use our custom GitHub token if we need to clone submodules or anything like that | |
- run: | | |
sudo mkdir -p /etc/nix | |
echo "machine nix-cache.diogotc.com password ${{ secrets.ATTIC_TOKEN }}" | sudo tee /etc/nix/netrc > /dev/null | |
- uses: DeterminateSystems/nix-installer-action@main | |
with: | |
# We add all the config for extra platforms, other binary caches and to raise the number of connections that can be made | |
extra-conf: | | |
fallback = true | |
http-connections = 128 | |
max-substitution-jobs = 128 | |
extra-platforms = i686-linux aarch64-linux | |
substituters = https://nix-cache.diogotc.com/dtc?priority=43 https://cache.nixos.org/ | |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= dtc:HU5hQrzlNDSFAcA/kvzKx+IhyDYLvR+xUS/1drh3o2U= | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
# We build each system in a separate job, targeting the configuration using matrix.machine.host | |
# Once built, we login to Attic and push the built system to our `system` cache! | |
- name: Build and push system | |
run: | | |
nix build .#nixosConfigurations.${{ matrix.machine.host }}.config.system.build.toplevel | |
nix run github:zhaofengli/attic#default login phobos https://nix-cache.diogotc.com ${{ secrets.ATTIC_TOKEN }} | |
nix run github:zhaofengli/attic#default push dtc result -j 2 |