aboutsummaryrefslogtreecommitdiff
path: root/src/nix/shell.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/shell.cc')
-rw-r--r--src/nix/shell.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/nix/shell.cc b/src/nix/shell.cc
index 71e640667..439ef02ed 100644
--- a/src/nix/shell.cc
+++ b/src/nix/shell.cc
@@ -182,6 +182,11 @@ struct Common : InstallableCommand, MixProfile
out << "eval \"$shellHook\"\n";
}
+ Strings getDefaultFlakeAttrPaths() override
+ {
+ return {"devShell." + settings.thisSystem.get(), "defaultPackage." + settings.thisSystem.get()};
+ }
+
StorePath getShellOutPath(ref<Store> store)
{
auto path = installable->getStorePath();
@@ -238,11 +243,15 @@ struct CmdDevShell : Common, MixEnvironment
return {
Example{
"To get the build environment of GNU hello:",
- "nix dev-shell nixpkgs.hello"
+ "nix dev-shell nixpkgs#hello"
+ },
+ Example{
+ "To get the build environment of the default package of flake in the current directory:",
+ "nix dev-shell"
},
Example{
"To store the build environment in a profile:",
- "nix dev-shell --profile /tmp/my-shell nixpkgs.hello"
+ "nix dev-shell --profile /tmp/my-shell nixpkgs#hello"
},
Example{
"To use a build environment previously recorded in a profile:",
@@ -300,7 +309,7 @@ struct CmdPrintDevEnv : Common
return {
Example{
"To apply the build environment of GNU hello to the current shell:",
- ". <(nix print-dev-env nixpkgs.hello)"
+ ". <(nix print-dev-env nixpkgs#hello)"
},
};
}