From af99941279b80c962ec9cae3e5fa32976a3f5744 Mon Sep 17 00:00:00 2001 From: regnat Date: Mon, 25 Oct 2021 15:53:01 +0200 Subject: Make experimental-features a proper type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rather than having them plain strings scattered through the whole codebase, create an enum containing all the known experimental features. This means that - Nix can now `warn` when an unkwown experimental feature is passed (making it much nicer to spot typos and spot deprecated features) - It’s now easy to remove a feature altogether (once the feature isn’t experimental anymore or is dropped) by just removing the field for the enum and letting the compiler point us to all the now invalid usages of it. --- src/nix/sigs.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nix/sigs.cc') diff --git a/src/nix/sigs.cc b/src/nix/sigs.cc index 43e0d9148..6a238efbe 100644 --- a/src/nix/sigs.cc +++ b/src/nix/sigs.cc @@ -219,7 +219,7 @@ struct CmdKey : NixMultiCommand { if (!command) throw UsageError("'nix flake' requires a sub-command."); - settings.requireExperimentalFeature("flakes"); + settings.requireExperimentalFeature(Xp::Flakes); command->second->prepare(); command->second->run(); } -- cgit v1.2.3 From c1dea92dd6fb5c07127bcf43d8c76d8a59470d7a Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Thu, 11 Nov 2021 21:29:18 -0500 Subject: nix key: Fix error message and don't require flakes --- src/nix/sigs.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/nix/sigs.cc') diff --git a/src/nix/sigs.cc b/src/nix/sigs.cc index 6a238efbe..3d659d6d2 100644 --- a/src/nix/sigs.cc +++ b/src/nix/sigs.cc @@ -218,8 +218,7 @@ struct CmdKey : NixMultiCommand void run() override { if (!command) - throw UsageError("'nix flake' requires a sub-command."); - settings.requireExperimentalFeature(Xp::Flakes); + throw UsageError("'nix key' requires a sub-command."); command->second->prepare(); command->second->run(); } -- cgit v1.2.3