All Projects → cachix → Install Nix Action

cachix / Install Nix Action

Licence: apache-2.0
Installs Nix on GitHub Actions for the supported platforms: Linux and macOS.

Programming Languages

shell
77523 projects

Labels

Projects that are alternatives of or similar to Install Nix Action

Nixwrt
Build images for embedded MIPS SoCs using NixPkgs (experimental)
Stars: ✭ 111 (-15.91%)
Mutual labels:  nix
Hie Nix
Nix packages for Haskell IDE Engine
Stars: ✭ 118 (-10.61%)
Mutual labels:  nix
Dotfiles
Configuration files for XMonad, Emacs, NixOS, Taffybar and more.
Stars: ✭ 127 (-3.79%)
Mutual labels:  nix
Nix Config
My NixOS configuration
Stars: ✭ 112 (-15.15%)
Mutual labels:  nix
Docker
Dockerfiles to package Nix in a minimal docker container
Stars: ✭ 114 (-13.64%)
Mutual labels:  nix
Wasm Cross
Nix expressions for cross compiling to WebAssembly
Stars: ✭ 122 (-7.58%)
Mutual labels:  nix
Yarn2nix
Generate nix expressions from a yarn.lock file [maintainer=???]
Stars: ✭ 110 (-16.67%)
Mutual labels:  nix
Zsh Nix Shell
zsh plugin that lets you use zsh in nix-shell shells.
Stars: ✭ 130 (-1.52%)
Mutual labels:  nix
Mbp Nixos
Instructions and scripts related to getting NixOS running on a newer generation MBP
Stars: ✭ 115 (-12.88%)
Mutual labels:  nix
Micro Ci
A tiny CI server built around GitHub and Nix
Stars: ✭ 126 (-4.55%)
Mutual labels:  nix
Flake Utils
Pure Nix flake utility functions
Stars: ✭ 113 (-14.39%)
Mutual labels:  nix
Nix Emacs Ci
Emacs installations for continuous integration
Stars: ✭ 114 (-13.64%)
Mutual labels:  nix
Crate2nix
nix build file generator for rust crates
Stars: ✭ 123 (-6.82%)
Mutual labels:  nix
Nix Deploy
Deploy software or an entire NixOS system configuration to another NixOS system
Stars: ✭ 111 (-15.91%)
Mutual labels:  nix
Devshell
Per project developer environments
Stars: ✭ 129 (-2.27%)
Mutual labels:  nix
Nixos Config
My NixOS configuration files. (This public mirror is not updated anymore.)
Stars: ✭ 110 (-16.67%)
Mutual labels:  nix
Nixgl
A wrapper tool for nix OpenGL application
Stars: ✭ 120 (-9.09%)
Mutual labels:  nix
Nix Doom Emacs
doom-emacs packaged for Nix
Stars: ✭ 132 (+0%)
Mutual labels:  nix
Nixos Manager
Manage your NixOS packages and configuration via a simple, intuitive UI
Stars: ✭ 128 (-3.03%)
Mutual labels:  nix
Dotfiles
My small loan of configuration files and scripts - based on NixOS
Stars: ✭ 124 (-6.06%)
Mutual labels:  nix

install-nix-action

github actions badge

Installs Nix on GitHub Actions for the supported platforms: Linux and macOS.

By default it has no nixpkgs configured, you have to set nix_path by picking a channel or pin nixpkgs yourself (see also pinning tutorial).

Features

  • Quick installation (~4s on Linux, ~20s on macOS)
  • Multi-User installation (with sandboxing enabled only on Linux)
  • Self-hosted github runner support
  • Allows specifying Nix installation URL via install_url
  • Allows specifying extra Nix configration options via extra_nix_config
  • Allows specifying $NIX_PATH and channels via nix_path
  • Share /nix/store between builds using cachix-action for simple binary cache setup to speed up your builds and share binaries with your team

Usage

Create .github/workflows/test.yml in your repo with the following contents:

name: "Test"
on:
  pull_request:
  push:
jobs:
  tests:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/[email protected]
    - uses: cachix/[email protected]
      with:
        nix_path: nixpkgs=channel:nixos-unstable
    - run: nix-build

Usage with Flakes

name: "Test"
on:
  pull_request:
  push:
jobs:
  tests:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/[email protected]
      with:
          # Nix Flakes doesn't work on shallow clones
          fetch-depth: 0
    - uses: cachix/[email protected]
      with:
        install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20201221_9fab14a/install
        extra_nix_config: |
          experimental-features = nix-command flakes
    - run: nix-build

Inputs (specify using with:)

  • 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)

  • nix_path: set NIX_PATH environment variable, for example nixpkgs=channel:nixos-unstable

  • extra_nix_config: append to /etc/nix/nix.conf


FAQ

Is it possible to run NixOS tests / Qemu+KVM with GitHub Actions?

Currently GitHub Actions are not running on Azure instance types that support nested virtualization.

How do I print nixpkgs version I have configured?

nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'

How can I run NixOS tests?

With the following inputs:

    - uses: cachix/[email protected]
      with:
        extra_nix_config: "system-features = nixos-test benchmark big-parallel kvm"

Note that there's no hardware acceleration on GitHub Actions.

How can I install packages via nix-env from the specified nix_path?

nix-env -i mypackage -f '<nixpkgs>'

Hacking

Install the dependencies

$ yarn install

Build the typescript

$ yarn build

Run the tests ✔️

$ yarn test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].