Skip to content

Commit 2f12902

Browse files
committedJun 1, 2017
Merge remote-tracking branch 'upstream/master' into HEAD
2 parents 8b5dc2d + 08228e8 commit 2f12902

File tree

34 files changed

+353
-321
lines changed

34 files changed

+353
-321
lines changed
 

‎nixos/modules/services/monitoring/dd-agent/dd-agent-defaults.nix

-8
This file was deleted.

‎nixos/modules/services/monitoring/dd-agent/dd-agent.nix

+50-140
Original file line numberDiff line numberDiff line change
@@ -16,100 +16,24 @@ let
1616
forwarder_log_file: /var/log/datadog/forwarder.log
1717
dogstatsd_log_file: /var/log/datadog/dogstatsd.log
1818
pup_log_file: /var/log/datadog/pup.log
19-
20-
# proxy_host: my-proxy.com
21-
# proxy_port: 3128
22-
# proxy_user: user
23-
# proxy_password: password
24-
25-
# tags: mytag0, mytag1
2619
${optionalString (cfg.tags != null ) "tags: ${concatStringsSep "," cfg.tags }"}
27-
28-
# collect_ec2_tags: no
29-
# recent_point_threshold: 30
30-
# use_mount: no
31-
# listen_port: 17123
32-
# graphite_listen_port: 17124
33-
# non_local_traffic: no
34-
# use_curl_http_client: False
35-
# bind_host: localhost
36-
37-
# use_pup: no
38-
# pup_port: 17125
39-
# pup_interface: localhost
40-
# pup_url: http://localhost:17125
41-
42-
# dogstatsd_port : 8125
43-
# dogstatsd_interval : 10
44-
# dogstatsd_normalize : yes
45-
# statsd_forward_host: address_of_own_statsd_server
46-
# statsd_forward_port: 8125
47-
48-
# device_blacklist_re: .*\/dev\/mapper\/lxc-box.*
49-
50-
# ganglia_host: localhost
51-
# ganglia_port: 8651
20+
${cfg.extraDdConfig}
5221
'';
5322

54-
diskConfig = pkgs.writeText "disk.yaml" ''
55-
init_config:
56-
57-
instances:
58-
- use_mount: no
59-
'';
60-
61-
networkConfig = pkgs.writeText "network.yaml" ''
62-
init_config:
63-
64-
instances:
65-
# Network check only supports one configured instance
66-
- collect_connection_state: false
67-
excluded_interfaces:
68-
- lo
69-
- lo0
70-
'';
71-
72-
postgresqlConfig = pkgs.writeText "postgres.yaml" cfg.postgresqlConfig;
73-
nginxConfig = pkgs.writeText "nginx.yaml" cfg.nginxConfig;
74-
mongoConfig = pkgs.writeText "mongo.yaml" cfg.mongoConfig;
75-
jmxConfig = pkgs.writeText "jmx.yaml" cfg.jmxConfig;
76-
processConfig = pkgs.writeText "process.yaml" cfg.processConfig;
77-
7823
etcfiles =
79-
let
80-
defaultConfd = import ./dd-agent-defaults.nix;
81-
in (map (f: { source = "${pkgs.dd-agent}/agent/conf.d-system/${f}";
82-
target = "dd-agent/conf.d/${f}";
83-
}) defaultConfd) ++ [
84-
{ source = ddConf;
85-
target = "dd-agent/datadog.conf";
86-
}
87-
{ source = diskConfig;
88-
target = "dd-agent/conf.d/disk.yaml";
89-
}
90-
{ source = networkConfig;
91-
target = "dd-agent/conf.d/network.yaml";
92-
} ] ++
93-
(optional (cfg.postgresqlConfig != null)
94-
{ source = postgresqlConfig;
95-
target = "dd-agent/conf.d/postgres.yaml";
96-
}) ++
97-
(optional (cfg.nginxConfig != null)
98-
{ source = nginxConfig;
99-
target = "dd-agent/conf.d/nginx.yaml";
100-
}) ++
101-
(optional (cfg.mongoConfig != null)
102-
{ source = mongoConfig;
103-
target = "dd-agent/conf.d/mongo.yaml";
104-
}) ++
105-
(optional (cfg.processConfig != null)
106-
{ source = processConfig;
107-
target = "dd-agent/conf.d/process.yaml";
108-
}) ++
109-
(optional (cfg.jmxConfig != null)
110-
{ source = jmxConfig;
111-
target = "dd-agent/conf.d/jmx.yaml";
112-
});
24+
map (i: { source = if builtins.hasAttr "config" i
25+
then pkgs.writeText "${i.name}.yaml" i.config
26+
else "${pkgs.dd-agent}/agent/conf.d-system/${i.name}.yaml";
27+
target = "dd-agent/conf.d/${i.name}.yaml";
28+
}
29+
) cfg.integrations ++
30+
[ { source = ddConf;
31+
target = "dd-agent/datadog.conf";
32+
}
33+
];
34+
35+
# restart triggers
36+
etcSources = map (i: i.source) etcfiles;
11337

11438
in {
11539
options.services.dd-agent = {
@@ -139,44 +63,46 @@ in {
13963
type = types.uniq (types.nullOr types.string);
14064
};
14165

142-
postgresqlConfig = mkOption {
143-
description = "Datadog PostgreSQL integration configuration";
144-
default = null;
145-
type = types.uniq (types.nullOr types.string);
146-
};
147-
148-
nginxConfig = mkOption {
149-
description = "Datadog nginx integration configuration";
150-
default = null;
151-
type = types.uniq (types.nullOr types.string);
152-
};
153-
154-
mongoConfig = mkOption {
155-
description = "MongoDB integration configuration";
156-
default = null;
157-
type = types.uniq (types.nullOr types.string);
158-
};
159-
160-
jmxConfig = mkOption {
161-
description = "JMX integration configuration";
162-
default = null;
163-
type = types.uniq (types.nullOr types.string);
66+
agent = mkOption {
67+
description = "The dd-agent package to use. Useful when overriding the package.";
68+
default = pkgs.dd-agent;
69+
type = types.package;
16470
};
16571

166-
processConfig = mkOption {
72+
integrations = mkOption {
16773
description = ''
168-
Process integration configuration
169-
170-
See http://docs.datadoghq.com/integrations/process/
74+
Any integrations to use. Default config used if none
75+
specified. It is currently up to the user to make sure that
76+
the dd-agent package used has all the dependencies chosen
77+
integrations require in scope.
78+
'';
79+
type = types.listOf (types.attrsOf types.string);
80+
default = [];
81+
example = ''
82+
[ { name = "elastic";
83+
config = '''
84+
init_config:
85+
86+
instances:
87+
- url: http://localhost:9200
88+
''';
89+
}
90+
{ name = "nginx"; }
91+
{ name = "ntp"; }
92+
{ name = "network"; }
93+
]
17194
'';
172-
default = null;
173-
type = types.uniq (types.nullOr types.string);
17495
};
17596

97+
extraDdConfig = mkOption {
98+
description = "Extra settings to append to datadog agent config.";
99+
default = "";
100+
type = types.string;
101+
};
176102
};
177103

178104
config = mkIf cfg.enable {
179-
environment.systemPackages = [ pkgs."dd-agent" pkgs.sysstat pkgs.procps ];
105+
environment.systemPackages = [ cfg.agent pkgs.sysstat pkgs.procps ];
180106

181107
users.extraUsers.datadog = {
182108
description = "Datadog Agent User";
@@ -190,7 +116,7 @@ in {
190116

191117
systemd.services.dd-agent = {
192118
description = "Datadog agent monitor";
193-
path = [ pkgs."dd-agent" pkgs.python pkgs.sysstat pkgs.procps ];
119+
path = [ cfg.agent pkgs.python pkgs.sysstat pkgs.procps ];
194120
wantedBy = [ "multi-user.target" ];
195121
serviceConfig = {
196122
ExecStart = "${pkgs.dd-agent}/bin/dd-agent foreground";
@@ -199,28 +125,12 @@ in {
199125
Restart = "always";
200126
RestartSec = 2;
201127
};
202-
restartTriggers = [ pkgs.dd-agent ddConf diskConfig networkConfig postgresqlConfig nginxConfig mongoConfig jmxConfig processConfig ];
203-
};
204-
205-
systemd.services.dogstatsd = {
206-
description = "Datadog statsd";
207-
path = [ pkgs."dd-agent" pkgs.python pkgs.procps ];
208-
wantedBy = [ "multi-user.target" ];
209-
serviceConfig = {
210-
ExecStart = "${pkgs.dd-agent}/bin/dogstatsd start";
211-
User = "datadog";
212-
Group = "datadog";
213-
Type = "forking";
214-
PIDFile = "/tmp/dogstatsd.pid";
215-
Restart = "always";
216-
RestartSec = 2;
217-
};
218-
restartTriggers = [ pkgs.dd-agent ddConf diskConfig networkConfig postgresqlConfig nginxConfig mongoConfig jmxConfig processConfig ];
128+
restartTriggers = [ pkgs.dd-agent ddConf ] ++ etcSources;
219129
};
220130

221-
systemd.services.dd-jmxfetch = lib.mkIf (cfg.jmxConfig != null) {
131+
systemd.services.dd-jmxfetch = lib.mkIf (builtins.any (i: i.name == "jmx") cfg.integrations) {
222132
description = "Datadog JMX Fetcher";
223-
path = [ pkgs."dd-agent" pkgs.python pkgs.sysstat pkgs.procps pkgs.jdk ];
133+
path = [ cfg.agent pkgs.python pkgs.sysstat pkgs.procps pkgs.jdk ];
224134
wantedBy = [ "multi-user.target" ];
225135
serviceConfig = {
226136
ExecStart = "${pkgs.dd-agent}/bin/dd-jmxfetch";
@@ -229,7 +139,7 @@ in {
229139
Restart = "always";
230140
RestartSec = 2;
231141
};
232-
restartTriggers = [ pkgs.dd-agent ddConf diskConfig networkConfig postgresqlConfig nginxConfig mongoConfig jmxConfig ];
142+
restartTriggers = [ cfg.agent ddConf ] ++ etcSources;
233143
};
234144

235145
environment.etc = etcfiles;

‎nixos/modules/services/monitoring/dd-agent/update-dd-agent-defaults

-9
This file was deleted.

‎pkgs/applications/misc/electrum/default.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
python2Packages.buildPythonApplication rec {
44
name = "electrum-${version}";
5-
version = "2.8.2";
5+
version = "2.8.3";
66

77
src = fetchurl {
88
url = "https://download.electrum.org/${version}/Electrum-${version}.tar.gz";
9-
sha256 = "01xphbi7lx64s9380zjfakz5h8blqmxp0ryqlll7px66qpmjn5fq";
9+
sha256 = "04jswalydzwm16iismbq1h2shj17iq9sqm0mz8p98sh3dwkacvn1";
1010
};
1111

1212
propagatedBuildInputs = with python2Packages; [

‎pkgs/applications/misc/taskwarrior/default.nix

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ stdenv.mkDerivation rec {
1616
nativeBuildInputs = [ cmake libuuid gnutls ];
1717

1818
postInstall = ''
19-
mkdir -p "$out/etc/bash_completion.d"
20-
ln -s "../../share/doc/task/scripts/bash/task.sh" "$out/etc/bash_completion.d/"
19+
mkdir -p "$out/share/bash-completion/completions"
20+
ln -s "../../doc/task/scripts/bash/task.sh" "$out/share/bash-completion/completions/"
21+
mkdir -p "$out/etc/fish/completions"
22+
ln -s "../../../share/doc/task/scripts/fish/task.fish" "$out/etc/fish/completions/"
2123
'';
2224

2325
meta = with stdenv.lib; {

‎pkgs/applications/networking/dropbox/default.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
let
2424
# NOTE: When updating, please also update in current stable,
2525
# as older versions stop working
26-
version = "26.4.24";
26+
version = "27.4.22";
2727
sha256 =
2828
{
29-
"x86_64-linux" = "1qzz88d3akbqfk1539w2z0ldyjjscqjqgsvadf9i4xr2y0syfv4y";
30-
"i686-linux" = "12xwmmycrg56xl88k9pqd7mcn0jqi4jijf36vn4fdjvmn7ksskcw";
29+
"x86_64-linux" = "1v1q799dj0bffg3s98ifzpsccjaajl221h5ckaqijlmpzr2q5hhh";
30+
"i686-linux" = "1qsw6c0mb0n0djz7xpfixispi9k68kbvf8dc92frpcbcvm0h845y";
3131
}."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
3232

3333
arch =

‎pkgs/development/python-modules/Nikola/default.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
buildPythonPackage rec {
3131
name = "${pname}-${version}";
3232
pname = "Nikola";
33-
version = "7.8.4";
33+
version = "7.8.6";
3434

3535
# Nix contains only Python 3 supported version of doit, which is a dependency
3636
# of Nikola. Python 2 support would require older doit 0.29.0 (which on the
@@ -47,7 +47,7 @@ buildPythonPackage rec {
4747

4848
src = fetchPypi {
4949
inherit pname version;
50-
sha256 = "14pd5zk6l6f58snq9n9zpxwhqcc3xz8b1gz31zsrqajggg1i8fn8";
50+
sha256 = "48d3a00c3fc9c61bcd305653a531949bdd777d9211434172549498fd8136e036";
5151
};
5252

5353
meta = {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{ lib
2+
, buildPythonPackage
3+
, fetchPypi
4+
}:
5+
6+
buildPythonPackage rec {
7+
pname = "appdirs";
8+
version = "1.4.3";
9+
name = "${pname}-${version}";
10+
11+
src = fetchPypi {
12+
inherit pname version;
13+
sha256 = "9e5896d1372858f8dd3344faf4e5014d21849c756c8d5701f78f8a103b372d92";
14+
};
15+
16+
meta = {
17+
description = "A python module for determining appropriate platform-specific dirs";
18+
homepage = http://github.com/ActiveState/appdirs;
19+
license = lib.licenses.mit;
20+
};
21+
}

‎pkgs/development/python-modules/bootstrapped-pip/default.nix

+19-12
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
1-
{ stdenv, python, fetchurl, makeWrapper, unzip }:
1+
{ stdenv, python, fetchPypi, makeWrapper, unzip }:
22

33
let
4-
wheel_source = fetchurl {
5-
url = "https://pypi.python.org/packages/py2.py3/w/wheel/wheel-0.29.0-py2.py3-none-any.whl";
4+
wheel_source = fetchPypi {
5+
pname = "wheel";
6+
version = "0.29.0";
7+
format = "wheel";
68
sha256 = "ea8033fc9905804e652f75474d33410a07404c1a78dd3c949a66863bd1050ebd";
79
};
8-
setuptools_source = fetchurl {
9-
url = "https://files.pythonhosted.org/packages/b8/cb/b919f52dd81b4b2210d0c5529b6b629a4002e08d49a90183605d1181b10c/setuptools-30.2.0-py2.py3-none-any.whl";
10-
sha256 = "b7e7b28d6a728ea38953d66e12ef400c3c153c523539f1b3997c5a42f3770ff1";
10+
setuptools_source = fetchPypi {
11+
pname = "setuptools";
12+
version = "36.0.1";
13+
format = "wheel";
14+
sha256 = "f2900e560efc479938a219433c48f15a4ff4ecfe575a65de385eeb44f2425587";
1115
};
12-
argparse_source = fetchurl {
13-
url = "https://pypi.python.org/packages/2.7/a/argparse/argparse-1.4.0-py2.py3-none-any.whl";
14-
sha256 = "0533cr5w14da8wdb2q4py6aizvbvsdbk3sj7m1jx9lwznvnlf5n3";
16+
argparse_source = fetchPypi {
17+
pname = "argparse";
18+
version = "1.4.0";
19+
sha256 = "c31647edb69fd3d465a847ea3157d37bed1f95f19760b11a47aa91c04b666314";
1520
};
1621
in stdenv.mkDerivation rec {
17-
name = "${python.libPrefix}-bootstrapped-pip-${version}";
22+
pname = "pip";
1823
version = "9.0.1";
24+
name = "${python.libPrefix}-bootstrapped-${pname}-${version}";
1925

20-
src = fetchurl {
21-
url = "https://files.pythonhosted.org/packages/b6/ac/7015eb97dc749283ffdec1c3a88ddb8ae03b8fad0f0e611408f196358da3/pip-9.0.1-py2.py3-none-any.whl";
26+
src = fetchPypi {
27+
inherit pname version;
28+
format = "wheel";
2229
sha256 = "690b762c0a8460c303c089d5d0be034fb15a5ea2b75bdf565f40421f542fefb0";
2330
};
2431

0 commit comments

Comments
 (0)
Please sign in to comment.