mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 15:26:17 +02:00
24 lines
547 B
Bash
Executable file
24 lines
547 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
source common.sh
|
|
|
|
clearStoreIfPossible
|
|
clearCache
|
|
|
|
outPath=$(nix-build dependencies.nix --no-out-link)
|
|
|
|
cacheURI="file://$cacheDir?compression=xz&compression-level=0"
|
|
|
|
nix copy --to "$cacheURI" "$outPath"
|
|
|
|
FILESIZES=$(cat "${cacheDir}"/*.narinfo | awk '/FileSize: /{sum+=$2}END{print sum}')
|
|
|
|
clearCache
|
|
|
|
cacheURI="file://$cacheDir?compression=xz&compression-level=5"
|
|
|
|
nix copy --to "$cacheURI" "$outPath"
|
|
|
|
FILESIZES2=$(cat "${cacheDir}"/*.narinfo | awk '/FileSize: /{sum+=$2}END{print sum}')
|
|
|
|
[[ $FILESIZES -gt $FILESIZES2 ]]
|