use-nix-action
This action is a composite action that combines multiple common actions when
using Nix
on any Github Action, minimizing the setup. Below
you can see the list of included actions:
More actions will be supported soon.
Inputs
Specify inputs using the with:
keyword in your workflow file.
All regular cachix/install-nix-action
inputs are supported:
-
enable_install_nix_action
: Enablescachix/install-nix-action
. The default istrue
. -
extra_nix_config
: append to/etc/nix/nix.conf
-
github_access_token
: configure Nix to pull from GitHub using the given GitHub token. This helps work around rate limit issues. Has no effect whenaccess-tokens
is also specified inextra_nix_config
. -
install_url
: specify URL to install Nix from (useful for testing non-stable releases or pinning Nix, for example https://releases.nixos.org/nix/nix-2.3.7/install) -
install_options
: additional installer flags passed to the installer script. -
nix_path
: setNIX_PATH
environment variable, for examplenixpkgs=channel:nixos-unstable
All regular aldoborrero/direnv-nix-action
inputs are supported:
-
enable_direnv_nix_action
: Enablescachix/direnv-nix-action
. The default istrue
. -
use_nix_profile
: Optional. Set totrue
to use thenix profile
command instead ofnix-env
for installingdirenv
. The default isfalse
. -
nix_channel
: Optional. Specify the nix channel nix will use to installdirenv
package. The default isnixpkgs
.
Outputs
This action produces no outputs.
Usage
Below is an example of how to use use-nix-action
in a workflow:
name: Example workflow using use-nix-action
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: aldoborrero/use-nix-action@v4
# Add additional steps that utilize the environment variables or binaries sourced from direnv
License
See License for more information.