GitLab CI¶
Create new binary cache on https://app.cachix.org and generate a signing key
Replace
mycache
occourances in following.gitlab-ci.yml
:
image: nixos/nix:latest
build:
before_script:
- nix-env -iA nixpkgs.cachix nixpkgs.bash
- cachix use mycache
- nix path-info --all > /tmp/store-path-pre-build
script:
- nix-build default.nix
after_script:
# push all store paths that were added during the build
- bash -c "comm -13 <(sort /tmp/store-path-pre-build | grep -v '\.drv$') <(nix path-info --all | grep -v '\.drv$' | sort) | cachix push mycache"
Follow variables configuration tutorial to export
$CACHIX_SIGNING_KEY
and (needed if the cache is private).If you’re using a private cache, export
$CACHIX_AUTH_TOKEN
and callcachix authtoken $CACHIX_AUTH_TOKEN` just before ``cachix use
.