Files
nix/profiles/apollo/nixos/network.nix
2025-05-09 14:40:19 +08:00

43 lines
968 B
Nix

{ config, pkgs, hostname, ... }: {
networking = {
hostId = "6fa8b74d";
hostName = "${hostname}";
networkmanager = {
enable = true;
ensureProfiles.profiles = {
"eno1" = {
connection = {
id = "eno1";
type = "ethernet"; # 有线连接
autoconnect = true; # 自动连接
};
ipv4 = {
method = "manual"; # 设置为手动配置 IPv4
addresses = "10.7.43.10/24,10.7.43.30";
# 如果需要,可以添加 DNS 服务器
# dns = [ "10.7.43.1" "8.8.8.8" ];
};
ipv6 = {
method = "auto"; # 设置为自动配置 IPv6 (动态)
};
ethernet = {
wake-on-lan=64;
};
};
};
};
interfaces = {
eno1 = {
wakeOnLan = {
enable = true;
policy = [
"magic"
];
};
};
};
};
}