Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/libcmd/builtin-flake-schemas.nix
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
roles.nix-build = { };
roles.nix-run = { };
roles.nix-search = { };
roles.nix-develop = { };
appendSystem = true;
inventory =
output:
Expand Down
17 changes: 17 additions & 0 deletions tests/functional/flakes/develop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,20 @@ sed -i "$TEST_HOME/flake.nix" -e 's/devShells/devShells2/' # remove devShells
[[ $(nix develop . -L --command sh -c "echo \$x") == "bar" ]]
sed -i "$TEST_HOME/flake.nix" -e 's/devShell/devShell2/' # remove devShell
[[ $(nix develop . -L --command sh -c "echo \$x") == "xyzzy" ]]

# Check that legacyPackages is used, but only when specifying an explicit package.
cat <<EOF >"$TEST_HOME/flake.nix"
{
inputs.nixpkgs.url = "$TEST_HOME/nixpkgs";
outputs = {self, nixpkgs}: {
legacyPackages.$system.default = (import ./config.nix).mkDerivation {
name = "hello";
buildCommand = "set -x; mkdir \$out";
x = "foo";
};
};
}
EOF

(! nix develop . -L --command sh -c "echo \$x")
[[ $(nix develop .#default -L --command sh -c "echo \$x") == "foo" ]]
Loading