2021-05-30 19:10:28 +00:00
|
|
|
{
|
2023-10-07 14:45:42 +00:00
|
|
|
flake,
|
2022-11-22 11:30:54 +00:00
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
2023-10-07 14:45:42 +00:00
|
|
|
}: {
|
|
|
|
# disable NetworkManager and systemd-networkd -wait-online by default
|
|
|
|
systemd.services.NetworkManager-wait-online.enable = lib.mkDefault false;
|
|
|
|
systemd.services.systemd-networkd-wait-online.enable = lib.mkDefault false;
|
|
|
|
|
|
|
|
networking.networkmanager = {
|
|
|
|
# Enable networkmanager. REMEMBER to add yourself to group in order to use nm related stuff.
|
2023-10-07 19:11:08 +00:00
|
|
|
enable = lib.mkDefault true;
|
2023-10-07 14:45:42 +00:00
|
|
|
wifi.backend = lib.mkDefault "iwd";
|
|
|
|
};
|
|
|
|
|
|
|
|
networking.firewall.enable = true;
|
|
|
|
|
|
|
|
networking.hosts = flake.self.lib.addLocalHostname ["caddy.local"];
|
|
|
|
|
|
|
|
# Caddy reverse proxy for local services like cups
|
|
|
|
services.caddy = {
|
2023-10-07 19:11:08 +00:00
|
|
|
# don't enable by default
|
2023-10-07 14:45:42 +00:00
|
|
|
globalConfig = ''
|
|
|
|
default_bind 127.0.0.1
|
|
|
|
auto_https off
|
|
|
|
'';
|
2021-05-30 19:10:28 +00:00
|
|
|
};
|
2023-10-07 14:45:42 +00:00
|
|
|
|
|
|
|
# For rage encryption, all hosts need a ssh key pair
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
allowSFTP = false;
|
|
|
|
|
|
|
|
# If you don't want the host to have SSH actually opened up to the net,
|
|
|
|
# set `services.openssh.openFirewall` to false in your config.
|
|
|
|
openFirewall = true;
|
|
|
|
|
|
|
|
settings.PasswordAuthentication = lib.mkDefault false;
|
|
|
|
settings.KbdInteractiveAuthentication = false;
|
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
AllowTcpForwarding yes
|
|
|
|
X11Forwarding no
|
|
|
|
AllowAgentForwarding no
|
|
|
|
AllowStreamLocalForwarding no
|
|
|
|
AuthenticationMethods publickey
|
|
|
|
'';
|
2021-05-30 19:10:28 +00:00
|
|
|
};
|
|
|
|
}
|