mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-22 17:39:56 +01:00
32 lines
813 B
Nix
32 lines
813 B
Nix
{lib, ...}: {
|
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
|
# Or disable the firewall altogether.
|
|
networking.firewall.enable = lib.mkDefault false;
|
|
|
|
# Enable the OpenSSH daemon.
|
|
services.openssh = {
|
|
enable = true;
|
|
settings = {
|
|
X11Forwarding = true;
|
|
PermitRootLogin = "no"; # disable root login
|
|
PasswordAuthentication = false; # disable password login
|
|
};
|
|
openFirewall = true;
|
|
};
|
|
|
|
# Network discovery, mDNS
|
|
# With this enabled, you can access your machine at <hostname>.local
|
|
# it's more convenient than using the IP address.
|
|
# https://avahi.org/
|
|
services.avahi = {
|
|
enable = true;
|
|
nssmdns4 = true;
|
|
publish = {
|
|
enable = true;
|
|
domain = true;
|
|
userServices = true;
|
|
};
|
|
};
|
|
}
|