File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626 # log-type = "file";
2727 # logfile = "/var/log/nix-serve-ng.log";
2828 # };
29+ services . gc . env . IS_CACHE = "true" ;
2930 # Umbrella service for cache
3031 services . cache = {
3132 type = "internal" ;
Original file line number Diff line number Diff line change 3434 ''
3535 while :; do
3636 # Copy everything to cache
37- CACHE_ENABLED="'' ${CACHE_ENABLED:-false}"
37+ CACHE_ENABLED="'' ${CACHE_ENABLED:-"false"}"
38+ IS_CACHE="'' ${IS_CACHE:-"false"}"
3839 if test "$CACHE_ENABLED" = "true"; then
3940 nix copy --all --store local --to ssh-ng://nix@nix-cache || true
4041 fi
4142 # Garbage collect anything older than an hour
4243 nix path-info --store local --all --json | \
4344 jq -r --argjson age ${ rs } 'map(select(.registrationTime < (now - $age)) | .path) | .[]' | \
4445 nix store delete --store local --stdin --skip-live
46+ if test "$IS_CACHE" = "true"; then
47+ nix store optimise
48+ fi
4549 # chill
4650 SLEEP=$(shuf -i ${ lis } -${ uis } -n 1)
4751 echo Sleeping for "$SLEEP" seconds
You can’t perform that action at this time.
0 commit comments