77 lines
2.4 KiB
Nix
77 lines
2.4 KiB
Nix
{ config, pkgs, lib, ... }:
|
||
|
||
{
|
||
imports =
|
||
[ # Include the results of the hardware scan.
|
||
./hardware-configuration.nix
|
||
./voip.nix
|
||
];
|
||
|
||
# Use the systemd-boot EFI boot loader.
|
||
boot.loader.systemd-boot.enable = true;
|
||
boot.loader.efi.canTouchEfiVariables = true;
|
||
|
||
networking.hostName = "yate-dialup";
|
||
|
||
networking.useNetworkd = true;
|
||
services.resolved.dnssec = "false";
|
||
systemd.network = {
|
||
networks."10-ens18" = {
|
||
matchConfig = {
|
||
Name = "ens18";
|
||
};
|
||
address = [
|
||
"10.42.10.9/24"
|
||
"2a01:4f8:1c0c:8221::9/64"
|
||
];
|
||
gateway = [
|
||
"10.42.10.1"
|
||
"2a01:4f8:1c0c:8221::1"
|
||
];
|
||
dns = [
|
||
"10.42.10.8"
|
||
"2a01:4f8:1c0c:8221::8"
|
||
];
|
||
};
|
||
};
|
||
|
||
networking.firewall.enable = false;
|
||
networking.nftables = {
|
||
enable = true;
|
||
ruleset = let
|
||
tcpPorts = lib.concatStringsSep ", " (map toString config.networking.firewall.allowedTCPPorts);
|
||
udpPorts = lib.concatStringsSep ", " (map toString config.networking.firewall.allowedUDPPorts);
|
||
in ''
|
||
table inet filter {
|
||
chain input {
|
||
type filter hook input priority 0; policy drop;
|
||
|
||
iifname lo accept
|
||
ct state {established, related} accept
|
||
ip6 nexthdr icmpv6 icmpv6 type { destination-unreachable, packet-too-big, time-exceeded, parameter-problem, nd-router-advert, nd-neighbor-solicit, nd-neighbor-advert } accept
|
||
ip protocol icmp icmp type { destination-unreachable, router-advertisement, time-exceeded, parameter-problem } accept
|
||
|
||
ip6 nexthdr icmpv6 icmpv6 type echo-request accept
|
||
ip protocol icmp icmp type echo-request accept
|
||
|
||
tcp dport 22 accept
|
||
tcp dport { ${tcpPorts} } accept
|
||
udp dport { ${udpPorts} } accept
|
||
|
||
ip saddr { 10.42.10.6, 217.10.68.150 } accept
|
||
ip6 saddr { 2a01:4f8:1c0c:8221::6, 2001:ab7::0/64 } accept
|
||
}
|
||
}
|
||
'';
|
||
};
|
||
|
||
# This value determines the NixOS release from which the default
|
||
# settings for stateful data, like file locations and database versions
|
||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||
# this value at the release version of the first install of this system.
|
||
# Before changing this value read the documentation for this option
|
||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||
system.stateVersion = "22.05"; # Did you read the comment?
|
||
|
||
}
|