Skip to content

Commit

Permalink
Merge branch 'master' into staging
Browse files Browse the repository at this point in the history
Hydra: ?compare=1427817
  • Loading branch information
vcunat committed Jan 20, 2018
2 parents 5fafb7e + b81c65c commit 94f4857
Show file tree
Hide file tree
Showing 56 changed files with 4,720 additions and 859 deletions.
10 changes: 5 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -12,17 +12,17 @@

# Libraries
/lib @edolstra @nbp
/lib/systems @edolstra @nbp @ericson2314
/lib/systems @nbp @ericson2314

# Nixpkgs Internals
/default.nix @nbp
/pkgs/top-level/default.nix @nbp @Ericson2314
/pkgs/top-level/impure.nix @nbp @Ericson2314
/pkgs/top-level/stage.nix @nbp @Ericson2314
/pkgs/stdenv @edolstra
/pkgs/build-support/cc-wrapper @edolstra @Ericson2314
/pkgs/build-support/bintools-wrapper @edolstra @Ericson2314
/pkgs/build-support/setup-hooks @edolstra @Ericson2314
/pkgs/stdenv
/pkgs/build-support/cc-wrapper @Ericson2314 @orivej
/pkgs/build-support/bintools-wrapper @Ericson2314 @orivej
/pkgs/build-support/setup-hooks @Ericson2314

# NixOS Internals
/nixos/default.nix @nbp
Expand Down
6 changes: 4 additions & 2 deletions maintainers/scripts/debian-patches.sh
Expand Up @@ -4,11 +4,13 @@
# Usage $0 debian-patches.txt debian-patches.nix
# An example input and output files can be found in applications/graphics/xara/

DEB_URL=http://patch-tracker.debian.org/patch/series/dl
DEB_URL=https://sources.debian.org/data/main
declare -a deb_patches
mapfile -t deb_patches < $1

prefix="${DEB_URL}/${deb_patches[0]}"
# First letter
deb_prefix="${deb_patches[0]:0:1}"
prefix="${DEB_URL}/${deb_prefix}/${deb_patches[0]}/debian/patches"

if [[ -n "$2" ]]; then
exec 1> $2
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Expand Up @@ -200,6 +200,7 @@
./services/desktops/dleyna-server.nix
./services/desktops/geoclue2.nix
./services/desktops/gnome3/at-spi2-core.nix
./services/desktops/gnome3/chrome-gnome-shell.nix
./services/desktops/gnome3/evolution-data-server.nix
./services/desktops/gnome3/gnome-disks.nix
./services/desktops/gnome3/gnome-documents.nix
Expand Down
27 changes: 27 additions & 0 deletions nixos/modules/services/desktops/gnome3/chrome-gnome-shell.nix
@@ -0,0 +1,27 @@
# Chrome GNOME Shell native host connector.
{ config, lib, pkgs, ... }:

with lib;

{
###### interface
options = {
services.gnome3.chrome-gnome-shell.enable = mkEnableOption ''
Chrome GNOME Shell native host connector, a DBus service
allowing to install GNOME Shell extensions from a web browser.
'';
};


###### implementation
config = mkIf config.services.gnome3.chrome-gnome-shell.enable {
environment.etc = {
"chromium/native-messaging-hosts/org.gnome.chrome_gnome_shell.json".source = "${pkgs.chrome-gnome-shell}/etc/chromium/native-messaging-hosts/org.gnome.chrome_gnome_shell.json";
"opt/chrome/native-messaging-hosts/org.gnome.chrome_gnome_shell.json".source = "${pkgs.chrome-gnome-shell}/etc/opt/chrome/native-messaging-hosts/org.gnome.chrome_gnome_shell.json";
};

environment.systemPackages = [ pkgs.chrome-gnome-shell ];

services.dbus.packages = [ pkgs.chrome-gnome-shell ];
};
}
54 changes: 44 additions & 10 deletions nixos/modules/services/monitoring/netdata.nix
Expand Up @@ -5,18 +5,25 @@ with lib;
let
cfg = config.services.netdata;

configFile = pkgs.writeText "netdata.conf" cfg.configText;
wrappedPlugins = pkgs.runCommand "wrapped-plugins" {} ''
mkdir -p $out/libexec/netdata/plugins.d
ln -s /run/wrappers/bin/apps.plugin $out/libexec/netdata/plugins.d/apps.plugin
'';

localConfig = {
global = {
"plugins directory" = "${wrappedPlugins}/libexec/netdata/plugins.d ${pkgs.netdata}/libexec/netdata/plugins.d";
};
};
mkConfig = generators.toINI {} (recursiveUpdate localConfig cfg.config);
configFile = pkgs.writeText "netdata.conf" (if cfg.configText != null then cfg.configText else mkConfig);

defaultUser = "netdata";

in {
options = {
services.netdata = {
enable = mkOption {
default = false;
type = types.bool;
description = "Whether to enable netdata monitoring.";
};
enable = mkEnableOption "netdata";

user = mkOption {
type = types.str;
Expand All @@ -31,9 +38,9 @@ in {
};

configText = mkOption {
type = types.lines;
default = "";
description = "netdata.conf configuration.";
type = types.nullOr types.lines;
description = "Verbatim netdata.conf, cannot be combined with config.";
default = null;
example = ''
[global]
debug log = syslog
Expand All @@ -42,11 +49,29 @@ in {
'';
};

config = mkOption {
type = types.attrsOf types.attrs;
default = {};
description = "netdata.conf configuration as nix attributes. cannot be combined with configText.";
example = literalExample ''
global = {
"debug log" = "syslog";
"access log" = "syslog";
"error log" = "syslog";
};
'';
};
};
};
};

config = mkIf cfg.enable {
assertions =
[ { assertion = cfg.config != {} -> cfg.configText == null ;
message = "Cannot specify both config and configText";
}
];
systemd.services.netdata = {
path = with pkgs; [ gawk curl ];
description = "Real time performance monitoring";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
Expand All @@ -66,6 +91,15 @@ in {
};
};

security.wrappers."apps.plugin" = {
source = "${pkgs.netdata}/libexec/netdata/plugins.d/apps.plugin";
capabilities = "cap_dac_read_search,cap_sys_ptrace+ep";
owner = cfg.user;
group = cfg.group;
permissions = "u+rx,g+rx,o-rwx";
};


users.extraUsers = optional (cfg.user == defaultUser) {
name = defaultUser;
};
Expand Down
2 changes: 1 addition & 1 deletion nixos/release-combined.nix
Expand Up @@ -80,7 +80,7 @@ in rec {
(all nixos.tests.boot.uefiUsb)
(all nixos.tests.boot-stage1)
(all nixos.tests.hibernate)
nixos.tests.docker
nixos.tests.docker.x86_64-linux
(all nixos.tests.ecryptfs)
(all nixos.tests.env)
(all nixos.tests.ipv6)
Expand Down
29 changes: 16 additions & 13 deletions nixos/release.nix
Expand Up @@ -16,7 +16,8 @@ let
inherit system;
} // args);

callTest = fn: args: forAllSystems (system: hydraJob (importTest fn args system));
callTestOnTheseSystems = systems: fn: args: forTheseSystems systems (system: hydraJob (importTest fn args system));
callTest = callTestOnTheseSystems supportedSystems;

callSubTests = fn: args: let
discover = attrs: let
Expand Down Expand Up @@ -90,13 +91,13 @@ let

makeNetboot = config:
let
config_evaled = import lib/eval-config.nix config;
build = config_evaled.config.system.build;
kernelTarget = config_evaled.pkgs.stdenv.platform.kernelTarget;
configEvaled = import lib/eval-config.nix config;
build = configEvaled.config.system.build;
kernelTarget = configEvaled.pkgs.stdenv.platform.kernelTarget;
in
pkgs.symlinkJoin {
name="netboot";
paths=[
name = "netboot";
paths = [
build.netbootRamdisk
build.kernel
build.netbootIpxeScript
Expand All @@ -107,6 +108,7 @@ let
echo "file initrd $out/initrd" >> $out/nix-support/hydra-build-products
echo "file ipxe $out/netboot.ipxe" >> $out/nix-support/hydra-build-products
'';
preferLocalBuild = true;
};


Expand Down Expand Up @@ -227,7 +229,7 @@ in rec {
tests.blivet = callTest tests/blivet.nix {};
tests.boot = callSubTests tests/boot.nix {};
tests.boot-stage1 = callTest tests/boot-stage1.nix {};
tests.cadvisor = hydraJob (import tests/cadvisor.nix { system = "x86_64-linux"; });
tests.cadvisor = callTestOnTheseSystems ["x86_64-linux"] tests/cadvisor.nix {};
tests.chromium = (callSubTests tests/chromium.nix { system = "x86_64-linux"; }).stable;
tests.cjdns = callTest tests/cjdns.nix {};
tests.cloud-init = callTest tests/cloud-init.nix {};
Expand All @@ -242,20 +244,20 @@ in rec {
tests.containers-hosts = callTest tests/containers-hosts.nix {};
tests.containers-macvlans = callTest tests/containers-macvlans.nix {};
tests.couchdb = callTest tests/couchdb.nix {};
tests.docker = hydraJob (import tests/docker.nix { system = "x86_64-linux"; });
tests.docker-edge = hydraJob (import tests/docker-edge.nix { system = "x86_64-linux"; });
tests.docker = callTestOnTheseSystems ["x86_64-linux"] tests/docker.nix {};
tests.docker-edge = callTestOnTheseSystems ["x86_64-linux"] tests/docker-edge.nix {};
tests.dovecot = callTest tests/dovecot.nix {};
tests.dnscrypt-proxy = callTest tests/dnscrypt-proxy.nix { system = "x86_64-linux"; };
tests.dnscrypt-proxy = callTestOnTheseSystems ["x86_64-linux"] tests/dnscrypt-proxy.nix {};
tests.ecryptfs = callTest tests/ecryptfs.nix {};
tests.etcd = hydraJob (import tests/etcd.nix { system = "x86_64-linux"; });
tests.etcd = callTestOnTheseSystems ["x86_64-linux"] tests/etcd.nix {};
tests.ec2-nixops = hydraJob (import tests/ec2.nix { system = "x86_64-linux"; }).boot-ec2-nixops;
tests.ec2-config = hydraJob (import tests/ec2.nix { system = "x86_64-linux"; }).boot-ec2-config;
tests.elk = callSubTests tests/elk.nix { system = "x86_64-linux"; };
tests.env = callTest tests/env.nix {};
tests.ferm = callTest tests/ferm.nix {};
tests.firefox = callTest tests/firefox.nix {};
tests.firewall = callTest tests/firewall.nix {};
tests.fleet = hydraJob (import tests/fleet.nix { system = "x86_64-linux"; });
tests.fleet = callTestOnTheseSystems ["x86_64-linux"] tests/fleet.nix {};
#tests.gitlab = callTest tests/gitlab.nix {};
tests.gitolite = callTest tests/gitolite.nix {};
tests.gocd-agent = callTest tests/gocd-agent.nix {};
Expand Down Expand Up @@ -302,6 +304,7 @@ in rec {
tests.nat.firewall = callTest tests/nat.nix { withFirewall = true; };
tests.nat.firewall-conntrack = callTest tests/nat.nix { withFirewall = true; withConntrackHelpers = true; };
tests.nat.standalone = callTest tests/nat.nix { withFirewall = false; };
tests.netdata = callTest tests/netdata.nix { };
tests.networking.networkd = callSubTests tests/networking.nix { networkd = true; };
tests.networking.scripted = callSubTests tests/networking.nix { networkd = false; };
# TODO: put in networking.nix after the test becomes more complete
Expand All @@ -315,7 +318,7 @@ in rec {
tests.openssh = callTest tests/openssh.nix {};
tests.owncloud = callTest tests/owncloud.nix {};
tests.pam-oath-login = callTest tests/pam-oath-login.nix {};
#tests.panamax = hydraJob (import tests/panamax.nix { system = "x86_64-linux"; });
#tests.panamax = callTestOnTheseSystems ["x86_64-linux"] tests/panamax.nix {};
tests.peerflix = callTest tests/peerflix.nix {};
tests.php-pcre = callTest tests/php-pcre.nix {};
tests.postgresql = callSubTests tests/postgresql.nix {};
Expand Down
31 changes: 31 additions & 0 deletions nixos/tests/netdata.nix
@@ -0,0 +1,31 @@
# This test runs netdata and checks for data via apps.plugin

import ./make-test.nix ({ pkgs, ...} : {
name = "netdata";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ cransom ];
};

nodes = {
netdata =
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [ curl jq ];
services.netdata.enable = true;
};
};

testScript = ''
startAll;
$netdata->waitForUnit("netdata.service");
# check if netdata can read disk ops for root owned processes.
# if > 0, successful. verifies both netdata working and
# apps.plugin has elevated capabilities.
my $cmd = <<'CMD';
curl -s http://localhost:19999/api/v1/data\?chart=users.pwrites | \
jq -e '[.data[range(10)][.labels | indices("root")[0]]] | add | . > 0'
CMD
$netdata->waitUntilSucceeds($cmd);
'';
})
14 changes: 7 additions & 7 deletions pkgs/applications/kde/akonadi/default.nix
Expand Up @@ -19,13 +19,13 @@ mkDerivation {
];
propagatedBuildInputs = [ boost kitemmodels ];
outputs = [ "out" "dev" ];
NIX_CFLAGS_COMPILE = [
''-DNIXPKGS_MYSQL_MYSQLD="${lib.getBin mysql}/bin/mysqld"''
''-DNIXPKGS_MYSQL_MYSQLADMIN="${lib.getBin mysql}/bin/mysqladmin"''
''-DNIXPKGS_MYSQL_MYSQL_INSTALL_DB="${lib.getBin mysql}/bin/mysql_install_db"''
''-DNIXPKGS_MYSQL_MYSQLCHECK="${lib.getBin mysql}/bin/mysqlcheck"''
''-DNIXPKGS_POSTGRES_PG_CTL=""''
''-DNIXPKGS_POSTGRES_INITDB=""''
CXXFLAGS = [
''-DNIXPKGS_MYSQL_MYSQLD=\"${lib.getBin mysql}/bin/mysqld\"''
''-DNIXPKGS_MYSQL_MYSQLADMIN=\"${lib.getBin mysql}/bin/mysqladmin\"''
''-DNIXPKGS_MYSQL_MYSQL_INSTALL_DB=\"${lib.getBin mysql}/bin/mysql_install_db\"''
''-DNIXPKGS_MYSQL_MYSQLCHECK=\"${lib.getBin mysql}/bin/mysqlcheck\"''
''-DNIXPKGS_POSTGRES_PG_CTL=\"\"''
''-DNIXPKGS_POSTGRES_INITDB=\"\"''
];
preConfigure = ''
NIX_CFLAGS_COMPILE+=" -DNIX_OUT=\"$out\""
Expand Down
3 changes: 2 additions & 1 deletion pkgs/applications/networking/browsers/firefox/wrapper.nix
Expand Up @@ -8,7 +8,7 @@
, google_talk_plugin, fribid, gnome3/*.gnome_shell*/
, esteidfirefoxplugin
, vlc_npapi
, browserpass
, browserpass, chrome-gnome-shell
, libudev
, kerberos
}:
Expand Down Expand Up @@ -63,6 +63,7 @@ let
nativeMessagingHosts =
([ ]
++ lib.optional (cfg.enableBrowserpass or false) browserpass
++ lib.optional (cfg.enableGnomeExtensions or false) chrome-gnome-shell
++ extraNativeMessagingHosts
);
libs = (if ffmpegSupport then [ ffmpeg ] else with gst_all; [ gstreamer gst-plugins-base ])
Expand Down
25 changes: 20 additions & 5 deletions pkgs/applications/virtualization/containerd/default.nix
@@ -1,23 +1,38 @@
{ stdenv, lib, fetchFromGitHub, removeReferencesTo
, go, libapparmor, apparmor-parser, libseccomp }:
, go, libapparmor, apparmor-parser, libseccomp, btrfs-progs }:

with lib;

stdenv.mkDerivation rec {
name = "containerd-${version}";
version = "0.2.9";
version = "1.0.1";

src = fetchFromGitHub {
owner = "containerd";
repo = "containerd";
rev = "v${version}";
sha256 = "0rix0mv203fn3rcxmpqdpb54l1a0paqplg2xgldpd943qi1rm552";
sha256 = "0kfafqi66yp4qy738pl11f050hfrx9m4kc670qpx7fmf9ii7q6p2";
};

buildInputs = [ removeReferencesTo go ];
hardeningDisable = [ "fortify" ];

buildInputs = [ removeReferencesTo go btrfs-progs ];
buildFlags = "VERSION=v${version}";

BUILDTAGS = []
++ optional (btrfs-progs == null) "no_btrfs";

preConfigure = ''
# Extract the source
cd "$NIX_BUILD_TOP"
mkdir -p "go/src/github.com/containerd"
mv "$sourceRoot" "go/src/github.com/containerd/containerd"
export GOPATH=$NIX_BUILD_TOP/go:$GOPATH
'';

preBuild = ''
ln -s $(pwd) vendor/src/github.com/containerd/containerd
cd go/src/github.com/containerd/containerd
patchShebangs .
'';

installPhase = ''
Expand Down
7 changes: 0 additions & 7 deletions pkgs/applications/virtualization/docker/default.nix
Expand Up @@ -39,13 +39,6 @@ rec {
hardeningDisable = [ "fortify" ];

buildInputs = [ removeReferencesTo go btrfs-progs ];

# This should go into the containerd derivation once 1.0.0 is out
preBuild = ''
export GOPATH=$(pwd)/vendor
mkdir $(pwd)/vendor/src
mv $(pwd)/vendor/{github.com,golang.org,google.golang.org} $(pwd)/vendor/src/
'' + oldAttrs.preBuild;
});

docker-tini = tini.overrideAttrs (oldAttrs: rec {
Expand Down

0 comments on commit 94f4857

Please sign in to comment.