This GitHub Action will run nix-build
, using the latest
nixos/nix docker image.
It will build one of, in order or preference:
"$@"
if arguments are setnix-build release.nix
if release.nix existsnix-build default.nix
if default.nix exists
Given that this executes in a single-use Docker container, the Nix store is not persistent, and will be lost once the action is over.
The results from running nix-build [release|default].nix
will be
automatically resolved from their symlinks and copied in place in a non-
recursive manner.
This means that release.nix
is expected to not keep reference to the store.
By default, it will use nixos-unstable
as a channel. This is meant to
keep the action "always up to date" even on new NixOS releases.
To configure another channel, set NIX_PATH
accordingly
action "samueldr/action-nix-build@master" {
uses = "samueldr/action-nix-build@master"
env = {
NIX_PATH = "nixpkgs=channel:nixos-18.09"
}
}
See the Nix manual for more information about
NIX_PATH
.
The easiest way to handle this is to use the environment variable that Nixpkgs looks at.
action "samueldr/action-nix-build@master" {
uses = "samueldr/action-nix-build@master"
env = {
NIXPKGS_ALLOW_UNFREE = "1"
}
}