From dbcdd7b4199b46140d8010642d6dc84d5f7e3f8c Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Mon, 10 Sep 2018 13:56:24 +0200
Subject: [PATCH] ma iso.euer.krebsco.de: init

---
 1systems/iso/config.nix     |  1 +
 2configs/nginx/iso.euer.nix | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 2configs/nginx/iso.euer.nix

diff --git a/1systems/iso/config.nix b/1systems/iso/config.nix
index f863321..34a75db 100644
--- a/1systems/iso/config.nix
+++ b/1systems/iso/config.nix
@@ -11,6 +11,7 @@ with import <stockholm/lib>;
   # TODO: NIX_PATH and nix.nixPath are being set by default.nix right now
   # cd ~/stockholm ; nix-build -A config.system.build.isoImage -I nixos-config=makefu/1systems/iso.nix -I secrets=/home/makefu/secrets/iso /var/src/nixpkgs/nixos
   krebs.build.host = config.krebs.hosts.iso;
+  isoImage.isoBaseName = lib.mkForce "stockholm";
   krebs.hidden-ssh.enable = true;
   environment.systemPackages = with pkgs; [
     aria2
diff --git a/2configs/nginx/iso.euer.nix b/2configs/nginx/iso.euer.nix
new file mode 100644
index 0000000..63ef380
--- /dev/null
+++ b/2configs/nginx/iso.euer.nix
@@ -0,0 +1,25 @@
+{config, pkgs, ... }:
+let
+  system = builtins.currentSystem; #we can also build for other platforms
+  iso = (import <nixpkgs/nixos/lib/eval-config.nix>
+      { inherit system;
+        modules = [ ../../1systems/iso/config.nix ]; }
+
+    );
+  image = iso.config.system.build.isoImage;
+  name = iso.config.isoImage.isoName;
+in
+{
+  services.nginx = {
+    virtualHosts = {
+      "iso.euer.krebsco.de" = {
+        enableACME = true;
+        forceSSL = true;
+        locations."/" = {
+            root = "${image}/iso";
+            index = name;
+        };
+      };
+    };
+  };
+}