about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2018-05-24 10:24:38 +0100
committerGitHub <noreply@github.com>2018-05-24 10:24:38 +0100
commitd45e3e36f85ebf98f7e9bcb4105c44463a171655 (patch)
tree2e1a7a04462625a6887f09bde44ea965699d318f
parente27a4502cb1e0fb4a618dae0f6eee390f037d089 (diff)
parentf4c87183df72a71d3d12c20bb2d99f68207dce8f (diff)
downloadnixlib-d45e3e36f85ebf98f7e9bcb4105c44463a171655.tar
nixlib-d45e3e36f85ebf98f7e9bcb4105c44463a171655.tar.gz
nixlib-d45e3e36f85ebf98f7e9bcb4105c44463a171655.tar.bz2
nixlib-d45e3e36f85ebf98f7e9bcb4105c44463a171655.tar.lz
nixlib-d45e3e36f85ebf98f7e9bcb4105c44463a171655.tar.xz
nixlib-d45e3e36f85ebf98f7e9bcb4105c44463a171655.tar.zst
nixlib-d45e3e36f85ebf98f7e9bcb4105c44463a171655.zip
Merge pull request #41015 from tazjin/feat/datadog-gohai
Add missing gohai derivation and fix dd-agent service unit
-rw-r--r--nixos/modules/services/monitoring/dd-agent/dd-agent.nix12
-rw-r--r--pkgs/tools/system/gohai/default.nix32
-rw-r--r--pkgs/tools/system/gohai/deps.nix30
-rw-r--r--pkgs/top-level/all-packages.nix2
4 files changed, 70 insertions, 6 deletions
diff --git a/nixos/modules/services/monitoring/dd-agent/dd-agent.nix b/nixos/modules/services/monitoring/dd-agent/dd-agent.nix
index beaa2c01b298..6367c8245f71 100644
--- a/nixos/modules/services/monitoring/dd-agent/dd-agent.nix
+++ b/nixos/modules/services/monitoring/dd-agent/dd-agent.nix
@@ -57,7 +57,7 @@ let
     instances:
       - use_mount: no
   '';
-  
+
   networkConfig = pkgs.writeText "network.yaml" ''
     init_config:
 
@@ -68,13 +68,13 @@ let
           - lo
           - lo0
   '';
-  
+
   postgresqlConfig = pkgs.writeText "postgres.yaml" cfg.postgresqlConfig;
   nginxConfig = pkgs.writeText "nginx.yaml" cfg.nginxConfig;
   mongoConfig = pkgs.writeText "mongo.yaml" cfg.mongoConfig;
   jmxConfig = pkgs.writeText "jmx.yaml" cfg.jmxConfig;
   processConfig = pkgs.writeText "process.yaml" cfg.processConfig;
-  
+
   etcfiles =
     let
       defaultConfd = import ./dd-agent-defaults.nix;
@@ -150,7 +150,7 @@ in {
       default = null;
       type = types.uniq (types.nullOr types.string);
     };
-    
+
     mongoConfig = mkOption {
       description = "MongoDB integration configuration";
       default = null;
@@ -166,7 +166,7 @@ in {
     processConfig = mkOption {
       description = ''
         Process integration configuration
- 
+
         See http://docs.datadoghq.com/integrations/process/
       '';
       default = null;
@@ -190,7 +190,7 @@ in {
 
     systemd.services.dd-agent = {
       description = "Datadog agent monitor";
-      path = [ pkgs."dd-agent" pkgs.python pkgs.sysstat pkgs.procps ];
+      path = [ pkgs."dd-agent" pkgs.python pkgs.sysstat pkgs.procps pkgs.gohai ];
       wantedBy = [ "multi-user.target" ];
       serviceConfig = {
         ExecStart = "${pkgs.dd-agent}/bin/dd-agent foreground";
diff --git a/pkgs/tools/system/gohai/default.nix b/pkgs/tools/system/gohai/default.nix
new file mode 100644
index 000000000000..77f65de9a8d0
--- /dev/null
+++ b/pkgs/tools/system/gohai/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }:
+
+buildGoPackage rec {
+  name = "gohai-${version}";
+  version = "2018-05-23";
+  rev = "60e13eaed98afa238ad6dfc98224c04fbb7b19b1";
+
+  goPackagePath = "github.com/DataDog/gohai";
+
+  src = fetchgit {
+    inherit rev;
+    url    = "https://github.com/DataDog/gohai";
+    sha256 = "15hdw195f6ayrmj1nbyfpfswdai1r1z3qjw927mbma7rwql24dkr";
+  };
+
+  goDeps = ./deps.nix;
+
+  meta = with lib; {
+    description      = "System information collector";
+    homepage         = "https://github.com/DataDog/gohai";
+    license          = licenses.mit;
+    maintainers      = [ maintainers.tazjin ];
+    platforms        = platforms.unix;
+    repositories.git = git://github.com/DataDog/gohai.git;
+
+    longDescription = ''
+      Gohai is a tool which collects an inventory of system
+      information. It is used by the Datadog agent to provide detailed
+      system metrics.
+    '';
+  };
+}
diff --git a/pkgs/tools/system/gohai/deps.nix b/pkgs/tools/system/gohai/deps.nix
new file mode 100644
index 000000000000..f6d63e460246
--- /dev/null
+++ b/pkgs/tools/system/gohai/deps.nix
@@ -0,0 +1,30 @@
+# This file was generated by https://github.com/kamilchm/go2nix v1.2.1
+[
+  {
+    goPackagePath = "github.com/cihub/seelog";
+    fetch = {
+      type = "git";
+      url = "https://github.com/cihub/seelog";
+      rev = "f561c5e57575bb1e0a2167028b7339b3a8d16fb4";
+      sha256 = "0r3228hvgljgpaggj6b9mvxfsizfw25q2c1761wsvcif8gz49cvl";
+    };
+  }
+  {
+    goPackagePath = "github.com/shirou/gopsutil";
+    fetch = {
+      type = "git";
+      url = "https://github.com/shirou/gopsutil";
+      rev = "eeb1d38d69593f121e060d24d17f7b1f0936b203";
+      sha256 = "01qsznk599225gf4pld7p2m30p61y77mvzhrs6raxpk6wf7icp4w";
+    };
+  }
+  {
+    goPackagePath = "golang.org/x/sys";
+    fetch = {
+      type = "git";
+      url = "https://go.googlesource.com/sys";
+      rev = "77b0e4315053a57ed2962443614bdb28db152054";
+      sha256 = "1024gcv1b40i2rgvpgyw2hgy1k5g7473pn29yavwysj37m1rrplp";
+    };
+  }
+]
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 84311e2559e1..9c8acb7cff0e 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1289,6 +1289,8 @@ with pkgs;
 
   goa = callPackage ../development/tools/goa { };
 
+  gohai = callPackage ../tools/system/gohai { };
+
   gorilla-bin = callPackage ../tools/security/gorilla-bin { };
 
   gosu = callPackage ../tools/misc/gosu { };