2023-05-08 13:12:01 -06:00
|
|
|
#!@shell@ -e
|
|
|
|
|
2023-05-09 12:14:07 -06:00
|
|
|
BOLD=$(tput bold)
|
|
|
|
NORMAL=$(tput sgr0)
|
2023-05-08 13:12:01 -06:00
|
|
|
|
2023-05-11 05:56:50 -06:00
|
|
|
# TODO: Use the following for more accurate, to-the-input results:
|
|
|
|
# nix flake metadata --json | jq -r '.locks.nodes[] | select(.original.repo == "nixpkgs" and .original.owner == "NixOS") | [ .original.ref, .locked.lastModified ] | join("^")'
|
|
|
|
|
2023-05-09 12:14:07 -06:00
|
|
|
FLAKE_EPOCH=$(@nix@/bin/nix flake metadata --json | @jq@/bin/jq .lastModified)
|
|
|
|
NOW_EPOCH=$(@coreutils@/bin/date +"%s")
|
2023-05-08 13:12:01 -06:00
|
|
|
|
2024-06-28 09:37:50 -06:00
|
|
|
EPOCH_DIFF=$((NOW_EPOCH - FLAKE_EPOCH))
|
2023-05-08 13:12:01 -06:00
|
|
|
|
2023-05-09 14:13:12 -06:00
|
|
|
if [ $EPOCH_DIFF -gt $((60480 * 5)) ]; then
|
|
|
|
echo
|
2024-06-28 09:37:50 -06:00
|
|
|
echo "${BOLD}WARNING: inputs haven't been updated in $((EPOCH_DIFF / 86400)) days!${NORMAL}"
|
2023-05-09 14:13:12 -06:00
|
|
|
echo
|
2023-05-09 12:14:07 -06:00
|
|
|
fi
|