nixos-config/configs/sputnik/configuration.nix

53 lines
1.2 KiB
Nix
Raw Normal View History

2019-12-20 05:54:26 +01:00
{ config, pkgs, lib, ... }: {
2019-10-24 02:20:38 +02:00
imports = [
<system/proxy>
./hardware-configuration.nix
./nginx.nix
./tinc.nix
2020-04-22 22:25:26 +02:00
#./syncplay.nix
#./mail-server.nix
2019-10-24 02:20:38 +02:00
];
2019-12-20 05:54:26 +01:00
networking.hostName = "sputnik";
2019-10-24 02:20:38 +02:00
networking.useDHCP = true;
boot.kernelParams = [ "net.ifnames=0" ];
boot.loader.grub = {
2019-12-20 05:54:26 +01:00
enable = true;
2019-10-24 02:20:38 +02:00
version = 2;
2019-12-20 05:54:26 +01:00
device = "/dev/sda";
2019-10-24 02:20:38 +02:00
};
# nix-shell -p speedtest_cli --run speedtest
configuration.fireqos = {
enable = true;
interface = "eth0";
input = 55000;
output = 4000;
balance = false;
};
2019-12-20 05:54:26 +01:00
services.custom.ssh.sshd.rootKeyFiles =
[ (toString <secrets/ssh/jenkins_rsa.pub>) ];
2019-10-24 02:20:38 +02:00
# make sure ssh is only available trough the tinc
networking.firewall.extraCommands = ''
iptables -t nat -A PREROUTING ! -i tinc.private -p tcp -m tcp --dport 22 -j REDIRECT --to-ports 0
'';
# enable all subdomains to be reached to make nginx rules easier
services.dnsmasq = with lib; {
enable = true;
extraConfig = ''
${concatStringsSep "\n"
(flip mapAttrsToList config.module.cluster.services.tinc."private".hosts
(name: attrs: "address=/.${name}.private/${attrs.tincIp}"))}
'';
};
2019-10-24 02:20:38 +02:00
}