Summary Files Commits Branches @commit @diff @stats
path: root / machines / uttu / configuration.nix
diff options
context:
space:
mode:
1 files changed, 44 insertions, 0 deletions
-rw-r--r--machines/uttu/configuration.nix44
diff --git a/machines/uttu/configuration.nix b/machines/uttu/configuration.nix
new file mode 100644
index 0000000..7d18b3d
--- /dev/null
+++ b/machines/uttu/configuration.nix
@@ -0,0 +1,44 @@
+# This is device is meant to be a home, LOCAL ONLY server!
+# The configurations you will find are woefully insecure and hard-coded.
+{ lib, ... }: {
+ imports = [
+ ./httpd.nix
+ ];
+
+ options = {
+ constants = lib.mkOption {
+ type = lib.types.attrs;
+ };
+ };
+
+ config = rec {
+ constants = {
+ # I've currently set this IP in my router configuration.
+ # It would be better to write a proper static IP NixOS config, but its
+ # fine like that.
+ ip = "192.168.0.11";
+ # 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";
+ };
+
+ # 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 = {
+ ${constants.ip} = [ "server.int" ];
+ };
+ system.nssDatabases.hosts = lib.mkForce [
+ "files"
+ "mymachines"
+ "mdns4_minimal"
+ "[NOTFOUND=return]"
+ "myhostname"
+ "dns"
+ ];
+ };
+}