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

@ -2,7 +2,8 @@
imports = [
/etc/nixos/roles/desktop.nix
/etc/nixos/modules/security.nix
/etc/nixos/modules/dns.nix
/etc/nixos/modules/security
/etc/nixos/modules/nix.nix
/etc/nixos/modules/tailscale.nix
/etc/nixos/modules/ssl.nix

View file

@ -11,8 +11,9 @@ in
/etc/nixos/roles/desktop.nix
# module
/etc/nixos/modules/security
/etc/nixos/modules/dns.nix
/etc/nixos/modules/nix.nix
/etc/nixos/modules/security.nix
/etc/nixos/modules/sops.nix
/etc/nixos/modules/ssl.nix
/etc/nixos/modules/tailscale.nix

View file

@ -1 +0,0 @@
{ }

11
modules/dns.nix Normal file
View file

@ -0,0 +1,11 @@
{
networking = {
nameservers = [
"45.90.28.0"
"2a07:a8c0::"
"45.90.30.0"
"2a07:a8c1::"
];
networkmanager.dns = "none";
};
}

View file

@ -1,31 +0,0 @@
{
# Classic deny all
networking.nftables.enable = true;
networking.firewall = {
enable = true;
allowedTCPPorts = [ ];
allowedUDPPorts = [ ];
};
networking = {
nameservers = [
"45.90.28.0"
"2a07:a8c0::"
"45.90.30.0"
"2a07:a8c1::"
];
networkmanager.dns = "none";
};
# 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"
];
}

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"
];
}