From dbc414a8a52acb71dcb7bcc4d0d36e9490433511 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Tue, 12 Dec 2017 01:14:00 +0100 Subject: [PATCH 01/51] yabar: add module To make the configuration of `yabar` more pleasant and easier to validate, a NixOS module will be quite helpful. An example config could look like this: ``` { programs.yabar = { enable = true; bars.top.indicators.exec = "YA_DATE"; }; } ``` The module adds a user-controlled systemd service which runs `yabar` after starting up X. --- nixos/modules/module-list.nix | 1 + nixos/modules/programs/yabar.nix | 149 +++++++++++++++++++++++++++++++ nixos/release.nix | 1 + nixos/tests/yabar.nix | 25 ++++++ 4 files changed, 176 insertions(+) create mode 100644 nixos/modules/programs/yabar.nix create mode 100644 nixos/tests/yabar.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index fdd3bb844c2f..78dd1ee6c713 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -110,6 +110,7 @@ ./programs/wireshark.nix ./programs/xfs_quota.nix ./programs/xonsh.nix + ./programs/yabar.nix ./programs/zsh/oh-my-zsh.nix ./programs/zsh/zsh.nix ./programs/zsh/zsh-syntax-highlighting.nix diff --git a/nixos/modules/programs/yabar.nix b/nixos/modules/programs/yabar.nix new file mode 100644 index 000000000000..a01083c3ace9 --- /dev/null +++ b/nixos/modules/programs/yabar.nix @@ -0,0 +1,149 @@ +{ lib, pkgs, config, ... }: + +with lib; + +let + cfg = config.programs.yabar; + + mapExtra = v: lib.concatStringsSep "\n" (mapAttrsToList ( + key: val: "${key} = ${if (isString val) then "\"${val}\"" else "${builtins.toString val}"};" + ) v); + + listKeys = r: concatStringsSep "," (map (n: "\"${n}\"") (attrNames r)); + + configFile = let + bars = mapAttrsToList ( + name: cfg: '' + ${name}: { + font: "${cfg.font}"; + position: "${cfg.position}"; + + ${mapExtra cfg.extra} + + block-list: [${listKeys cfg.indicators}] + + ${concatStringsSep "\n" (mapAttrsToList ( + name: cfg: '' + ${name}: { + exec: "${cfg.exec}"; + align: "${cfg.align}"; + ${mapExtra cfg.extra} + }; + '' + ) cfg.indicators)} + }; + '' + ) cfg.bars; + in pkgs.writeText "yabar.conf" '' + bar-list = [${listKeys cfg.bars}]; + ${concatStringsSep "\n" bars} + ''; +in + { + options.programs.yabar = { + enable = mkEnableOption "yabar"; + + package = mkOption { + default = pkgs.yabar; + example = literalExample "pkgs.yabar-unstable"; + type = types.package; + + description = '' + The package which contains the `yabar` binary. + + Nixpkgs provides the `yabar` and `yabar-unstable` + derivations since 18.03, so it's possible to choose. + ''; + }; + + bars = mkOption { + default = {}; + type = types.attrsOf(types.submodule { + options = { + font = mkOption { + default = "sans bold 9"; + example = "Droid Sans, FontAwesome Bold 9"; + type = types.string; + + description = '' + The font that will be used to draw the status bar. + ''; + }; + + position = mkOption { + default = "top"; + example = "bottom"; + type = types.enum [ "top" "bottom" ]; + + description = '' + The position where the bar will be rendered. + ''; + }; + + extra = mkOption { + default = {}; + type = types.attrsOf types.string; + + description = '' + An attribute set which contains further attributes of a bar. + ''; + }; + + indicators = mkOption { + default = {}; + type = types.attrsOf(types.submodule { + options.exec = mkOption { + example = "YABAR_DATE"; + type = types.string; + description = '' + The type of the indicator to be executed. + ''; + }; + + options.align = mkOption { + default = "left"; + example = "right"; + type = types.enum [ "left" "center" "right" ]; + + description = '' + Whether to align the indicator at the left or right of the bar. + ''; + }; + + options.extra = mkOption { + default = {}; + type = types.attrsOf (types.either types.string types.int); + + description = '' + An attribute set which contains further attributes of a indicator. + ''; + }; + }); + + description = '' + Indicators that should be rendered by yabar. + ''; + }; + }; + }); + + description = '' + List of bars that should be rendered by yabar. + ''; + }; + }; + + config = mkIf cfg.enable { + systemd.user.services.yabar = { + description = "yabar service"; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + + script = '' + ${cfg.package}/bin/yabar -c ${configFile} + ''; + + serviceConfig.Restart = "always"; + }; + }; + } diff --git a/nixos/release.nix b/nixos/release.nix index cf3fe6abd48c..c6fe633cdd1e 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -356,6 +356,7 @@ in rec { tests.wordpress = callTest tests/wordpress.nix {}; tests.xfce = callTest tests/xfce.nix {}; tests.xmonad = callTest tests/xmonad.nix {}; + tests.yabar = callTest tests/yabar.nix {}; tests.zookeeper = callTest tests/zookeeper.nix {}; /* Build a bunch of typical closures so that Hydra can keep track of diff --git a/nixos/tests/yabar.nix b/nixos/tests/yabar.nix new file mode 100644 index 000000000000..40ca91e8064d --- /dev/null +++ b/nixos/tests/yabar.nix @@ -0,0 +1,25 @@ +import ./make-test.nix ({ pkgs, lib }: + +with lib; + +{ + name = "yabar"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ ma27 ]; + }; + + nodes.yabar = { + imports = [ ./common/x11.nix ./common/user-account.nix ]; + + services.xserver.displayManager.auto.user = "bob"; + + programs.yabar.enable = true; + }; + + testScript = '' + $yabar->start; + $yabar->waitForX; + + $yabar->waitForUnit("yabar.service", "bob"); + ''; +}) From f2a45a47d4b4b1293083a2e5882380c7e15a7e2c Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 10 Jan 2018 15:19:37 +0100 Subject: [PATCH 02/51] nixos: Add nixpkgs.pkgs option This lets the user set pkgs directly, so that it can be injected externally and be reused among evaluations of NixOS. --- nixos/modules/misc/nixpkgs.nix | 53 ++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix index 1793c1447d60..351a802a517a 100644 --- a/nixos/modules/misc/nixpkgs.nix +++ b/nixos/modules/misc/nixpkgs.nix @@ -3,6 +3,8 @@ with lib; let + cfg = config.nixpkgs; + isConfig = x: builtins.isAttrs x || builtins.isFunction x; @@ -42,12 +44,51 @@ let merge = lib.mergeOneOption; }; - _pkgs = import ../../.. config.nixpkgs; + pkgsType = mkOptionType { + name = "nixpkgs"; + description = "An evaluation of Nixpkgs; the top level attribute set of packages"; + check = builtins.isAttrs; + }; in { options.nixpkgs = { + + pkgs = mkOption { + defaultText = literalExample + ''import "''${nixos}/.." { + inherit (config.nixpkgs) config overlays system; + } + ''; + default = import ../../.. { inherit (cfg) config overlays system; }; + type = pkgsType; + example = literalExample ''import {}''; + description = '' + This is the evaluation of Nixpkgs that will be provided to + all NixOS modules. Defining this option has the effect of + ignoring the other options that would otherwise be used to + evaluate Nixpkgs, because those are arguments to the default + value. The default value imports the Nixpkgs source files + relative to the location of this NixOS module, because + NixOS and Nixpkgs are distributed together for consistency, + so the nixos in the default value is in fact a + relative path. The config, overlays + and system come from this option's siblings. + + This option can be used by applications like NixOps to increase + the performance of evaluation, or to create packages that depend + on a container that should be built with the exact same evaluation + of Nixpkgs, for example. Applications like this should set + their default value using lib.mkDefault, so + user-provided configuration can override it without using + lib. + + Note that using a distinct version of Nixpkgs with NixOS may + be an unexpected source of problems. Use this option with care. + ''; + }; + config = mkOption { default = {}; example = literalExample @@ -59,6 +100,8 @@ in The configuration of the Nix Packages collection. (For details, see the Nixpkgs documentation.) It allows you to set package configuration options. + + Ignored when nixpkgs.pkgs is set. ''; }; @@ -83,6 +126,8 @@ in takes as an argument the original Nixpkgs. The first argument should be used for finding dependencies, and the second should be used for overriding recipes. + + Ignored when nixpkgs.pkgs is set. ''; }; @@ -94,14 +139,16 @@ in If unset, it defaults to the platform type of your host system. Specifying this option is useful when doing distributed multi-platform deployment, or when building virtual machines. + + Ignored when nixpkgs.pkgs is set. ''; }; }; config = { _module.args = { - pkgs = _pkgs; - pkgs_i686 = _pkgs.pkgsi686Linux; + pkgs = cfg.pkgs; + pkgs_i686 = cfg.pkgs.pkgsi686Linux; }; }; } From 56253afe2ec08f1780ca544d92d28702f0facbc8 Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Tue, 30 Jan 2018 15:04:51 -0800 Subject: [PATCH 03/51] uhd: 3.10.2.0 -> 3.10.3.0 --- pkgs/development/tools/misc/uhd/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/misc/uhd/default.nix b/pkgs/development/tools/misc/uhd/default.nix index 8212eccc6d13..8f7ef254cf8b 100644 --- a/pkgs/development/tools/misc/uhd/default.nix +++ b/pkgs/development/tools/misc/uhd/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { name = "uhd-${version}"; - version = "3.10.2.0"; + version = "3.10.3.0"; # UHD seems to use three different version number styles: x.y.z, xxx_yyy_zzz # and xxx.yyy.zzz. Hrmpf... @@ -17,8 +17,8 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "EttusResearch"; repo = "uhd"; - rev = "release_003_010_002_000"; - sha256 = "0g6f4amw7h0vr6faa1nc1zs3bc645binza0zqqx5cwgfxybv8cfy"; + rev = "release_003_010_003_000"; + sha256 = "1aj8qizbyz4shwawj3qlhl6pyyda59hhgm9cwrj7s5kfdi4vdlc3"; }; enableParallelBuilding = true; From 67b0496e0b54d3e0f57a4de0c3658a59b996232e Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Thu, 1 Feb 2018 11:43:40 -0800 Subject: [PATCH 04/51] uhd: uhd firmware 3.7.3->3.10.3, lock img version to host tools thanks to lukeadams for the patch --- pkgs/development/tools/misc/uhd/default.nix | 26 ++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/pkgs/development/tools/misc/uhd/default.nix b/pkgs/development/tools/misc/uhd/default.nix index 8f7ef254cf8b..78195e994c94 100644 --- a/pkgs/development/tools/misc/uhd/default.nix +++ b/pkgs/development/tools/misc/uhd/default.nix @@ -7,17 +7,28 @@ # SUBSYSTEMS=="usb", ATTRS{idVendor}=="fffe", ATTRS{idProduct}=="0002", MODE:="0666" # SUBSYSTEMS=="usb", ATTRS{idVendor}=="2500", ATTRS{idProduct}=="0002", MODE:="0666" -stdenv.mkDerivation rec { - name = "uhd-${version}"; - version = "3.10.3.0"; +let + uhdVer = "003_010_003_000"; + ImgVer = stdenv.lib.replaceStrings ["_"] ["."] uhdVer; # UHD seems to use three different version number styles: x.y.z, xxx_yyy_zzz # and xxx.yyy.zzz. Hrmpf... + version = "3.10.3.0"; + + # Firmware images are downloaded (pre-built) from: + # http://files.ettus.com/binaries/images/ + uhdImagesSrc = fetchurl { + url = "http://files.ettus.com/binaries/images/uhd-images_${ImgVer}-release.tar.gz"; + sha256 = "198awvw6zsh19ydgx5qry5yc6yahdval9wjrsqbyj51pnr6s5qvy"; + }; + +in stdenv.mkDerivation { + name = "uhd-${version}"; src = fetchFromGitHub { owner = "EttusResearch"; repo = "uhd"; - rev = "release_003_010_003_000"; + rev = "release_${uhdVer}"; sha256 = "1aj8qizbyz4shwawj3qlhl6pyyda59hhgm9cwrj7s5kfdi4vdlc3"; }; @@ -31,13 +42,6 @@ stdenv.mkDerivation rec { # Build only the host software preConfigure = "cd host"; - # Firmware images are downloaded (pre-built) - uhdImagesName = "uhd-images_003.007.003-release"; - uhdImagesSrc = fetchurl { - url = "http://files.ettus.com/binaries/maint_images/archive/${uhdImagesName}.tar.gz"; - sha256 = "1pv5c5902041494z0jfw623ca29pvylrw5klybbhklvn5wwlr6cv"; - }; - postPhases = [ "installFirmware" ]; installFirmware = '' From d251a4b40b0eeb96007ab2027e7499fde7c217b6 Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Fri, 2 Feb 2018 11:22:35 -0800 Subject: [PATCH 05/51] uhd: revert boost back standard version --- pkgs/top-level/all-packages.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index defd9e93d105..d3933c3eceea 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7971,9 +7971,7 @@ with pkgs; tweak = callPackage ../applications/editors/tweak { }; - uhd = callPackage ../development/tools/misc/uhd { - boost = boost165; - }; + uhd = callPackage ../development/tools/misc/uhd { }; uisp = callPackage ../development/tools/misc/uisp { }; From 27ee0b9099e8c27d3a09de3e8489bce43f8e7624 Mon Sep 17 00:00:00 2001 From: Brian Olsen Date: Fri, 2 Feb 2018 01:35:32 +0100 Subject: [PATCH 06/51] nixos/tests: add basic tests for services.rspamd --- nixos/release.nix | 1 + nixos/tests/rspamd.nix | 63 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 nixos/tests/rspamd.nix diff --git a/nixos/release.nix b/nixos/release.nix index a396eaac9a3e..e443e423b1ad 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -332,6 +332,7 @@ in rec { # tests.quagga = callTest tests/quagga.nix {}; tests.quake3 = callTest tests/quake3.nix {}; tests.radicale = callTest tests/radicale.nix {}; + tests.rspamd = callSubTests tests/rspamd.nix {}; tests.runInMachine = callTest tests/run-in-machine.nix {}; tests.samba = callTest tests/samba.nix {}; tests.sddm = callSubTests tests/sddm.nix {}; diff --git a/nixos/tests/rspamd.nix b/nixos/tests/rspamd.nix new file mode 100644 index 000000000000..35e534246b65 --- /dev/null +++ b/nixos/tests/rspamd.nix @@ -0,0 +1,63 @@ +{ system ? builtins.currentSystem }: +with import ../lib/testing.nix { inherit system; }; +with pkgs.lib; +let + initMachine = '' + startAll + $machine->waitForUnit("rspamd.service"); + $machine->succeed("id \"rspamd\" >/dev/null"); + ''; + checkSocket = socket: user: group: mode: '' + $machine->succeed("ls ${socket} >/dev/null"); + $machine->succeed("[[ \"\$(stat -c %U ${socket})\" == \"${user}\" ]]"); + $machine->succeed("[[ \"\$(stat -c %G ${socket})\" == \"${group}\" ]]"); + $machine->succeed("[[ \"\$(stat -c %a ${socket})\" == \"${mode}\" ]]"); + ''; + simple = name: enableIPv6: makeTest { + name = "rspamd-${name}"; + machine = { + services.rspamd = { + enable = true; + }; + networking.enableIPv6 = enableIPv6; + }; + testScript = '' + startAll + $machine->waitForUnit("multi-user.target"); + $machine->waitForOpenPort(11334); + $machine->waitForUnit("rspamd.service"); + $machine->succeed("id \"rspamd\" >/dev/null"); + ${checkSocket "/run/rspamd/rspamd.sock" "rspamd" "rspamd" "660" } + sleep 10; + $machine->log($machine->succeed("systemctl cat rspamd.service")); + $machine->log($machine->succeed("curl http://localhost:11334/auth")); + $machine->log($machine->succeed("curl http://127.0.0.1:11334/auth")); + ${optionalString enableIPv6 '' + $machine->log($machine->succeed("curl http://[::1]:11334/auth")); + ''} + ''; + }; +in +{ + simple = simple "simple" true; + ipv4only = simple "ipv4only" false; + bindports = makeTest { + name = "rspamd-bindports"; + machine = { + services.rspamd = { + enable = true; + bindSocket = [ "/run/rspamd.sock mode=0600 user=root group=root" ]; + bindUISocket = [ "/run/rspamd-worker.sock mode=0666 user=root group=root" ]; + }; + }; + + testScript = '' + ${initMachine} + $machine->waitForFile("/run/rspamd.sock"); + ${checkSocket "/run/rspamd.sock" "root" "root" "600" } + ${checkSocket "/run/rspamd-worker.sock" "root" "root" "666" } + $machine->log($machine->succeed("rspamc -h /run/rspamd-worker.sock stat")); + $machine->log($machine->succeed("curl --unix-socket /run/rspamd-worker.sock http://localhost/ping")); + ''; + }; +} From 04769e898f5f453e4a59cda3a908b3fc334705fd Mon Sep 17 00:00:00 2001 From: Elmar Athmer Date: Sat, 3 Feb 2018 00:36:02 +0100 Subject: [PATCH 07/51] hcloud: init at 1.3.0 --- pkgs/development/tools/hcloud/default.nix | 24 +++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/development/tools/hcloud/default.nix diff --git a/pkgs/development/tools/hcloud/default.nix b/pkgs/development/tools/hcloud/default.nix new file mode 100644 index 000000000000..e56502a4ad05 --- /dev/null +++ b/pkgs/development/tools/hcloud/default.nix @@ -0,0 +1,24 @@ +{ stdenv, buildGoPackage, fetchFromGitHub }: + +buildGoPackage rec { + name = "hcloud-${version}"; + version = "1.3.0"; + goPackagePath = "github.com/hetznercloud/cli"; + + src = fetchFromGitHub { + owner = "hetznercloud"; + repo = "cli"; + rev = "v${version}"; + sha256 = "1216qz1kk38vkvfrznjwb65vsbhscqvvrsbp2i6pnf0i85p00pqm"; + }; + + buildFlagsArray = [ "-ldflags=" "-X github.com/hetznercloud/cli.Version=${version}" ]; + + meta = { + description = "A command-line interface for Hetzner Cloud, a provider for cloud virtual private servers"; + homepage = https://github.com/hetznercloud/cli; + license = stdenv.lib.licenses.mit; + platforms = stdenv.lib.platforms.all; + maintainers = [ stdenv.lib.maintainers.zauberpony ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 73f478280554..42c2e752511b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7603,6 +7603,8 @@ with pkgs; guile = guile_2_0; }; + hcloud = callPackage ../development/tools/hcloud { }; + help2man = callPackage ../development/tools/misc/help2man { inherit (perlPackages) LocaleGettext; }; From 448fdc221c1464317f6dbe44b531d6c2f282be30 Mon Sep 17 00:00:00 2001 From: Marius Bergmann Date: Mon, 5 Feb 2018 18:59:34 +0100 Subject: [PATCH 08/51] keepalived: 1.3.6 -> 1.4.1 --- pkgs/tools/networking/keepalived/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/networking/keepalived/default.nix b/pkgs/tools/networking/keepalived/default.nix index fe8988dc41d9..140ea6860fc3 100644 --- a/pkgs/tools/networking/keepalived/default.nix +++ b/pkgs/tools/networking/keepalived/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { name = "keepalived-${version}"; - version = "1.3.6"; + version = "1.4.1"; src = fetchFromGitHub { owner = "acassen"; repo = "keepalived"; rev = "v${version}"; - sha256 = "05088vv510dlflzyg8sh8l8qfscnvxl6n6pw9ycp27zhb6r5cr5y"; + sha256 = "1d3jnfhj9mpnc27wvgsiz2vr4lnvvccw3v128z16jpyibyv20ph0"; }; buildInputs = [ From c055b010df63bae3705a2f42b577a6499e61068e Mon Sep 17 00:00:00 2001 From: Thorsten Weber Date: Tue, 6 Feb 2018 11:50:37 +0100 Subject: [PATCH 09/51] slic3r-prusa3d: init at 1.38.7 --- .../misc/slic3r-prusa3d/default.nix | 93 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 95 insertions(+) create mode 100644 pkgs/applications/misc/slic3r-prusa3d/default.nix diff --git a/pkgs/applications/misc/slic3r-prusa3d/default.nix b/pkgs/applications/misc/slic3r-prusa3d/default.nix new file mode 100644 index 000000000000..ef8bfb1b2be5 --- /dev/null +++ b/pkgs/applications/misc/slic3r-prusa3d/default.nix @@ -0,0 +1,93 @@ +{ stdenv, fetchFromGitHub, makeWrapper, which, cmake, perl, perlPackages, + boost, tbb, wxGTK30, pkgconfig, gtk3, fetchurl, gtk2, bash, mesa_glu }: +let + AlienWxWidgets = perlPackages.buildPerlPackage rec { + name = "Alien-wxWidgets-0.69"; + src = fetchurl { + url = "mirror://cpan/authors/id/M/MD/MDOOTSON/${name}.tar.gz"; + sha256 = "075m880klf66pbcfk0la2nl60vd37jljizqndrklh5y4zvzdy1nr"; + }; + propagatedBuildInputs = [ + pkgconfig perlPackages.ModulePluggable perlPackages.ModuleBuild + gtk2 gtk3 wxGTK30 + ]; + }; + + Wx = perlPackages.Wx.overrideAttrs (oldAttrs: { + propagatedBuildInputs = [ + perlPackages.ExtUtilsXSpp + AlienWxWidgets + ]; + }); + + WxGLCanvas = perlPackages.buildPerlPackage rec { + name = "Wx-GLCanvas-0.09"; + src = fetchurl { + url = "mirror://cpan/authors/id/M/MB/MBARBON/${name}.tar.gz"; + sha256 = "1q4gvj4gdx4l8k4mkgiix24p9mdfy1miv7abidf0my3gy2gw5lka"; + }; + propagatedBuildInputs = [ Wx perlPackages.OpenGL mesa_glu ]; + doCheck = false; + }; +in +stdenv.mkDerivation rec { + name = "slic3r-prusa-edition-${version}"; + version = "1.38.7"; + + buildInputs = [ + cmake + perl + makeWrapper + tbb + which + Wx + WxGLCanvas + ] ++ (with perlPackages; [ + boost + ClassXSAccessor + EncodeLocale + ExtUtilsMakeMaker + ExtUtilsXSpp + GrowlGNTP + ImportInto + IOStringy + locallib + LWP + MathClipper + MathConvexHullMonotoneChain + MathGeometryVoronoi + MathPlanePath + ModuleBuild + Moo + NetDBus + OpenGL + threads + XMLSAX + ]); + + postInstall = '' + echo 'postInstall' + wrapProgram "$out/bin/slic3r-prusa3d" \ + --prefix PERL5LIB : "$out/lib/slic3r-prusa3d:$PERL5LIB" + + # it seems we need to copy the icons... + mkdir -p $out/bin/var + cp ../resources/icons/* $out/bin/var/ + cp -r ../resources $out/bin/ + ''; + + src = fetchFromGitHub { + owner = "prusa3d"; + repo = "Slic3r"; + sha256 = "1nrryd2bxmk4y59bq5fp7n2alyvc5a9xvnbx5j4fg4mqr91ccs5c"; + rev = "version_${version}"; + }; + + meta = with stdenv.lib; { + description = "G-code generator for 3D printer"; + homepage = https://github.com/prusa3d/Slic3r; + license = licenses.agpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ tweber ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 73f478280554..eaab439bd8d0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17141,6 +17141,8 @@ with pkgs; slic3r = callPackage ../applications/misc/slic3r { }; + slic3r-prusa3d = callPackage ../applications/misc/slic3r-prusa3d { }; + curaengine_stable = callPackage ../applications/misc/curaengine/stable.nix { }; cura_stable = callPackage ../applications/misc/cura/stable.nix { curaengine = curaengine_stable; From 17210fee46826873a623ffd6b691da3d897277e3 Mon Sep 17 00:00:00 2001 From: Bignaux Ronan Date: Tue, 6 Feb 2018 15:03:39 +0100 Subject: [PATCH 10/51] squashfuse: init at 0.1.101 --- pkgs/tools/filesystems/squashfuse/default.nix | 61 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 63 insertions(+) create mode 100644 pkgs/tools/filesystems/squashfuse/default.nix diff --git a/pkgs/tools/filesystems/squashfuse/default.nix b/pkgs/tools/filesystems/squashfuse/default.nix new file mode 100644 index 000000000000..8a8bc5396fc0 --- /dev/null +++ b/pkgs/tools/filesystems/squashfuse/default.nix @@ -0,0 +1,61 @@ +{ stdenv, fetchurl, automake, autoconf, libtool, fuse, pkgconfig, pcre, + +# Optional Dependencies +lz4 ? null, xz ? null, zlib ? null, lzo ? null, zstd ? null}: + +with stdenv.lib; +let + mkFlag = trueStr: falseStr: cond: name: val: "--" + + (if cond then trueStr else falseStr) + + name + + optionalString (val != null && cond != false) "=${val}"; + mkEnable = mkFlag "enable-" "disable-"; + mkWith = mkFlag "with-" "--without-"; + mkOther = mkFlag "" "" true; + + shouldUsePkg = pkg: if pkg != null && any (x: x == stdenv.system) pkg.meta.platforms then pkg else null; + + optLz4 = shouldUsePkg lz4; + optLzma = shouldUsePkg xz; + optZlib = shouldUsePkg zlib; + optLzo = shouldUsePkg lzo; + optZstd = shouldUsePkg zstd; +in + +stdenv.mkDerivation rec { + + pname = "squashfuse"; + version = "0.1.101"; + name = "${pname}-${version}"; + + meta = { + description = "FUSE filesystem to mount squashfs archives"; + homepage = https://github.com/vasi/squashfuse; + maintainers = [ maintainers.genesis ]; + platforms = platforms.linux ++ platforms.darwin; + license = "BSD-2-Clause"; + }; + + src = fetchurl { + url = "https://github.com/vasi/squashfuse/archive/${version}.tar.gz"; + sha256 = "08d1j1a73dhhypbk0q20qkrz564zpmvkpk3k3s8xw8gd9nvy2xa2"; + }; + + nativeBuildInputs = [ automake autoconf libtool pkgconfig]; + buildInputs = [ optLz4 optLzma optZlib optLzo optZstd fuse ]; + + # We can do it far better i guess, ignoring -with option + # but it should be safer like that. + # TODO: Improve writing nix expression mkWithLib. + configureFlags = [ + (mkWith (optLz4 != null) "lz4=${lz4}/lib" null) + (mkWith (optLzma != null) "xz=${xz}/lib" null) + (mkWith (optZlib != null) "zlib=${zlib}/lib" null) + (mkWith (optLzo != null) "lzo=${lzo}/lib" null) + (mkWith (optZstd != null) "zstd=${zstd}/lib" null) + ]; + + preConfigure = '' + ./autogen.sh + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 73f478280554..c89384e037f1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4690,6 +4690,8 @@ with pkgs; squashfsTools = callPackage ../tools/filesystems/squashfs { }; + squashfuse = callPackage ../tools/filesystems/squashfuse { }; + srcml = callPackage ../applications/version-management/srcml { }; sshfs-fuse = callPackage ../tools/filesystems/sshfs-fuse { }; From e2bf162f04b81222550d5f0574ef72f32d68125f Mon Sep 17 00:00:00 2001 From: Bignaux Ronan Date: Tue, 6 Feb 2018 15:34:51 +0100 Subject: [PATCH 11/51] remove platforms.darwin support --- pkgs/tools/filesystems/squashfuse/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/filesystems/squashfuse/default.nix b/pkgs/tools/filesystems/squashfuse/default.nix index 8a8bc5396fc0..75b6deccc83e 100644 --- a/pkgs/tools/filesystems/squashfuse/default.nix +++ b/pkgs/tools/filesystems/squashfuse/default.nix @@ -32,10 +32,14 @@ stdenv.mkDerivation rec { description = "FUSE filesystem to mount squashfs archives"; homepage = https://github.com/vasi/squashfuse; maintainers = [ maintainers.genesis ]; - platforms = platforms.linux ++ platforms.darwin; + platforms = platforms.linux; license = "BSD-2-Clause"; }; + # platforms.darwin should be supported : see PLATFORMS file in src. + # we could use a nix fuseProvider, and let the derivation choose the OS + # specific implementation. + src = fetchurl { url = "https://github.com/vasi/squashfuse/archive/${version}.tar.gz"; sha256 = "08d1j1a73dhhypbk0q20qkrz564zpmvkpk3k3s8xw8gd9nvy2xa2"; From 2b8e900403ac104ae0ae3c0f5c04379a115b5777 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Tue, 6 Feb 2018 19:56:54 -0600 Subject: [PATCH 12/51] zsh: set configureFlags and checkFlags at nix level, also fix cross As-is the use of 'configureFlags="..."' breaks cross compilation as it drops the configure platforms arguments. Set zprofile separately to handle $out. --- pkgs/shells/zsh/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/shells/zsh/default.nix b/pkgs/shells/zsh/default.nix index 4b2b79a21046..43b766fdaf2e 100644 --- a/pkgs/shells/zsh/default.nix +++ b/pkgs/shells/zsh/default.nix @@ -20,15 +20,19 @@ stdenv.mkDerivation { buildInputs = [ ncurses pcre ]; + configureFlags = [ + "--enable-maildir-support" + "--enable-multibyte" + "--with-tcsetpgrp" + "--enable-pcre" + ]; preConfigure = '' - configureFlags="--enable-maildir-support --enable-multibyte --enable-zprofile=$out/etc/zprofile --with-tcsetpgrp --enable-pcre" + configureFlagsArray+=(--enable-zprofile=$out/etc/zprofile) ''; # the zsh/zpty module is not available on hydra # so skip groups Y Z - checkFlagsArray = '' - (TESTNUM=A TESTNUM=B TESTNUM=C TESTNUM=D TESTNUM=E TESTNUM=V TESTNUM=W) - ''; + checkFlags = map (T: "TESTNUM=${T}") (stdenv.lib.stringToCharacters "ABCDEVW"); # XXX: think/discuss about this, also with respect to nixos vs nix-on-X postInstall = '' From ef727716cf7707dfe4dcf8cc05d7efaddd6b211e Mon Sep 17 00:00:00 2001 From: Frank Doepper Date: Wed, 7 Feb 2018 11:38:58 +0100 Subject: [PATCH 13/51] uudeview: init at 0.5.20 --- pkgs/tools/misc/uudeview/default.nix | 24 ++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/tools/misc/uudeview/default.nix diff --git a/pkgs/tools/misc/uudeview/default.nix b/pkgs/tools/misc/uudeview/default.nix new file mode 100644 index 000000000000..e66580f25ffb --- /dev/null +++ b/pkgs/tools/misc/uudeview/default.nix @@ -0,0 +1,24 @@ +{ stdenv, fetchurl, tcl, tk }: + +stdenv.mkDerivation rec { + name = "uudeview-0.5.20"; + src = fetchurl { + url = "http://www.fpx.de/fp/Software/UUDeview/download/${name}.tar.gz"; + sha256 = "0dg4v888fxhmf51vxq1z1gd57fslsidn15jf42pj4817vw6m36p4"; + }; + + buildInputs = [ tcl tk ]; + hardeningDisable = [ "format" ]; + configureFlags = [ "--enable-tk=${tk.dev}" "--enable-tcl=${tcl}" ]; + postPatch = '' + substituteInPlace tcl/xdeview --replace "exec uuwish" "exec $out/bin/uuwish" + ''; + + meta = { + description = "The Nice and Friendly Decoder"; + homepage = http://www.fpx.de/fp/Software/UUDeview/; + license = stdenv.lib.licenses.gpl2; + maintainers = with stdenv.lib.maintainers; [ woffs ]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 908d1a8f7bbd..087a33b03360 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1969,6 +1969,8 @@ with pkgs; mcrcon = callPackage ../tools/networking/mcrcon {}; + uudeview = callPackage ../tools/misc/uudeview { }; + zabbix-cli = callPackage ../tools/misc/zabbix-cli { }; ### DEVELOPMENT / EMSCRIPTEN From 7bd68dff1ef93044079cbcde560fab214befa643 Mon Sep 17 00:00:00 2001 From: Mathias Schreck Date: Wed, 7 Feb 2018 16:57:10 +0100 Subject: [PATCH 14/51] chromedriver: 2.33 -> 2.35 --- .../tools/selenium/chromedriver/default.nix | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pkgs/development/tools/selenium/chromedriver/default.nix b/pkgs/development/tools/selenium/chromedriver/default.nix index 61f5f93ebfaa..554a5585f150 100644 --- a/pkgs/development/tools/selenium/chromedriver/default.nix +++ b/pkgs/development/tools/selenium/chromedriver/default.nix @@ -4,19 +4,14 @@ }: let allSpecs = { - "i686-linux" = { - system = "linux32"; - sha256 = "13fngjg2v0l3vhlmjnffy785ckgk2kbpm7307li75vinkcly91cj"; - }; - "x86_64-linux" = { system = "linux64"; - sha256 = "0x5vnmnw6mws6iw9s0kcm4crx9gfgy0vjjpk1v0wk7jpn6d0bl47"; + sha256 = "13iyz6579yw4fk9dr4nf2pdj55v1iflj8yf9a4zz7qw5996d5yk7"; }; "x86_64-darwin" = { system = "mac64"; - sha256 = "09y8ijj75q5a7snzchxinxfq2ad2sw0f30zi0p3hqf1n88y28jq6"; + sha256 = "11xa31bxhrq0p7kd3j76dihp73abdbmbwdng5454m1wir6yj25f1"; }; }; @@ -33,7 +28,7 @@ let in stdenv.mkDerivation rec { name = "chromedriver-${version}"; - version = "2.33"; + version = "2.35"; src = fetchurl { url = "http://chromedriver.storage.googleapis.com/${version}/chromedriver_${spec.system}.zip"; From 8e70725077f750d8cc46611d6427dd0aa85a7e6e Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 7 Feb 2018 15:27:05 +0100 Subject: [PATCH 15/51] vim_configurable: enable overrides Sometimes it's needed to override parts of `vim_configurable`, for instance when using ENSIME (http://ensime.github.io/), in this case you need a Python interpreter and the modules `sexpdata` and `websocket_client`. However overriding `vim_configurable` is quite hard as we run `vimUtils.makeCustomizable` over the default comming from `configurable.nix`. Therefore it's necessary to copy the code from `all-packages.nix` and alter the parts you need: https://nixos.org/nix-dev/2017-April/023364.html In order to simplify overriding `vim_configurable` I added an `override` and an `overrideAttrs` function to `vimutils.makeCustomizable` to ensure that the customization capabilities won't be lost after altering the derivation. Now it's possible to write expressions like this without evaluation failures: ``` with pkgs; let vimPy3 = vim_configurable.override { python = python3; }; in vimPy3.customize { ... } ``` --- pkgs/misc/vim-plugins/vim-utils.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/misc/vim-plugins/vim-utils.nix b/pkgs/misc/vim-plugins/vim-utils.nix index 23749fd4ce60..e11419846aeb 100644 --- a/pkgs/misc/vim-plugins/vim-utils.nix +++ b/pkgs/misc/vim-plugins/vim-utils.nix @@ -325,11 +325,14 @@ rec { # add a customize option to a vim derivation makeCustomizable = vim: vim // { - customize = {name, vimrcConfig}: vimWithRC { + customize = { name, vimrcConfig }: vimWithRC { vimExecutable = "${vim}/bin/vim"; inherit name; vimrcFile = vimrcFile vimrcConfig; }; + + override = f: makeCustomizable (vim.override f); + overrideAttrs = f: makeCustomizable (vim.overrideAttrs f); }; pluginnames2Nix = {name, namefiles} : vim_configurable.customize { From 5e31eaea9da06f6293c78dd39dc807b38c3bc8a7 Mon Sep 17 00:00:00 2001 From: mingchuan Date: Thu, 8 Feb 2018 01:30:45 +0800 Subject: [PATCH 16/51] rstudio: 1.1.414 -> 1.1.423 Also fixes the version number displayed in GUI. --- pkgs/applications/editors/rstudio/default.nix | 55 +++++++------------ 1 file changed, 21 insertions(+), 34 deletions(-) diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix index 6ff67728ea11..6b7881c490cf 100644 --- a/pkgs/applications/editors/rstudio/default.nix +++ b/pkgs/applications/editors/rstudio/default.nix @@ -4,7 +4,10 @@ }: let - version = "1.1.414"; + verMajor = "1"; + verMinor = "1"; + verPatch = "423"; + version = "${verMajor}.${verMinor}.${verPatch}"; ginVer = "1.5"; gwtVer = "2.7.0"; in @@ -19,46 +22,30 @@ stdenv.mkDerivation rec { owner = "rstudio"; repo = "rstudio"; rev = "v${version}"; - sha256 = "1rr2zkv53r8swhq5d745jpp0ivxpsizzh7srf34isqpkn5pgx3v8"; + sha256 = "02kpmzh0vr0gb5dhiwcm4gwjbc3biwz0km655mgzmx9j64cyd3nf"; }; # Hack RStudio to only use the input R. patches = [ ./r-location.patch ]; postPatch = "substituteInPlace src/cpp/core/r_util/REnvironmentPosix.cpp --replace '@R@' ${R}"; - inherit ginVer; ginSrc = fetchurl { url = "https://s3.amazonaws.com/rstudio-buildtools/gin-${ginVer}.zip"; sha256 = "155bjrgkf046b8ln6a55x06ryvm8agnnl7l8bkwwzqazbpmz8qgm"; }; - inherit gwtVer; gwtSrc = fetchurl { url = "https://s3.amazonaws.com/rstudio-buildtools/gwt-${gwtVer}.zip"; sha256 = "1cs78z9a1jg698j2n35wsy07cy4fxcia9gi00x0r0qc3fcdhcrda"; }; - hunspellDictionaries = builtins.attrValues hunspellDicts; + hunspellDictionaries = with stdenv.lib; filter isDerivation (attrValues hunspellDicts); mathJaxSrc = fetchurl { url = https://s3.amazonaws.com/rstudio-buildtools/mathjax-26.zip; sha256 = "0wbcqb9rbfqqvvhqr1pbqax75wp8ydqdyhp91fbqfqp26xzjv6lk"; }; - rmarkdownSrc = fetchFromGitHub { - owner = "rstudio"; - repo = "rmarkdown"; - rev = "v1.8"; - sha256 = "1blqxdr1vp2z5wd52nmf8hq36sdd4s2pyms441dqj50v35f8girb"; - }; - - rsconnectSrc = fetchFromGitHub { - owner = "rstudio"; - repo = "rsconnect"; - rev = "953c945779dd180c1bfe68f41c173c13ec3e222d"; - sha256 = "1yxwd9v4mvddh7m5rbljicmssw7glh1lhin7a9f01vxxa92vpj7z"; - }; - rstudiolibclang = fetchurl { url = https://s3.amazonaws.com/rstudio-buildtools/libclang-3.5.zip; sha256 = "1sl5vb8misipwbbbykdymw172w9qrh8xv3p29g0bf3nzbnv6zc7c"; @@ -71,31 +58,31 @@ stdenv.mkDerivation rec { preConfigure = '' + export RSTUDIO_VERSION_MAJOR=${verMajor} + export RSTUDIO_VERSION_MINOR=${verMinor} + export RSTUDIO_VERSION_PATCH=${verPatch} + GWT_LIB_DIR=src/gwt/lib - mkdir -p $GWT_LIB_DIR/gin/$ginVer - unzip $ginSrc -d $GWT_LIB_DIR/gin/$ginVer + mkdir -p $GWT_LIB_DIR/gin/${ginVer} + unzip ${ginSrc} -d $GWT_LIB_DIR/gin/${ginVer} - unzip $gwtSrc + unzip ${gwtSrc} mkdir -p $GWT_LIB_DIR/gwt - mv gwt-$gwtVer $GWT_LIB_DIR/gwt/$gwtVer + mv gwt-${gwtVer} $GWT_LIB_DIR/gwt/${gwtVer} mkdir dependencies/common/dictionaries - for dict in $hunspellDictionaries; do - for i in "$dict/share/hunspell/"* - do ln -sv $i dependencies/common/dictionaries/ - done + for dict in ${builtins.concatStringsSep " " hunspellDictionaries}; do + for i in "$dict/share/hunspell/"*; do + ln -sv $i dependencies/common/dictionaries/ + done done - unzip $mathJaxSrc -d dependencies/common/mathjax-26 - mkdir -p dependencies/common/rmarkdown - ln -s $rmarkdownSrc dependencies/common/rmarkdown/ - mkdir -p dependencies/common/rsconnect - ln -s $rsconnectSrc dependencies/common/rsconnect/ + unzip ${mathJaxSrc} -d dependencies/common/mathjax-26 mkdir -p dependencies/common/libclang/3.5 - unzip $rstudiolibclang -d dependencies/common/libclang/3.5 + unzip ${rstudiolibclang} -d dependencies/common/libclang/3.5 mkdir -p dependencies/common/libclang/builtin-headers - unzip $rstudiolibclangheaders -d dependencies/common/libclang/builtin-headers + unzip ${rstudiolibclangheaders} -d dependencies/common/libclang/builtin-headers mkdir -p dependencies/common/pandoc cp ${pandoc}/bin/pandoc dependencies/common/pandoc/ From 202fb6faeabcb6f78e711ac0dd48002e0f776c53 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Wed, 7 Feb 2018 19:28:38 +0000 Subject: [PATCH 17/51] coq: default to 8.7 --- pkgs/top-level/coq-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/coq-packages.nix b/pkgs/top-level/coq-packages.nix index c27a2e7d39d8..12a62ba3851b 100644 --- a/pkgs/top-level/coq-packages.nix +++ b/pkgs/top-level/coq-packages.nix @@ -75,7 +75,7 @@ in rec { coqPackages_8_5 = mkCoqPackages coq_8_5; coqPackages_8_6 = mkCoqPackages coq_8_6; coqPackages_8_7 = mkCoqPackages coq_8_7; - coqPackages = coqPackages_8_6; + coqPackages = coqPackages_8_7; coq = coqPackages.coq; } From 8cc3fcdfd485b96f7fcf83c45f1919b54e5eb838 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 8 Feb 2018 06:24:14 +0000 Subject: [PATCH 18/51] proofgeneral_HEAD: 2017-11-06 -> 2018-01-30 --- pkgs/applications/editors/emacs-modes/proofgeneral/HEAD.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/emacs-modes/proofgeneral/HEAD.nix b/pkgs/applications/editors/emacs-modes/proofgeneral/HEAD.nix index 1cdcb9b85544..de72b24f87ac 100644 --- a/pkgs/applications/editors/emacs-modes/proofgeneral/HEAD.nix +++ b/pkgs/applications/editors/emacs-modes/proofgeneral/HEAD.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation (rec { name = "ProofGeneral-unstable-${version}"; - version = "2017-11-06"; + version = "2018-01-30"; src = fetchFromGitHub { owner = "ProofGeneral"; repo = "PG"; - rev = "2eab72c33751768c8a6cde36b978ea4a36b91843"; - sha256 = "1l3n48d6d4l5q3wkhdyp8dc6hzdw1ckdzr57dj8rdm78j87vh2cg"; + rev = "945cada601c5729edd16fcc989a3969c8b34d20a"; + sha256 = "1zjmbhq6c8g8b93nnsvr5pxx6mlcndb0fz152b2h80vfh9663cn8"; }; buildInputs = [ emacs texinfo perl which ] ++ stdenv.lib.optional enableDoc texLive; From 7bfc62a3778d6d4388b817e172aa6262f6871b41 Mon Sep 17 00:00:00 2001 From: Karol Chmist Date: Thu, 8 Feb 2018 10:10:18 +0100 Subject: [PATCH 19/51] dotty: 0.4.0 -> 0.6.0 --- pkgs/development/compilers/scala/dotty-bare.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/scala/dotty-bare.nix b/pkgs/development/compilers/scala/dotty-bare.nix index 60cb3e9a2029..bff73337e9e8 100644 --- a/pkgs/development/compilers/scala/dotty-bare.nix +++ b/pkgs/development/compilers/scala/dotty-bare.nix @@ -1,12 +1,12 @@ { stdenv, fetchurl, makeWrapper, jre }: stdenv.mkDerivation rec { - version = "0.4.0-RC1"; + version = "0.6.0-RC1"; name = "dotty-bare-${version}"; src = fetchurl { url = "https://github.com/lampepfl/dotty/releases/download/${version}/dotty-${version}.tar.gz"; - sha256 = "1d1ab08b85bd6898ce6273fa50818de0d314fc6e5377fb6ee05494827043321b"; + sha256 = "de1f5e72fb0e0b4c377d6cec93f565eff49769698cd8be01b420705fe8475ca4"; }; propagatedBuildInputs = [ jre ] ; From e7fc9fe5e1a46ea561ef7c64a30ac7045e9c5dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 8 Feb 2018 15:03:08 +0100 Subject: [PATCH 20/51] pythonPackages.pytest-sugar: 0.9.0 -> 0.9.1 --- pkgs/development/python-modules/pytest-sugar/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pytest-sugar/default.nix b/pkgs/development/python-modules/pytest-sugar/default.nix index 2965d169599a..a266b4617492 100644 --- a/pkgs/development/python-modules/pytest-sugar/default.nix +++ b/pkgs/development/python-modules/pytest-sugar/default.nix @@ -1,17 +1,20 @@ { stdenv, buildPythonPackage, fetchPypi, termcolor, pytest }: buildPythonPackage rec { - name = "${pname}-${version}"; pname = "pytest-sugar"; - version = "0.9.0"; + version = "0.9.1"; src = fetchPypi { inherit pname version; - sha256 = "11lni9kn0r1y896xg20qjv4yjcyr56h0hx9dprdgjnam4dqcl6lg"; + sha256 = "ab8cc42faf121344a4e9b13f39a51257f26f410e416c52ea11078cdd00d98a2c"; }; propagatedBuildInputs = [ termcolor pytest ]; + checkPhase = '' + py.test + ''; + meta = with stdenv.lib; { description = "A plugin that changes the default look and feel of py.test"; homepage = https://github.com/Frozenball/pytest-sugar; From 64fbc476b7dcccfffb66d2f46f20c45d15d29359 Mon Sep 17 00:00:00 2001 From: Ryan Mulligan Date: Thu, 8 Feb 2018 07:43:34 -0800 Subject: [PATCH 21/51] ataripp: 1.73 -> 1.81 fixes #34725 --- pkgs/misc/emulators/atari++/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/misc/emulators/atari++/default.nix b/pkgs/misc/emulators/atari++/default.nix index d669233e7593..5a37b1b32c5b 100644 --- a/pkgs/misc/emulators/atari++/default.nix +++ b/pkgs/misc/emulators/atari++/default.nix @@ -1,16 +1,20 @@ -{ stdenv, fetchurl, libSM, libX11, SDL }: +{ stdenv, fetchurl, libSM, libX11, libICE, SDL, alsaLib, gcc-unwrapped, libXext }: with stdenv.lib; stdenv.mkDerivation rec{ name = "atari++-${version}"; - version = "1.73"; + version = "1.81"; src = fetchurl { url = "http://www.xl-project.com/download/atari++_${version}.tar.gz"; - sha256 = "1y5kwh08717jsa5agxrvxnggnwxq36irrid9rzfhca1nnvp9a45l"; + sha256 = "1sv268dsjddirhx47zaqgqiahy6zjxj7xaiiksd1gjvs4lvf3cdg"; }; - buildInputs = [ libSM libX11 SDL ]; + buildInputs = [ libSM libX11 SDL libICE alsaLib gcc-unwrapped libXext ]; + + postFixup = '' + patchelf --set-rpath ${stdenv.lib.makeLibraryPath buildInputs} "$out/bin/atari++" + ''; meta = { homepage = http://www.xl-project.com/; From 37fb8d3e11988f93e006eab9b94f7356652b2a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Thu, 8 Feb 2018 17:09:47 +0100 Subject: [PATCH 22/51] nix-bash-completions: 0.6.2 -> 0.6.3 --- pkgs/shells/nix-bash-completions/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/shells/nix-bash-completions/default.nix b/pkgs/shells/nix-bash-completions/default.nix index bb945f404215..fb6fa24ac334 100644 --- a/pkgs/shells/nix-bash-completions/default.nix +++ b/pkgs/shells/nix-bash-completions/default.nix @@ -1,14 +1,14 @@ { stdenv, fetchFromGitHub }: stdenv.mkDerivation rec { - version = "0.6.2"; + version = "0.6.3"; name = "nix-bash-completions-${version}"; src = fetchFromGitHub { owner = "hedning"; repo = "nix-bash-completions"; rev = "v${version}"; - sha256 = "0w6mimi70drjkdpx5pcw66xy2a4kysjfzmank0kc5vbhrjgkjwyp"; + sha256 = "1zmk9f53xpwk5j6qqisjlddgm2fr68p1q6pn3wa14bd777lranhj"; }; # To enable lazy loading via. bash-completion we need a symlink to the script From 2954c6ce863cd8eb05baadf592126a4a6a991033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Thu, 8 Feb 2018 17:13:29 +0100 Subject: [PATCH 23/51] nix-zsh-completions: 0.3.7 -> 0.3.8 --- pkgs/shells/nix-zsh-completions/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/shells/nix-zsh-completions/default.nix b/pkgs/shells/nix-zsh-completions/default.nix index 29fb065a6f8b..2bcff6b809dc 100644 --- a/pkgs/shells/nix-zsh-completions/default.nix +++ b/pkgs/shells/nix-zsh-completions/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchFromGitHub }: let - version = "0.3.7"; + version = "0.3.8"; in stdenv.mkDerivation rec { @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { owner = "spwhitt"; repo = "nix-zsh-completions"; rev = "${version}"; - sha256 = "164x8awia56z481r898pbywjgrx8fv8gfw8pxp4qgbxzp3gwq9iy"; + sha256 = "05ynd38br2kn657g7l01jg1q8ja9xwrdyb95w02gh7j9cww2k06w"; }; installPhase = '' From b21952e7669fd69479cd71987f4b1b9907842590 Mon Sep 17 00:00:00 2001 From: Markus Hauck Date: Thu, 8 Feb 2018 18:46:04 +0100 Subject: [PATCH 24/51] spotify: 1.0.69.336.g7edcc575-39 -> 1.0.70.399.g5ffabd56-26 --- pkgs/applications/audio/spotify/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/spotify/default.nix b/pkgs/applications/audio/spotify/default.nix index 9ac0c49ebc31..35c5dff27106 100644 --- a/pkgs/applications/audio/spotify/default.nix +++ b/pkgs/applications/audio/spotify/default.nix @@ -9,7 +9,7 @@ let # Latest version number can be found at: # http://repository-origin.spotify.com/pool/non-free/s/spotify-client/ # Be careful not to pick the testing version. - version = "1.0.69.336.g7edcc575-39"; + version = "1.0.70.399.g5ffabd56-26"; deps = [ alsaLib @@ -54,7 +54,7 @@ stdenv.mkDerivation { src = fetchurl { url = "https://repository-origin.spotify.com/pool/non-free/s/spotify-client/spotify-client_${version}_amd64.deb"; - sha256 = "0bh2q7g478g7wj661fypxcbhrbq87zingfyigg7rz1shgsgwc3gd"; + sha256 = "0kpakz11xkyqqjvln4jkhc3z5my8zgpw8m6jx954cjdbc6vkxd29"; }; buildInputs = [ dpkg makeWrapper ]; From aefaab9516e2476ed0918626d6221d1a73af94f3 Mon Sep 17 00:00:00 2001 From: Ryan Mulligan Date: Thu, 8 Feb 2018 17:58:20 -0800 Subject: [PATCH 25/51] biosdevname: 0.7.2 -> 0.7.3 --- pkgs/tools/networking/biosdevname/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/networking/biosdevname/default.nix b/pkgs/tools/networking/biosdevname/default.nix index ae36980a60d8..93a98a10daad 100644 --- a/pkgs/tools/networking/biosdevname/default.nix +++ b/pkgs/tools/networking/biosdevname/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { name = "biosdevname-${version}"; - version = "0.7.2"; + version = "0.7.3"; src = fetchFromGitHub { owner = "dell"; repo = "biosdevname"; rev = "v${version}"; - sha256 = "183k6f9nayhai27y6nizf0sp9bj1kabykj66hcwdzllhrrh505sd"; + sha256 = "19wbb79x9h79k55sgd4dylvdbhhrvfaiaknbw9s1wvfmirkxa1dz"; }; nativeBuildInputs = [ autoreconfHook ]; From 1d1209381a04594678694b2d32723fce68de4910 Mon Sep 17 00:00:00 2001 From: Raymond Gauthier Date: Mon, 5 Feb 2018 16:58:25 -0500 Subject: [PATCH 26/51] pythonnet: Init at 2.3.0 --- .../python-modules/pythonnet/default.nix | 84 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 5 ++ 2 files changed, 89 insertions(+) create mode 100644 pkgs/development/python-modules/pythonnet/default.nix diff --git a/pkgs/development/python-modules/pythonnet/default.nix b/pkgs/development/python-modules/pythonnet/default.nix new file mode 100644 index 000000000000..98f714c8d538 --- /dev/null +++ b/pkgs/development/python-modules/pythonnet/default.nix @@ -0,0 +1,84 @@ +{ lib +, fetchPypi +, fetchNuGet +, buildPythonPackage +, python +, pytest +, pycparser +, pkgconfig +, dotnetbuildhelpers +, clang +, mono +}: + +let + + UnmanagedExports127 = fetchNuGet { + baseName = "UnmanagedExports"; + version = "1.2.7"; + sha256 = "0bfrhpmq556p0swd9ssapw4f2aafmgp930jgf00sy89hzg2bfijf"; + outputFiles = [ "*" ]; + }; + + NUnit360 = fetchNuGet { + baseName = "NUnit"; + version = "3.6.0"; + sha256 = "0wz4sb0hxlajdr09r22kcy9ya79lka71w0k1jv5q2qj3d6g2frz1"; + outputFiles = [ "*" ]; + }; + +in + +buildPythonPackage rec { + pname = "pythonnet"; + version = "2.3.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "1hxnkrfj8ark9sbamcxzd63p98vgljfvdwh79qj3ac8pqrgghq80"; + }; + + postPatch = '' + substituteInPlace setup.py --replace 'self._install_packages()' '#self._install_packages()' + ''; + + preConfigure = '' + [ -z "$dontPlacateNuget" ] && placate-nuget.sh + [ -z "$dontPlacatePaket" ] && placate-paket.sh + ''; + + nativeBuildInputs = [ + pytest + pycparser + + pkgconfig + dotnetbuildhelpers + clang + + NUnit360 + UnmanagedExports127 + ]; + + buildInputs = [ + mono + ]; + + preBuild = '' + rm -rf packages + mkdir packages + + ln -s ${NUnit360}/lib/dotnet/NUnit/ packages/NUnit.3.6.0 + ln -s ${UnmanagedExports127}/lib/dotnet/NUnit/ packages/UnmanagedExports.1.2.7 + ''; + + checkPhase = '' + ${python.interpreter} -m pytest + ''; + + meta = with lib; { + description = ".Net and Mono integration for Python"; + homepage = https://pythonnet.github.io; + license = licenses.mit; + maintainers = with maintainers; [ jraygauthier ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b36407936127..ca0acaa69057 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -14845,6 +14845,11 @@ in { }; }; + pythonnet = callPackage ../development/python-modules/pythonnet { + # `mono >= 4.6` required to prevent crashes encountered with earlier versions. + mono = pkgs.mono46; + }; + pytz = callPackage ../development/python-modules/pytz { }; pytzdata = callPackage ../development/python-modules/pytzdata { }; From 44d1f99a22dc4b2b8e70d831e2332eb32f8376fe Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Fri, 9 Feb 2018 10:20:22 +0800 Subject: [PATCH 27/51] syncthing: 0.14.43 -> 0.14.44 --- pkgs/applications/networking/syncthing/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/syncthing/default.nix b/pkgs/applications/networking/syncthing/default.nix index 1a79e31a05d8..f5e8876e2b34 100644 --- a/pkgs/applications/networking/syncthing/default.nix +++ b/pkgs/applications/networking/syncthing/default.nix @@ -1,14 +1,14 @@ { stdenv, lib, fetchFromGitHub, go, procps, removeReferencesTo }: stdenv.mkDerivation rec { - version = "0.14.43"; + version = "0.14.44"; name = "syncthing-${version}"; src = fetchFromGitHub { owner = "syncthing"; repo = "syncthing"; rev = "v${version}"; - sha256 = "1n09zmp9dqrl3y0fa0l1gx6f09j9mm3xdf7b58y03znspsg7mxhi"; + sha256 = "1gdkx6lbzmdz2hqc9slbq41rwgkxmdisnj0iywx4mppmc2b4v6wh"; }; buildInputs = [ go removeReferencesTo ]; From 908fc5e14b59650d7b1ea5a0f9e85351f79b2439 Mon Sep 17 00:00:00 2001 From: Brian Olsen Date: Sat, 3 Feb 2018 19:04:31 +0100 Subject: [PATCH 28/51] nixos/rspamd: options for worker configuration and socket activation --- nixos/modules/services/mail/rspamd.nix | 261 +++++++++++++++++++++---- nixos/tests/rspamd.nix | 87 ++++++++- 2 files changed, 308 insertions(+), 40 deletions(-) diff --git a/nixos/modules/services/mail/rspamd.nix b/nixos/modules/services/mail/rspamd.nix index b80aa48f2c86..09fb587e74b5 100644 --- a/nixos/modules/services/mail/rspamd.nix +++ b/nixos/modules/services/mail/rspamd.nix @@ -1,14 +1,152 @@ -{ config, lib, pkgs, ... }: +{ config, options, pkgs, lib, ... }: with lib; let cfg = config.services.rspamd; + opts = options.services.rspamd; - mkBindSockets = socks: concatStringsSep "\n" (map (each: " bind_socket = \"${each}\"") socks); + bindSocketOpts = {options, config, ... }: { + options = { + socket = mkOption { + type = types.str; + example = "localhost:11333"; + description = '' + Socket for this worker to listen on in a format acceptable by rspamd. + ''; + }; + mode = mkOption { + type = types.str; + default = "0644"; + description = "Mode to set on unix socket"; + }; + owner = mkOption { + type = types.str; + default = "${cfg.user}"; + description = "Owner to set on unix socket"; + }; + group = mkOption { + type = types.str; + default = "${cfg.group}"; + description = "Group to set on unix socket"; + }; + rawEntry = mkOption { + type = types.str; + internal = true; + }; + }; + config.rawEntry = let + maybeOption = option: + optionalString options.${option}.isDefined " ${option}=${config.${option}}"; + in + if (!(hasPrefix "/" config.socket)) then "${config.socket}" + else "${config.socket}${maybeOption "mode"}${maybeOption "owner"}${maybeOption "group"}"; + }; - rspamdConfFile = pkgs.writeText "rspamd.conf" + workerOpts = { name, ... }: { + options = { + enable = mkOption { + type = types.nullOr types.bool; + default = null; + description = "Whether to run the rspamd worker."; + }; + name = mkOption { + type = types.nullOr types.str; + default = name; + description = "Name of the worker"; + }; + type = mkOption { + type = types.nullOr (types.enum [ + "normal" "controller" "fuzzy_storage" "proxy" "lua" + ]); + description = "The type of this worker"; + }; + bindSockets = mkOption { + type = types.listOf (types.either types.str (types.submodule bindSocketOpts)); + default = []; + description = '' + List of sockets to listen, in format acceptable by rspamd + ''; + example = [{ + socket = "/run/rspamd.sock"; + mode = "0666"; + owner = "rspamd"; + } "*:11333"]; + apply = value: map (each: if (isString each) + then if (isUnixSocket each) + then {socket = each; owner = cfg.user; group = cfg.group; mode = "0644"; rawEntry = "${each}";} + else {socket = each; rawEntry = "${each}";} + else each) value; + }; + count = mkOption { + type = types.nullOr types.int; + default = null; + description = '' + Number of worker instances to run + ''; + }; + includes = mkOption { + type = types.listOf types.str; + default = []; + description = '' + List of files to include in configuration + ''; + }; + extraConfig = mkOption { + type = types.lines; + default = ""; + description = "Additional entries to put verbatim into worker section of rspamd config file."; + }; + }; + config = mkIf (name == "normal" || name == "controller" || name == "fuzzy") { + type = mkDefault name; + includes = mkDefault [ "$CONFDIR/worker-${name}.inc" ]; + bindSockets = mkDefault (if name == "normal" + then [{ + socket = "/run/rspamd/rspamd.sock"; + mode = "0660"; + owner = cfg.user; + group = cfg.group; + }] + else if name == "controller" + then [ "localhost:11334" ] + else [] ); + }; + }; + + indexOf = default: start: list: e: + if list == [] + then default + else if (head list) == e then start + else (indexOf default (start + (length (listenStreams (head list).socket))) (tail list) e); + + systemdSocket = indexOf (abort "Socket not found") 0 allSockets; + + isUnixSocket = socket: hasPrefix "/" (if (isString socket) then socket else socket.socket); + isPort = hasPrefix "*:"; + isIPv4Socket = hasPrefix "*v4:"; + isIPv6Socket = hasPrefix "*v6:"; + isLocalHost = hasPrefix "localhost:"; + listenStreams = socket: + if (isLocalHost socket) then + let port = (removePrefix "localhost:" socket); + in [ "127.0.0.1:${port}" ] ++ (if config.networking.enableIPv6 then ["[::1]:${port}"] else []) + else if (isIPv6Socket socket) then [removePrefix "*v6:" socket] + else if (isPort socket) then [removePrefix "*:" socket] + else if (isIPv4Socket socket) then + throw "error: IPv4 only socket not supported in rspamd with socket activation" + else if (length (splitString " " socket)) != 1 then + throw "error: string options not supported in rspamd with socket activation" + else [socket]; + + mkBindSockets = enabled: socks: concatStringsSep "\n " (flatten (map (each: + if cfg.socketActivation && enabled != false then + let systemd = (systemdSocket each); + in (imap (idx: e: "bind_socket = \"systemd:${toString (systemd + idx - 1)}\";") (listenStreams each.socket)) + else "bind_socket = \"${each.rawEntry}\";") socks)); + + rspamdConfFile = pkgs.writeText "rspamd.conf" '' .include "$CONFDIR/common.conf" @@ -22,19 +160,33 @@ let .include "$CONFDIR/logging.inc" } - worker { - ${mkBindSockets cfg.bindSocket} - .include "$CONFDIR/worker-normal.inc" - } - - worker { - ${mkBindSockets cfg.bindUISocket} - .include "$CONFDIR/worker-controller.inc" - } + ${concatStringsSep "\n" (mapAttrsToList (name: value: '' + worker ${optionalString (value.name != "normal" && value.name != "controller") "${value.name}"} { + type = "${value.type}"; + ${optionalString (value.enable != null) + "enabled = ${if value.enable != false then "yes" else "no"};"} + ${mkBindSockets value.enable value.bindSockets} + ${optionalString (value.count != null) "count = ${toString value.count};"} + ${concatStringsSep "\n " (map (each: ".include \"${each}\"") value.includes)} + ${value.extraConfig} + } + '') cfg.workers)} ${cfg.extraConfig} ''; + allMappedSockets = flatten (mapAttrsToList (name: value: + if value.enable != false + then imap (idx: each: { + name = "${name}"; + index = idx; + value = each; + }) value.bindSockets + else []) cfg.workers); + allSockets = map (e: e.value) allMappedSockets; + + allSocketNames = map (each: "rspamd-${each.name}-${toString each.index}.socket") allMappedSockets; + in { @@ -48,36 +200,43 @@ in enable = mkEnableOption "Whether to run the rspamd daemon."; debug = mkOption { + type = types.bool; default = false; description = "Whether to run the rspamd daemon in debug mode."; }; - bindSocket = mkOption { - type = types.listOf types.str; - default = [ - "/run/rspamd/rspamd.sock mode=0660 owner=${cfg.user} group=${cfg.group}" - ]; - defaultText = ''[ - "/run/rspamd/rspamd.sock mode=0660 owner=${cfg.user} group=${cfg.group}" - ]''; + socketActivation = mkOption { + type = types.bool; description = '' - List of sockets to listen, in format acceptable by rspamd - ''; - example = '' - bindSocket = [ - "/run/rspamd.sock mode=0666 owner=rspamd" - "*:11333" - ]; + Enable systemd socket activation for rspamd. ''; }; - bindUISocket = mkOption { - type = types.listOf types.str; - default = [ - "localhost:11334" - ]; + workers = mkOption { + type = with types; attrsOf (submodule workerOpts); description = '' - List of sockets for web interface, in format acceptable by rspamd + Attribute set of workers to start. + ''; + default = { + normal = {}; + controller = {}; + }; + example = literalExample '' + { + normal = { + includes = [ "$CONFDIR/worker-normal.inc" ]; + bindSockets = [{ + socket = "/run/rspamd/rspamd.sock"; + mode = "0660"; + owner = "${cfg.user}"; + group = "${cfg.group}"; + }]; + }; + controller = { + includes = [ "$CONFDIR/worker-controller.inc" ]; + bindSockets = [ "[::1]:11334" ]; + }; + } ''; }; @@ -113,6 +272,13 @@ in config = mkIf cfg.enable { + services.rspamd.socketActivation = mkDefault (!opts.bindSocket.isDefined && !opts.bindUISocket.isDefined); + + assertions = [ { + assertion = !cfg.socketActivation || !(opts.bindSocket.isDefined || opts.bindUISocket.isDefined); + message = "Can't use socketActivation for rspamd when using renamed bind socket options"; + } ]; + # Allow users to run 'rspamc' and 'rspamadm'. environment.systemPackages = [ pkgs.rspamd ]; @@ -128,17 +294,22 @@ in gid = config.ids.gids.rspamd; }; + environment.etc."rspamd.conf".source = rspamdConfFile; + systemd.services.rspamd = { description = "Rspamd Service"; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; + wantedBy = mkIf (!cfg.socketActivation) [ "multi-user.target" ]; + after = [ "network.target" ] ++ + (if cfg.socketActivation then allSocketNames else []); + requires = mkIf cfg.socketActivation allSocketNames; serviceConfig = { ExecStart = "${pkgs.rspamd}/bin/rspamd ${optionalString cfg.debug "-d"} --user=${cfg.user} --group=${cfg.group} --pid=/run/rspamd.pid -c ${rspamdConfFile} -f"; Restart = "always"; RuntimeDirectory = "rspamd"; PrivateTmp = true; + Sockets = mkIf cfg.socketActivation (concatStringsSep " " allSocketNames); }; preStart = '' @@ -146,5 +317,25 @@ in ${pkgs.coreutils}/bin/chown ${cfg.user}:${cfg.group} /var/lib/rspamd ''; }; + systemd.sockets = mkIf cfg.socketActivation + (listToAttrs (map (each: { + name = "rspamd-${each.name}-${toString each.index}"; + value = { + description = "Rspamd socket ${toString each.index} for worker ${each.name}"; + wantedBy = [ "sockets.target" ]; + listenStreams = (listenStreams each.value.socket); + socketConfig = { + BindIPv6Only = mkIf (isIPv6Socket each.value.socket) "ipv6-only"; + Service = "rspamd.service"; + SocketUser = mkIf (isUnixSocket each.value.socket) each.value.owner; + SocketGroup = mkIf (isUnixSocket each.value.socket) each.value.group; + SocketMode = mkIf (isUnixSocket each.value.socket) each.value.mode; + }; + }; + }) allMappedSockets)); }; + imports = [ + (mkRenamedOptionModule [ "services" "rspamd" "bindSocket" ] [ "services" "rspamd" "workers" "normal" "bindSockets" ]) + (mkRenamedOptionModule [ "services" "rspamd" "bindUISocket" ] [ "services" "rspamd" "workers" "controller" "bindSockets" ]) + ]; } diff --git a/nixos/tests/rspamd.nix b/nixos/tests/rspamd.nix index 35e534246b65..6b2e2dd3a531 100644 --- a/nixos/tests/rspamd.nix +++ b/nixos/tests/rspamd.nix @@ -13,11 +13,12 @@ let $machine->succeed("[[ \"\$(stat -c %G ${socket})\" == \"${group}\" ]]"); $machine->succeed("[[ \"\$(stat -c %a ${socket})\" == \"${mode}\" ]]"); ''; - simple = name: enableIPv6: makeTest { + simple = name: socketActivation: enableIPv6: makeTest { name = "rspamd-${name}"; machine = { services.rspamd = { enable = true; + socketActivation = socketActivation; }; networking.enableIPv6 = enableIPv6; }; @@ -29,7 +30,15 @@ let $machine->succeed("id \"rspamd\" >/dev/null"); ${checkSocket "/run/rspamd/rspamd.sock" "rspamd" "rspamd" "660" } sleep 10; + $machine->log($machine->succeed("cat /etc/rspamd.conf")); $machine->log($machine->succeed("systemctl cat rspamd.service")); + ${if socketActivation then '' + $machine->log($machine->succeed("systemctl cat rspamd-controller-1.socket")); + $machine->log($machine->succeed("systemctl cat rspamd-normal-1.socket")); + '' else '' + $machine->fail("systemctl cat rspamd-controller-1.socket"); + $machine->fail("systemctl cat rspamd-normal-1.socket"); + ''} $machine->log($machine->succeed("curl http://localhost:11334/auth")); $machine->log($machine->succeed("curl http://127.0.0.1:11334/auth")); ${optionalString enableIPv6 '' @@ -39,10 +48,12 @@ let }; in { - simple = simple "simple" true; - ipv4only = simple "ipv4only" false; - bindports = makeTest { - name = "rspamd-bindports"; + simple = simple "simple" false true; + ipv4only = simple "ipv4only" false false; + simple-socketActivated = simple "simple-socketActivated" true true; + ipv4only-socketActivated = simple "ipv4only-socketActivated" true false; + deprecated = makeTest { + name = "rspamd-deprecated"; machine = { services.rspamd = { enable = true; @@ -56,6 +67,72 @@ in $machine->waitForFile("/run/rspamd.sock"); ${checkSocket "/run/rspamd.sock" "root" "root" "600" } ${checkSocket "/run/rspamd-worker.sock" "root" "root" "666" } + $machine->log($machine->succeed("cat /etc/rspamd.conf")); + $machine->fail("systemctl cat rspamd-normal-1.socket"); + $machine->log($machine->succeed("rspamc -h /run/rspamd-worker.sock stat")); + $machine->log($machine->succeed("curl --unix-socket /run/rspamd-worker.sock http://localhost/ping")); + ''; + }; + + bindports = makeTest { + name = "rspamd-bindports"; + machine = { + services.rspamd = { + enable = true; + socketActivation = false; + workers.normal.bindSockets = [{ + socket = "/run/rspamd.sock"; + mode = "0600"; + owner = "root"; + group = "root"; + }]; + workers.controller.bindSockets = [{ + socket = "/run/rspamd-worker.sock"; + mode = "0666"; + owner = "root"; + group = "root"; + }]; + }; + }; + + testScript = '' + ${initMachine} + $machine->waitForFile("/run/rspamd.sock"); + ${checkSocket "/run/rspamd.sock" "root" "root" "600" } + ${checkSocket "/run/rspamd-worker.sock" "root" "root" "666" } + $machine->log($machine->succeed("cat /etc/rspamd.conf")); + $machine->fail("systemctl cat rspamd-normal-1.socket"); + $machine->log($machine->succeed("rspamc -h /run/rspamd-worker.sock stat")); + $machine->log($machine->succeed("curl --unix-socket /run/rspamd-worker.sock http://localhost/ping")); + ''; + }; + socketActivated = makeTest { + name = "rspamd-socketActivated"; + machine = { + services.rspamd = { + enable = true; + workers.normal.bindSockets = [{ + socket = "/run/rspamd.sock"; + mode = "0600"; + owner = "root"; + group = "root"; + }]; + workers.controller.bindSockets = [{ + socket = "/run/rspamd-worker.sock"; + mode = "0666"; + owner = "root"; + group = "root"; + }]; + }; + }; + + testScript = '' + startAll + $machine->waitForFile("/run/rspamd.sock"); + ${checkSocket "/run/rspamd.sock" "root" "root" "600" } + ${checkSocket "/run/rspamd-worker.sock" "root" "root" "666" } + $machine->log($machine->succeed("cat /etc/rspamd.conf")); + $machine->log($machine->succeed("systemctl cat rspamd-normal-1.socket")); $machine->log($machine->succeed("rspamc -h /run/rspamd-worker.sock stat")); $machine->log($machine->succeed("curl --unix-socket /run/rspamd-worker.sock http://localhost/ping")); ''; From f41eb52bc90c46c1b91baafd4693f8326453dec3 Mon Sep 17 00:00:00 2001 From: mkgvt Date: Fri, 9 Feb 2018 03:05:11 -0500 Subject: [PATCH 29/51] rename: init at 1.9 (#34719) --- lib/maintainers.nix | 1 + pkgs/tools/misc/rename/default.nix | 18 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++++ 3 files changed, 23 insertions(+) create mode 100644 pkgs/tools/misc/rename/default.nix diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 85e1e6171be7..0302cc3bc798 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -449,6 +449,7 @@ mirrexagon = "Andrew Abbott "; mjanczyk = "Marcin Janczyk "; mjp = "Mike Playle "; # github = "MikePlayle"; + mkg = "Mark K Gardner "; mlieberman85 = "Michael Lieberman "; mmahut = "Marek Mahut "; moaxcp = "John Mercier "; diff --git a/pkgs/tools/misc/rename/default.nix b/pkgs/tools/misc/rename/default.nix new file mode 100644 index 000000000000..e30c2e89349d --- /dev/null +++ b/pkgs/tools/misc/rename/default.nix @@ -0,0 +1,18 @@ +{ stdenv, fetchFromGitHub, buildPerlPackage }: + +buildPerlPackage rec { + name = "rename-${version}"; + version = "1.9"; + src = fetchFromGitHub { + owner = "pstray"; + repo = "rename"; + rev = "d46f1d0ced25dc5849acb5d5974a3e2e9d97d536"; + sha256 = "0qahs1cqfaci2hdf1xncrz4k0z5skkfr43apnm3kybs7za33apzw"; + }; + meta = with stdenv.lib; { + description = "Rename files according to a Perl rewrite expression"; + homepage = http://search.cpan.org/~pederst/rename-1.9/bin/rename.PL; + maintainers = with maintainers; [ mkg ]; + license = with licenses; [ gpl1Plus ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 12b00338723a..5faab0baf5f6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4400,6 +4400,10 @@ with pkgs; gsettings_desktop_schemas = gnome3.gsettings_desktop_schemas; }; + rename = callPackage ../tools/misc/rename { + inherit (perlPackages) buildPerlPackage; + }; + renameutils = callPackage ../tools/misc/renameutils { }; renderdoc = libsForQt5.callPackage ../applications/graphics/renderdoc { }; From 09d04f6b6fa9ee3c4189a105277f52501f1bad8c Mon Sep 17 00:00:00 2001 From: Lucca Fraser Date: Fri, 9 Feb 2018 04:41:18 -0400 Subject: [PATCH 30/51] electrum-dash: 2.4.1 -> 2.9.3.1 --- pkgs/applications/misc/electrum-dash/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/misc/electrum-dash/default.nix b/pkgs/applications/misc/electrum-dash/default.nix index bde8d5b81e3e..c98efa547b39 100644 --- a/pkgs/applications/misc/electrum-dash/default.nix +++ b/pkgs/applications/misc/electrum-dash/default.nix @@ -1,12 +1,13 @@ { stdenv, fetchurl, python2Packages }: python2Packages.buildPythonApplication rec { + version = "2.9.3.1"; name = "electrum-dash-${version}"; - version = "2.4.1"; src = fetchurl { - url = "https://github.com/dashpay/electrum-dash/releases/download/v${version}/Electrum-DASH-${version}.tar.gz"; - sha256 = "02k7m7fyn0cvlgmwxr2gag7rf2knllkch1ma58shysp7zx9jb000"; + url = "https://github.com/akhavr/electrum-dash/releases/download/${version}/Electrum-DASH-${version}.tar.gz"; + #"https://github.com/dashpay/electrum-dash/releases/download/v${version}/Electrum-DASH-${version}.tar.gz"; + sha256 = "9b7ac205f63fd4bfb15d77a34a4451ef82caecf096f31048a7603bd276dfc33e"; }; propagatedBuildInputs = with python2Packages; [ @@ -20,10 +21,11 @@ python2Packages.buildPythonApplication rec { pyqt4 qrcode requests - slowaes + pyaes tlslite x11_hash mnemonic + jsonrpclib # plugins trezor From d1c5b483d2cade5c48f295cf168a8c3d814e4f37 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Fri, 9 Feb 2018 16:41:49 +0800 Subject: [PATCH 31/51] yaml2json: init at unstable-2017-05-03 --- pkgs/development/tools/yaml2json/default.nix | 24 ++++++++++++++++++++ pkgs/development/tools/yaml2json/deps.nix | 11 +++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 37 insertions(+) create mode 100644 pkgs/development/tools/yaml2json/default.nix create mode 100644 pkgs/development/tools/yaml2json/deps.nix diff --git a/pkgs/development/tools/yaml2json/default.nix b/pkgs/development/tools/yaml2json/default.nix new file mode 100644 index 000000000000..1a8d7f13aff5 --- /dev/null +++ b/pkgs/development/tools/yaml2json/default.nix @@ -0,0 +1,24 @@ +{ stdenv, buildGoPackage, fetchFromGitHub }: + + +buildGoPackage rec { + name = "yaml2json-${version}"; + version = "unstable-2017-05-03"; + goPackagePath = "github.com/bronze1man/yaml2json"; + + goDeps = ./deps.nix; + + src = fetchFromGitHub { + rev = "ee8196e587313e98831c040c26262693d48c1a0c"; + owner = "bronze1man"; + repo = "yaml2json"; + sha256 = "16a2sqzbam5adbhfvilnpdabzwncs7kgpr0cn4gp09h2imzsprzw"; + }; + + meta = with stdenv.lib; { + homepage = https://github.com/bronze1man/yaml2json; + description = "Convert yaml to json"; + license = with licenses; [ mit ]; + maintainers = [ maintainers.adisbladis ]; + }; +} diff --git a/pkgs/development/tools/yaml2json/deps.nix b/pkgs/development/tools/yaml2json/deps.nix new file mode 100644 index 000000000000..f907520cc872 --- /dev/null +++ b/pkgs/development/tools/yaml2json/deps.nix @@ -0,0 +1,11 @@ +[ + { + goPackagePath = "gopkg.in/yaml.v2"; + fetch = { + type = "git"; + url = "https://gopkg.in/yaml.v2"; + rev = "d670f9405373e636a5a2765eea47fac0c9bc91a4"; + sha256 = "1w1xid51n8v1mydn2m3vgggw8qgpd5a5sr62snsc77d99fpjsrs0"; + }; + } +] diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5faab0baf5f6..82bb8b42e465 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8058,6 +8058,8 @@ with pkgs; yacc = bison; + yaml2json = callPackage ../development/tools/yaml2json { }; + ycmd = callPackage ../development/tools/misc/ycmd { inherit (darwin.apple_sdk.frameworks) Cocoa; llvmPackages = llvmPackages_5; From 00970f76f9f5d494d8a1fea790acac31e3578cf7 Mon Sep 17 00:00:00 2001 From: Matthieu Chevrier Date: Fri, 9 Feb 2018 10:00:15 +0100 Subject: [PATCH 32/51] theharvester: init at 2.7.1 (#34704) --- lib/maintainers.nix | 1 + pkgs/tools/security/theharvester/default.nix | 41 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 44 insertions(+) create mode 100644 pkgs/tools/security/theharvester/default.nix diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 0302cc3bc798..b73a2854c782 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -700,6 +700,7 @@ tomberek = "Thomas Bereknyei "; tomsmeets = "Tom Smeets "; travisbhartwell = "Travis B. Hartwell "; + treemo = "Matthieu Chevrier "; trevorj = "Trevor Joynson "; trino = "Hubert Mühlhans "; tstrobel = "Thomas Strobel <4ZKTUB6TEP74PYJOPWIR013S2AV29YUBW5F9ZH2F4D5UMJUJ6S@hash.domains>"; diff --git a/pkgs/tools/security/theharvester/default.nix b/pkgs/tools/security/theharvester/default.nix new file mode 100644 index 000000000000..f1bac7adba10 --- /dev/null +++ b/pkgs/tools/security/theharvester/default.nix @@ -0,0 +1,41 @@ +{ stdenv, makeWrapper, python2Packages, fetchFromGitHub, python2 }: + +stdenv.mkDerivation rec { + pname = "theHarvester"; + version = "2.7.1"; + name = "${pname}-${version}"; + + src = fetchFromGitHub { + owner = "laramies"; + repo = "${pname}"; + rev = "25553762d2d93a39083593adb08a34d5f5142c60"; + sha256 = "0gnm598y6paz0knwvdv1cx0w6ngdbbpzkdark3q5vs66yajv24w4"; + }; + + nativeBuildInputs = [ makeWrapper ]; + + # add dependencies + propagatedBuildInputs = [ python2Packages.requests ]; + + installPhase = '' + # create dirs + mkdir -p $out/share/${pname} $out/bin + + # move project code + mv * $out/share/${pname}/ + + # make project runnable + chmod +x $out/share/${pname}/theHarvester.py + ln -s $out/share/${pname}/theHarvester.py $out/bin + + wrapProgram "$out/bin/theHarvester.py" --prefix PYTHONPATH : $out/share/${pname}:$PYTHONPATH + ''; + + meta = with stdenv.lib; { + description = "Gather E-mails, subdomains and names from different public sources"; + homepage = "https://github.com/laramies/theHarvester"; + platforms = platforms.all; + maintainers = with maintainers; [ treemo ]; + license = licenses.gpl2; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 82bb8b42e465..28a4515d49e2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4870,6 +4870,8 @@ with pkgs; thc-hydra = callPackage ../tools/security/thc-hydra { }; + theharvester = callPackage ../tools/security/theharvester { }; + thefuck = python3Packages.callPackage ../tools/misc/thefuck { }; thin-provisioning-tools = callPackage ../tools/misc/thin-provisioning-tools { }; From abfac62df5c9424acab73bec7d02a886bd50915b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 31 Jan 2018 22:18:37 +0000 Subject: [PATCH 33/51] alacritty: 2017-12-29 -> 2018-01-31 --- pkgs/applications/misc/alacritty/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/alacritty/default.nix b/pkgs/applications/misc/alacritty/default.nix index 7bfcc6e72c89..0f629aace456 100644 --- a/pkgs/applications/misc/alacritty/default.nix +++ b/pkgs/applications/misc/alacritty/default.nix @@ -30,18 +30,18 @@ let ]; in buildRustPackage rec { name = "alacritty-unstable-${version}"; - version = "2017-12-29"; + version = "2018-01-31"; # At the moment we cannot handle git dependencies in buildRustPackage. # This fork only replaces rust-fontconfig/libfontconfig with a git submodules. src = fetchgit { url = https://github.com/Mic92/alacritty.git; rev = "rev-${version}"; - sha256 = "0pk4b8kfxixmd9985v2fya1m7np8ggws8d9msw210drc0grwbfkd"; + sha256 = "0jc8haijd6f8r5fqiknrvqnwc9q4cp93852lr2p7zak7dv29v45p"; fetchSubmodules = true; }; - cargoSha256 = "0acj526cx4xl52vbcbd3hp1klh4p756j6alxqqz3x715zi2dqkzf"; + cargoSha256 = "0023jpc6krilmp5wzbbwapxafsi6m1k13mvjh4zlvls1nyyhk808"; nativeBuildInputs = [ cmake From 3a2b0cdf5c9751fce19023f4e3948e19ac795b81 Mon Sep 17 00:00:00 2001 From: Hamish Date: Fri, 9 Feb 2018 12:37:29 +0300 Subject: [PATCH 34/51] nixos/traefik: make group configurable for docker support (#34749) --- nixos/modules/services/web-servers/traefik.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/web-servers/traefik.nix b/nixos/modules/services/web-servers/traefik.nix index 4ede4fc20967..b6c7fef21fb2 100644 --- a/nixos/modules/services/web-servers/traefik.nix +++ b/nixos/modules/services/web-servers/traefik.nix @@ -64,6 +64,16 @@ in { ''; }; + group = mkOption { + default = "traefik"; + type = types.string; + example = "docker"; + description = '' + Set the group that traefik runs under. + For the docker backend this needs to be set to docker instead. + ''; + }; + package = mkOption { default = pkgs.traefik; defaultText = "pkgs.traefik"; @@ -87,7 +97,7 @@ in { ]; Type = "simple"; User = "traefik"; - Group = "traefik"; + Group = cfg.group; Restart = "on-failure"; StartLimitInterval = 86400; StartLimitBurst = 5; From 0cdc0ac3a1a0423e077c82db5b6d7f54edc03ea6 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Fri, 9 Feb 2018 18:04:55 +0800 Subject: [PATCH 35/51] screenfetch: 2016-10-11 -> 3.8.0 --- pkgs/tools/misc/screenfetch/default.nix | 65 +++++++++++++------------ 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/pkgs/tools/misc/screenfetch/default.nix b/pkgs/tools/misc/screenfetch/default.nix index 9ef0c9ebdf7d..a9cd9d75de8e 100644 --- a/pkgs/tools/misc/screenfetch/default.nix +++ b/pkgs/tools/misc/screenfetch/default.nix @@ -3,14 +3,30 @@ , darwin }: -stdenv.mkDerivation { - name = "screenFetch-2016-10-11"; +let + path = lib.makeBinPath ([ + coreutils gawk gnused findutils + gnugrep ncurses bc + ] ++ lib.optionals stdenv.isLinux [ + procps + xdpyinfo + xprop + ] ++ lib.optionals stdenv.isDarwin (with darwin; [ + adv_cmds + DarwinTools + system_cmds + "/usr" # some commands like defaults is not available to us + ])); + +in stdenv.mkDerivation rec { + name = "screenFetch-${version}"; + version = "3.8.0"; src = fetchFromGitHub { - owner = "KittyKatt"; - repo = "screenFetch"; - rev = "89e51f24018c89b3647deb24406a9af3a78bbe99"; - sha256 = "0i2k261jj2s4sfhav7vbsd362pa0gghw6qhwafhmicmf8hq2a18v"; + owner = "KittyKatt"; + repo = "screenFetch"; + rev = "v${version}"; + sha256 = "00ibv72cb7cqfpljyzgvajhbp0clqsqliz18nyv83bfy3gkf2qs8"; }; nativeBuildInputs = [ makeWrapper ]; @@ -18,40 +34,29 @@ stdenv.mkDerivation { installPhase = '' install -Dm 0755 screenfetch-dev $out/bin/screenfetch install -Dm 0644 screenfetch.1 $out/share/man/man1/screenfetch.1 + install -Dm 0644 -t $out/share/doc/screenfetch CHANGELOG COPYING README.mkdn TODO - # Fix all of the depedencies of screenfetch + # Fix all of the dependencies of screenfetch patchShebangs $out/bin/screenfetch wrapProgram "$out/bin/screenfetch" \ - --set PATH ${lib.makeBinPath ([ - coreutils gawk gnused findutils - gnugrep ncurses bc - ] ++ lib.optionals stdenv.isLinux [ - procps - xdpyinfo - xprop - ] ++ lib.optionals stdenv.isDarwin (with darwin; [ - adv_cmds - DarwinTools - system_cmds - "/usr" # some commands like defaults is not available to us - ]))} + --prefix PATH : ${path} ''; meta = with lib; { description = "Fetches system/theme information in terminal for Linux desktop screenshots"; longDescription = '' - screenFetch is a "Bash Screenshot Information Tool". This handy Bash - script can be used to generate one of those nifty terminal theme - information + ASCII distribution logos you see in everyone's screenshots - nowadays. It will auto-detect your distribution and display an ASCII - version of that distribution's logo and some valuable information to the - right. There are options to specify no ascii art, colors, taking a - screenshot upon displaying info, and even customizing the screenshot - command! This script is very easy to add to and can easily be extended. + screenFetch is a "Bash Screenshot Information Tool". This handy Bash + script can be used to generate one of those nifty terminal theme + information + ASCII distribution logos you see in everyone's screenshots + nowadays. It will auto-detect your distribution and display an ASCII + version of that distribution's logo and some valuable information to the + right. There are options to specify no ascii art, colors, taking a + screenshot upon displaying info, and even customizing the screenshot + command! This script is very easy to add to and can easily be extended. ''; license = licenses.gpl3; - homepage = http://git.silverirc.com/cgit.cgi/screenfetch-dev.git/; - maintainers = with maintainers; [relrod]; + homepage = https://github.com/KittyKatt/screenFetch; + maintainers = with maintainers; [ relrod ]; platforms = platforms.all; }; } From 6ceece6b591de56507409d6c690dddd9854ba969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 9 Feb 2018 12:20:55 +0100 Subject: [PATCH 36/51] nixos/dovecot: no " in mailbox.name --- nixos/modules/services/mail/dovecot.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/mail/dovecot.nix b/nixos/modules/services/mail/dovecot.nix index c5cb06cf54e2..b42c73b86668 100644 --- a/nixos/modules/services/mail/dovecot.nix +++ b/nixos/modules/services/mail/dovecot.nix @@ -113,7 +113,7 @@ let mailboxes = { lib, pkgs, ... }: { options = { name = mkOption { - type = types.str; + type = types.strMatching ''[^"]+''; example = "Spam"; description = "The name of the mailbox."; }; From c6bd327af869aba4db98f10b3f85659853f8518a Mon Sep 17 00:00:00 2001 From: Chris Hodapp Date: Fri, 21 Apr 2017 20:00:45 -0400 Subject: [PATCH 37/51] darktable: Removed unneeded dependencies Based on what LebedevRI told me on IRC and in https://github.com/darktable-org/darktable/pull/1474 --- .../graphics/darktable/default.nix | 34 ++++++++----------- pkgs/top-level/all-packages.nix | 1 - 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/pkgs/applications/graphics/darktable/default.nix b/pkgs/applications/graphics/darktable/default.nix index 787ddc72ec9a..e9932b93fbe0 100644 --- a/pkgs/applications/graphics/darktable/default.nix +++ b/pkgs/applications/graphics/darktable/default.nix @@ -1,15 +1,10 @@ -{ stdenv, fetchurl, libsoup, graphicsmagick, SDL, json_glib -, GConf, atk, cairo, cmake, curl, dbus_glib, exiv2, glib -, libgnome_keyring, gtk3, ilmbase, intltool, lcms, lcms2 -, lensfun, libXau, libXdmcp, libexif, libglade, libgphoto2, libjpeg -, libpng, libpthreadstubs, librsvg, libtiff, libxcb -, openexr, osm-gps-map, pixman, pkgconfig, sqlite, bash, libxslt, openjpeg -, mesa, lua, pugixml, colord, colord-gtk, libxshmfence, libxkbcommon -, epoxy, at_spi2_core, libwebp, libsecret, wrapGAppsHook, gnome3 +{ stdenv, fetchurl, libsoup, graphicsmagick, json_glib, wrapGAppsHook +, cairo, cmake, ninja, curl, perl, llvm, desktop_file_utils, exiv2, glib +, ilmbase, gtk3, intltool, lcms2, lensfun, libX11, libexif, libgphoto2, libjpeg +, libpng, librsvg, libtiff, openexr, osm-gps-map, pkgconfig, sqlite, libxslt +, openjpeg, lua, pugixml, colord, colord-gtk, libwebp, libsecret, gnome3 }: -assert stdenv ? glibc; - stdenv.mkDerivation rec { version = "2.4.1"; name = "darktable-${version}"; @@ -19,16 +14,15 @@ stdenv.mkDerivation rec { sha256 = "014pq80i5k1kdvvrl7xrgaaq3i4fzv09h7a3pwzlp2ahkczwcm32"; }; - buildInputs = - [ GConf atk cairo cmake curl dbus_glib exiv2 glib libgnome_keyring gtk3 - ilmbase intltool lcms lcms2 lensfun libXau libXdmcp libexif - libglade libgphoto2 libjpeg libpng libpthreadstubs - librsvg libtiff libxcb openexr pixman pkgconfig sqlite libxslt - libsoup graphicsmagick SDL json_glib openjpeg mesa lua pugixml - colord colord-gtk libxshmfence libxkbcommon epoxy at_spi2_core - libwebp libsecret wrapGAppsHook gnome3.adwaita-icon-theme - osm-gps-map - ]; + nativeBuildInputs = [ cmake ninja llvm pkgconfig intltool perl desktop_file_utils wrapGAppsHook ]; + + buildInputs = [ + cairo curl exiv2 glib gtk3 ilmbase lcms2 lensfun libX11 libexif + libgphoto2 libjpeg libpng librsvg libtiff openexr sqlite libxslt + libsoup graphicsmagick json_glib openjpeg lua pugixml + colord colord-gtk libwebp libsecret gnome3.adwaita-icon-theme + osm-gps-map + ]; cmakeFlags = [ "-DBUILD_USERMANUAL=False" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e0cca97ea849..84ad04e4ce7e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14651,7 +14651,6 @@ with pkgs; }); darktable = callPackage ../applications/graphics/darktable { - inherit (gnome2) GConf libglade; lua = lua5_3; pugixml = pugixml.override { shared = true; }; }; From 6f56749b071741b8f54254c5522e82d37290176e Mon Sep 17 00:00:00 2001 From: zimbatm Date: Fri, 9 Feb 2018 10:48:11 +0000 Subject: [PATCH 38/51] asciidoctor: expose all the bins asciidoctor has multiple binaries, expose them all to the user --- pkgs/tools/typesetting/asciidoctor/default.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/typesetting/asciidoctor/default.nix b/pkgs/tools/typesetting/asciidoctor/default.nix index f494f1911593..02b57ee3a13b 100644 --- a/pkgs/tools/typesetting/asciidoctor/default.nix +++ b/pkgs/tools/typesetting/asciidoctor/default.nix @@ -1,12 +1,18 @@ -{ stdenv, lib, bundlerEnv, ruby, curl }: - -bundlerEnv { - pname = "asciidoctor"; +{ stdenv, lib, bundlerApp, ruby, curl }: +bundlerApp { inherit ruby; - + pname = "asciidoctor"; gemdir = ./.; + exes = [ + "asciidoctor" + "asciidoctor-bespoke" + "asciidoctor-latex" + "asciidoctor-pdf" + "asciidoctor-safe" + ]; + meta = with lib; { description = "A faster Asciidoc processor written in Ruby"; homepage = http://asciidoctor.org/; From 3b6f8b5b154d75872a52ffbd3ab9dfebfdf03022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Lafuente?= Date: Fri, 9 Feb 2018 16:17:22 +0100 Subject: [PATCH 39/51] youtube-dl: 2018.01.27 -> 2018.02.08 (#34762) --- pkgs/tools/misc/youtube-dl/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/youtube-dl/default.nix b/pkgs/tools/misc/youtube-dl/default.nix index c4595a1a94e1..0386896d97f8 100644 --- a/pkgs/tools/misc/youtube-dl/default.nix +++ b/pkgs/tools/misc/youtube-dl/default.nix @@ -16,11 +16,11 @@ with stdenv.lib; buildPythonApplication rec { name = "youtube-dl-${version}"; - version = "2018.01.27"; + version = "2018.02.08"; src = fetchurl { url = "https://yt-dl.org/downloads/${version}/${name}.tar.gz"; - sha256 = "14vbm8pr6xdrdbk8j9k4v82rnalbdpk2lcm7n9wj6z6d441ymji9"; + sha256 = "0iq5mav782gz0gm00rry3v7gdxkkx4y1k0p20pvz32ga4id5k1mg"; }; nativeBuildInputs = [ makeWrapper ]; From 855e66860ab2d200d79e0853d8c9b6e8a769ac42 Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 9 Feb 2018 16:16:43 +0100 Subject: [PATCH 40/51] gajim: 0.16.8 -> 0.16.9 Upstream changes: * Improve Zeroconf behavior * Fix showing normal message event * remove usage of OpenSSL.rand * a few minor bugfixes The really important part here is the third point about OpenSSL.rand, because the rand attribute no longer exists in pyopenssl and thus Gajim doesn't even start. Also the fix-tests.patch has been fixed upstream as well, so we don't need it anymore. Another change in 0.16.9 that's not included in the changelog is that there is a test_nogui target, which is also run by the CI upstream is using, so let's use that and remove xvfb_run. Signed-off-by: aszlig Cc: @7c6f434c, @Mic92 --- .../instant-messengers/gajim/default.nix | 15 ++++----------- .../instant-messengers/gajim/fix-tests.patch | 13 ------------- 2 files changed, 4 insertions(+), 24 deletions(-) delete mode 100644 pkgs/applications/networking/instant-messengers/gajim/fix-tests.patch diff --git a/pkgs/applications/networking/instant-messengers/gajim/default.nix b/pkgs/applications/networking/instant-messengers/gajim/default.nix index b01c6497fb23..42c510495574 100644 --- a/pkgs/applications/networking/instant-messengers/gajim/default.nix +++ b/pkgs/applications/networking/instant-messengers/gajim/default.nix @@ -1,9 +1,6 @@ { stdenv, fetchurl, autoreconfHook, python, intltool, pkgconfig, libX11 , ldns, pythonPackages -# Test requirements -, xvfb_run - , enableJingle ? true, farstream ? null, gst-plugins-bad ? null , libnice ? null , enableE2E ? true @@ -25,13 +22,13 @@ with stdenv.lib; stdenv.mkDerivation rec { name = "gajim-${version}"; - version = "0.16.8"; + version = "0.16.9"; src = fetchurl { name = "${name}.tar.bz2"; url = "https://dev.gajim.org/gajim/gajim/repository/archive.tar.bz2?" + "ref=${name}"; - sha256 = "009cpzqh4zy7hc9pq3r5m4lgagwawhjab13rjzavb0n9ggijcscb"; + sha256 = "121dh906zya9n7npyk7b5xama0z3ycy9jl7l5jm39pc86h1winh3"; }; patches = let @@ -46,8 +43,7 @@ stdenv.mkDerivation rec { name = "gajim-${name}.patch"; url = "https://dev.gajim.org/gajim/gajim/commit/${rev}.diff"; inherit sha256; - }) cherries) - ++ [./fix-tests.patch]; # https://dev.gajim.org/gajim/gajim/issues/8660 + }) cherries); postPatch = '' sed -i -e '0,/^[^#]/ { @@ -74,8 +70,6 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook pythonPackages.wrapPython intltool pkgconfig - # Test dependencies - xvfb_run ]; autoreconfPhase = '' @@ -114,9 +108,8 @@ stdenv.mkDerivation rec { doInstallCheck = true; installCheckPhase = '' - XDG_DATA_DIRS="$out/share/gajim''${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS" \ PYTHONPATH="test:$out/share/gajim/src:''${PYTHONPATH:+:}$PYTHONPATH" \ - xvfb-run make test + make test_nogui ''; enableParallelBuilding = true; diff --git a/pkgs/applications/networking/instant-messengers/gajim/fix-tests.patch b/pkgs/applications/networking/instant-messengers/gajim/fix-tests.patch deleted file mode 100644 index cb866bb2d739..000000000000 --- a/pkgs/applications/networking/instant-messengers/gajim/fix-tests.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/common/gajim.py b/src/common/gajim.py -index 4a5d884b6..95d401b67 100644 ---- a/src/common/gajim.py -+++ b/src/common/gajim.py -@@ -415,7 +415,7 @@ def get_jid_from_account(account_name, full=False): - jid = name + '@' + hostname - if full: - resource = connections[account_name].server_resource -- jid += '/' + resource -+ jid += '/' + str(resource) - return jid - - def get_our_jids(): From 4ffe462b10f1bd55afe9ea6d92ee44dccaf1f2f5 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Fri, 9 Feb 2018 10:25:50 -0500 Subject: [PATCH 41/51] docker-edge: 18.01.0 -> 18.02.0 --- .../virtualization/docker/default.nix | 16 ++++++++-------- pkgs/top-level/all-packages.nix | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/virtualization/docker/default.nix b/pkgs/applications/virtualization/docker/default.nix index 56436d047f2e..339d3e8490d9 100644 --- a/pkgs/applications/virtualization/docker/default.nix +++ b/pkgs/applications/virtualization/docker/default.nix @@ -209,14 +209,14 @@ rec { tiniSha256 = "0zj4kdis1vvc6dwn4gplqna0bs7v6d1y2zc8v80s3zi018inhznw"; }; - docker_18_01 = dockerGen rec { - version = "18.01.0-ce"; - rev = "03596f51b120095326d2004d676e97228a21014d"; # git commit - sha256 = "1zffaxwkfz8ca76f5ql5z76mcjx37jbgv2kk75i68487yg16x0md"; - runcRev = "b2567b37d7b75eb4cf325b77297b140ea686ce8f"; - runcSha256 = "0zarsrbfcm1yp6mdl6rcrigdf7nb70xmv2cbggndz0qqyrw0mk0l"; - containerdRev = "89623f28b87a6004d4b785663257362d1658a729"; - containerdSha256 = "0irx7ps6rhq7z69cr3gspxdr7ywrv6dz62gkr1z2723cki9hsxma"; + docker_18_02 = dockerGen rec { + version = "18.02.0-ce"; + rev = "fc4de447b563498eb4da89f56fb858bbe761d91b"; # git commit + sha256 = "1025cwv2niiwg5pc30nb1qky1raisvd9ix2qw6rdib232hwq9k8m"; + runcRev = "9f9c96235cc97674e935002fc3d78361b696a69e"; + runcSha256 = "18f8vqdbf685dd777pjh8jzpxafw2vapqh4m43xgyi7lfwa0gsln"; + containerdRev = "9b55aab90508bd389d7654c4baf173a981477d55"; + containerdSha256 = "0kfafqi66yp4qy738pl11f050hfrx9m4kc670qpx7fmf9ii7q6p2"; tiniRev = "949e6facb77383876aeff8a6944dde66b3089574"; tiniSha256 = "0zj4kdis1vvc6dwn4gplqna0bs7v6d1y2zc8v80s3zi018inhznw"; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 84ad04e4ce7e..d192c3dcf4be 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11167,7 +11167,7 @@ with pkgs; strigi = callPackage ../development/libraries/strigi { clucene_core = clucene_core_2; }; subdl = callPackage ../applications/video/subdl { }; - + subtitleeditor = callPackage ../applications/video/subtitleeditor { }; suil-qt4 = callPackage ../development/libraries/audio/suil { @@ -14711,10 +14711,10 @@ with pkgs; inherit (callPackage ../applications/virtualization/docker { }) docker_17_12 - docker_18_01; + docker_18_02; docker = docker_17_12; - docker-edge = docker_18_01; + docker-edge = docker_18_02; docker-proxy = callPackage ../applications/virtualization/docker/proxy.nix { }; From 7f6c4e2703792d9e2405331607a8798a632eccd2 Mon Sep 17 00:00:00 2001 From: Geoffrey Reedy Date: Fri, 9 Feb 2018 08:32:28 -0700 Subject: [PATCH 42/51] libproxy: fix building on darwin --- pkgs/development/libraries/libproxy/default.nix | 12 ++++++++---- pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/libproxy/default.nix b/pkgs/development/libraries/libproxy/default.nix index 614890e929f7..bf9e2d079cd6 100644 --- a/pkgs/development/libraries/libproxy/default.nix +++ b/pkgs/development/libraries/libproxy/default.nix @@ -1,5 +1,6 @@ -{ stdenv, lib, fetchFromGitHub, pkgconfig, cmake -, dbus, networkmanager, spidermonkey_38, pcre, python2, python3 }: +{ stdenv, lib, fetchFromGitHub, pkgconfig, cmake, zlib +, dbus, networkmanager, spidermonkey_38, pcre, python2, python3 +, SystemConfiguration, CoreFoundation, JavaScriptCore }: stdenv.mkDerivation rec { name = "libproxy-${version}"; @@ -16,7 +17,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig cmake ]; - buildInputs = [ dbus networkmanager spidermonkey_38 pcre python2 python3 ]; + buildInputs = [ pcre python2 python3 zlib ] + ++ (if stdenv.hostPlatform.isDarwin + then [ SystemConfiguration CoreFoundation JavaScriptCore ] + else [ spidermonkey_38 dbus networkmanager ]); preConfigure = '' cmakeFlagsArray+=( @@ -27,7 +31,7 @@ stdenv.mkDerivation rec { ''; meta = with stdenv.lib; { - platforms = platforms.linux; + platforms = platforms.linux ++ platforms.darwin; license = licenses.lgpl21; homepage = http://libproxy.github.io/libproxy/; description = "A library that provides automatic proxy configuration management"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 84ad04e4ce7e..a747a516f66e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9894,9 +9894,7 @@ with pkgs; }; libproxy = callPackage ../development/libraries/libproxy { - stdenv = if stdenv.isDarwin - then overrideCC stdenv gcc - else stdenv; + inherit (darwin.apple_sdk.frameworks) SystemConfiguration CoreFoundation JavaScriptCore; }; libpseudo = callPackage ../development/libraries/libpseudo { }; From c4658ac0a4ebb8a5a5f5fd4305479d9f3ee7f714 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Nakamura Date: Fri, 9 Feb 2018 13:34:19 +0900 Subject: [PATCH 43/51] rPackages.pbdZMQ: fix package loading on Darwin --- pkgs/development/r-modules/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index 4510308d3e56..ee1fb24b3098 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -285,7 +285,7 @@ let pbdMPI = [ pkgs.openmpi ]; pbdNCDF4 = [ pkgs.netcdf ]; pbdPROF = [ pkgs.openmpi ]; - pbdZMQ = [ pkgs.which ]; + pbdZMQ = lib.optionals stdenv.isDarwin [ pkgs.which ]; pdftools = [ pkgs.poppler.dev ]; PKI = [ pkgs.openssl.dev ]; png = [ pkgs.libpng.dev ]; @@ -393,6 +393,7 @@ let nat = [ pkgs.which ]; nat_nblast = [ pkgs.which ]; nat_templatebrains = [ pkgs.which ]; + pbdZMQ = lib.optionals stdenv.isDarwin [ pkgs.binutils.bintools ]; RMark = [ pkgs.which ]; RPushbullet = [ pkgs.which ]; qtpaint = [ pkgs.cmake ]; @@ -776,6 +777,14 @@ let PKG_LIBS = "-L${pkgs.openblasCompat}/lib -lopenblas"; }); + pbdZMQ = old.pbdZMQ.overrideDerivation (attrs: { + postPatch = lib.optionalString stdenv.isDarwin '' + for file in R/*.{r,r.in}; do + sed -i 's#system("which \(\w\+\)"[^)]*)#"${pkgs.binutils.bintools}/bin/\1"#g' $file + done + ''; + }); + qtbase = old.qtbase.overrideDerivation (attrs: { patches = [ ./patches/qtbase.patch ]; }); From 814a9310dc05df88c677b8acb44303e183af35a3 Mon Sep 17 00:00:00 2001 From: thorstenweber83 Date: Fri, 9 Feb 2018 17:02:23 +0100 Subject: [PATCH 44/51] python.pkgs.awesome-slugify: fix build (#34764) It broke because Unidecode went out of its defined range (Unidecode>=0.04.14,<0.05) with commit 57e9ed3719e5cef086a3463513e8805c761c3cf4 --- pkgs/development/python-modules/awesome-slugify/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/awesome-slugify/default.nix b/pkgs/development/python-modules/awesome-slugify/default.nix index 105c70c28b34..945c941dec4e 100644 --- a/pkgs/development/python-modules/awesome-slugify/default.nix +++ b/pkgs/development/python-modules/awesome-slugify/default.nix @@ -3,13 +3,17 @@ buildPythonPackage rec { pname = "awesome-slugify"; version = "1.6.5"; - name = "${pname}-${version}"; src = fetchPypi { inherit pname version; sha256 = "0wgxrhr8s5vk2xmcz9s1z1aml4ppawmhkbggl9rp94c747xc7pmv"; }; + prePatch = '' + substituteInPlace setup.py \ + --replace 'Unidecode>=0.04.14,<0.05' 'Unidecode>=0.04.14' + ''; + patches = [ ./slugify_filename_test.patch # fixes broken test by new unidecode ]; From 56a21983f9289079be6ef22b7fb60d9707132fb3 Mon Sep 17 00:00:00 2001 From: Jens Binkert Date: Fri, 9 Feb 2018 17:16:32 +0100 Subject: [PATCH 45/51] typora: 0.9.41 -> 0.9.44 --- pkgs/applications/editors/typora/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/typora/default.nix b/pkgs/applications/editors/typora/default.nix index 22e7c3d31b36..7c6d186b8830 100644 --- a/pkgs/applications/editors/typora/default.nix +++ b/pkgs/applications/editors/typora/default.nix @@ -3,18 +3,18 @@ stdenv.mkDerivation rec { name = "typora-${version}"; - version = "0.9.41"; + version = "0.9.44"; src = if stdenv.system == "x86_64-linux" then fetchurl { url = "https://www.typora.io/linux/typora_${version}_amd64.deb"; - sha256 = "e4916f86c7c12aec8fd59b3ef79c2a4d3f77b02a0a9e962916c688871c9fda1d"; + sha256 = "9442c090bf2619d270890228abd7dabb9e217c0b200615f8ed3cb255efd122d5"; } else fetchurl { url = "https://www.typora.io/linux/typora_${version}_i386.deb"; - sha256 = "18960fb4b2cd6cf9cb77025a4035a3258f1599b1d225fb673b49c1588fa272d6"; + sha256 = "ae228ca946d03940b85df30c995c4de3f942a780e32d4dcab872dec671c66ef3"; } ; From 9622cdb69f60d1bb6aad9158fce9dd6205c5ebc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 9 Feb 2018 17:08:28 +0000 Subject: [PATCH 46/51] flexget: mark as broken --- pkgs/applications/networking/flexget/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/networking/flexget/default.nix b/pkgs/applications/networking/flexget/default.nix index 105239aca024..585e0c847da2 100644 --- a/pkgs/applications/networking/flexget/default.nix +++ b/pkgs/applications/networking/flexget/default.nix @@ -75,5 +75,6 @@ buildPythonApplication rec { description = "Multipurpose automation tool for content like torrents"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ domenkozar tari ]; + broken = true; # as of 2018-02-09 }; } From 209f8b1acd4c855d223d93f02caf3ccf6cec7e32 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 1 Feb 2018 10:34:03 +0100 Subject: [PATCH 47/51] nixos/release*.nix: Clean nixpkgs sources by default Currently, when building NixOS from a git clone, Nix has to copy the entire repo at >1GB into the store by default. That is not necessary and causes a dumping large path message. If you need the old behaviour for some reason, you will have to specify it by passing the path to your repo explicitly as the nixpkgs argument like this: --arg nixpkgs '{outPath = ./.; revCount = 56789; shortRev = "gfedcba"; }' --- nixos/release-combined.nix | 2 +- nixos/release-small.nix | 2 +- nixos/release.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/release-combined.nix b/nixos/release-combined.nix index d4f77ea445d0..9d4a551a958b 100644 --- a/nixos/release-combined.nix +++ b/nixos/release-combined.nix @@ -2,7 +2,7 @@ # and nixos-14.04). The channel is updated every time the ‘tested’ job # succeeds, and all other jobs have finished (they may fail). -{ nixpkgs ? { outPath = ./..; revCount = 56789; shortRev = "gfedcba"; } +{ nixpkgs ? { outPath = (import ../lib).cleanSource ./..; revCount = 56789; shortRev = "gfedcba"; } , stableBranch ? false , supportedSystems ? [ "x86_64-linux" ] , limitedSupportedSystems ? [ "i686-linux" ] diff --git a/nixos/release-small.nix b/nixos/release-small.nix index e9f3cfb4de53..24c448449c1f 100644 --- a/nixos/release-small.nix +++ b/nixos/release-small.nix @@ -2,7 +2,7 @@ # small subset of Nixpkgs, mostly useful for servers that need fast # security updates. -{ nixpkgs ? { outPath = ./..; revCount = 56789; shortRev = "gfedcba"; } +{ nixpkgs ? { outPath = (import ../lib).cleanSource ./..; revCount = 56789; shortRev = "gfedcba"; } , stableBranch ? false , supportedSystems ? [ "x86_64-linux" ] # no i686-linux }: diff --git a/nixos/release.nix b/nixos/release.nix index e9d145031c4f..2c6055003767 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -1,4 +1,4 @@ -{ nixpkgs ? { outPath = ./..; revCount = 56789; shortRev = "gfedcba"; } +{ nixpkgs ? { outPath = (import ../lib).cleanSource ./..; revCount = 56789; shortRev = "gfedcba"; } , stableBranch ? false , supportedSystems ? [ "x86_64-linux" "aarch64-linux" ] }: From 01460745602c2c31f2ce6d7a22ff80602894679b Mon Sep 17 00:00:00 2001 From: symphorien Date: Fri, 9 Feb 2018 18:40:39 +0000 Subject: [PATCH 48/51] nixos/tests: add predictable-interface-names.nix (#34305) --- lib/lists.nix | 8 ++++-- nixos/release-small.nix | 1 + nixos/release.nix | 1 + nixos/tests/predictable-interface-names.nix | 27 +++++++++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 nixos/tests/predictable-interface-names.nix diff --git a/lib/lists.nix b/lib/lists.nix index 8f67c6bb0ca3..f2e6bacdc98b 100644 --- a/lib/lists.nix +++ b/lib/lists.nix @@ -440,8 +440,12 @@ rec { init = list: assert list != []; take (length list - 1) list; - /* FIXME(zimbatm) Not used anywhere - */ + /* return the image of the cross product of some lists by a function + + Example: + crossLists (x:y: "${toString x}${toString y}") [[1 2] [3 4]] + => [ "13" "14" "23" "24" ] + */ crossLists = f: foldl (fs: args: concatMap (f: map f args) fs) [f]; diff --git a/nixos/release-small.nix b/nixos/release-small.nix index 24c448449c1f..2b532c70763f 100644 --- a/nixos/release-small.nix +++ b/nixos/release-small.nix @@ -41,6 +41,7 @@ in rec { nfs3 openssh php-pcre + predictable-interface-names proxy simple; installer = { diff --git a/nixos/release.nix b/nixos/release.nix index 2c6055003767..16f00e78faa9 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -326,6 +326,7 @@ in rec { tests.pgmanage = callTest tests/pgmanage.nix {}; tests.postgis = callTest tests/postgis.nix {}; #tests.pgjwt = callTest tests/pgjwt.nix {}; + tests.predictable-interface-names = callSubTests tests/predictable-interface-names.nix {}; tests.printing = callTest tests/printing.nix {}; tests.prometheus = callTest tests/prometheus.nix {}; tests.proxy = callTest tests/proxy.nix {}; diff --git a/nixos/tests/predictable-interface-names.nix b/nixos/tests/predictable-interface-names.nix new file mode 100644 index 000000000000..b4c2039923cf --- /dev/null +++ b/nixos/tests/predictable-interface-names.nix @@ -0,0 +1,27 @@ +{ system ? builtins.currentSystem +, pkgs ? import ../.. { inherit system; } +}: +with import ../lib/testing.nix { inherit system; }; +let boolToString = x: if x then "yes" else "no"; in +let testWhenSetTo = predictable: withNetworkd: +makeTest { + name = "${if predictable then "" else "un"}predictableInterfaceNames${if withNetworkd then "-with-networkd" else ""}"; + meta = {}; + + machine = { config, pkgs, ... }: { + networking.usePredictableInterfaceNames = pkgs.stdenv.lib.mkForce predictable; + networking.useNetworkd = withNetworkd; + networking.dhcpcd.enable = !withNetworkd; + }; + + testScript = '' + print $machine->succeed("ip link"); + $machine->succeed("ip link show ${if predictable then "ens3" else "eth0"}"); + $machine->fail("ip link show ${if predictable then "eth0" else "ens3"}"); + ''; +}; in +with pkgs.stdenv.lib.lists; +with pkgs.stdenv.lib.attrsets; +listToAttrs (map (drv: nameValuePair drv.name drv) ( +crossLists testWhenSetTo [[true false] [true false]] +)) From bd3379c4434334bd5bccc2fb91ac64a02ca77fb1 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Fri, 9 Feb 2018 19:47:39 +0100 Subject: [PATCH 49/51] haskell-generic-builder: include build-tool dependencies in shell environments For a Haskell package "foo" the environment foo.env now contains the build tool dependencies required for compiling the package in $PATH. Fixes https://github.com/NixOS/cabal2nix/issues/331. --- pkgs/development/haskell-modules/generic-builder.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index eb66a6f89223..de37a8e92441 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -384,7 +384,7 @@ stdenv.mkDerivation ({ env = stdenv.mkDerivation { name = "interactive-${pname}-${version}-environment"; buildInputs = systemBuildInputs; - nativeBuildInputs = [ ghcEnv ]; + nativeBuildInputs = [ ghcEnv ] ++ nativeBuildInputs; LANG = "en_US.UTF-8"; LOCALE_ARCHIVE = optionalString stdenv.isLinux "${glibcLocales}/lib/locale/locale-archive"; shellHook = '' From 2c134357345d4166d62db2e4cc029d004f28edae Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Fri, 9 Feb 2018 19:52:21 +0100 Subject: [PATCH 50/51] haskell-generic-builder: revert "set LD_LIBRARY_PATH in shellHook" This reverts commit e73e5c884f5770110d99675db8495bb1535a6308. Please don't set $LD_LIBRARY_PATH! Instead, pass appropriate --extra-include-dir and --extra-lib-dir arguments to "cabal configure" to ensure that Cabal knows about system dependencies. --- pkgs/development/haskell-modules/generic-builder.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index de37a8e92441..14a8a628b58c 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -72,8 +72,7 @@ assert enableSplitObjs == null; let inherit (stdenv.lib) optional optionals optionalString versionOlder versionAtLeast - concatStringsSep enableFeature optionalAttrs toUpper - filter makeLibraryPath; + concatStringsSep enableFeature optionalAttrs toUpper; isGhcjs = ghc.isGhcjs or false; isHaLVM = ghc.isHaLVM or false; @@ -392,9 +391,6 @@ stdenv.mkDerivation ({ export NIX_${ghcCommandCaps}PKG="${ghcEnv}/bin/${ghcCommand}-pkg" # TODO: is this still valid? export NIX_${ghcCommandCaps}_DOCDIR="${ghcEnv}/share/doc/ghc/html" - export LD_LIBRARY_PATH="''${LD_LIBRARY_PATH:+''${LD_LIBRARY_PATH}:}${ - makeLibraryPath (filter (x: !isNull x) systemBuildInputs) - }" ${if isHaLVM then ''export NIX_${ghcCommandCaps}_LIBDIR="${ghcEnv}/lib/HaLVM-${ghc.version}"'' else ''export NIX_${ghcCommandCaps}_LIBDIR="${ghcEnv}/lib/${ghcCommand}-${ghc.version}"''} From 1cba74dfc1541673f91b91c3ab50dbdce43c764a Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 1 Feb 2018 22:54:18 +0100 Subject: [PATCH 51/51] setup-hooks: Add autoPatchelfHook I originally wrote this for packaging proprietary games in Vuizvui[1] but I thought it would be generally useful as we have a fair amount of proprietary software lurking around in nixpkgs, which are a bit tedious to maintain, especially when the library dependencies change after an update. So this setup hook searches for all ELF executables and libraries in the resulting output paths after install phase and uses patchelf to set the RPATH and interpreter according to what dependencies are available inside the builder. For example consider something like this: stdenv.mkDerivation { ... nativeBuildInputs = [ autoPatchelfHook ]; buildInputs = [ mesa zlib ]; ... } Whenever for example an executable requires mesa or zlib, the RPATH will automatically be set to the lib dir of the corresponding dependency. If the library dependency is required at runtime, an attribute called runtimeDependencies can be used to list dependencies that are added to all executables that are discovered unconditionally. Beside this, it also makes initial packaging of proprietary software easier, because one no longer has to manually figure out the dependencies in the first place. [1]: https://github.com/openlab-aux/vuizvui Signed-off-by: aszlig Closes: #34506 --- doc/stdenv.xml | 14 ++ .../setup-hooks/auto-patchelf.sh | 174 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 + 3 files changed, 192 insertions(+) create mode 100644 pkgs/build-support/setup-hooks/auto-patchelf.sh diff --git a/doc/stdenv.xml b/doc/stdenv.xml index 3a7b23baaa7e..2a3316b8d018 100644 --- a/doc/stdenv.xml +++ b/doc/stdenv.xml @@ -1802,6 +1802,20 @@ addEnvHooks "$hostOffset" myBashFunction disabled or patched to work with PaX. + + autoPatchelfHook + This is a special setup hook which helps in packaging + proprietary software in that it automatically tries to find missing shared + library dependencies of ELF files. All packages within the + runtimeDependencies environment variable are unconditionally + added to executables, which is useful for programs that use + + dlopen + 3 + + to load libraries at runtime. + + diff --git a/pkgs/build-support/setup-hooks/auto-patchelf.sh b/pkgs/build-support/setup-hooks/auto-patchelf.sh new file mode 100644 index 000000000000..0f9d7603d48f --- /dev/null +++ b/pkgs/build-support/setup-hooks/auto-patchelf.sh @@ -0,0 +1,174 @@ +declare -a autoPatchelfLibs + +gatherLibraries() { + autoPatchelfLibs+=("$1/lib") +} + +addEnvHooks "$targetOffset" gatherLibraries + +isExecutable() { + [ "$(file -b -N --mime-type "$1")" = application/x-executable ] +} + +findElfs() { + find "$1" -type f -exec "$SHELL" -c ' + while [ -n "$1" ]; do + mimeType="$(file -b -N --mime-type "$1")" + if [ "$mimeType" = application/x-executable \ + -o "$mimeType" = application/x-sharedlib ]; then + echo "$1" + fi + shift + done + ' -- {} + +} + +# We cache dependencies so that we don't need to search through all of them on +# every consecutive call to findDependency. +declare -a cachedDependencies + +addToDepCache() { + local existing + for existing in "${cachedDependencies[@]}"; do + if [ "$existing" = "$1" ]; then return; fi + done + cachedDependencies+=("$1") +} + +declare -gi depCacheInitialised=0 +declare -gi doneRecursiveSearch=0 +declare -g foundDependency + +getDepsFromSo() { + ldd "$1" 2> /dev/null | sed -n -e 's/[^=]*=> *\(.\+\) \+([^)]*)$/\1/p' +} + +populateCacheWithRecursiveDeps() { + local so found foundso + for so in "${cachedDependencies[@]}"; do + for found in $(getDepsFromSo "$so"); do + local libdir="${found%/*}" + local base="${found##*/}" + local soname="${base%.so*}" + for foundso in "${found%/*}/$soname".so*; do + addToDepCache "$foundso" + done + done + done +} + +getSoArch() { + objdump -f "$1" | sed -ne 's/^architecture: *\([^,]\+\).*/\1/p' +} + +# NOTE: If you want to use this function outside of the autoPatchelf function, +# keep in mind that the dependency cache is only valid inside the subshell +# spawned by the autoPatchelf function, so invoking this directly will possibly +# rebuild the dependency cache. See the autoPatchelf function below for more +# information. +findDependency() { + local filename="$1" + local arch="$2" + local lib dep + + if [ $depCacheInitialised -eq 0 ]; then + for lib in "${autoPatchelfLibs[@]}"; do + for so in "$lib/"*.so*; do addToDepCache "$so"; done + done + depCacheInitialised=1 + fi + + for dep in "${cachedDependencies[@]}"; do + if [ "$filename" = "${dep##*/}" ]; then + if [ "$(getSoArch "$dep")" = "$arch" ]; then + foundDependency="$dep" + return 0 + fi + fi + done + + # Populate the dependency cache with recursive dependencies *only* if we + # didn't find the right dependency so far and afterwards run findDependency + # again, but this time with $doneRecursiveSearch set to 1 so that it won't + # recurse again (and thus infinitely). + if [ $doneRecursiveSearch -eq 0 ]; then + populateCacheWithRecursiveDeps + doneRecursiveSearch=1 + findDependency "$filename" "$arch" || return 1 + return 0 + fi + return 1 +} + +autoPatchelfFile() { + local dep rpath="" toPatch="$1" + + local interpreter="$(< "$NIX_CC/nix-support/dynamic-linker")" + if isExecutable "$toPatch"; then + patchelf --set-interpreter "$interpreter" "$toPatch" + if [ -n "$runtimeDependencies" ]; then + for dep in $runtimeDependencies; do + rpath="$rpath${rpath:+:}$dep/lib" + done + fi + fi + + echo "searching for dependencies of $toPatch" >&2 + + # We're going to find all dependencies based on ldd output, so we need to + # clear the RPATH first. + patchelf --remove-rpath "$toPatch" + + local missing="$( + ldd "$toPatch" 2> /dev/null | \ + sed -n -e 's/^[\t ]*\([^ ]\+\) => not found.*/\1/p' + )" + + # This ensures that we get the output of all missing dependencies instead + # of failing at the first one, because it's more useful when working on a + # new package where you don't yet know its dependencies. + local -i depNotFound=0 + + for dep in $missing; do + echo -n " $dep -> " >&2 + if findDependency "$dep" "$(getSoArch "$toPatch")"; then + rpath="$rpath${rpath:+:}${foundDependency%/*}" + echo "found: $foundDependency" >&2 + else + echo "not found!" >&2 + depNotFound=1 + fi + done + + # This makes sure the builder fails if we didn't find a dependency, because + # the stdenv setup script is run with set -e. The actual error is emitted + # earlier in the previous loop. + [ $depNotFound -eq 0 ] + + if [ -n "$rpath" ]; then + echo "setting RPATH to: $rpath" >&2 + patchelf --set-rpath "$rpath" "$toPatch" + fi +} + +autoPatchelf() { + echo "automatically fixing dependencies for ELF files" >&2 + + # Add all shared objects of the current output path to the start of + # cachedDependencies so that it's choosen first in findDependency. + cachedDependencies+=( + $(find "$prefix" \! -type d \( -name '*.so' -o -name '*.so.*' \)) + ) + local elffile + + # Here we actually have a subshell, which also means that + # $cachedDependencies is final at this point, so whenever we want to run + # findDependency outside of this, the dependency cache needs to be rebuilt + # from scratch, so keep this in mind if you want to run findDependency + # outside of this function. + findElfs "$prefix" | while read -r elffile; do + autoPatchelfFile "$elffile" + done +} + +fixupOutputHooks+=(autoPatchelf) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fb9bcac35189..45cf17897bd2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -79,6 +79,10 @@ with pkgs; { deps = [ autoconf264 automake111x gettext libtool ]; } ../build-support/setup-hooks/autoreconf.sh; + autoPatchelfHook = makeSetupHook + { deps = [ file ]; } + ../build-support/setup-hooks/auto-patchelf.sh; + ensureNewerSourcesHook = { year }: makeSetupHook {} (writeScript "ensure-newer-sources-hook.sh" '' postUnpackHooks+=(_ensureNewerSources)