feat(system/limits): add reusable system limits module

- Created a `limits` module to centralize system limit configurations.
- Replaced inlined user and systemd limits with the new module on aarch64 and x86_64 platforms.
- Simplifies maintenance and ensures consistency across configurations.
This commit is contained in:
Harald Hoyer 2025-03-20 09:39:45 +01:00
parent 6f89baaf94
commit e68012ff09
3 changed files with 65 additions and 34 deletions

View file

@ -16,6 +16,15 @@ with lib.metacfg;
nix.enable = true;
podman.enable = true;
secureboot.enable = false;
system = {
limits = {
enable = true;
nofileLimit = 32768;
memlockLimit = 32768;
};
};
tools = {
direnv.enable = true;
};
@ -71,22 +80,5 @@ with lib.metacfg;
allowReboot = false;
};
systemd.user.extraConfig = "DefaultLimitNOFILE=32768";
security.pam.loginLimits = [
{
domain = "*";
item = "nofile";
type = "-";
value = "32768";
}
{
domain = "*";
item = "memlock";
type = "-";
value = "32768";
}
];
system.stateVersion = "23.11";
}