From 7b0b6e53a92d71e91c5f51bd60fa2c5c7dc0db50 Mon Sep 17 00:00:00 2001 From: mat ess Date: Wed, 19 Oct 2022 21:03:02 -0400 Subject: [PATCH] Add cachix --- .drone.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 636910b..ad64bde 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,7 +2,18 @@ kind: pipeline type: docker name: default +environment: + NIX: nix --extra-experimental-features 'nix-command flakes ca-derivations' + CACHE_NAME: mat + CACHIX_AUTH_TOKEN: + from_secret: cachix_auth_token + steps: + - name: set up cachix + image: nixos/nix + commands: + - $NIX profile install nixpkgs#cachix + - cachix use $CACHE_NAME - name: nix build image: nixos/nix volumes: @@ -10,10 +21,13 @@ steps: path: /site commands: - > - nix \ - --extra-experimental-features nix-command \ - --extra-experimental-features flakes \ - build + $NIX flake archive --json \ + | jq -r '.path,(.inputs|to_entries[].value.path)' \ + | cachix push $CACHE_NAME + - > + $NIX build \ + | jq -r '.[].outputs | to_entries[].value' \ + | cachix push $CACHE_NAME - cp -r result/* /site/ - name: netlify deploy