2023-03-08 19:13:59 +01:00
|
|
|
|
{ pkgs
|
|
|
|
|
, lib
|
|
|
|
|
, config
|
|
|
|
|
, ...
|
|
|
|
|
}:
|
|
|
|
|
let
|
2023-02-07 18:24:28 +01:00
|
|
|
|
keys = import ../../../variables/keys.nix;
|
2023-03-08 19:13:59 +01:00
|
|
|
|
in
|
|
|
|
|
{
|
2020-11-25 21:53:26 +01:00
|
|
|
|
# TASK: new device
|
2023-03-08 19:13:59 +01:00
|
|
|
|
networking.hostName = "sj-pvehtz0"; # Define your hostname.
|
2020-11-25 21:53:26 +01:00
|
|
|
|
# networking.domain = "";
|
|
|
|
|
|
|
|
|
|
networking.firewall.enable = true;
|
|
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
|
|
|
# iperf3
|
|
|
|
|
5201
|
|
|
|
|
];
|
|
|
|
|
networking.firewall.logRefusedConnections = false;
|
|
|
|
|
|
|
|
|
|
networking.usePredictableInterfaceNames = false;
|
|
|
|
|
|
2023-03-08 19:13:59 +01:00
|
|
|
|
networking.dhcpcd.enable = false;
|
|
|
|
|
|
2020-11-25 21:53:26 +01:00
|
|
|
|
networking.interfaces.eth0 = {
|
|
|
|
|
mtu = 1400;
|
|
|
|
|
useDHCP = false;
|
2023-02-07 18:24:28 +01:00
|
|
|
|
ipv4.addresses = [
|
|
|
|
|
{
|
|
|
|
|
"address" = "167.233.1.14";
|
|
|
|
|
"prefixLength" = 29;
|
|
|
|
|
}
|
|
|
|
|
];
|
2023-03-08 19:13:59 +01:00
|
|
|
|
ipv6.addresses = [ ];
|
2020-11-25 21:53:26 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
networking.defaultGateway = {
|
|
|
|
|
address = "167.233.1.9";
|
|
|
|
|
interface = "eth0";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
networking.defaultGateway6 = {
|
|
|
|
|
address = "fe80::1";
|
|
|
|
|
interface = "eth0";
|
|
|
|
|
};
|
|
|
|
|
|
2023-03-08 19:13:59 +01:00
|
|
|
|
networking.nameservers = [ "1.1.1.1" ];
|
2020-11-25 21:53:26 +01:00
|
|
|
|
|
|
|
|
|
networking.nat = {
|
|
|
|
|
enable = true;
|
2023-03-08 19:13:59 +01:00
|
|
|
|
internalInterfaces = [ "ve-+" ];
|
2020-11-25 21:53:26 +01:00
|
|
|
|
externalInterface = "eth0";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Kubernetes
|
|
|
|
|
# services.kubernetes.roles = ["master" "node"];
|
|
|
|
|
|
|
|
|
|
# virtualization
|
2023-03-08 19:13:59 +01:00
|
|
|
|
virtualisation = { docker.enable = true; };
|
2020-11-25 21:53:26 +01:00
|
|
|
|
|
|
|
|
|
services.spice-vdagentd.enable = true;
|
|
|
|
|
services.qemuGuest.enable = true;
|
|
|
|
|
|
2023-03-08 19:13:59 +01:00
|
|
|
|
nix.gc = { automatic = true; };
|
2020-11-25 21:53:26 +01:00
|
|
|
|
|
2023-03-08 19:13:59 +01:00
|
|
|
|
# networking.useHostResolvConf = true;
|
2020-11-25 21:53:26 +01:00
|
|
|
|
|
2023-03-08 19:13:59 +01:00
|
|
|
|
services.openssh.forwardX11 = true;
|
|
|
|
|
|
|
|
|
|
containers = {
|
|
|
|
|
mailserver = import ../../containers/mailserver.nix {
|
|
|
|
|
autoStart = true;
|
|
|
|
|
|
|
|
|
|
hostAddress = "192.168.100.10";
|
|
|
|
|
localAddress = "192.168.100.11";
|
|
|
|
|
|
|
|
|
|
imapsPort = 993;
|
|
|
|
|
sievePort = 4190;
|
2020-11-25 21:53:26 +01:00
|
|
|
|
};
|
|
|
|
|
|
2023-03-08 19:13:59 +01:00
|
|
|
|
webserver = import ../../containers/webserver.nix
|
|
|
|
|
{
|
|
|
|
|
autoStart = true;
|
2020-11-25 21:53:26 +01:00
|
|
|
|
|
2023-03-08 19:13:59 +01:00
|
|
|
|
hostAddress = "192.168.100.12";
|
|
|
|
|
localAddress = "192.168.100.13";
|
2020-11-25 21:53:26 +01:00
|
|
|
|
|
2023-03-08 19:13:59 +01:00
|
|
|
|
httpPort = 80;
|
|
|
|
|
httpsPort = 443;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
syncthing = import ../../containers/syncthing.nix {
|
|
|
|
|
autoStart = true;
|
|
|
|
|
|
|
|
|
|
hostAddress = "192.168.100.14";
|
|
|
|
|
localAddress = "192.168.100.15";
|
|
|
|
|
|
|
|
|
|
syncthingPort = 22000;
|
|
|
|
|
};
|
|
|
|
|
};
|
2020-11-25 23:27:29 +01:00
|
|
|
|
|
2020-11-25 21:53:26 +01:00
|
|
|
|
# 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).
|
2023-03-08 19:13:59 +01:00
|
|
|
|
system.stateVersion = "22.11"; # Did you read the comment?
|
2020-11-25 21:53:26 +01:00
|
|
|
|
}
|