2024-05-28 16:43:04 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2021-10-12 06:14:36 +00:00
|
|
|
source common.sh
|
|
|
|
|
|
|
|
clearStore
|
|
|
|
clearCache
|
|
|
|
|
|
|
|
outPath=$(nix-build dependencies.nix --no-out-link)
|
|
|
|
|
|
|
|
cacheURI="file://$cacheDir?compression=xz&compression-level=0"
|
|
|
|
|
2024-06-04 20:32:30 +00:00
|
|
|
nix copy --to "$cacheURI" "$outPath"
|
2021-10-12 06:14:36 +00:00
|
|
|
|
2024-06-04 20:32:30 +00:00
|
|
|
FILESIZES=$(cat "${cacheDir}"/*.narinfo | awk '/FileSize: /{sum+=$2}END{print sum}')
|
2021-10-12 06:14:36 +00:00
|
|
|
|
|
|
|
clearCache
|
|
|
|
|
|
|
|
cacheURI="file://$cacheDir?compression=xz&compression-level=5"
|
|
|
|
|
2024-06-04 20:32:30 +00:00
|
|
|
nix copy --to "$cacheURI" "$outPath"
|
2021-10-12 06:14:36 +00:00
|
|
|
|
2024-06-04 20:32:30 +00:00
|
|
|
FILESIZES2=$(cat "${cacheDir}"/*.narinfo | awk '/FileSize: /{sum+=$2}END{print sum}')
|
2021-10-12 06:14:36 +00:00
|
|
|
|
|
|
|
[[ $FILESIZES -gt $FILESIZES2 ]]
|