2015-07-23 00:20:44 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
2015-07-24 12:00:28 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
createStaticPage = domain:
|
|
|
|
{
|
2015-07-27 11:55:16 +00:00
|
|
|
krebs.nginx.servers."${domain}" = {
|
2015-07-24 12:00:28 +00:00
|
|
|
server-names = [
|
|
|
|
"${domain}"
|
|
|
|
"www.${domain}"
|
|
|
|
];
|
|
|
|
locations = [
|
|
|
|
(nameValuePair "/" ''
|
|
|
|
root /var/lib/http/${domain};
|
|
|
|
'')
|
|
|
|
];
|
|
|
|
};
|
|
|
|
#networking.extraHosts = ''
|
|
|
|
# 10.243.206.102 ${domain}
|
|
|
|
#'';
|
2015-08-02 19:13:06 +00:00
|
|
|
users.extraUsers = {
|
|
|
|
"${domain}" = {
|
|
|
|
name = "${domain}";
|
|
|
|
home = "/var/lib/http/${domain}";
|
|
|
|
createHome = true;
|
|
|
|
};
|
|
|
|
};
|
2015-07-24 12:00:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
2015-07-23 00:20:44 +00:00
|
|
|
imports = [
|
2015-07-29 12:54:23 +00:00
|
|
|
../3modules/iptables.nix
|
2015-07-24 12:00:28 +00:00
|
|
|
] ++ map createStaticPage [
|
|
|
|
"habsys.de"
|
|
|
|
"pixelpocket.de"
|
|
|
|
"karlaskop.de"
|
|
|
|
"ubikmedia.de"
|
|
|
|
"apanowicz.de"
|
2015-07-23 00:20:44 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
lass.iptables = {
|
|
|
|
tables = {
|
|
|
|
filter.INPUT.rules = [
|
|
|
|
{ predicate = "-p tcp --dport http"; target = "ACCEPT"; }
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-07-27 11:55:16 +00:00
|
|
|
krebs.nginx = {
|
2015-07-23 00:20:44 +00:00
|
|
|
enable = true;
|
|
|
|
servers = {
|
2015-07-24 12:00:28 +00:00
|
|
|
#"habsys.de" = {
|
|
|
|
# server-names = [
|
|
|
|
# "habsys.de"
|
|
|
|
# "www.habsys.de"
|
|
|
|
# ];
|
|
|
|
# locations = [
|
|
|
|
# (nameValuePair "/" ''
|
|
|
|
# root /var/lib/http/habsys.de;
|
|
|
|
# '')
|
|
|
|
# ];
|
|
|
|
#};
|
2015-07-23 00:20:44 +00:00
|
|
|
|
2015-07-24 12:00:28 +00:00
|
|
|
#"karlaskop.de" = {
|
|
|
|
# server-names = [
|
|
|
|
# "karlaskop.de"
|
|
|
|
# "www.karlaskop.de"
|
|
|
|
# ];
|
|
|
|
# locations = [
|
|
|
|
# (nameValuePair "/" ''
|
|
|
|
# root /var/lib/http/karlaskop.de;
|
|
|
|
# '')
|
|
|
|
# ];
|
|
|
|
#};
|
2015-07-23 00:20:44 +00:00
|
|
|
|
2015-07-24 12:00:28 +00:00
|
|
|
#"pixelpocket.de" = {
|
|
|
|
# server-names = [
|
|
|
|
# "pixelpocket.de"
|
|
|
|
# "www.karlaskop.de"
|
|
|
|
# ];
|
|
|
|
# locations = [
|
|
|
|
# (nameValuePair "/" ''
|
|
|
|
# root /var/lib/http/karlaskop.de;
|
|
|
|
# '')
|
|
|
|
# ];
|
|
|
|
#};
|
2015-07-23 00:20:44 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2015-08-02 19:13:06 +00:00
|
|
|
services.postgresql = {
|
|
|
|
enable = true;
|
|
|
|
};
|
2015-07-23 00:20:44 +00:00
|
|
|
|
|
|
|
#config.services.vsftpd = {
|
|
|
|
# enable = true;
|
|
|
|
# userlistEnable = true;
|
|
|
|
# userlistFile = pkgs.writeFile "vsftpd-userlist" ''
|
|
|
|
# '';
|
|
|
|
#};
|
|
|
|
}
|