mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 00:08:07 +02:00
259d6778ef
Requires a slight update to the test infra to work properly, but having the possibility to group tests that way makes the whole thing quite cleaner imho
34 lines
937 B
Bash
Executable file
34 lines
937 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
source common.sh
|
|
|
|
# Globally enable the ca derivations experimental flag
|
|
sed -i 's/experimental-features = .*/& ca-derivations ca-references/' "$NIX_CONF_DIR/nix.conf"
|
|
|
|
export REMOTE_STORE_DIR="$TEST_ROOT/remote_store"
|
|
export REMOTE_STORE="file://$REMOTE_STORE_DIR"
|
|
|
|
ensureCorrectlyCopied () {
|
|
attrPath="$1"
|
|
nix build --store "$REMOTE_STORE" --file ./content-addressed.nix "$attrPath"
|
|
}
|
|
|
|
testOneCopy () {
|
|
clearStore
|
|
rm -rf "$REMOTE_STORE_DIR"
|
|
|
|
attrPath="$1"
|
|
nix copy --to $REMOTE_STORE "$attrPath" --file ./content-addressed.nix
|
|
|
|
ensureCorrectlyCopied "$attrPath"
|
|
|
|
# Ensure that we can copy back what we put in the store
|
|
clearStore
|
|
nix copy --from $REMOTE_STORE \
|
|
--file ./content-addressed.nix "$attrPath" \
|
|
--no-check-sigs
|
|
}
|
|
|
|
for attrPath in rootCA dependentCA transitivelyDependentCA dependentNonCA dependentFixedOutput; do
|
|
testOneCopy "$attrPath"
|
|
done
|