Skip to content

Instantly share code, notes, and snippets.

@zimbatm
Created November 27, 2020 14:27
Show Gist options
  • Save zimbatm/aad9571e788f38108d085c64254fb951 to your computer and use it in GitHub Desktop.
Save zimbatm/aad9571e788f38108d085c64254fb951 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