File: zstd.sh

package info (click to toggle)
nix 2.26.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 12,524 kB
  • sloc: cpp: 87,540; sh: 8,864; perl: 649; yacc: 466; xml: 410; javascript: 378; lex: 329; ansic: 215; python: 128; sql: 56; makefile: 33; exp: 5; ruby: 1
file content (35 lines) | stat: -rwxr-xr-x 629 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash

source common.sh

TODO_NixOS

clearStore
clearCache

cacheURI="file://$cacheDir?compression=zstd"

outPath=$(nix-build dependencies.nix --no-out-link)

nix copy --to "$cacheURI" "$outPath"

HASH=$(nix hash path "$outPath")

clearStore
clearCacheCache

nix copy --from "$cacheURI" "$outPath" --no-check-sigs --profile "$TEST_ROOT/profile" --out-link "$TEST_ROOT/result"

[[ -e $TEST_ROOT/profile ]]
[[ -e $TEST_ROOT/result ]]

if ls "$cacheDir/nar/"*.zst &> /dev/null; then
    echo "files do exist"
else
    echo "nars do not exist"
    exit 1
fi

HASH2=$(nix hash path "$outPath")

[[ "$HASH" = "$HASH2" ]]