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