Skip to content

Instantly share code, notes, and snippets.

@smunix
Forked from zimbatm/.gitlab-ci.yml
Created April 30, 2021 09:26
Show Gist options
  • Save smunix/28ffb0843a77f36bad8c4c721678d74d to your computer and use it in GitHub Desktop.
Save smunix/28ffb0843a77f36bad8c4c721678d74d to your computer and use it in GitHub Desktop.
image: nixpkgs/cachix-flakes:nixos-20.03
build:
before_script:
- mkdir -p /etc/nix
- echo "experimental-features = nix-command flakes ca-references recursive-nix" >> /etc/nix/nix.conf
- cachix use numtide
- nix path-info --all > /tmp/store-path-pre-build
script:
- nix flake check
after_script:
- nix develop -c ./cachix-upload.sh /tmp/store-path-pre-build
#!/usr/bin/env bash
set -euo pipefail
echo "Pushing paths"
comm -13 \
<(sort "$1" | grep -v '\.drv$') \
<(nix path-info --all | grep -v '\.drv$' | sort) \
| cachix push numtide
echo "Pushing flake archives"
nix flake archive --json \
| jq -r '.path,(.inputs|to_entries[].value.path)' \
| cachix push numtide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment