diff --git a/modules/services/misc/nix-daemon.nix b/modules/services/misc/nix-daemon.nix index 3e435348f9d..ca18a8ad5b4 100644 --- a/modules/services/misc/nix-daemon.nix +++ b/modules/services/misc/nix-daemon.nix @@ -230,6 +230,11 @@ in ${config.nix.envVars} exec nice -n ${builtins.toString config.nix.daemonNiceLevel} ${nix}/bin/nix-worker --daemon > /dev/null 2>&1 ''; + + extraConfig = + '' + limit nofile 4096 4096 + ''; }; environment.shellInit = diff --git a/modules/system/upstart/upstart.nix b/modules/system/upstart/upstart.nix index 7c9253b23f0..cdf96d7cb79 100644 --- a/modules/system/upstart/upstart.nix +++ b/modules/system/upstart/upstart.nix @@ -60,6 +60,8 @@ let ${job.postStop} end script '' else ""} + + ${job.extraConfig} ''; in @@ -238,6 +240,15 @@ in ''; }; + extraConfig = mkOption { + type = types.string; + default = ""; + example = "limit nofile 4096 4096"; + description = '' + Additional Upstart stanzas not otherwise supported. + ''; + }; + }; };