summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/nginx/iso.euer.nix
blob: 701609d4b54e14dcf1bb8635d40fc2576642f96f (plain)
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
42
43
{ 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;

  drivedroid-cfg = builtins.toJSON [{
    id = "stockholm";
    imageUrl = http://krebsco.de/krebs-v2.png;
    name = "stockholm";
    tags = [ "hybrid" ];
    url = http://krebsco.de;
    releases = [
      { version = iso.config.system.nixos.label;
        url = "/stockholm.iso";
        arch = system; }
    ];
    # size = TODO;
  }];
  web = pkgs.linkFarm "web" [{
    name = "drivedroid.json";
    path = pkgs.writeText "drivedroid.json" drivedroid-cfg; }
  { name = "stockholm.iso";
    path = "${image}/iso/${name}"; }
  ];
in
{
  services.nginx = {
    virtualHosts = {
      "iso.euer.krebsco.de" = {
        enableACME = true;
        forceSSL = true;
        root = web;
        locations."/".index = "drivedroid.json";
      };
    };
  };
}