From 7ff18cdf3c3b286f57018e6f3aad23c7a2a088f0 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 21 Apr 2021 13:45:13 +0200 Subject: [PATCH] nixos/xserver: set fs.inotify.max_user_instances too A too low number of inotify user instances causes similar problems as max_user_watches. Without this, my workstation keeps running into things like this: $ sudo systemctl restart display-manager.service Failed to allocate directory watch: Too many open files --- nixos/modules/services/x11/xserver.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 35bd4dabb673..4dde4476d2c4 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -666,6 +666,7 @@ in # The default max inotify watches is 8192. # Nowadays most apps require a good number of inotify watches, # the value below is used by default on several other distros. + boot.kernel.sysctl."fs.inotify.max_user_instances" = mkDefault 524288; boot.kernel.sysctl."fs.inotify.max_user_watches" = mkDefault 524288; systemd.defaultUnit = mkIf cfg.autorun "graphical.target";