moved security module to dns module and multiple submodules
This commit is contained in:
parent
34d472ffc8
commit
6e01e14b33
8 changed files with 43 additions and 34 deletions
|
|
@ -2,7 +2,8 @@
|
||||||
imports = [
|
imports = [
|
||||||
/etc/nixos/roles/desktop.nix
|
/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/nix.nix
|
||||||
/etc/nixos/modules/tailscale.nix
|
/etc/nixos/modules/tailscale.nix
|
||||||
/etc/nixos/modules/ssl.nix
|
/etc/nixos/modules/ssl.nix
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,9 @@ in
|
||||||
/etc/nixos/roles/desktop.nix
|
/etc/nixos/roles/desktop.nix
|
||||||
|
|
||||||
# module
|
# module
|
||||||
|
/etc/nixos/modules/security
|
||||||
|
/etc/nixos/modules/dns.nix
|
||||||
/etc/nixos/modules/nix.nix
|
/etc/nixos/modules/nix.nix
|
||||||
/etc/nixos/modules/security.nix
|
|
||||||
/etc/nixos/modules/sops.nix
|
/etc/nixos/modules/sops.nix
|
||||||
/etc/nixos/modules/ssl.nix
|
/etc/nixos/modules/ssl.nix
|
||||||
/etc/nixos/modules/tailscale.nix
|
/etc/nixos/modules/tailscale.nix
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
{ }
|
|
||||||
11
modules/dns.nix
Normal file
11
modules/dns.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
networking = {
|
||||||
|
nameservers = [
|
||||||
|
"45.90.28.0"
|
||||||
|
"2a07:a8c0::"
|
||||||
|
"45.90.30.0"
|
||||||
|
"2a07:a8c1::"
|
||||||
|
];
|
||||||
|
networkmanager.dns = "none";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
6
modules/security/default.nix
Normal file
6
modules/security/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./firewall.nix
|
||||||
|
./misc.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
9
modules/security/firewall.nix
Normal file
9
modules/security/firewall.nix
Normal 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
13
modules/security/misc.nix
Normal 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"
|
||||||
|
];
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue