Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 29ccb2e9697e
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 29c2dfd0a966
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jun 19, 2019

  1. Copy the full SHA
    e3552f2 View commit details

Commits on Jun 21, 2019

  1. Copy the full SHA
    29c2dfd View commit details
Showing with 23 additions and 1 deletion.
  1. +23 −1 tests/flakes.sh
24 changes: 23 additions & 1 deletion tests/flakes.sh
Original file line number Diff line number Diff line change
@@ -16,9 +16,10 @@ flake1Dir=$TEST_ROOT/flake1
flake2Dir=$TEST_ROOT/flake2
flake3Dir=$TEST_ROOT/flake3
flake4Dir=$TEST_ROOT/flake4
flake7Dir=$TEST_ROOT/flake7
nonFlakeDir=$TEST_ROOT/nonFlake

for repo in $flake1Dir $flake2Dir $flake3Dir $nonFlakeDir; do
for repo in $flake1Dir $flake2Dir $flake3Dir $flake7Dir $nonFlakeDir; do
rm -rf $repo $repo.tmp
mkdir $repo
git -C $repo init
@@ -76,6 +77,10 @@ cat > $flake3Dir/flake.nix <<EOF
outputs = inputs: rec {
packages.xyzzy = inputs.flake2.packages.bar;
checks = {
xyzzy = packages.xyzzy;
};
};
}
EOF
@@ -159,6 +164,10 @@ git -C $flake2Dir commit flake.lock -m 'Add flake.lock'
nix build -o $TEST_ROOT/result --flake-registry $registry $flake2Dir:bar
[[ -z $(git -C $flake2Dir diff master) ]]

# Updating the flake should not change the lockfile.
nix flake update --flake-registry $registry $flake2Dir
[[ -z $(git -C $flake2Dir diff master) ]]

# Now we should be able to build the flake in pure mode.
nix build -o $TEST_ROOT/result --flake-registry $registry flake2:bar

@@ -328,3 +337,16 @@ git -C $flake3Dir checkout master
# Test whether fuzzy-matching works for IsGit
(! nix build -o $TEST_ROOT/result --flake-registry $registry flake4/removeXyzzy:xyzzy)
nix build -o $TEST_ROOT/result --flake-registry $registry flake4/removeXyzzy:sth

# Testing the nix CLI
nix flake add --flake-registry $registry flake1 flake3
(( $(nix flake list --flake-registry $registry | wc -l) == 7 ))
nix flake pin --flake-registry $registry flake1
(( $(nix flake list --flake-registry $registry | wc -l) == 7 ))
nix flake remove --flake-registry $registry flake1
(( $(nix flake list --flake-registry $registry | wc -l) == 6 ))

(cd $flake7Dir && nix flake init)
nix flake --flake-registry $registry check $flake3Dir

nix flake clone --flake-registry $registry flake1 $TEST_ROOT/flake1-v2