Skip to content
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

CI integration - Gitlab CI #133

Open
adisbladis opened this issue Nov 6, 2023 · 0 comments
Open

CI integration - Gitlab CI #133

adisbladis opened this issue Nov 6, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@adisbladis
Copy link
Member

There should be a quick & easy way to get Gitlab CI to publish Nix builds to a log instance running elsewhere.

This integration will take care of:

  • Integrating with the system Nix installation.
  • Integration of the write token into github actions yaml syntax.
  • Using Github Actions secrets for write token.

Considerations

  • It's probably worth it to not install the push as a post-build-hook but as a post action step
    Instead of slowing down and doing a network round trip after every build we can do one big submission in one big chunk.
    Not only is this better for less round trips, but it also means that we can possibly publish fewer STHs (signed tree heads).

Hosting

Notably this action does not take care of hosting a Trustix instance.
That's still an exercise left up to the user.

Advanced setups

More advanced setups might want to use the NixOS Gitlab Runner module.
For these setups it's recommended that you use the post build hook on the host instead and ignore the Gitlab CI specific setup.

Example usage:

image: nixos/nix:2.3.12

build:
  variables:
    CACHIX_CACHE_NAME: mycache
  before_script:
    - nix-env --install --attr nixpkgs.cachix
    - cachix use "$CACHIX_CACHE_NAME"
  script:
    - cachix watch-exec $CACHIX_CACHE_NAME -- nix-build default.nix
@adisbladis adisbladis added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant