Skip to content

Commit

Permalink
Merge branch 'master' into staging
Browse files Browse the repository at this point in the history
The haskell split got reverted (again).
Hydra: ?compare=1416012
  • Loading branch information
vcunat committed Dec 5, 2017
2 parents a9b5900 + fd7953d commit 689d630
Show file tree
Hide file tree
Showing 39 changed files with 1,125 additions and 991 deletions.
4 changes: 2 additions & 2 deletions nixos/modules/config/networking.nix
Expand Up @@ -290,8 +290,8 @@ in
ln -s /run/systemd/resolve/resolv.conf /run/resolvconf/interfaces/systemd
''}
# Make sure resolv.conf is up to date if not managed by systemd
${optionalString (!config.services.resolved.enable) ''
# Make sure resolv.conf is up to date if not managed manually or by systemd
${optionalString (!config.environment.etc?"resolv.conf") ''
${pkgs.openresolv}/bin/resolvconf -u
''}
'';
Expand Down
31 changes: 22 additions & 9 deletions nixos/modules/services/monitoring/statsd.nix
Expand Up @@ -9,6 +9,12 @@ let
isBuiltinBackend = name:
builtins.elem name [ "graphite" "console" "repeater" ];

backendsToPackages = let
mkMap = list: name:
if isBuiltinBackend name then list
else list ++ [ pkgs.nodePackages.${name} ];
in foldl mkMap [];

configFile = pkgs.writeText "statsd.conf" ''
{
address: "${cfg.listenAddress}",
Expand All @@ -27,13 +33,21 @@ let
prettyprint: false
},
log: {
backend: "syslog"
backend: "stdout"
},
automaticConfigReload: false${optionalString (cfg.extraConfig != null) ","}
${cfg.extraConfig}
}
'';

deps = pkgs.buildEnv {
name = "statsd-runtime-deps";
pathsToLink = [ "/lib" ];
ignoreCollisions = true;

paths = backendsToPackages cfg.backends;
};

in

{
Expand All @@ -42,11 +56,7 @@ in

options.services.statsd = {

enable = mkOption {
description = "Whether to enable statsd stats aggregation service";
default = false;
type = types.bool;
};
enable = mkEnableOption "statsd";

listenAddress = mkOption {
description = "Address that statsd listens on over UDP";
Expand Down Expand Up @@ -110,6 +120,11 @@ in

config = mkIf cfg.enable {

assertions = map (backend: {
assertion = !isBuiltinBackend backend -> hasAttrByPath [ backend ] pkgs.nodePackages;
message = "Only builtin backends (graphite, console, repeater) or backends enumerated in `pkgs.nodePackages` are allowed!";
}) cfg.backends;

users.extraUsers = singleton {
name = "statsd";
uid = config.ids.uids.statsd;
Expand All @@ -120,9 +135,7 @@ in
description = "Statsd Server";
wantedBy = [ "multi-user.target" ];
environment = {
NODE_PATH=concatMapStringsSep ":"
(pkg: "${builtins.getAttr pkg pkgs.statsd.nodePackages}/lib/node_modules")
(filter (name: !isBuiltinBackend name) cfg.backends);
NODE_PATH = "${deps}/lib/node_modules";
};
serviceConfig = {
ExecStart = "${pkgs.statsd}/bin/statsd ${configFile}";
Expand Down
1 change: 1 addition & 0 deletions nixos/release.nix
Expand Up @@ -332,6 +332,7 @@ in rec {
tests.slim = callTest tests/slim.nix {};
tests.smokeping = callTest tests/smokeping.nix {};
tests.snapper = callTest tests/snapper.nix {};
tests.statsd = callTest tests/statsd.nix {};
tests.switchTest = callTest tests/switch-test.nix {};
tests.taskserver = callTest tests/taskserver.nix {};
tests.tomcat = callTest tests/tomcat.nix {};
Expand Down
40 changes: 40 additions & 0 deletions nixos/tests/statsd.nix
@@ -0,0 +1,40 @@
import ./make-test.nix ({ pkgs, lib }:

with lib;

{
name = "statsd";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ ma27 ];
};

nodes.statsd1 = {
services.statsd.enable = true;
services.statsd.backends = [ "statsd-influxdb-backend" "console" ];
services.statsd.extraConfig = ''
influxdb: {
username: "root",
password: "root",
database: "statsd"
}
'';

services.influxdb.enable = true;

systemd.services.influx-init = {
description = "Setup Influx Test Base";
after = [ "influxdb.service" ];
before = [ "statsd.service" ];

script = ''
echo "CREATE DATABASE statsd" | ${pkgs.influxdb}/bin/influx
'';
};
};

testScript = ''
$statsd1->start();
$statsd1->waitForUnit("statsd.service");
$statsd1->succeed("nc -z 127.0.0.1 8126");
'';
})
11 changes: 5 additions & 6 deletions pkgs/applications/networking/p2p/transmission/default.nix
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, intltool, file, makeWrapper
{ stdenv, fetchurl, pkgconfig, intltool, file, wrapGAppsHook
, openssl, curl, libevent, inotify-tools, systemd, zlib
, enableGTK3 ? false, gtk3
, enableSystemd ? stdenv.isLinux
Expand All @@ -20,9 +20,10 @@ stdenv.mkDerivation rec {
sha256 = "0pykmhi7pdmzq47glbj8i2im6iarp4wnj4l1pyvsrnba61f0939s";
};

nativeBuildInputs = [ pkgconfig ];
nativeBuildInputs = [ pkgconfig ]
++ optionals enableGTK3 [ wrapGAppsHook ];
buildInputs = [ intltool file openssl curl libevent zlib ]
++ optionals enableGTK3 [ gtk3 makeWrapper ]
++ optionals enableGTK3 [ gtk3 ]
++ optionals enableSystemd [ systemd ]
++ optionals stdenv.isLinux [ inotify-tools ];

Expand All @@ -41,10 +42,8 @@ stdenv.mkDerivation rec {
++ optional enableSystemd "--with-systemd-daemon"
++ optional enableGTK3 "--with-gtk";

preFixup = optionalString enableGTK3 /* gsettings schemas for file dialogues */ ''
preFixup = optionalString enableGTK3 ''
rm "$out/share/icons/hicolor/icon-theme.cache"
wrapProgram "$out/bin/transmission-gtk" \
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
'';

NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework CoreFoundation";
Expand Down
13 changes: 13 additions & 0 deletions pkgs/build-support/vm/default.nix
Expand Up @@ -1322,6 +1322,19 @@ rec {
archs = ["noarch" "x86_64"];
packages = commonCentOSPackages ++ [ "procps-ng" ];
};

centos74x86_64 = rec {
name = "centos-7.4-x86_64";
fullName = "CentOS 7.4 (x86_64)";
# N.B. Switch to vault.centos.org when the next release comes out
urlPrefix = http://mirror.centos.org/centos-7/7.4.1708/os/x86_64;
packagesList = fetchurl {
url = "${urlPrefix}/repodata/b686d3a0f337323e656d9387b9a76ce6808b26255fc3a138b1a87d3b1cb95ed5-primary.xml.gz";
sha256 = "1mayp4f3nzd8n4wa3hsz4lk8p076djkvk1wkdmjkwcipyfhd71mn";
};
archs = ["noarch" "x86_64"];
packages = commonCentOSPackages ++ [ "procps-ng" ];
};
};


Expand Down
1 change: 0 additions & 1 deletion pkgs/desktops/gnome-3/core/dconf-editor/default.nix
Expand Up @@ -7,7 +7,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig wrapGAppsHook ];

buildInputs = [ vala libxslt glib dbus_glib gnome3.gtk libxml2 gnome3.defaultIconTheme
gnome3.gsettings_desktop_schemas
intltool docbook_xsl docbook_xsl_ns gnome3.dconf ];

meta = with stdenv.lib; {
Expand Down
167 changes: 0 additions & 167 deletions pkgs/development/compilers/dmd/2.067.1.nix

This file was deleted.

0 comments on commit 689d630

Please sign in to comment.