2020-07-17 19:50:53 +00:00
|
|
|
source common.sh
|
|
|
|
|
|
|
|
cd $TEST_ROOT
|
|
|
|
|
|
|
|
echo example > example.txt
|
|
|
|
mkdir -p ./x
|
|
|
|
|
|
|
|
NIX_STORE_DIR=$TEST_ROOT/x
|
|
|
|
|
|
|
|
CORRECT_PATH=$(nix-store --store ./x --add example.txt)
|
|
|
|
|
|
|
|
PATH1=$(nix path-info --store ./x $CORRECT_PATH)
|
|
|
|
[ $CORRECT_PATH == $PATH1 ]
|
|
|
|
|
|
|
|
PATH2=$(nix path-info --store "$PWD/x" $CORRECT_PATH)
|
|
|
|
[ $CORRECT_PATH == $PATH2 ]
|
|
|
|
|
2021-08-06 16:36:03 +00:00
|
|
|
PATH3=$(nix path-info --store "local?root=$PWD/x" $CORRECT_PATH)
|
|
|
|
[ $CORRECT_PATH == $PATH3 ]
|
2022-12-26 20:21:08 +00:00
|
|
|
|
|
|
|
# Ensure store ping trusted works with local store
|
|
|
|
nix --store ./x store ping --json | jq -e '.trusted'
|
2024-04-08 05:34:24 +00:00
|
|
|
|
|
|
|
# Suppress grumpiness about multiple nixes on PATH
|
|
|
|
(nix --store ./x doctor || true) 2>&1 | grep 'You are trusted by'
|