This commit is contained in:
Jonathan De Troye 2025-04-12 23:58:38 +00:00 committed by GitHub
commit 6c730624f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 0 deletions

View File

@ -8,6 +8,7 @@ struct CmdStore : NixMultiCommand
{
aliases = {
{"ping", { AliasStatus::Deprecated, {"info"}}},
{"optimize", { AliasStatus::AcceptedShorthand, {"optimise"}}},
};
}

View File

@ -41,6 +41,28 @@ if [ "$inode1" != "$inode3" ]; then
exit 1
fi
outPath4=$(echo 'with import '"${config_nix}"'; mkDerivation { name = "foo4"; builder = builtins.toFile "builder" "mkdir $out; echo hello > $out/foo"; }' | nix-build - --no-out-link)
NIX_REMOTE="" nix store optimise
inode1="$(stat --format=%i $outPath1/foo)"
inode4="$(stat --format=%i $outPath4/foo)"
if [ "$inode1" != "$inode4" ]; then
echo "inodes do not match"
exit 1
fi
outPath5=$(echo 'with import '"${config_nix}"'; mkDerivation { name = "foo5"; builder = builtins.toFile "builder" "mkdir $out; echo hello > $out/foo"; }' | nix-build - --no-out-link)
NIX_REMOTE="" nix store optimize # alias of optimise
inode1="$(stat --format=%i $outPath1/foo)"
inode5="$(stat --format=%i $outPath5/foo)"
if [ "$inode1" != "$inode5" ]; then
echo "inodes do not match"
exit 1
fi
nix-store --gc
if [ -n "$(ls $NIX_STORE_DIR/.links)" ]; then