diff --git a/doc/manual/change-authors.yml b/doc/manual/change-authors.yml index ef3c6f245..b5f0358ce 100644 --- a/doc/manual/change-authors.yml +++ b/doc/manual/change-authors.yml @@ -66,6 +66,10 @@ delan: forgejo: delan github: delan +detroyejr: + display_name: Jonathan De Troye + github: detroyejr + edolstra: display_name: Eelco Dolstra github: edolstra @@ -102,6 +106,11 @@ jade: just1602: forgejo: just1602 +kfears: + display_name: KFears + forgejo: kfearsoff + github: kfearsoff + kiara: github: KiaraGrouwstra diff --git a/doc/manual/rl-next/repl-flake.md b/doc/manual/rl-next/repl-flake.md new file mode 100644 index 000000000..3a13e961f --- /dev/null +++ b/doc/manual/rl-next/repl-flake.md @@ -0,0 +1,10 @@ +--- +synopsis: Remove experimental repl-flake +issues: [gh#10103, fj#557] +cls: [2147] +prs: [gh#10299] +category: Breaking Changes +credits: [detroyejr, kfears] +--- + +The `repl-flake` experimental feature flag has been removed, its functionality is now the default when `flakes` experimental feature is active. 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). diff --git a/lix/libutil/experimental-features/repl-flake.md b/lix/libutil/experimental-features/repl-flake.md deleted file mode 100644 index 76d910bbf..000000000 --- a/lix/libutil/experimental-features/repl-flake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -name: repl-flake -internalName: ReplFlake ---- -Allow passing [installables](@docroot@/command-ref/new-cli/nix.md#installables) to `nix repl`, making its interface consistent with the other experimental commands. diff --git a/lix/libutil/meson.build b/lix/libutil/meson.build index eb07425e1..fd6135029 100644 --- a/lix/libutil/meson.build +++ b/lix/libutil/meson.build @@ -153,7 +153,6 @@ experimental_feature_definitions = files( 'experimental-features/read-only-local-store.md', 'experimental-features/recursive-nix.md', 'experimental-features/repl-automation.md', - 'experimental-features/repl-flake.md', ) deprecated_feature_definitions = files( diff --git a/lix/nix/repl.cc b/lix/nix/repl.cc index 466ffea6a..39287a7e5 100644 --- a/lix/nix/repl.cc +++ b/lix/nix/repl.cc @@ -47,15 +47,6 @@ struct CmdRepl : RawInstallablesCommand void applyDefaultInstallables(std::vector & rawInstallables) override { - if (!experimentalFeatureSettings.isEnabled(Xp::ReplFlake) && !(file) && rawInstallables.size() >= 1) { - warn("future versions of Lix 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("."); } diff --git a/lix/nix/repl.md b/lix/nix/repl.md index f8ad49199..fdb310b9c 100644 --- a/lix/nix/repl.md +++ b/lix/nix/repl.md @@ -38,7 +38,7 @@ R""( Loading Installable ''... Added 1 variables. - # nix repl --extra-experimental-features 'flakes repl-flake' nixpkgs + # nix repl --extra-experimental-features 'flakes' nixpkgs Loading Installable 'flake:nixpkgs#'... Added 5 variables. diff --git a/tests/functional/repl.sh b/tests/functional/repl.sh index 1f2c2e93f..5868f7931 100644 --- a/tests/functional/repl.sh +++ b/tests/functional/repl.sh @@ -47,6 +47,12 @@ testRepl () { | grep "attribute 'currentSystem' missing" nix repl "${nixArgs[@]}" 2>&1 <<< "builtins.currentSystem" \ | grep "$(nix-instantiate --eval -E 'builtins.currentSystem')" + + local replOutput="$(nix repl "${nixArgs[@]}" ${testDir}/simple.nix 2>&1)" + echo "$replOutput" + echo "$replOutput" \ + | grepQuiet "error: could not find a flake.nix file" \ + || fail "nix repl simple.nix doesn't fail because simple.nix is not a flake" } # Simple test, try building a drv @@ -115,7 +121,7 @@ testReplResponseNoRegex ' testReplResponse ' drvPath ' '".*-simple.drv"' \ -$testDir/simple.nix +--file $testDir/simple.nix testReplResponse ' drvPath @@ -125,7 +131,7 @@ drvPath testReplResponse ' drvPath ' '".*-simple.drv"' \ ---file $testDir/simple.nix --extra-experimental-features 'repl-flake ca-derivations' +--file $testDir/simple.nix --extra-experimental-features 'ca-derivations' mkdir -p flake && cat < flake/flake.nix { @@ -140,7 +146,7 @@ EOF testReplResponse ' foo + baz ' "3" \ - ./flake ./flake\#bar --experimental-features 'flakes repl-flake' + ./flake ./flake\#bar --experimental-features 'flakes' # Test the `:reload` mechansim with flakes: # - Eval `./flake#changingThing` @@ -153,7 +159,7 @@ sleep 1 # Leave the repl the time to eval 'foo' sed -i 's/beforeChange/afterChange/' flake/flake.nix echo ":reload" echo "changingThing" -) | nix repl ./flake --experimental-features 'flakes repl-flake') +) | nix repl ./flake --experimental-features 'flakes') echo "$replResult" | grepQuiet -s beforeChange echo "$replResult" | grepQuiet -s afterChange