summaryrefslogtreecommitdiffstats
path: root/lass/2configs/fastpoke-pages.nix
blob: 1c8106a88b8c134c7bab0a331222d5f3cfbc677f (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{ config, lib, pkgs, ... }:

with lib;

let
  createStaticPage = domain:
    {
      krebs.nginx.servers."${domain}" = {
        server-names = [
          "${domain}"
          "www.${domain}"
        ];
        locations = [
          (nameValuePair "/" ''
            root /var/lib/http/${domain};
          '')
        ];
      };
      #networking.extraHosts = ''
      #  10.243.206.102 ${domain}
      #'';
      users.extraUsers = {
        ${domain} = {
          name = domain;
          home = "/var/lib/http/${domain}";
          createHome = true;
        };
      };
    };

in {
  imports = [
    ../3modules/iptables.nix
  ] ++ map createStaticPage [
    "habsys.de"
    "pixelpocket.de"
    "karlaskop.de"
    "ubikmedia.de"
    "apanowicz.de"
  ];

  lass.iptables = {
    tables = {
      filter.INPUT.rules = [
        { predicate = "-p tcp --dport http"; target = "ACCEPT"; }
      ];
    };
  };


  krebs.nginx = {
    enable = true;
    servers = {
      #"habsys.de" = {
      #  server-names = [
      #    "habsys.de"
      #    "www.habsys.de"
      #  ];
      #  locations = [
      #    (nameValuePair "/" ''
      #      root /var/lib/http/habsys.de;
      #    '')
      #  ];
      #};

      #"karlaskop.de" = {
      #  server-names = [
      #    "karlaskop.de"
      #    "www.karlaskop.de"
      #  ];
      #  locations = [
      #    (nameValuePair "/" ''
      #      root /var/lib/http/karlaskop.de;
      #    '')
      #  ];
      #};

      #"pixelpocket.de" = {
      #  server-names = [
      #    "pixelpocket.de"
      #    "www.karlaskop.de"
      #  ];
      #  locations = [
      #    (nameValuePair "/" ''
      #      root /var/lib/http/karlaskop.de;
      #    '')
      #  ];
      #};

    };
  };

  #services.postgresql = {
  #  enable = true;
  #};

  #config.services.vsftpd = {
  #  enable = true;
  #  userlistEnable = true;
  #  userlistFile = pkgs.writeFile "vsftpd-userlist" ''
  #  '';
  #};
}