moved security module to dns module and multiple submodules

This commit is contained in:
boyreau 2026-09-02 08:28:25 +02:00
commit 6e01e14b33
8 changed files with 43 additions and 34 deletions

View file

@ -0,0 +1,6 @@
{
imports = [
./firewall.nix
./misc.nix
];
}

View file

@ -0,0 +1,9 @@
{
# Deny all, specific modules may open things
networking.nftables.enable = true;
networking.firewall = {
enable = true;
allowedTCPPorts = [ ];
allowedUDPPorts = [ ];
};
}

13
modules/security/misc.nix Normal file
View file

@ -0,0 +1,13 @@
{
# No fork bomb
environment.etc."security/limits.conf".text = ''
* soft nproc 2000
* hard nproc 4000
'';
# Wheel group may edit the configuration.
systemd.tmpfiles.rules = [
"Z /etc/nixos ~6070 root wheel"
"A /etc/nixos - - - - d:u::rwx,d:g::-,d:g:wheel:rwx,d:mask:rwx"
];
}