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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. { config, pkgs, lib, ... }:
  2. {
  3. imports =
  4. [ ../../../lib/lxc-container.nix
  5. ../../../lib/shared.nix
  6. ../../../lib/admins.nix
  7. ];
  8. networking.hostName = "grafana";
  9. networking.useNetworkd = true;
  10. networking.defaultGateway = "172.22.99.4";
  11. # Needs IPv4 for obtaining certs?
  12. networking.useDHCP = lib.mkForce true;
  13. # List packages installed in system profile. To search, run:
  14. # $ nix search wget
  15. environment.systemPackages = with pkgs; [
  16. vim
  17. ];
  18. # http https
  19. networking.firewall.allowedTCPPorts = [ 80 443 ];
  20. # collectd
  21. networking.firewall.allowedUDPPorts = [ 25826 ];
  22. services.caddy = {
  23. enable = true;
  24. agree = true;
  25. config = ''
  26. grafana.hq.c3d2.de
  27. proxy / localhost:3000
  28. '';
  29. };
  30. services.grafana = {
  31. enable = true;
  32. auth.anonymous = {
  33. enable = true;
  34. org_name = "Chaos";
  35. };
  36. users.allowSignUp = true;
  37. };
  38. services.influxdb =
  39. let
  40. collectdTypes = pkgs.stdenv.mkDerivation {
  41. name = "collectd-types";
  42. src = ./.;
  43. buildInputs = [ pkgs.collectd ];
  44. buildPhase = ''
  45. mkdir -p $out/share/collectd
  46. cat ${pkgs.collectd}/share/collectd/types.db >> $out/share/collectd/types.db
  47. echo "stations value:GAUGE:0:U" >> $out/share/collectd/types.db
  48. '';
  49. installPhase = ''
  50. cp -r . $out
  51. '';
  52. };
  53. in {
  54. enable = true;
  55. extraConfig = {
  56. logging.level = "debug";
  57. collectd = [{
  58. enabled = true;
  59. database = "collectd";
  60. typesdb = "${collectdTypes}/share/collectd/types.db";
  61. }];
  62. };
  63. };
  64. # This value determines the NixOS release with which your system is to be
  65. # compatible, in order to avoid breaking some software such as database
  66. # servers. You should change this only after NixOS release notes say you
  67. # should.
  68. system.stateVersion = "18.09"; # Did you read the comment?
  69. }