From 8306b292a94d467f185052cd912053059ead9c14 Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Fri, 28 Apr 2017 12:45:09 +0200
Subject: [PATCH] m 2 deployment: add boot-euer

---
 2configs/deployment/boot-euer.nix | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 2configs/deployment/boot-euer.nix

diff --git a/2configs/deployment/boot-euer.nix b/2configs/deployment/boot-euer.nix
new file mode 100644
index 0000000..be24209
--- /dev/null
+++ b/2configs/deployment/boot-euer.nix
@@ -0,0 +1,28 @@
+{ config, lib, pkgs, ... }:
+# more than just nginx config but not enough to become a module
+with import <stockholm/lib>;
+let
+  hostname = config.krebs.build.host.name;
+  bootscript = pkgs.writeTextDir "runit" ''
+    set -euf
+    cd /root
+    mkdir -p .ssh
+    echo "${config.krebs.users.makefu.pubkey}" > .ssh/authorized_keys
+    chmod 700 -R .ssh
+    systemctl restart sshd
+  '';
+in {
+
+  services.nginx = {
+    enable = mkDefault true;
+    virtualHosts."boot.euer.krebsco.de" = {
+      enableSSL = true;
+      forceSSL = true;
+      enableACME = true;
+      locations."/" = {
+        root = bootscript;
+        index = "runit";
+      };
+    };
+  };
+}