Compare commits

...

1 Commits

Author SHA1 Message Date
coolneng 8392ac213b
Assign a static IP address 2021-05-13 19:09:28 +02:00
2 changed files with 20 additions and 11 deletions

View File

@ -32,9 +32,6 @@
# Cleanup tmp on startup # Cleanup tmp on startup
boot.cleanTmpDir = true; boot.cleanTmpDir = true;
# Set hostname
networking.hostName = "zion";
# Create coolneng user # Create coolneng user
users.users.coolneng = { users.users.coolneng = {
isNormalUser = true; isNormalUser = true;
@ -54,7 +51,6 @@
services.timesyncd.enable = true; services.timesyncd.enable = true;
# Enable ZFS support # Enable ZFS support
networking.hostId = "4e74ea68";
boot.supportedFilesystems = [ "zfs" ]; boot.supportedFilesystems = [ "zfs" ];
# Scrub zpool monthly # Scrub zpool monthly

View File

@ -3,6 +3,25 @@
let password = builtins.readFile /var/keys/ddclient; let password = builtins.readFile /var/keys/ddclient;
in { in {
# Assign a static IP
networking = {
hostName = "zion";
hostId = "4e74ea68";
interfaces.eth0 = {
useDHCP = false;
ipv4.addresses = [{
address = "192.168.13.2";
prefixLength = 24;
}];
};
defaultGateway = {
address = "192.168.13.1";
interface = "eth0";
};
nameservers = [ "195.10.195.195" "165.22.224.164" ];
enableIPv6 = false;
};
# Enable zeroconf # Enable zeroconf
services.avahi = { services.avahi = {
enable = true; enable = true;
@ -42,12 +61,6 @@ in {
''; '';
}; };
# Disable IPv6
networking.enableIPv6 = false;
# Disable WiFi
networking.interfaces."eth0".useDHCP = true;
# Enable NAT for wireguard # Enable NAT for wireguard
networking.nat = { networking.nat = {
enable = true; enable = true;
@ -79,7 +92,7 @@ in {
# DNS server with ad-block # DNS server with ad-block
services.dnsmasq = { services.dnsmasq = {
enable = true; enable = true;
servers = [ "195.10.195.195" "165.22.224.164" ]; servers = config.networking.nameservers;
extraConfig = '' extraConfig = ''
domain-needed domain-needed
bogus-priv bogus-priv