configurations of hq services
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configuration.nix 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. { config, pkgs, lib, modulesPath, ... }:
  2. {
  3. imports = [
  4. (modulesPath + "/profiles/minimal.nix")
  5. ../../../lib
  6. ../../../lib/lxc-container.nix
  7. ../../../lib/shared.nix
  8. ];
  9. networking.hostName = "kibana";
  10. networking.interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.44"; prefixLength = 26; } ];
  11. networking.defaultGateway = "172.20.73.1";
  12. networking.firewall.allowedTCPPorts = [ 80 443 ];
  13. # Required for krops
  14. services.openssh.enable = true;
  15. environment.systemPackages = [ pkgs.git ];
  16. nixpkgs.config.allowUnfree = true;
  17. services.elasticsearch = {
  18. enable = true;
  19. package = pkgs.elasticsearch7;
  20. };
  21. services.kibana = {
  22. enable = true;
  23. package = pkgs.kibana7;
  24. };
  25. security.acme = {
  26. acceptTerms = true;
  27. email = "mail@c3d2.de";
  28. };
  29. services.nginx =
  30. let
  31. authFile = pkgs.writeText "htpasswd" "k-ot:sawCOTsl/fIUY";
  32. vhost = url: {
  33. forceSSL = true;
  34. enableACME = true;
  35. locations."/" = {
  36. proxyPass = url;
  37. extraConfig = ''
  38. auth_basic "Chaos";
  39. auth_basic_user_file ${authFile};
  40. '';
  41. };
  42. };
  43. in
  44. {
  45. enable = true;
  46. recommendedGzipSettings = true;
  47. recommendedProxySettings = true;
  48. virtualHosts = {
  49. "kibana.hq.c3d2.de" =
  50. vhost "http://127.0.0.1:${toString config.services.kibana.port}";
  51. "kibana-es.hq.c3d2.de" =
  52. vhost "http://127.0.0.1:${toString config.services.elasticsearch.port}";
  53. };
  54. };
  55. # This value determines the NixOS release with which your system is to be
  56. # compatible, in order to avoid breaking some software such as database
  57. # servers. You should change this only after NixOS release notes say you
  58. # should.
  59. system.stateVersion = "20.03"; # Did you read the comment?
  60. }