about summary refs log tree commit diff
path: root/users/sterni/machines/ingeborg/http/sterni.lv.nix
blob: d71ced6df2d7c89e99acd38d33dbb5f277c3ed96 (plain) (blame)
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
{ pkgs, depot, ... }:

let
  inherit (depot.users.sterni.nix.html)
    __findFile
    ;
in

{
  imports = [
    ./nginx.nix
  ];

  config = {
    services.nginx.virtualHosts."sterni.lv" = {
      enableACME = true;
      forceSSL = true;
      root = pkgs.writeTextFile {
        name = "sterni.lv-http-root";
        destination = "/index.html";
        text = <html> { } [
          (<head> { } [
            (<meta> { charset = "utf-8"; } null)
            (<title> { } "no thoughts")
          ])
          (<body> { } "🦩")
        ];
      };
      # TODO(sterni): tmp.sterni.lv
      locations."/tmp/".root = toString /srv/http;
      extraConfig = ''
        location = /robots.txt {
           add_header Content-Type text/plain;
           return 200 "User-agent: *\nDisallow: /tmp\n";
        }
      '';
    };
  };
}