From 69a1c046219e33c662c3ca6d6273f4d57cfdc701 Mon Sep 17 00:00:00 2001
From: Tristan Maat <tristan.maat@codethink.co.uk>
Date: Sat, 23 Nov 2019 23:55:26 +0000
Subject: [PATCH] Initial commit

---
 etc/nixos/configuration.nix | 47 +++++++++++++++++++++++++++++++++++++
 etc/nixos/linode.nix        | 22 +++++++++++++++++
 2 files changed, 69 insertions(+)
 create mode 100644 etc/nixos/configuration.nix
 create mode 100644 etc/nixos/linode.nix

diff --git a/etc/nixos/configuration.nix b/etc/nixos/configuration.nix
new file mode 100644
index 0000000..e10fadf
--- /dev/null
+++ b/etc/nixos/configuration.nix
@@ -0,0 +1,47 @@
+{ config, pkgs, ... };
+
+{
+  imports = [
+    ./hardware-configuration.nix
+    ./linode.nix
+  ];
+
+  networking = {
+    hostName = "tlater.net";
+
+    # useDHCP is deprecated
+    useDHCP = false;
+    # interfaces.enp0s31f6.useDHCP = true;
+  };
+
+  time.timeZone = "Europe/London";
+
+  users.users = {
+    tlater = {
+      isNormalUser = true;
+      extraGroups = [ "wheel" "docker" ];
+      openssh.authorizedKeys.keys = [];
+    };
+
+    lauren = {
+      isNormalUser = true;
+      openssh.authorizedKeys.keys = [];
+    };
+  };
+
+  environment.systemPackages = with pkgs; [
+  ];
+
+  services = {
+    openssh = {
+      enable = true;
+      allowSFTP = false;
+      passwordAuthentication = false;
+      permitRootLogin = "no";
+      ports = [ 2222 ];
+      startWhenNeeded = true;
+    };
+  };
+
+  system.stateVersion = "19.09";
+}
diff --git a/etc/nixos/linode.nix b/etc/nixos/linode.nix
new file mode 100644
index 0000000..c2f5fe6
--- /dev/null
+++ b/etc/nixos/linode.nix
@@ -0,0 +1,22 @@
+{ config, lib, pkgs, ... };
+
+{
+  # Required for the lish console
+  boot = {
+    kernelParams = [ "console=ttyS0,19200n8" ];
+  };
+
+  boot.loader = {
+    # Timeout to allow lish to connect
+    timeout = 10;
+
+    grub = {
+      device = "nodev";
+      extraConfig = ''
+        serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1;
+        terminal_input serial;
+        terminal_output serial;
+      '';
+    };
+  };
+}