https://github.com/tulip/gha-setup-nix
Reusable action to setup Nix with Tulip's binary cache and other settings.
https://github.com/tulip/gha-setup-nix
Last synced: about 2 months ago
JSON representation
Reusable action to setup Nix with Tulip's binary cache and other settings.
- Host: GitHub
- URL: https://github.com/tulip/gha-setup-nix
- Owner: tulip
- Created: 2023-01-18T20:24:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-08T01:41:48.000Z (over 2 years ago)
- Last Synced: 2025-03-21T05:02:17.255Z (3 months ago)
- Size: 3.91 KB
- Stars: 2
- Watchers: 41
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
# gha-setup-nix
Setup runner environment to use Nix with Tulip credentials and caches.* inputs
** github_pa_token
- description :: GitHub Personal Access Token
- required :: true
- type :: string** yucca_token
- description :: Cachix Yucca Store Token ( Required for =use_cachix= )
- required :: false
- type :: string** nixpkgs_channel
- description :: Nixpkgs Channel for =NIX_PATH=
- required :: true
- type :: string
- default :: =nixpkgs-22.05=** use_cachix
- description :: Whether to use Cachix with Yucca store
- required :: true
- type :: boolean
- default :: =true=* Example Usage
#+BEGIN_SRC yaml
# Boiler plate stuff
name: Example Job
on:
push:
branches:
- main
paths:
- **/*.nix
- **/flake.lock
pull_request:
branches:
- main
paths:
- **/*.nix
- **/flake.lock
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
my-job:
runs-on: ubuntu-latest
steps:
# This is where the magic happens.
# Note that you /should/ really use a full rev SHA instead of a tag.
- uses: tulip/gha-setup-nix@v1
with:
github_pa_token: ${{ secrets.TULIP_BUILD_GITHUB_ACTION_TOKEN }}
yucca_token: ${{ secrets.YUCCA_TOKEN }}
# Lets do a Nix thing. Notice that we don't have to checkout.
# Nix will perform the repo checkout for us with `FLAKE_REF'.
- name: All Checks
id: checks
shell: bash
run: |
set -eu;
set -o pipefail;
FLAKE_REF="github:tulip/my-repo-name/$GITHUB_REF";
echo "Running system independent eval checks:" >&2;
nix flake check \
-L \
--show-trace \
--no-update-lock-file \
"$FLAKE_REF" \
;
echo "Running system dependent build checks:" >&2;
nix flake check \
-L \
--show-trace \
--no-update-lock-file \
--system x86_64-linux \
"$FLAKE_REF" \
;
echo "Great Success" >&2;
#+END_SRC