From 1b9de42a5bba2c4fdf8b41358583022fa78d1f8b Mon Sep 17 00:00:00 2001 From: Neyts Zupan Date: Thu, 10 Aug 2023 12:55:14 +0200 Subject: [PATCH] Support setting nix_path (#2) --- README.md | 18 +++++++++++++++++- nix/action.yml | 10 ++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ddac6ba..878c54c 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,22 @@ This GitHub Action sets nix for use in CI. cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}' ``` +By default, this action assumes that: +* You are using the `niteo` cachix cache. +* You have `./nix/default.nix` in your repo where nix can find nixpkgs. + +You can set your project specific values like so: + +```yaml + - name: Configure nix + uses: teamniteo/gha-actions/nix@main + with: + cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}' + cache: myproject + nix_path: nixpkgs=nixos-unstable +``` + + # Uncommited changes Action This GitHub Action checks if there are uncommited or not ignored files present after the steps ran. @@ -28,4 +44,4 @@ This GitHub Action checks if there are uncommited or not ignored files present a ```yaml - name: Check for uncommitted-changes uses: teamniteo/gha-actions/uncommitted-changes@main -``` \ No newline at end of file +``` diff --git a/nix/action.yml b/nix/action.yml index 6df6f20..2dd4d53 100644 --- a/nix/action.yml +++ b/nix/action.yml @@ -4,18 +4,20 @@ description: derivations to cache inputs: - cache: - default: niteo auth_token: required: true + cache: + default: niteo + nix_path: + default: nixpkgs=./nix/default.nix - runs: using: "composite" steps: - uses: cachix/install-nix-action@v22 with: - nix_path: nixpkgs=channel:nixos-unstable + nix_path: ${{ inputs.nix_path }} + - uses: cachix/cachix-action@v12 with: name: ${{ inputs.cache }}