2023-02-07 18:24:28 +01:00
|
|
|
|
{
|
|
|
|
|
pkgs,
|
|
|
|
|
lib,
|
|
|
|
|
config,
|
|
|
|
|
...
|
|
|
|
|
}: let
|
|
|
|
|
keys = import ../../../variables/keys.nix;
|
2020-11-25 21:53:26 +01:00
|
|
|
|
in {
|
2023-02-07 18:24:28 +01:00
|
|
|
|
nix.binaryCaches = ["https://cache.holo.host"];
|
2020-12-21 16:10:49 +01:00
|
|
|
|
|
|
|
|
|
nix.binaryCachePublicKeys = [
|
|
|
|
|
"cache.holo.host-1:lNXIXtJgS9Iuw4Cu6X0HINLu9sTfcjEntnrgwMQIMcE="
|
|
|
|
|
"cache.holo.host-2:ZJCkX3AUYZ8soxTLfTb60g+F3MkWD7hkH9y8CgqwhDQ="
|
|
|
|
|
];
|
|
|
|
|
|
2020-11-25 21:53:26 +01:00
|
|
|
|
# TASK: new device
|
|
|
|
|
networking.hostName = "sj-pvehtz-0"; # Define your hostname.
|
|
|
|
|
# networking.domain = "";
|
|
|
|
|
|
|
|
|
|
networking.firewall.enable = true;
|
|
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
|
|
|
# iperf3
|
|
|
|
|
5201
|
|
|
|
|
];
|
|
|
|
|
networking.firewall.logRefusedConnections = false;
|
|
|
|
|
|
|
|
|
|
networking.usePredictableInterfaceNames = false;
|
|
|
|
|
|
|
|
|
|
networking.interfaces.eth0 = {
|
|
|
|
|
mtu = 1400;
|
|
|
|
|
useDHCP = false;
|
2023-02-07 18:24:28 +01:00
|
|
|
|
ipv4.addresses = [
|
|
|
|
|
{
|
|
|
|
|
"address" = "167.233.1.14";
|
|
|
|
|
"prefixLength" = 29;
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
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-02-07 18:24:28 +01:00
|
|
|
|
networking.nameservers = ["1.1.1.1"];
|
2020-11-25 21:53:26 +01:00
|
|
|
|
|
|
|
|
|
networking.nat = {
|
|
|
|
|
enable = true;
|
2023-02-07 18:24:28 +01:00
|
|
|
|
internalInterfaces = ["ve-+"];
|
2020-11-25 21:53:26 +01:00
|
|
|
|
externalInterface = "eth0";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Kubernetes
|
|
|
|
|
# services.kubernetes.roles = ["master" "node"];
|
|
|
|
|
|
|
|
|
|
# virtualization
|
2023-02-07 18:24:28 +01:00
|
|
|
|
virtualisation = {docker.enable = true;};
|
2020-11-25 21:53:26 +01:00
|
|
|
|
|
|
|
|
|
services.spice-vdagentd.enable = true;
|
|
|
|
|
services.qemuGuest.enable = true;
|
|
|
|
|
|
|
|
|
|
systemd.services."sshd-status" = {
|
|
|
|
|
enable = true;
|
|
|
|
|
description = "sshd-status service";
|
2023-02-07 18:24:28 +01:00
|
|
|
|
path = [pkgs.systemd];
|
2020-11-25 21:53:26 +01:00
|
|
|
|
script = ''
|
|
|
|
|
systemctl status sshd | grep -i tasks
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2023-02-07 18:24:28 +01:00
|
|
|
|
systemd.services.sshd.serviceConfig = {TasksMax = 32;};
|
2020-11-25 21:53:26 +01:00
|
|
|
|
|
|
|
|
|
systemd.timers."sshd-status" = {
|
|
|
|
|
description = "Timer to trigger sshd-status periodically";
|
|
|
|
|
enable = true;
|
2023-02-07 18:24:28 +01:00
|
|
|
|
wantedBy = ["timer.target" "multi-user.target"];
|
2020-11-25 21:53:26 +01:00
|
|
|
|
timerConfig = {
|
2022-10-31 11:04:38 +01:00
|
|
|
|
OnActiveSec = "360s";
|
|
|
|
|
OnUnitActiveSec = "360s";
|
|
|
|
|
AccuracySec = "1s";
|
2020-11-25 21:53:26 +01:00
|
|
|
|
Unit = "sshd-status.service";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2023-02-07 18:24:28 +01:00
|
|
|
|
nix.gc = {automatic = true;};
|
2020-11-25 21:53:26 +01:00
|
|
|
|
|
|
|
|
|
networking.useHostResolvConf = true;
|
|
|
|
|
|
2020-11-25 23:27:29 +01:00
|
|
|
|
services.openssh.forwardX11 = true;
|
|
|
|
|
|
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).
|
|
|
|
|
system.stateVersion = "20.09"; # Did you read the comment?
|
|
|
|
|
}
|