infra/nix/os/devices/167.233.1.14/system.nix

105 lines
2.5 KiB
Nix
Raw Normal View History

2023-02-07 18:23:51 +01:00
{
pkgs,
lib,
config,
...
}: let
keys = import ../../../variables/keys.nix;
in {
2023-02-07 18:23:51 +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="
];
# 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:23:51 +01:00
ipv4.addresses = [
{
"address" = "167.233.1.14";
"prefixLength" = 29;
}
];
ipv6.addresses = [];
};
networking.defaultGateway = {
address = "167.233.1.9";
interface = "eth0";
};
networking.defaultGateway6 = {
address = "fe80::1";
interface = "eth0";
};
2023-02-07 18:23:51 +01:00
networking.nameservers = ["1.1.1.1"];
networking.nat = {
enable = true;
2023-02-07 18:23:51 +01:00
internalInterfaces = ["ve-+"];
externalInterface = "eth0";
};
# Kubernetes
# services.kubernetes.roles = ["master" "node"];
# virtualization
2023-02-07 18:23:51 +01:00
virtualisation = {docker.enable = true;};
services.spice-vdagentd.enable = true;
services.qemuGuest.enable = true;
systemd.services."sshd-status" = {
enable = true;
description = "sshd-status service";
2023-02-07 18:23:51 +01:00
path = [pkgs.systemd];
script = ''
systemctl status sshd | grep -i tasks
'';
};
2023-02-07 18:23:51 +01:00
systemd.services.sshd.serviceConfig = {TasksMax = 32;};
systemd.timers."sshd-status" = {
description = "Timer to trigger sshd-status periodically";
enable = true;
2023-02-07 18:23:51 +01:00
wantedBy = ["timer.target" "multi-user.target"];
timerConfig = {
2022-10-31 11:04:38 +01:00
OnActiveSec = "360s";
OnUnitActiveSec = "360s";
AccuracySec = "1s";
Unit = "sshd-status.service";
};
};
2023-02-07 18:23:51 +01:00
nix.gc = {automatic = true;};
networking.useHostResolvConf = true;
services.openssh.forwardX11 = true;
# 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. Its 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?
}