2021-05-30 19:10:28 +00:00
|
|
|
{
|
2023-11-10 18:48:06 +00:00
|
|
|
flake,
|
2022-11-22 11:30:54 +00:00
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-10 18:48:06 +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;
|
2022-10-02 01:17:34 +00:00
|
|
|
|
2023-11-10 18:48:06 +00:00
|
|
|
networking.networkmanager = {
|
|
|
|
# Enable networkmanager. REMEMBER to add yourself to group in order to use nm related stuff.
|
2024-04-13 00:05:59 +00:00
|
|
|
enable = if config.programs.sway.enable then lib.mkDefault true else false;
|
2023-11-10 18:48:06 +00:00
|
|
|
# not as stable as wpa_supplicant yet, also more trouble with 5 GHz networks
|
|
|
|
#wifi.backend = "iwd";
|
2021-05-30 19:10:28 +00:00
|
|
|
};
|
2022-08-24 16:19:03 +00:00
|
|
|
|
2023-11-10 18:48:06 +00:00
|
|
|
networking.firewall.enable = true;
|
2021-05-30 19:10:28 +00:00
|
|
|
|
2023-11-10 18:48:06 +00:00
|
|
|
# For rage encryption, all hosts need a ssh key pair
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
allowSFTP = lib.mkDefault false;
|
2022-10-03 01:57:34 +00:00
|
|
|
|
2023-11-10 18:48:06 +00:00
|
|
|
openFirewall = lib.mkDefault false;
|
2021-05-30 19:10:28 +00:00
|
|
|
|
2023-11-10 18:48:06 +00:00
|
|
|
settings.PasswordAuthentication = lib.mkDefault false;
|
|
|
|
settings.KbdInteractiveAuthentication = false;
|
2021-05-30 19:10:28 +00:00
|
|
|
|
2023-11-10 18:48:06 +00:00
|
|
|
extraConfig = ''
|
|
|
|
AllowTcpForwarding yes
|
|
|
|
X11Forwarding no
|
|
|
|
AllowAgentForwarding no
|
|
|
|
AllowStreamLocalForwarding no
|
|
|
|
AuthenticationMethods publickey
|
|
|
|
'';
|
2021-05-30 19:10:28 +00:00
|
|
|
};
|
|
|
|
}
|