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.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. ../../../lib/admins.nix
  9. ];
  10. c3d2.isInHq = false;
  11. services.openssh.enable = true;
  12. networking.hostName = "grafana";
  13. networking.useNetworkd = true;
  14. networking.interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.43"; prefixLength = 26; } ];
  15. networking.defaultGateway = "172.20.73.1";
  16. # http https influxdb
  17. networking.firewall.allowedTCPPorts = [ 80 443 8086 ];
  18. # collectd
  19. networking.firewall.allowedUDPPorts = [ 25826 ];
  20. services.caddy = {
  21. enable = true;
  22. agree = true;
  23. config = ''
  24. grafana.hq.c3d2.de
  25. proxy / localhost:3000
  26. '';
  27. };
  28. services.grafana = {
  29. enable = true;
  30. auth.anonymous = {
  31. enable = true;
  32. org_name = "Chaos";
  33. };
  34. users.allowSignUp = false;
  35. };
  36. services.influxdb = let
  37. collectdTypes = pkgs.stdenv.mkDerivation {
  38. name = "collectd-types";
  39. src = ./.;
  40. buildInputs = [ pkgs.collectd ];
  41. buildPhase = ''
  42. mkdir -p $out/share/collectd
  43. cat ${pkgs.collectd}/share/collectd/types.db >> $out/share/collectd/types.db
  44. echo "stations value:GAUGE:0:U" >> $out/share/collectd/types.db
  45. '';
  46. installPhase = ''
  47. cp -r . $out
  48. '';
  49. };
  50. in {
  51. enable = true;
  52. extraConfig = {
  53. logging.level = "debug";
  54. collectd = [{
  55. enabled = true;
  56. database = "collectd";
  57. typesdb = "${collectdTypes}/share/collectd/types.db";
  58. }];
  59. };
  60. };
  61. # This value determines the NixOS release with which your system is to be
  62. # compatible, in order to avoid breaking some software such as database
  63. # servers. You should change this only after NixOS release notes say you
  64. # should.
  65. system.stateVersion = "18.09"; # Did you read the comment?
  66. }