Skip to content

Commit

Permalink
Add cache script
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrw committed Aug 13, 2023
1 parent 0dc13a1 commit 43fbecc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -euo pipefail
. "$(dirname "$(readlink -f "$0")")/utils.sh"

NIXARCH="$(nixarch)"
HOSTNAME="$(hostname -s)"
HOSTNAME="${HOSTNAME:-$(hostname -s)}"

case ${NIXARCH} in
*-linux)
Expand Down
19 changes: 19 additions & 0 deletions bin/cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -euo pipefail

. "$(dirname "$(readlink -f "$0")")/utils.sh"
NIXARCH="$(nixarch)"
HOSTNAME="${HOSTNAME:-$(hostname -s)}"

case ${NIXARCH} in
*-linux)
echo "Not implemented" >&2
exit 1
;;
*-darwin)
nix --extra-experimental-features "nix-command flakes" build ".#darwinConfigurations.${HOSTNAME}.system" --json \
| jq -r '.[].outputs | to_entries[].value' \
| cachix push mindriot101-home
;;
esac

0 comments on commit 43fbecc

Please sign in to comment.