cachix / install-nix-action

Installs Nix on GitHub Actions for the supported platforms: Linux and macOS.
Apache License 2.0
498 stars 78 forks source link

instal-nix.sh options: KVM support #174

Closed tartavull closed 1 year ago

tartavull commented 1 year ago

Hello,

I've noticed that instal-nix.sh supports certain environmental variables.

home/runner/work/_actions/cachix/install-nix-action/v20/install-nix.sh
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    INPUT_EXTRA_NIX_CONFIG: 
    INPUT_GITHUB_ACCESS_TOKEN: 
    INPUT_INSTALL_OPTIONS: 
    INPUT_INSTALL_URL: 
    INPUT_NIX_PATH: nixpkgs=channel:nixos-unstable
    GITHUB_TOKEN: ***

My github action is failing with

error: a 'x86_64-linux' with features {kvm} is required to build '/nix/store/sj0w8iws6c0ckxc8m3jbzz9navafy3pf-google-compute-image.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, nixos-test, uid-range}

So I was wondering if there was a way to install nix with kvm support by setting some of those environmental variables.

Thank you!

sandydoo commented 1 year ago

@tartavull, you can add system features with extra_nix_config:

- uses: cachix/install-nix-action@v20
  with:
    extra_nix_config: "system-features = nixos-test benchmark big-parallel kvm"
tartavull commented 1 year ago

That worked perfectly, thank you @sandydoo !