Skip to content

Instantly share code, notes, and snippets.

@msteen
Created April 14, 2020 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msteen/685e129cd7e4344036827451ec3faa68 to your computer and use it in GitHub Desktop.
Save msteen/685e129cd7e4344036827451ec3faa68 to your computer and use it in GitHub Desktop.
{ # Limits
# We increase to inotify limits since the defaults are easily exceeded.
boot.kernel.sysctl = {
"fs.inotify.max_user_instances" = 4096;
"fs.inotify.max_user_watches" = 524288;
};
# Be very generous with resource restrictions.
# Should be lower than the value defined in /proc/sys/fs/file-max.
# The domain * excludes root, so we need repeat it for root.
security.pam.loginLimits =
flip concatMap [ "*" "root" ] (domain:
flip concatMap [ "nproc" "nofile" ] (item:
flip map [ "soft" "hard" ] (type:
{ inherit domain; inherit item; inherit type; value = "65536"; }
)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment