Closed peterromfeldhk closed 8 years ago
(The nixos tree is deprecated, use nixpkgs tree instead.)
You can use the security.pam.loginLimits option for this.
Is anyone able to provide an example of a working security.pam.loginLimits? My Here's what I had:nixos-rebuild switch --upgrade
worked but the default limits are still used.
security.pam.loginLimits = [{ domain = "-"; type = "-"; item = "nofile"; value = "4096"; }];
which is wrong as -
isn't a wildcard. I used *
instead for domain which sets the defaults, as-per man limits.conf
. Here's a complete example for anyone who stumbles on this:
security.pam.loginLimits = [{
domain = "*";
type = "soft";
item = "nofile";
value = "4096";
}];
Hi,
I already sent a mail to dev-nix but i figured here would be a better place ;)
i would like to be able to set ulimits in nixstyle
example:
security.ulimits = { ejabberd = { soft = { nofile = 65536; nproc = 65536; }; hard = { nofile = 65536; nproc = 65536; }; }; };
which translates in standard linux /etc/security/limits.d/ejabberd.conf
ejabberd soft nofile 65536 ejabberd hard nofile 65536 ejabberd hard nproc 65536 ejabberd soft nproc 65536
cheers, peter