`security.pam.loginLimits` is set but `/etc/security/limits.conf` is not created

  security.pam.loginLimits = [
    { domain = "@audio"; item = "memlock"; type = "*"; value = "unlimited"; }
    { domain = "@audio"; item = "rtprio"; type = "*"; value = "99"; }
    { domain = "@audio"; item = "nofile"; type = "soft"; value = "99999"; }
    { domain = "@audio"; item = "nofile"; type = "hard"; value = "99999"; }
  ];

But:

% cat /etc/security/limits.conf                                                                                                                                                                                                
cat: /etc/security/limits.conf: No such file or directory

So nix put the limits file in the store and sets conf=<limits.conf path> in all files in /etc/pam.d.

Also, it should be really type = "-" instead of type = "*". Otherwise the corresponding limits do not work.

1 Like