2020-01-26 18:49:43 +01:00
|
|
|
name:
|
|
|
|
|
|
|
|
(import ../outer-defaults.nix name) // {
|
|
|
|
|
2020-01-26 22:02:30 +01:00
|
|
|
bindMounts."/srv/c3d2" = {
|
|
|
|
hostPath = "/srv/ceph/c3d2";
|
|
|
|
isReadOnly = false;
|
2020-01-26 18:49:43 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
config = { config, pkgs, lib, ... }: {
|
|
|
|
imports = [ ../inner-defaults.nix ];
|
|
|
|
|
2020-01-26 21:50:00 +01:00
|
|
|
c3d2 = {
|
|
|
|
users.k-ot = true;
|
|
|
|
hq.statistics.enable = true;
|
2020-04-21 13:44:42 +02:00
|
|
|
hq.yggdrasil.enableGateway = true;
|
2020-01-26 21:50:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
allowSFTP = true;
|
|
|
|
};
|
2020-01-26 18:49:43 +01:00
|
|
|
|
2020-04-23 18:46:35 +02:00
|
|
|
environment.systemPackages = with pkgs; [ git borgbackup ];
|
|
|
|
|
2020-01-26 18:49:43 +01:00
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.nginx.override {
|
|
|
|
modules = with pkgs.nginxModules; [ fancyindex ];
|
|
|
|
};
|
|
|
|
virtualHosts = {
|
|
|
|
"storage-ng.hq.c3d2.de".extraConfig = ''
|
|
|
|
server_name storage-ng.hq.c3d2.de;
|
|
|
|
return 301 $scheme://storage.hq.c3d2.de$request_uri;
|
|
|
|
'';
|
|
|
|
|
|
|
|
"storage.hq.c3d2.de" = {
|
|
|
|
default = true;
|
|
|
|
http2 = true;
|
|
|
|
# addSSL = true;
|
|
|
|
locations = {
|
2020-01-26 22:02:30 +01:00
|
|
|
"/" = let authFile = pkgs.writeText "htpasswd" "k-ot:sawCOTsl/fIUY";
|
|
|
|
in {
|
|
|
|
alias = "/srv/c3d2/files/";
|
|
|
|
extraConfig = ''
|
2020-01-26 18:49:43 +01:00
|
|
|
auth_basic "Chaos";
|
|
|
|
auth_basic_user_file ${authFile};
|
2020-01-26 21:59:55 +01:00
|
|
|
fancyindex on;
|
|
|
|
# autoindex on;
|
|
|
|
dav_access all:r;
|
2020-03-25 19:52:13 +01:00
|
|
|
'';
|
2020-01-26 18:49:43 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-06-05 19:42:07 +02:00
|
|
|
networking.interfaces.eth0 = {
|
|
|
|
ipv4 = {
|
|
|
|
addresses = [{
|
|
|
|
address = "172.22.99.20";
|
|
|
|
prefixLength = 24;
|
|
|
|
}];
|
|
|
|
routes = [{
|
|
|
|
address = "0.0.0.0";
|
|
|
|
prefixLength = 0;
|
|
|
|
via = "172.22.99.1";
|
|
|
|
}];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-01-26 18:49:43 +01:00
|
|
|
networking.firewall.enable = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|