-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic Nix build action #336
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Left some general feedback. Might want another reviewer more familiar with nix to review those specific steps though.
default: "" | ||
cache-privkey: | ||
description: "Nix cache binary private signing key - not used if setup-only=true" | ||
required: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we enforce signing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose to enforce we could add a check where if setup-only != true and this is empty, to fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory you can use this action without any cache setup - it will still build your flake and all derivations. It will just be slower.
actions/nix-build/action.yml
Outdated
aws-access-key-id: ${{ inputs.aws-access-key-id }} | ||
aws-secret-access-key: ${{ inputs.aws-secret-access-key }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aws-access-key-id: ${{ inputs.aws-access-key-id }} | |
aws-secret-access-key: ${{ inputs.aws-secret-access-key }} | |
aws-access-key-id: ${{ inputs.aws-access-key-id }} | |
aws-secret-access-key: ${{ inputs.aws-secret-access-key }} | |
mask-aws-account-id: true |
Don't think we need access keys (see earlier comment) and we should mask the AWS account ID so it doesn't appear in logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Access key and accompanying fields removed.
GitHub already does the masking for us - anything that comes from the secrets appears as ***
in the output of the action.
Example:
Run aws-actions/configure-aws-credentials@v4
with:
aws-region: ***
aws-access-key-id: ***
aws-secret-access-key: ***
audience: sts.amazonaws.com
env:
NIX_PATH: nixpkgs=channel:nixos-unstable
TMPDIR: /home/runner/work/_temp
Proceeding with IAM user credentials
Run # run check package builds
# run check package builds
nix flake check --impure --all-systems
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
NIX_PATH: nixpkgs=channel:nixos-unstable
TMPDIR: /home/runner/work/_temp
AWS_DEFAULT_REGION: ***
AWS_REGION: ***
AWS_ACCESS_KEY_ID: ***
AWS_SECRET_ACCESS_KEY: ***
Co-authored-by: chainchad <[email protected]>
This PR adds a generic GHA that can build a Nix project and cache its artefacts on S3.
TODO: This PR should probably be adapted to augment the
setup-nix
action, instead of being a separate one.Example usage: