summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorGabriel Ebner <gebner@gebner.org>2021-04-03 10:11:52 +0200
committerGabriel Ebner <gebner@gebner.org>2021-04-03 10:11:52 +0200
commitc709fd42d9f7b7df45dd730dbe5b56817dfe0e5b (patch)
tree6f2941402e4e296cbd00a475a5b39263f763299c /nixos
parent3ab6e84b79abc45855e666fff33078189b4960c3 (diff)
downloadnixpkgs-c709fd42d9f7b7df45dd730dbe5b56817dfe0e5b.tar
nixpkgs-c709fd42d9f7b7df45dd730dbe5b56817dfe0e5b.tar.gz
nixpkgs-c709fd42d9f7b7df45dd730dbe5b56817dfe0e5b.tar.bz2
nixpkgs-c709fd42d9f7b7df45dd730dbe5b56817dfe0e5b.tar.lz
nixpkgs-c709fd42d9f7b7df45dd730dbe5b56817dfe0e5b.tar.xz
nixpkgs-c709fd42d9f7b7df45dd730dbe5b56817dfe0e5b.tar.zst
nixpkgs-c709fd42d9f7b7df45dd730dbe5b56817dfe0e5b.zip
nixos/systemd: increase default numeric PID range
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/systemd.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 03c70102c8c..d4ae4c93468 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -1188,9 +1188,12 @@ in
     systemd.services.systemd-remount-fs.unitConfig.ConditionVirtualization = "!container";
     systemd.services.systemd-random-seed.unitConfig.ConditionVirtualization = "!container";
 
-    boot.kernel.sysctl = mkIf (!cfg.coredump.enable) {
-      "kernel.core_pattern" = "core";
-    };
+    boot.kernel.sysctl."kernel.core_pattern" = mkIf (!cfg.coredump.enable) "core";
+
+    # Increase numeric PID range (set directly instead of copying a one-line file from systemd)
+    # https://github.com/systemd/systemd/pull/12226
+    boot.kernel.sysctl."kernel.pid_max" = mkIf pkgs.stdenv.is64bit (lib.mkDefault 4194304);
+
     boot.kernelParams = optional (!cfg.enableUnifiedCgroupHierarchy) "systemd.unified_cgroup_hierarchy=0";
   };