Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e468a1091bd3
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9c984b06c4b4
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Oct 27, 2018

  1. Copy the full SHA
    5573795 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5b30cd7 View commit details

Commits on Nov 10, 2018

  1. Merge pull request #38514 from disassembler/grafana-reporter

    grafana-reporter: init at 2.0.1
    infinisil authored Nov 10, 2018
    Copy the full SHA
    9c984b0 View commit details
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
@@ -431,6 +431,7 @@
./services/monitoring/dd-agent/dd-agent.nix
./services/monitoring/fusion-inventory.nix
./services/monitoring/grafana.nix
./services/monitoring/grafana-reporter.nix
./services/monitoring/graphite.nix
./services/monitoring/hdaps.nix
./services/monitoring/heapster.nix
66 changes: 66 additions & 0 deletions nixos/modules/services/monitoring/grafana-reporter.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{ options, config, lib, pkgs, ... }:

with lib;

let
cfg = config.services.grafana_reporter;

in {
options.services.grafana_reporter = {
enable = mkEnableOption "grafana_reporter";

grafana = {
protocol = mkOption {
description = "Grafana protocol.";
default = "http";
type = types.enum ["http" "https"];
};
addr = mkOption {
description = "Grafana address.";
default = "127.0.0.1";
type = types.str;
};
port = mkOption {
description = "Grafana port.";
default = 3000;
type = types.int;
};

};
addr = mkOption {
description = "Listening address.";
default = "127.0.0.1";
type = types.str;
};

port = mkOption {
description = "Listening port.";
default = 8686;
type = types.int;
};

templateDir = mkOption {
description = "Optional template directory to use custom tex templates";
default = "${pkgs.grafana_reporter}";
type = types.str;
};
};

config = mkIf cfg.enable {
systemd.services.grafana_reporter = {
description = "Grafana Reporter Service Daemon";
wantedBy = ["multi-user.target"];
after = ["network.target"];
serviceConfig = let
args = lib.concatSepString " " [
"-proto ${cfg.grafana.protocol}://"
"-ip ${cfg.grafana.addr}:${toString cfg.grafana.port}"
"-port :${toString cfg.port}"
"-templates ${cfg.templateDir}"
];
in {
ExecStart = "${pkgs.grafana_reporter.bin}/bin/grafana-reporter ${args}";
};
};
};
}
32 changes: 32 additions & 0 deletions pkgs/servers/monitoring/grafana-reporter/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{ stdenv, buildGoPackage, fetchFromGitHub, tetex, makeWrapper }:

with stdenv.lib;

buildGoPackage rec {
name = "reporter-${version}";
version = "2.0.1";
rev = "v${version}";

goPackagePath = "github.com/IzakMarais/reporter";

nativeBuildInputs = [ makeWrapper ];

src = fetchFromGitHub {
inherit rev;
owner = "IzakMarais";
repo = "reporter";
sha256 = "0yi7nx8ig5xgkwizddl0gdicnmcdp4qgg1fdxyq04l2y3qs176sg";
};

postInstall = ''
wrapProgram $bin/bin/grafana-reporter \
--prefix PATH : ${makeBinPath [ tetex ]}
'';

meta = {
description = "PDF report generator from a Grafana dashboard";
homepage = https://github.com/IzakMarais/reporter;
license = licenses.mit;
maintainers = with maintainers; [ disassembler ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -13354,6 +13354,8 @@ with pkgs;

grafana = callPackage ../servers/monitoring/grafana { };

grafana_reporter = callPackage ../servers/monitoring/grafana-reporter { };

h2o = callPackage ../servers/http/h2o { };

haka = callPackage ../tools/security/haka { };