summaryrefslogtreecommitdiffstats
path: root/lass/2configs/bepasty.nix
blob: b2d40d4f349611338310ec7b50f346c18b768c8a (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
{ config, pkgs, ... }:
with import <stockholm/lib>;

# secrets used:
#   wildcard.krebsco.de.crt
#   wildcard.krebsco.de.key
#   bepasty-secret.nix     <- contains single string

with import <stockholm/lib>;
let
  secKey = import <secrets/bepasty-secret.nix>;
  ext-doms = [
    "paste.lassul.us"
    "paste.krebsco.de"
  ];
in {

  services.nginx.enable = mkDefault true;
  krebs.bepasty = {
    enable = true;
    serveNginx= true;

    servers = {
      "paste.r" = {
        nginx = {
          serverAliases = [ "paste.retiolum" "paste.${config.krebs.build.host.name}" ];
        };
        defaultPermissions = "admin,list,create,read,delete";
        secretKey = secKey;
      };
    } //
    genAttrs ext-doms (ext-dom: {
      nginx = {
        enableSSL = true;
        forceSSL = true;
        enableACME = true;
      };
      defaultPermissions = "read,create";
      secretKey = secKey;
    });
  };
}