Summary Files Commits Branches @commit @diff @stats
path: root / machines / marduk / configuration.nix
blob: bef2e93c89046a94ca35f66d1b5d46e6a4a1227a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# This is device is meant to be a home, LOCAL ONLY server!
# The configurations you will find are woefully insecure and hard-coded.
{ config, lib, ... }: {
  imports = [
    ./mail.nix
    ./aim.nix
    ./minecraft.nix

    ./kamen.nix
  ];

  srv = {
    static = {
      ip = "192.168.0.20";
      interface = "enp1s0";
    };
    # This is actually a fantastic TLD. Very few sites use it, you may
    # consider it as an abbreviation of "internal" and is one of the
    # "original" gTLDs, introduced in 1988, so every device will always
    # work with it.
    tld = "int";
    slds = [ "marduk" ];
  };

  # This improves SSH speed via server.int
  # The main problem is that when SSH-ing with server.int, the domain is
  # queried, however DNS resolution doesn't happen through dnsmasq but
  # through the nss hosts, which causes ~20 seconds of delay.
  # Now we're first checking /etc/hosts and then the databases listed.
  networking.hosts = {
    ${config.srv.static.ip} = [ "${config.networking.hostName}.${config.srv.tld}" ];
  };
  system.nssDatabases.hosts = lib.mkForce [
    "files"
    "mymachines"
    "mdns4_minimal"
    "[NOTFOUND=return]"
    "myhostname"
    "dns"
  ];
}