diff --git a/tests/functional/flakes/develop.sh b/tests/functional/flakes/develop.sh deleted file mode 100644 index 81b3e6b78..000000000 --- a/tests/functional/flakes/develop.sh +++ /dev/null @@ -1,71 +0,0 @@ -source ../common.sh - -clearStore -rm -rf $TEST_HOME/.cache $TEST_HOME/.config $TEST_HOME/.local - -# Create flake under test. -cp ../shell-hello.nix ../config.nix $TEST_HOME/ -cat <$TEST_HOME/flake.nix -{ - inputs.nixpkgs.url = "$TEST_HOME/nixpkgs"; - outputs = {self, nixpkgs}: { - packages.$system.hello = (import ./config.nix).mkDerivation { - name = "hello"; - outputs = [ "out" "dev" ]; - meta.outputsToInstall = [ "out" ]; - buildCommand = ""; - }; - }; -} -EOF - -# Create fake nixpkgs flake. -mkdir -p $TEST_HOME/nixpkgs -cp ../config.nix ../nix-shell/shell.nix $TEST_HOME/nixpkgs -cat <$TEST_HOME/nixpkgs/flake.nix -{ - outputs = {self}: { - legacyPackages.$system.bashInteractive = (import ./shell.nix {}).bashInteractive; - }; -} -EOF - -cd $TEST_HOME - -# Test whether `nix develop` passes through environment variables. -[[ "$( - ENVVAR=a nix develop --no-write-lock-file .#hello <> $out/bin/foo + echo 'echo ${fooContents}' >> $out/bin/foo + chmod a+rx $out/bin/foo + ln -s ${shell} $out/bin/bash + ''; + + bar = runCommand "bar" {} '' + mkdir -p $out/bin + echo '#!${shell}' > $out/bin/bar + echo 'echo bar' >> $out/bin/bar + chmod a+rx $out/bin/bar + ''; + + bash = shell; + bashInteractive = runCommand "bash" {} '' + mkdir -p $out/bin + ln -s ${shell} $out/bin/bash + ''; + + # ruby "interpreter" that outputs "$@" + ruby = runCommand "ruby" {} '' + mkdir -p $out/bin + echo '#!${shell}' > $out/bin/ruby + echo 'printf %s "$*"' >> $out/bin/ruby + chmod a+rx $out/bin/ruby + ''; + + inherit pkgs; +}; in pkgs