forked from lix-project/lix
Enable recursive Nix using a feature
Derivations that want to use recursion should now set requiredSystemFeatures = [ "recursive-nix" ]; to make the daemon socket appear. Also, Nix should be configured with "experimental-features = recursive-nix".
This commit is contained in:
parent
2af9561316
commit
c119ab9db0
|
@ -2248,6 +2248,7 @@ void DerivationGoal::startBuilder()
|
||||||
|
|
||||||
/* Fire up a Nix daemon to process recursive Nix calls from the
|
/* Fire up a Nix daemon to process recursive Nix calls from the
|
||||||
builder. */
|
builder. */
|
||||||
|
if (parsedDrv->getRequiredSystemFeatures().count("recursive-nix"))
|
||||||
startDaemon();
|
startDaemon();
|
||||||
|
|
||||||
/* Run the builder. */
|
/* Run the builder. */
|
||||||
|
@ -2832,6 +2833,8 @@ struct RestrictedStore : public LocalFSStore
|
||||||
|
|
||||||
void DerivationGoal::startDaemon()
|
void DerivationGoal::startDaemon()
|
||||||
{
|
{
|
||||||
|
settings.requireExperimentalFeature("recursive-nix");
|
||||||
|
|
||||||
Store::Params params;
|
Store::Params params;
|
||||||
params["path-info-cache-size"] = "0";
|
params["path-info-cache-size"] = "0";
|
||||||
params["store"] = worker.store.storeDir;
|
params["store"] = worker.store.storeDir;
|
||||||
|
|
|
@ -95,7 +95,7 @@ StringSet Settings::getDefaultSystemFeatures()
|
||||||
/* For backwards compatibility, accept some "features" that are
|
/* For backwards compatibility, accept some "features" that are
|
||||||
used in Nixpkgs to route builds to certain machines but don't
|
used in Nixpkgs to route builds to certain machines but don't
|
||||||
actually require anything special on the machines. */
|
actually require anything special on the machines. */
|
||||||
StringSet features{"nixos-test", "benchmark", "big-parallel"};
|
StringSet features{"nixos-test", "benchmark", "big-parallel", "recursive-nix"};
|
||||||
|
|
||||||
#if __linux__
|
#if __linux__
|
||||||
if (access("/dev/kvm", R_OK | W_OK) == 0)
|
if (access("/dev/kvm", R_OK | W_OK) == 0)
|
||||||
|
|
|
@ -4,7 +4,7 @@ clearStore
|
||||||
|
|
||||||
export unreachable=$(nix add-to-store ./recursive.sh)
|
export unreachable=$(nix add-to-store ./recursive.sh)
|
||||||
|
|
||||||
nix build -o $TEST_ROOT/result -L '(
|
nix --experimental-features 'nix-command recursive-nix' build -o $TEST_ROOT/result -L '(
|
||||||
with import ./config.nix;
|
with import ./config.nix;
|
||||||
with import <nix/config.nix>;
|
with import <nix/config.nix>;
|
||||||
mkDerivation {
|
mkDerivation {
|
||||||
|
@ -15,6 +15,8 @@ nix build -o $TEST_ROOT/result -L '(
|
||||||
# Note: this is a string without context.
|
# Note: this is a string without context.
|
||||||
unreachable = builtins.getEnv "unreachable";
|
unreachable = builtins.getEnv "unreachable";
|
||||||
|
|
||||||
|
requiredSystemFeatures = [ "recursive-nix" ];
|
||||||
|
|
||||||
buildCommand = '\'\''
|
buildCommand = '\'\''
|
||||||
mkdir $out
|
mkdir $out
|
||||||
PATH=${nixBinDir}:$PATH
|
PATH=${nixBinDir}:$PATH
|
||||||
|
|
Loading…
Reference in a new issue