Skip to content

Commit

Permalink
Merge pull request #10299 from detroyejr/remove-repl-flake
Browse files Browse the repository at this point in the history
flakes: remove experimental repl-flake
  • Loading branch information
thufschmitt authored Mar 29, 2024
2 parents 90f5189 + a09d0e1 commit b72e1c7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 20 deletions.
8 changes: 8 additions & 0 deletions doc/manual/rl-next/remove-repl-flake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
synopsis: Remove experimental repl-flake
significance: significant
issues: 10103
prs: 10299
---

The `repl-flake` experimental feature has been removed. The `nix repl` command now works like the rest of the new CLI in that `nix repl {path}` now tries to load a flake at `{path}` (or fails if the `flakes` experimental feature isn't enabled).*
10 changes: 0 additions & 10 deletions src/libutil/experimental-features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,6 @@ constexpr std::array<ExperimentalFeatureDetails, numXpFeatures> xpFeatureDetails
)",
.trackingUrl = "https://github.com/NixOS/nix/milestone/40",
},
{
.tag = Xp::ReplFlake,
.name = "repl-flake",
.description = R"(
*Enabled with [`flakes`](#xp-feature-flakes) since 2.19*
Allow passing [installables](@docroot@/command-ref/new-cli/nix.md#installables) to `nix repl`, making its interface consistent with the other experimental commands.
)",
.trackingUrl = "https://github.com/NixOS/nix/milestone/32",
},
{
.tag = Xp::AutoAllocateUids,
.name = "auto-allocate-uids",
Expand Down
1 change: 0 additions & 1 deletion src/libutil/experimental-features.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ enum struct ExperimentalFeature
RecursiveNix,
NoUrlLiterals,
FetchClosure,
ReplFlake,
AutoAllocateUids,
Cgroups,
DaemonTrustOverride,
Expand Down
9 changes: 0 additions & 9 deletions src/nix/repl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@ struct CmdRepl : RawInstallablesCommand

void applyDefaultInstallables(std::vector<std::string> & rawInstallables) override
{
if (!experimentalFeatureSettings.isEnabled(Xp::Flakes) && !(file) && rawInstallables.size() >= 1) {
warn("future versions of Nix will require using `--file` to load a file");
if (rawInstallables.size() > 1)
warn("more than one input file is not currently supported");
auto filePath = rawInstallables[0].data();
file = std::optional(filePath);
rawInstallables.front() = rawInstallables.back();
rawInstallables.pop_back();
}
if (rawInstallables.empty() && (file.has_value() || expr.has_value())) {
rawInstallables.push_back(".");
}
Expand Down
3 changes: 3 additions & 0 deletions tests/functional/repl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ testRepl () {
| grep "attribute 'currentSystem' missing"
nix repl "${nixArgs[@]}" 2>&1 <<< "builtins.currentSystem" \
| grep "$(nix-instantiate --eval -E 'builtins.currentSystem')"

expectStderr 1 nix repl ${testDir}/simple.nix \
| grepQuiet -s "error: path '$testDir/simple.nix' is not a flake"
}

# Simple test, try building a drv
Expand Down

0 comments on commit b72e1c7

Please sign in to comment.