Skip to content

Commit

Permalink
feat: icarus/bk add pre/post commands for cachix (#1018)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnae authored Nov 24, 2024
1 parent 3f9da54 commit e11f416
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions hosts/x86_64-linux/icarus.nix
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,18 @@
CACHE_NAME=insane
export CACHIX_SIGNING_KEY CACHE_NAME
'';
command = ''
pre-command = ''
#!/usr/bin/env bash
cachix use "$CACHE_NAME"
cachix watch-exec "$CACHE_NAME" -- "$BUILDKITE_COMMAND"
cachix watch-store "$CACHE_NAME" &
CACHIX_PID="$!"
echo cachix pid is "$CACHIX_PID"
echo "$CACHIX_PID" > /tmp/"$BUILDKITE_AGENT_ID".cachix.pid
'';
post-command = ''
#!/usr/bin/env bash
echo "killing cachix"
kill "$(cat /tmp/"$BUILDKITE_AGENT_ID".cachix.pid)"
'';
};
};
Expand Down

0 comments on commit e11f416

Please sign in to comment.