mirror of
https://github.com/cachix/install-nix-action.git
synced 2024-11-23 17:10:53 +00:00
refactor: Format files using Prettier
Actual command: `nix-shell --packages nodePackages.prettier --pure --run 'prettier --write .'`.
This commit is contained in:
parent
ba01fffc51
commit
3d81dbf023
4 changed files with 95 additions and 97 deletions
19
.github/dependabot.yml
vendored
19
.github/dependabot.yml
vendored
|
@ -1,13 +1,12 @@
|
||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
|
- package-ecosystem: github-actions
|
||||||
- package-ecosystem: github-actions
|
directory: "/"
|
||||||
directory: "/"
|
schedule:
|
||||||
schedule:
|
interval: daily
|
||||||
interval: daily
|
time: "00:00"
|
||||||
time: '00:00'
|
timezone: UTC
|
||||||
timezone: UTC
|
open-pull-requests-limit: 10
|
||||||
open-pull-requests-limit: 10
|
commit-message:
|
||||||
commit-message:
|
|
||||||
prefix: "chore"
|
prefix: "chore"
|
||||||
include: "scope"
|
include: "scope"
|
||||||
|
|
134
.github/workflows/test.yml
vendored
134
.github/workflows/test.yml
vendored
|
@ -18,111 +18,111 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- macos-latest
|
- macos-latest
|
||||||
- macos-13
|
- macos-13
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
nix_path: ${{ env.nixpkgs_channel }}
|
nix_path: ${{ env.nixpkgs_channel }}
|
||||||
- run: nix-env -iA cachix -f https://cachix.org/api/v1/install
|
- run: nix-env -iA cachix -f https://cachix.org/api/v1/install
|
||||||
- run: cat /etc/nix/nix.conf
|
- run: cat /etc/nix/nix.conf
|
||||||
# cachix should be available and be able to configure a cache
|
# cachix should be available and be able to configure a cache
|
||||||
- run: cachix use cachix
|
- run: cachix use cachix
|
||||||
- run: nix-build test.nix
|
- run: nix-build test.nix
|
||||||
|
|
||||||
custom-nix-path:
|
custom-nix-path:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- macos-latest
|
- macos-latest
|
||||||
- macos-13
|
- macos-13
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
nix_path: ${{ env.nixpkgs_channel }}
|
nix_path: ${{ env.nixpkgs_channel }}
|
||||||
- run: test $NIX_PATH == '${{ env.nixpkgs_channel }}'
|
- run: test $NIX_PATH == '${{ env.nixpkgs_channel }}'
|
||||||
- run: nix-build test.nix
|
- run: nix-build test.nix
|
||||||
|
|
||||||
extra-nix-config:
|
extra-nix-config:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- macos-latest
|
- macos-latest
|
||||||
- macos-13
|
- macos-13
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
nix_path: ${{ env.nixpkgs_channel }}
|
nix_path: ${{ env.nixpkgs_channel }}
|
||||||
extra_nix_config: |
|
extra_nix_config: |
|
||||||
sandbox = relaxed
|
sandbox = relaxed
|
||||||
- run: cat /etc/nix/nix.conf
|
- run: cat /etc/nix/nix.conf
|
||||||
- run: nix-build test.nix --arg noChroot true
|
- run: nix-build test.nix --arg noChroot true
|
||||||
|
|
||||||
flakes:
|
flakes:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- macos-latest
|
- macos-latest
|
||||||
- macos-13
|
- macos-13
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: ./
|
uses: ./
|
||||||
- run: nix flake show github:NixOS/nixpkgs
|
- run: nix flake show github:NixOS/nixpkgs
|
||||||
|
|
||||||
installer-options:
|
installer-options:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
# - macos-latest missing installer for aarch64-darwin
|
# - macos-latest missing installer for aarch64-darwin
|
||||||
- macos-13
|
- macos-13
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
nix_path: ${{ env.nixpkgs_channel }}
|
nix_path: ${{ env.nixpkgs_channel }}
|
||||||
install_options: --tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve
|
install_options: --tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve
|
||||||
install_url: https://nixos-nix-install-tests.cachix.org/serve/${{ env.pinned_installer_hash }}/install
|
install_url: https://nixos-nix-install-tests.cachix.org/serve/${{ env.pinned_installer_hash }}/install
|
||||||
- run: nix-build test.nix
|
- run: nix-build test.nix
|
||||||
|
|
||||||
oldest-supported-installer:
|
oldest-supported-installer:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- macos-latest
|
- macos-latest
|
||||||
- macos-13
|
- macos-13
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
nix_path: ${{ env.nixpkgs_channel }}
|
nix_path: ${{ env.nixpkgs_channel }}
|
||||||
install_url: https://releases.nixos.org/nix/${{ env.oldest_supported_installer }}/install
|
install_url: https://releases.nixos.org/nix/${{ env.oldest_supported_installer }}/install
|
||||||
- run: nix-build test.nix
|
- run: nix-build test.nix
|
||||||
|
|
||||||
act-support:
|
act-support:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -130,7 +130,7 @@ jobs:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
|
- run: curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
|
||||||
- run: docker pull ghcr.io/catthehacker/ubuntu:js-20.04
|
- run: docker pull ghcr.io/catthehacker/ubuntu:js-20.04
|
||||||
- run: ./bin/act -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:js-20.04 push -j simple-build
|
- run: ./bin/act -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:js-20.04 push -j simple-build
|
||||||
|
|
13
README.md
13
README.md
|
@ -51,12 +51,12 @@ jobs:
|
||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: cachix/install-nix-action@v27
|
- uses: cachix/install-nix-action@v27
|
||||||
with:
|
with:
|
||||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- run: nix build
|
- run: nix build
|
||||||
- run: nix flake check
|
- run: nix flake check
|
||||||
```
|
```
|
||||||
|
|
||||||
To install Nix from any commit, go to [the corresponding installer_test action](https://github.com/NixOS/nix/runs/2219534360) and click on "Run cachix/install-nix-action@XX" step and expand the first line.
|
To install Nix from any commit, go to [the corresponding installer_test action](https://github.com/NixOS/nix/runs/2219534360) and click on "Run cachix/install-nix-action@XX" step and expand the first line.
|
||||||
|
@ -75,7 +75,6 @@ To install Nix from any commit, go to [the corresponding installer_test action](
|
||||||
|
|
||||||
- `enable_kvm`: whether to enable KVM for hardware-accelerated virtualization on Linux. Enabled by default if available.
|
- `enable_kvm`: whether to enable KVM for hardware-accelerated virtualization on Linux. Enabled by default if available.
|
||||||
|
|
||||||
|
|
||||||
## Differences from the default Nix installer
|
## Differences from the default Nix installer
|
||||||
|
|
||||||
Some settings have been optimised for use in CI environments:
|
Some settings have been optimised for use in CI environments:
|
||||||
|
|
26
action.yml
26
action.yml
|
@ -1,28 +1,28 @@
|
||||||
name: 'Install Nix'
|
name: "Install Nix"
|
||||||
description: 'Installs Nix on GitHub Actions for the supported platforms: Linux and macOS.'
|
description: "Installs Nix on GitHub Actions for the supported platforms: Linux and macOS."
|
||||||
author: 'Domen Kožar'
|
author: "Domen Kožar"
|
||||||
inputs:
|
inputs:
|
||||||
extra_nix_config:
|
extra_nix_config:
|
||||||
description: 'Gets appended to `/etc/nix/nix.conf` if passed.'
|
description: "Gets appended to `/etc/nix/nix.conf` if passed."
|
||||||
github_access_token:
|
github_access_token:
|
||||||
description: 'Configure nix to pull from github using the given github token.'
|
description: "Configure nix to pull from github using the given github token."
|
||||||
install_url:
|
install_url:
|
||||||
description: 'Installation URL that will contain a script to install Nix.'
|
description: "Installation URL that will contain a script to install Nix."
|
||||||
install_options:
|
install_options:
|
||||||
description: 'Additional installer flags passed to the installer script.'
|
description: "Additional installer flags passed to the installer script."
|
||||||
nix_path:
|
nix_path:
|
||||||
description: 'Set NIX_PATH environment variable.'
|
description: "Set NIX_PATH environment variable."
|
||||||
enable_kvm:
|
enable_kvm:
|
||||||
description: 'Enable KVM for hardware-accelerated virtualization on Linux, if available.'
|
description: "Enable KVM for hardware-accelerated virtualization on Linux, if available."
|
||||||
required: false
|
required: false
|
||||||
default: true
|
default: true
|
||||||
branding:
|
branding:
|
||||||
color: 'blue'
|
color: "blue"
|
||||||
icon: 'sun'
|
icon: "sun"
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- run : ${GITHUB_ACTION_PATH}/install-nix.sh
|
- run: ${GITHUB_ACTION_PATH}/install-nix.sh
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
INPUT_EXTRA_NIX_CONFIG: ${{ inputs.extra_nix_config }}
|
INPUT_EXTRA_NIX_CONFIG: ${{ inputs.extra_nix_config }}
|
||||||
|
|
Loading…
Reference in a new issue