Merge pull request #120141 from DavHau/davhau-nixFlakes-enable-flakes

This commit is contained in:
Maciej Krüger 2021-05-12 02:07:17 +02:00 committed by GitHub
commit 9c19ef7cf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 2 deletions

View file

@ -227,6 +227,12 @@ in rec {
inherit storeDir stateDir confDir boehmgc;
});
nixFlakes = nixUnstable;
nixExperimental = nixUnstable.overrideAttrs (prev: {
patches = (prev.patches or []) ++ [ ./enable-all-experimental.patch ];
});
nixFlakes = nixUnstable.overrideAttrs (prev: {
patches = (prev.patches or []) ++ [ ./enable-flakes.patch ];
});
}

View file

@ -0,0 +1,14 @@
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index d3b27d7be..e7d002e1d 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -172,8 +172,7 @@ MissingExperimentalFeature::MissingExperimentalFeature(std::string feature)
void Settings::requireExperimentalFeature(const std::string & name)
{
- if (!isExperimentalFeatureEnabled(name))
- throw MissingExperimentalFeature(name);
+ return;
}
bool Settings::isWSL1()

View file

@ -0,0 +1,14 @@
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index 3e4ead76c..81d407236 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -923,7 +923,8 @@ public:
value.
)"};
- Setting<Strings> experimentalFeatures{this, {}, "experimental-features",
+ Setting<Strings> experimentalFeatures{
+ this, {"flakes", "nix-command"}, "experimental-features",
"Experimental Nix features to enable."};
bool isExperimentalFeatureEnabled(const std::string & name);

View file

@ -30190,7 +30190,8 @@ in
nix
nixStable
nixUnstable
nixFlakes;
nixFlakes
nixExperimental;
nixStatic = pkgsStatic.nix;