Skip to content

Commit

Permalink
Merge branch 'master' into staging
Browse files Browse the repository at this point in the history
Hydra: ?compare=1400181
  • Loading branch information
vcunat committed Oct 9, 2017
2 parents 416979f + 28cd0f2 commit 994036d
Show file tree
Hide file tree
Showing 30 changed files with 448 additions and 48 deletions.
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Expand Up @@ -375,6 +375,7 @@
./services/monitoring/prometheus/collectd-exporter.nix
./services/monitoring/prometheus/fritzbox-exporter.nix
./services/monitoring/prometheus/json-exporter.nix
./services/monitoring/prometheus/minio-exporter.nix
./services/monitoring/prometheus/nginx-exporter.nix
./services/monitoring/prometheus/node-exporter.nix
./services/monitoring/prometheus/snmp-exporter.nix
Expand Down
117 changes: 117 additions & 0 deletions nixos/modules/services/monitoring/prometheus/minio-exporter.nix
@@ -0,0 +1,117 @@
{ config, pkgs, lib, ... }:

with lib;

let
cfg = config.services.prometheus.minioExporter;
in {
options = {
services.prometheus.minioExporter = {
enable = mkEnableOption "prometheus minio exporter";

port = mkOption {
type = types.int;
default = 9290;
description = ''
Port to listen on.
'';
};

listenAddress = mkOption {
type = types.nullOr types.str;
default = null;
example = "0.0.0.0";
description = ''
Address to listen on for web interface and telemetry.
'';
};

minioAddress = mkOption {
type = types.str;
example = "https://10.0.0.1:9000";
default = if config.services.minio.enable then "http://localhost:9000" else null;
description = ''
The URL of the minio server.
Use HTTPS if Minio accepts secure connections only.
By default this connects to the local minio server if enabled.
'';
};

minioAccessKey = mkOption ({
type = types.str;
example = "BKIKJAA5BMMU2RHO6IBB";
description = ''
The value of the Minio access key.
It is required in order to connect to the server.
By default this uses the one from the local minio server if enabled
and <literal>config.services.minio.accessKey</literal>.
'';
} // optionalAttrs (config.services.minio.enable && config.services.minio.accessKey != "") {
default = config.services.minio.accessKey;
});

minioAccessSecret = mkOption ({
type = types.str;
description = ''
The calue of the Minio access secret.
It is required in order to connect to the server.
By default this uses the one from the local minio server if enabled
and <literal>config.services.minio.secretKey</literal>.
'';
} // optionalAttrs (config.services.minio.enable && config.services.minio.secretKey != "") {
default = config.services.minio.secretKey;
});

minioBucketStats = mkOption {
type = types.bool;
default = false;
description = ''
Collect statistics about the buckets and files in buckets.
It requires more computation, use it carefully in case of large buckets..
'';
};

extraFlags = mkOption {
type = types.listOf types.str;
default = [];
description = ''
Extra commandline options when launching the minio exporter.
'';
};

openFirewall = mkOption {
type = types.bool;
default = false;
description = ''
Open port in firewall for incoming connections.
'';
};
};
};

config = mkIf cfg.enable {
networking.firewall.allowedTCPPorts = optional cfg.openFirewall cfg.port;

systemd.services.prometheus-minio-exporter = {
description = "Prometheus exporter for Minio server metrics";
unitConfig.Documentation = "https://github.com/joe-pll/minio-exporter";
wantedBy = [ "multi-user.target" ];
after = optional config.services.minio.enable "minio.service";
serviceConfig = {
DynamicUser = true;
Restart = "always";
PrivateTmp = true;
WorkingDirectory = /tmp;
ExecStart = ''
${pkgs.prometheus-minio-exporter}/bin/minio-exporter \
-web.listen-address ${optionalString (cfg.listenAddress != null) cfg.listenAddress}:${toString cfg.port} \
-minio.server ${cfg.minioAddress} \
-minio.access-key ${cfg.minioAccessKey} \
-minio.access-secret ${cfg.minioAccessSecret} \
${optionalString cfg.minioBucketStats "-minio.bucket-stats"} \
${concatStringsSep " \\\n " cfg.extraFlags}
'';
};
};
};
}
2 changes: 2 additions & 0 deletions nixos/modules/services/network-filesystems/kbfs.nix
Expand Up @@ -59,5 +59,7 @@ in {
};

services.keybase.enable = true;

environment.systemPackages = [ pkgs.kbfs ];
};
}
Expand Up @@ -93,7 +93,6 @@ in
preStop = ''
${pkgs.utillinux}/bin/umount /afs
${openafsPkgs}/sbin/afsd -shutdown
${pkgs.kmod}/sbin/rmmod libafs
'';
};
};
Expand Down
4 changes: 3 additions & 1 deletion nixos/tests/minio.nix
Expand Up @@ -12,6 +12,9 @@ import ./make-test.nix ({ pkgs, ...} : {
secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12";
};
environment.systemPackages = [ pkgs.minio-client ];

# Minio requires at least 1GiB of free disk space to run.
virtualisation.diskSize = 4 * 1024;
};
};

Expand All @@ -20,7 +23,6 @@ import ./make-test.nix ({ pkgs, ...} : {
startAll;
$machine->waitForUnit("minio.service");
$machine->waitForOpenPort(9000);
$machine->succeed("curl --fail http://localhost:9000/minio/index.html");
# Create a test bucket on the server
$machine->succeed("mc config host add minio http://localhost:9000 BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12 S3v4");
Expand Down
11 changes: 5 additions & 6 deletions pkgs/applications/editors/zile/default.nix
@@ -1,28 +1,27 @@
{ fetchurl, stdenv, pkgconfig, ncurses, boehmgc, perl, help2man }:

stdenv.mkDerivation rec {
name = "zile-2.4.13";
name = "zile-2.4.14";

src = fetchurl {
url = "mirror://gnu/zile/${name}.tar.gz";
sha256 = "03mcg0bxkzprlsx8y6h22w924pzx4a9zr7zm3g11j8j3x9lz75f7";
sha256 = "0x3byaddms8l3g7igx6njycqsq98wgapysdb5c7lhcnajlkp8y3s";
};

nativeBuildInputs = [ pkgconfig perl ]
buildInputs = [ ncurses boehmgc ];
nativeBuildInputs = [ perl pkgconfig ]
# `help2man' wants to run Zile, which won't work when the
# newly-produced binary can't be run at build-time.
++ stdenv.lib.optional
(stdenv.hostPlatform == stdenv.buildPlatform)
help2man;

buildInputs = [ ncurses boehmgc ];

# Tests can't be run because most of them rely on the ability to
# fiddle with the terminal.
doCheck = false;

# XXX: Work around cross-compilation-unfriendly `gl_FUNC_FSTATAT' macro.
preConfigure = "export gl_cv_func_fstatat_zero_flag=yes";
gl_cv_func_fstatat_zero_flag="yes";

meta = with stdenv.lib; {
description = "Lightweight Emacs clone";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/data/misc/hackage/default.nix
Expand Up @@ -6,6 +6,6 @@
fetchFromGitHub {
owner = "commercialhaskell";
repo = "all-cabal-hashes";
rev = "b490d26340638934d13c0c0cd4089dec0fb6b85e";
sha256 = "0cz76wcdlh5512g1aviv0ac9qwj1mmy9ncp6q4yywylxrlqgcbj5";
rev = "901c2522e6797270f5ded4495b1a529e6c16ef45";
sha256 = "0wng314y3yn6bbwa5ar254l7p8y99gsvm8ll4z7f3wg77v5fzish";
}
37 changes: 37 additions & 0 deletions pkgs/development/libraries/hotpatch/default.nix
@@ -0,0 +1,37 @@
{ stdenv, fetchFromGitHub, cmake }:

stdenv.mkDerivation rec {
name = "hotpatch-0.2";

src = fetchFromGitHub {
owner = "vikasnkumar";
repo = "hotpatch";
rev = "4b65e3f275739ea5aa798d4ad083c4cb10e29149";
sha256 = "169vdh55wsbn6fl58lpzqx64v6ifzh7krykav33x1d9hsk98qjqh";
};

enableParallelBuilding = true;
doCheck = true;

nativeBuildInputs = [ cmake ];

preConfigure = ''
substituteInPlace test/loader.c \
--replace \"/lib64/ld-linux-x86-64.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" \
--replace \"/lib/ld-linux-x86-64.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" \
--replace \"/lib/ld-linux.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" \
--replace \"/lib32/ld-linux.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)"
'';

checkPhase = ''
LD_LIBRARY_PATH=$(pwd)/src make test
'';

meta = with stdenv.lib; {
description = "Hot patching executables on Linux using .so file injection";
homepage = src.meta.homepage;
license = licenses.bsd3;
maintainers = [ maintainers.gnidorah ];
platforms = ["i686-linux" "x86_64-linux"];
};
}
1 change: 1 addition & 0 deletions pkgs/development/libraries/xmlsec/default.nix
Expand Up @@ -27,6 +27,7 @@ stdenv.mkDerivation rec {

# otherwise libxmlsec1-gnutls.so won't find libgcrypt.so, after #909
NIX_LDFLAGS = [ "-lgcrypt" ];
NIX_CFLAGS_COMPILE = [ "-I${nss.dev}/include/nss" ];

postInstall = ''
moveToOutput "bin/xmlsec1-config" "$dev"
Expand Down
13 changes: 10 additions & 3 deletions pkgs/development/ocaml-modules/janestreet/default.nix
Expand Up @@ -27,12 +27,19 @@ rec {
meta.description = "OCaml compiler libraries repackaged";
};

ppx_ast = janePackage {
ppx_ast = janePackage ({
name = "ppx_ast";
hash = "0p9v4q3cjz8wwdrh6bjidani2npzvhdy8isnqwigqkl6n326dba9";
propagatedBuildInputs = [ ocaml-compiler-libs ocaml-migrate-parsetree ];
meta.description = "OCaml AST used by Jane Street ppx rewriters";
};
} // (if lib.versionAtLeast ocaml.version "4.06"
then {
version = "0.9.2";
hash = "1h4qf26rg23z21rrw83fakiavw9km7174p3830pg0gg4bwakvba0";
} else {
version = "0.9.1";
hash = "0a9rxwavy2748k0yd4db3hg1ypq7mpqnwq9si5a5qdiclgkhcggw";
}
));

ppx_traverse_builtins = janePackage {
name = "ppx_traverse_builtins";
Expand Down
10 changes: 8 additions & 2 deletions pkgs/development/ocaml-modules/ounit/default.nix
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, camlp4 }:
{ stdenv, fetchurl, fetchpatch, ocaml, findlib, ocamlbuild }:

stdenv.mkDerivation {
name = "ounit-2.0.0";
Expand All @@ -8,7 +8,13 @@ stdenv.mkDerivation {
sha256 = "118xsadrx84pif9vaq13hv4yh22w9kmr0ypvhrs0viir1jr0ajjd";
};

buildInputs = [ ocaml findlib ocamlbuild camlp4 ];
patches = with stdenv.lib;
optional (versionAtLeast ocaml.version "4.02") (fetchpatch {
url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/ounit/ounit.2.0.0/files/safe-string.patch";
sha256 = "0hbd2sqdz75lv5ax82yhsfdk1dlcvq12xpys6n85ysmrl0c3d3lk";
});

buildInputs = [ ocaml findlib ocamlbuild ];

dontAddPrefix = true;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/tools/devtodo/default.nix
Expand Up @@ -18,6 +18,6 @@ stdenv.mkDerivation rec {
description = "A hierarchical command-line task manager";
license = licenses.gpl2;
maintainers = [ maintainers.woffs ];
platforms = platforms.all;
platforms = platforms.linux;
};
}
8 changes: 2 additions & 6 deletions pkgs/development/tools/ocaml/oasis/default.nix
@@ -1,6 +1,4 @@
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, camlp4
, ocaml_data_notation, type_conv, ocamlmod, ocamlify, ounit, expect
}:
{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, ocamlmod, ocamlify }:

stdenv.mkDerivation rec {
version = "0.4.10";
Expand All @@ -17,11 +15,9 @@ stdenv.mkDerivation rec {

buildInputs =
[
ocaml findlib ocamlbuild type_conv ocamlmod ocamlify ounit camlp4
ocaml findlib ocamlbuild ocamlmod ocamlify
];

propagatedBuildInputs = [ ocaml_data_notation ];

configurePhase = "ocaml setup.ml -configure --prefix $out";
buildPhase = "ocaml setup.ml -build";
installPhase = "ocaml setup.ml -install";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/misc/emulators/yabause/default.nix
Expand Up @@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
description = "An open-source Sega Saturn emulator";
homepage = https://yabause.org/;
license = licenses.gpl2Plus;
maintainers = with maintaines; [ AndersonTorres ];
maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.linux;
};
}
8 changes: 5 additions & 3 deletions pkgs/misc/vim-plugins/vim-utils.nix
Expand Up @@ -373,8 +373,10 @@ rec {
}
'';

addRtp = path: derivation:
derivation // { rtp = "${derivation}/${path}"; };
addRtp = path: attrs: derivation:
derivation // { rtp = "${derivation}/${path}"; } // {
overrideAttrs = f: buildVimPlugin (attrs // f attrs);
};

buildVimPlugin = a@{
name,
Expand All @@ -389,7 +391,7 @@ rec {
addonInfo ? null,
...
}:
addRtp "${rtpPath}/${path}" (stdenv.mkDerivation (a // {
addRtp "${rtpPath}/${path}" a (stdenv.mkDerivation (a // {
name = namePrefix + name;

inherit unpackPhase configurePhase buildPhase addonInfo preInstall postInstall;
Expand Down
4 changes: 3 additions & 1 deletion pkgs/os-specific/linux/fbterm/default.nix
Expand Up @@ -9,15 +9,17 @@ let
url="http://fbterm.googlecode.com/files/fbterm-1.7.0.tar.gz";
sha256="0pciv5by989vzvjxsv1jsv4bdp4m8j0nfbl29jm5fwi12w4603vj";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [gpm freetype fontconfig ncurses libx86];
in
stdenv.mkDerivation {
inherit (s) name version;
src = fetchurl {
inherit (s) url sha256;
};

nativeBuildInputs = [ pkgconfig ];
inherit buildInputs;

preConfigure = ''
sed -e '/ifdef SYS_signalfd/atypedef long long loff_t;' -i src/fbterm.cpp
sed -e '/install-exec-hook:/,/^[^\t]/{d}; /.NOEXPORT/iinstall-exec-hook:\
Expand Down
7 changes: 7 additions & 0 deletions pkgs/os-specific/linux/wireguard/default.nix
Expand Up @@ -47,6 +47,8 @@ let

buildInputs = [ libmnl ];

enableParallelBuilding = true;

makeFlags = [
"WITH_BASHCOMPLETION=yes"
"WITH_WGQUICK=yes"
Expand All @@ -57,6 +59,11 @@ let
];

buildPhase = "make tools";

postInstall = ''
substituteInPlace $out/lib/systemd/system/wg-quick@.service \
--replace /usr/bin $out/bin
'';
};

in if kernel == null
Expand Down

0 comments on commit 994036d

Please sign in to comment.