1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-10 04:43:53 +02:00

Merge remote-tracking branch 'origin/master' into lfs

This commit is contained in:
Eelco Dolstra 2025-02-10 14:46:01 +01:00
commit 1cb9a354fb
61 changed files with 921 additions and 478 deletions

View file

@ -16,7 +16,7 @@ in
{
seed ? 0,
}:
# A simple content-addressed derivation.
# A simple content-addressing derivation.
# The derivation can be arbitrarily modified by passing a different `seed`,
# but the output will always be the same
rec {

View file

@ -12,7 +12,7 @@ drvPath2=$(nix derivation add < "$TEST_HOME"/simple.json)
[[ "$drvPath" = "$drvPath2" ]]
# Content-addressed derivations can be renamed.
# Content-addressing derivations can be renamed.
jq '.name = "foo"' < "$TEST_HOME"/simple.json > "$TEST_HOME"/foo.json
drvPath3=$(nix derivation add --dry-run < "$TEST_HOME"/foo.json)
# With --dry-run nothing is actually written

View file

@ -1,6 +1,6 @@
with import ./config.nix;
# A simple content-addressed derivation.
# A simple content-addressing derivation.
# The derivation can be arbitrarily modified by passing a different `seed`,
# but the output will always be the same
rec {

View file

@ -1,6 +1,6 @@
with import ./config.nix;
# A simple content-addressed derivation.
# A simple content-addressing derivation.
# The derivation can be arbitrarily modified by passing a different `seed`,
# but the output will always be the same
rec {

View file

@ -6,14 +6,14 @@ requireGit
create_flake() {
local flakeDir="$1"
createGitRepo $flakeDir
cat > $flakeDir/flake.nix <<EOF
createGitRepo "$flakeDir"
cat > "$flakeDir/flake.nix" <<EOF
{
outputs = { self }: { x = 2; };
}
EOF
git -C $flakeDir add flake.nix
git -C $flakeDir commit -m Initial
git -C "$flakeDir" add flake.nix
git -C "$flakeDir" commit -m Initial
}
test_symlink_points_to_flake() {
@ -34,15 +34,15 @@ test_symlink_points_to_flake_in_subdir
test_symlink_points_to_dir_in_repo() {
local repoDir="$TEST_ROOT/flake1"
createGitRepo $repoDir
createGitRepo "$repoDir"
mkdir -p "$repoDir/subdir"
cat > $repoDir/subdir/flake.nix <<EOF
cat > "$repoDir/subdir/flake.nix" <<EOF
{
outputs = { self }: { x = 2; };
}
EOF
git -C $repoDir add subdir/flake.nix
git -C $repoDir commit -m Initial
git -C "$repoDir" add subdir/flake.nix
git -C "$repoDir" commit -m Initial
ln -sn "$TEST_ROOT/flake1/subdir" "$TEST_ROOT/flake1_sym"
[[ $(nix eval "$TEST_ROOT/flake1_sym#x") = 2 ]]
rm -rf "$TEST_ROOT/flake1" "$TEST_ROOT/flake1_sym"
@ -51,22 +51,22 @@ test_symlink_points_to_dir_in_repo
test_symlink_from_repo_to_another() {
local repoDir="$TEST_ROOT/repo1"
createGitRepo $repoDir
echo "Hello" > $repoDir/file
mkdir $repoDir/subdir
cat > $repoDir/subdir/flake.nix <<EOF
createGitRepo "$repoDir"
echo "Hello" > "$repoDir/file"
mkdir "$repoDir/subdir"
cat > "$repoDir/subdir/flake.nix" <<EOF
{
outputs = { self }: { x = builtins.readFile ../file; };
}
EOF
git -C $repoDir add subdir/flake.nix file
git -C $repoDir commit -m Initial
git -C "$repoDir" add subdir/flake.nix file
git -C "$repoDir" commit -m Initial
[[ $(nix eval "$TEST_ROOT/repo1/subdir#x") == \"Hello\\n\" ]]
local repo2Dir="$TEST_ROOT/repo2"
createGitRepo $repo2Dir
createGitRepo "$repo2Dir"
ln -sn "$repoDir/subdir" "$repo2Dir/flake1_sym"
echo "World" > $repo2Dir/file
echo "World" > "$repo2Dir/file"
git -C "$repo2Dir" add flake1_sym file
git -C "$repo2Dir" commit -m Initial
[[ $(nix eval "$repo2Dir/flake1_sym#x") == \"Hello\\n\" ]]

0
tests/functional/git-hashing/fixed.sh Normal file → Executable file
View file

2
tests/functional/git-hashing/simple.sh Normal file → Executable file
View file

@ -1,3 +1,5 @@
#!/usr/bin/env bash
source common.sh
repo="$TEST_ROOT/scratch"

View file

@ -25,7 +25,7 @@ done
# FIXME: we don't know whether we built the manpages, so we can't
# reliably test them here.
if false; then
skipTest "we don't know whether we built the manpages, so we can't reliably test them here."
# test help output
@ -74,5 +74,3 @@ nix-daemon --help
nix-hash --help
nix-instantiate --help
nix-prefetch-url --help
fi