diff options
Diffstat (limited to 'hosts/atlas/cachix.nix')
| -rw-r--r-- | hosts/atlas/cachix.nix | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/hosts/atlas/cachix.nix b/hosts/atlas/cachix.nix new file mode 100644 index 0000000..1dc1830 --- /dev/null +++ b/hosts/atlas/cachix.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: let + uploadToCachix = pkgs.writeScriptBin "upload-to-cachix" '' + #!/bin/sh + set -euf + + OUT_END=$(echo ''${OUT_PATHS: -10}) + if [ "$OUT_END" == "-spec.json" ]; then + exit 0 + fi + + export HOME=/root + exec ${pkgs.cachix}/bin/cachix -c /etc/cachix/cachix.dhall push getchoo $OUT_PATHS > /tmp/hydra_cachix 2>&1 + ''; +in { + nix.extraOptions = '' + post-build-hook = ${uploadToCachix}/bin/upload-to-cachix + ''; +} |
