Sorry for bumping an old thread, but it came out first in my Google results, so I thought I’d add my two cents. Thank you so much for the sample, @rmcgibbo; that helped a lot! The Nix options can now be declared in cachix/install-nix-action
with an extra_nix_config
input, so one can avoid written themselves to /etc/nix/nix.conf
or passing arguments to the Nix commands. The following minimal example works like a charm for my use case (building a NixOS configuration for an ARM machine):
jobs:
aarch64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt-get install -y qemu-user-static
- uses: cachix/install-nix-action@v21
with:
extra_nix_config: |
system = aarch64-linux
- name: Build
run: nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel