ci: add basic nix and cachix support ()

This commit is contained in:
zimbatm 2020-04-07 13:31:11 +00:00 committed by GitHub
parent cc67646556
commit 53e2bc01d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 86 additions and 23 deletions

11
deploy
View file

@ -2,10 +2,17 @@
#! nix-shell ./shell.nix -i bash
set -euo pipefail
options=(
--option extra-substituters "https://nix-community.cachix.org"
--option binary-cache-public-keys "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
)
mkdir -p state
if [ $(nixops list --state "$NIXOPS_STATE" | grep -c "$NIXOPS_DEPLOYMENT") -eq 0 ]; then
nixops create ./deployment.nix --deployment "$NIXOPS_DEPLOYMENT" --state "$NIXOPS_STATE"
nixops create ./deployment.nix \
"${options[@]}" \
--deployment "$NIXOPS_DEPLOYMENT" --state "$NIXOPS_STATE"
fi
nixops deploy "$@"
nixops deploy "${options[@]}" "$@"