nixFlakes: enable flakes,nix-command via patch

This commit is contained in:
DavHau 2021-04-22 12:31:41 +07:00
parent 118ef67e07
commit f94876e77b
2 changed files with 17 additions and 8 deletions

View File

@ -227,13 +227,8 @@ in rec {
inherit storeDir stateDir confDir boehmgc;
});
nixFlakes = callPackage ({ makeWrapper, runCommand, ... }:
runCommand "nix-flakes" { buildInputs = [ makeWrapper ]; } ''
mkdir -p $out/bin
for bin in ${nixUnstable}/bin/*; do
makeWrapper $bin $out/bin/$(basename $bin) \
--suffix NIX_CONFIG "\n" "experimental-features = nix-command flakes"
done;
'') {};
nixFlakes = nixUnstable.overrideAttrs (prev: {
patches = (prev.patches or []) ++ [ ./enable-flakes.patch ];
});
}

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);