forked from c3d2/nix-config
58 lines
1.5 KiB
Nix
58 lines
1.5 KiB
Nix
{ zentralwerk, config, pkgs, lib, ... }:
|
|
|
|
{
|
|
networking.hostName = "kibana";
|
|
networking.interfaces.eth0.ipv4.addresses = [{
|
|
address = "172.20.73.44";
|
|
prefixLength = zentralwerk.lib.config.site.net.serv.subnet4Len;
|
|
}];
|
|
networking.defaultGateway = "172.20.73.1";
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
|
|
|
# Required for deployment
|
|
services.openssh.enable = true;
|
|
|
|
# noXlibs breaks cairo:
|
|
environment.noXlibs = false;
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
services.elasticsearch = {
|
|
enable = true;
|
|
package = pkgs.elasticsearch7;
|
|
};
|
|
services.kibana = {
|
|
enable = true;
|
|
package = pkgs.kibana7;
|
|
};
|
|
|
|
services.nginx = let
|
|
authFile = pkgs.writeText "htpasswd" "k-ot:sawCOTsl/fIUY";
|
|
vhost = url: {
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
locations."/" = {
|
|
proxyPass = url;
|
|
extraConfig = ''
|
|
auth_basic "Chaos";
|
|
auth_basic_user_file ${authFile};
|
|
'';
|
|
};
|
|
};
|
|
in {
|
|
enable = true;
|
|
clientMaxBodySize = "100m";
|
|
virtualHosts = {
|
|
"kibana.hq.c3d2.de" =
|
|
vhost "http://127.0.0.1:${toString config.services.kibana.port}";
|
|
"kibana-es.hq.c3d2.de" =
|
|
vhost "http://127.0.0.1:${toString config.services.elasticsearch.port}";
|
|
};
|
|
};
|
|
|
|
# This value determines the NixOS release with which your system is to be
|
|
# compatible, in order to avoid breaking some software such as database
|
|
# servers. You should change this only after NixOS release notes say you
|
|
# should.
|
|
system.stateVersion = "20.03"; # Did you read the comment?
|
|
}
|