From bb6a5b079fe8c88a6e42c92179711b2d0a9a9842 Mon Sep 17 00:00:00 2001 From: Roger Qiu Date: Tue, 15 Mar 2016 00:00:55 +1100 Subject: [PATCH 01/38] nixos/xserver: Changed xrandrHeads to support corresponding monitor section configuration in Xorg --- nixos/doc/manual/release-notes/rl-1709.xml | 11 ++++- nixos/modules/services/x11/xserver.nix | 57 ++++++++++++++++++---- 2 files changed, 57 insertions(+), 11 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-1709.xml b/nixos/doc/manual/release-notes/rl-1709.xml index 5fba4c34ec8..46469a4da78 100644 --- a/nixos/doc/manual/release-notes/rl-1709.xml +++ b/nixos/doc/manual/release-notes/rl-1709.xml @@ -17,7 +17,16 @@ has the following highlights: A consequence is that UIDs and GIDs are no longer reused. - + + + Xserver services module now allows one to specify configuration for each monitor. + This is done via the xrandrHeads property. It is backwards compatible, so your + existing configuration still works. You can replace each monitor designation with + an attribute set containing the monitor designation, whether the monitor is the + primary monitor, and extra configuration for that specific monitor. Only one + monitor can be the primary monitor. + + The following new services were added since the last release: diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 8438e6dcc70..b5fece48820 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -33,12 +33,30 @@ let # Just enumerate all heads without discarding XRandR output information. - xrandrHeads = let - mkHead = num: output: { - name = "multihead${toString num}"; - inherit output; - }; - in imap mkHead cfg.xrandrHeads; + xrandrHeads = ( + fold + (nextHead: { index, alreadyPrimary, processedHeads }: + let + processedHead = { name = "multihead${toString index}"; } // + (if isAttrs nextHead then + { + output = nextHead.output; + primary = if alreadyPrimary then false else nextHead.primary || index == 0; + monitorConfig = nextHead.monitorConfig; + } + else + { + output = nextHead; + primary = if alreadyPrimary then false else index == 0; + monitorConfig = ""; + } + ); + primariness = if alreadyPrimary then true else processedHead.primary; + in + { index = index - 1; alreadyPrimary = primariness; processedHeads = ([ processedHead ] ++ processedHeads); }) + { index = (length cfg.xrandrHeads) - 1; alreadyPrimary = false; processedHeads = []; } + cfg.xrandrHeads + ).processedHeads; xrandrDeviceSection = let monitors = flip map xrandrHeads (h: '' @@ -62,9 +80,13 @@ let value = '' Section "Monitor" Identifier "${current.name}" + ${optionalString (current.primary) '' + Option "Primary" "true" + ''} ${optionalString (previous != []) '' Option "RightOf" "${(head previous).name}" ''} + ${current.monitorConfig} EndSection ''; } ++ previous; @@ -329,12 +351,27 @@ in xrandrHeads = mkOption { default = []; - example = [ "HDMI-0" "DVI-0" ]; - type = with types; listOf string; + example = [ "HDMI-0" { output = "DVI-0"; primary = true; monitorConfig = ""; } ]; + type = with types; listOf (either + str + (submodule { + options.output = str; + options.primary = bool; + options.monitorConfig = lines; + }) + ); description = '' Simple multiple monitor configuration, just specify a list of XRandR - outputs which will be mapped from left to right in the order of the - list. + outputs as the values of the list. The monitors will be mapped from + left to right in the order of the list. + + By default, the first monitor will be set as the primary monitor. + However instead of a list, you can give an attribute set. That set + can contain a primary monitor specification and a custom monitor + configuration section. + + Only one monitor is allowed to be primary. If multiple monitors are + specified as primary, only the last monitor will be primary. Be careful using this option with multiple graphic adapters or with drivers that have poor support for XRandR, unexpected things might From 4ac06ea6a13bf082791f1e3293528dc6c1b67841 Mon Sep 17 00:00:00 2001 From: Fernando J Pando Date: Tue, 7 Mar 2017 14:26:21 -0500 Subject: [PATCH 02/38] buildbot: 0.9.4 -> 0.9.5 - adds distro dependency - buildbot nodaemon in service module - fakerepo for module tests - service module parameter fixup - tested on nixos - tested on darwin --- .../buildbot/master.nix | 47 +++++---- .../buildbot/worker.nix | 11 ++- nixos/tests/buildbot.nix | 95 ++++++++++++++++--- .../tools/build-managers/buildbot/default.nix | 17 +++- .../tools/build-managers/buildbot/plugins.nix | 31 +++--- .../tools/build-managers/buildbot/worker.nix | 4 +- 6 files changed, 141 insertions(+), 64 deletions(-) diff --git a/nixos/modules/services/continuous-integration/buildbot/master.nix b/nixos/modules/services/continuous-integration/buildbot/master.nix index 533751734fa..244aae44596 100644 --- a/nixos/modules/services/continuous-integration/buildbot/master.nix +++ b/nixos/modules/services/continuous-integration/buildbot/master.nix @@ -12,7 +12,7 @@ let factory = util.BuildFactory() c = BuildmasterConfig = dict( workers = [${concatStringsSep "," cfg.workers}], - protocols = { 'pb': {'port': ${cfg.bpPort} } }, + protocols = { 'pb': {'port': ${toString cfg.bpPort} } }, title = '${escapeStr cfg.title}', titleURL = '${escapeStr cfg.titleUrl}', buildbotURL = '${escapeStr cfg.buildbotUrl}', @@ -62,7 +62,7 @@ in { extraConfig = mkOption { type = types.str; description = "Extra configuration to append to master.cfg"; - default = ""; + default = "c['buildbotNetUsageData'] = None"; }; masterCfg = mkOption { @@ -92,10 +92,7 @@ in { workers = mkOption { type = types.listOf types.str; description = "List of Workers."; - default = [ - "worker.Worker('example-worker', 'pass')" - ]; - example = [ "worker.LocalWorker('example-worker')" ]; + default = [ "worker.Worker('example-worker', 'pass')" ]; }; status = mkOption { @@ -135,9 +132,8 @@ in { }; bpPort = mkOption { - default = "9989"; - type = types.string; - example = "tcp:10000:interface=127.0.0.1"; + default = 9989; + type = types.int; description = "Port where the master will listen to Buildbot Worker."; }; @@ -179,14 +175,14 @@ in { package = mkOption { type = types.package; - default = pkgs.buildbot-ui; - defaultText = "pkgs.buildbot-ui"; + default = pkgs.buildbot-full; + defaultText = "pkgs.buildbot-full"; description = "Package to use for buildbot."; example = literalExample "pkgs.buildbot-full"; }; packages = mkOption { - default = [ ]; + default = with pkgs; [ python27Packages.twisted git ]; example = literalExample "[ pkgs.git ]"; type = types.listOf types.package; description = "Packages to add to PATH for the buildbot process."; @@ -212,29 +208,30 @@ in { systemd.services.buildbot-master = { description = "Buildbot Continuous Integration Server."; - after = [ "network.target" ]; + after = [ "network-online.target" ]; wantedBy = [ "multi-user.target" ]; path = cfg.packages; + preStart = '' + env > envvars + mkdir -vp ${cfg.buildbotDir} + ln -sfv ${masterCfg} ${cfg.buildbotDir}/master.cfg + rm -fv $cfg.buildbotDir}/buildbot.tac + ${cfg.package}/bin/buildbot create-master ${cfg.buildbotDir} + ''; + serviceConfig = { Type = "simple"; User = cfg.user; Group = cfg.group; WorkingDirectory = cfg.home; - ExecStart = "${cfg.package}/bin/buildbot start --nodaemon ${cfg.buildbotDir}"; + Environment = "PYTHONPATH=${cfg.package}/lib/python2.7/site-packages:${pkgs.buildbot-plugins.www}/lib/python2.7/site-packages:${pkgs.buildbot-plugins.waterfall-view}/lib/python2.7/site-packages:${pkgs.buildbot-plugins.console-view}/lib/python2.7/site-packages:${pkgs.python27Packages.future}/lib/python2.7/site-packages:${pkgs.python27Packages.dateutil}/lib/python2.7/site-packages:${pkgs.python27Packages.six}/lib/python2.7/site-packages:${pkgs.python27Packages.sqlalchemy}/lib/python2.7/site-packages:${pkgs.python27Packages.jinja2}/lib/python2.7/site-packages:${pkgs.python27Packages.markupsafe}/lib/python2.7/site-packages:${pkgs.python27Packages.sqlalchemy_migrate}/lib/python2.7/site-packages:${pkgs.python27Packages.tempita}/lib/python2.7/site-packages:${pkgs.python27Packages.decorator}/lib/python2.7/site-packages:${pkgs.python27Packages.sqlparse}/lib/python2.7/site-packages:${pkgs.python27Packages.txaio}/lib/python2.7/site-packages:${pkgs.python27Packages.autobahn}/lib/python2.7/site-packages:${pkgs.python27Packages.pyjwt}/lib/python2.7/site-packages:${pkgs.python27Packages.distro}/lib/python2.7/site-packages:${pkgs.python27Packages.pbr}/lib/python2.7/site-packages:${pkgs.python27Packages.urllib3}/lib/python2.7/site-packages"; + + # NOTE: call twistd directly with stdout logging for systemd + #ExecStart = "${cfg.package}/bin/buildbot start --nodaemon ${cfg.buildbotDir}"; + ExecStart = "${pkgs.python27Packages.twisted}/bin/twistd -n -l - -y ${cfg.buildbotDir}/buildbot.tac"; }; - preStart = '' - ${pkgs.coreutils}/bin/mkdir -vp ${cfg.buildbotDir} - ${pkgs.coreutils}/bin/ln -sfv ${masterCfg} ${cfg.buildbotDir}/master.cfg - ${cfg.package}/bin/buildbot create-master ${cfg.buildbotDir} - ''; - - postStart = '' - until [[ $(${pkgs.curl}/bin/curl -s --head -w '\n%{http_code}' http://localhost:${toString cfg.port} | tail -n1) =~ ^(200|403)$ ]]; do - sleep 1 - done - ''; }; }; diff --git a/nixos/modules/services/continuous-integration/buildbot/worker.nix b/nixos/modules/services/continuous-integration/buildbot/worker.nix index e4ee4dd861e..a97f571e89d 100644 --- a/nixos/modules/services/continuous-integration/buildbot/worker.nix +++ b/nixos/modules/services/continuous-integration/buildbot/worker.nix @@ -74,7 +74,7 @@ in { }; packages = mkOption { - default = [ ]; + default = with pkgs; [ python27Packages.twisted git ]; example = literalExample "[ pkgs.git ]"; type = types.listOf types.package; description = "Packages to add to PATH for the buildbot process."; @@ -106,7 +106,8 @@ in { path = cfg.packages; preStart = '' - ${pkgs.coreutils}/bin/mkdir -vp ${cfg.buildbotDir} + mkdir -vp ${cfg.buildbotDir} + rm -fv $cfg.buildbotDir}/buildbot.tac ${cfg.package}/bin/buildbot-worker create-worker ${cfg.buildbotDir} ${cfg.masterUrl} ${cfg.workerUser} ${cfg.workerPass} ''; @@ -115,7 +116,11 @@ in { User = cfg.user; Group = cfg.group; WorkingDirectory = cfg.home; - ExecStart = "${cfg.package}/bin/buildbot-worker start --nodaemon ${cfg.buildbotDir}"; + Environment = "PYTHONPATH=${cfg.package}/lib/python2.7/site-packages:${pkgs.python27Packages.future}/lib/python2.7/site-packages"; + + # NOTE: call twistd directly with stdout logging for systemd + #ExecStart = "${cfg.package}/bin/buildbot-worker start --nodaemon ${cfg.buildbotDir}"; + ExecStart = "${pkgs.python27Packages.twisted}/bin/twistd -n -l - -y ${cfg.buildbotDir}/buildbot.tac"; }; }; diff --git a/nixos/tests/buildbot.nix b/nixos/tests/buildbot.nix index 13a162e6c6e..828846f17c8 100644 --- a/nixos/tests/buildbot.nix +++ b/nixos/tests/buildbot.nix @@ -4,18 +4,22 @@ import ./make-test.nix ({ pkgs, ... } : { name = "buildbot"; nodes = { - bbmaster = { config, pkgs, nodes, ... }: { + bbmaster = { config, pkgs, ... }: { services.buildbot-master = { enable = true; + package = pkgs.buildbot-full; + + # NOTE: use fake repo due to no internet in hydra ci factorySteps = [ - "steps.Git(repourl='git://github.com/buildbot/pyflakes.git', mode='incremental')" - "steps.ShellCommand(command=['trial', 'pyflakes'])" + "steps.Git(repourl='git://gitrepo/fakerepo.git', mode='incremental')" + "steps.ShellCommand(command=['bash', 'fakerepo.sh'])" ]; changeSource = [ - "changes.GitPoller('git://github.com/buildbot/pyflakes.git', workdir='gitpoller-workdir', branch='master', pollinterval=300)" + "changes.GitPoller('git://gitrepo/fakerepo.git', workdir='gitpoller-workdir', branch='master', pollinterval=300)" ]; }; - networking.firewall.allowedTCPPorts = [ 8010 9989 ]; + networking.firewall.allowedTCPPorts = [ 8010 8011 9989 ]; + environment.systemPackages = with pkgs; [ git buildbot-full ]; }; bbworker = { config, pkgs, ... }: { @@ -23,24 +27,85 @@ import ./make-test.nix ({ pkgs, ... } : { enable = true; masterUrl = "bbmaster:9989"; }; + environment.systemPackages = with pkgs; [ git buildbot-worker ]; + }; + + gitrepo = { config, pkgs, ... }: { + services.openssh.enable = true; + networking.firewall.allowedTCPPorts = [ 22 9418 ]; + environment.systemPackages = with pkgs; [ git ]; }; }; testScript = '' + #Start up and populate fake repo + $gitrepo->waitForUnit("multi-user.target"); + print($gitrepo->execute(" \ + git config --global user.name 'Nobody Fakeuser' && \ + git config --global user.email 'nobody\@fakerepo.com' && \ + rm -rvf /srv/repos/fakerepo.git /tmp/fakerepo && \ + mkdir -pv /srv/repos/fakerepo ~/.ssh && \ + ssh-keyscan -H gitrepo > ~/.ssh/known_hosts && \ + cat ~/.ssh/known_hosts && \ + cd /srv/repos/fakerepo && \ + git init && \ + echo -e '#!/bin/sh\necho fakerepo' > fakerepo.sh && \ + cat fakerepo.sh && \ + touch .git/git-daemon-export-ok && \ + git add fakerepo.sh .git/git-daemon-export-ok && \ + git commit -m fakerepo && \ + git daemon --verbose --export-all --base-path=/srv/repos --reuseaddr & \ + ")); - $bbmaster->waitForUnit("network.target"); - $bbworker->waitForUnit("network.target"); + # Test gitrepo + $bbmaster->waitForUnit("network-online.target"); + #$bbmaster->execute("nc -z gitrepo 9418"); + print($bbmaster->execute(" \ + rm -rfv /tmp/fakerepo && \ + git clone git://gitrepo/fakerepo /tmp/fakerepo && \ + pwd && \ + ls -la && \ + ls -la /tmp/fakerepo \ + ")); - # Additional tests to be added - #$bbmaster->waitForUnit("buildbot-master.service"); - #$bbmaster->waitUntilSucceeds("curl -s --head http://bbmaster:8010") =~ /200 OK/ or die; - #$bbworker->waitForUnit("buildbot-worker.service"); - #$bbworker->waitUntilSucceeds("tail -10 /home/bbworker/worker/twistd.log") =~ /success/ or die; + # Test start master and connect worker + $bbmaster->waitForUnit("buildbot-master.service"); + $bbmaster->waitUntilSucceeds("curl -s --head http://bbmaster:8010") =~ /200 OK/; + $bbworker->waitForUnit("network-online.target"); + $bbworker->execute("nc -z bbmaster 8010"); + $bbworker->execute("nc -z bbmaster 9989"); + $bbworker->waitForUnit("buildbot-worker.service"); + print($bbworker->execute("ls -la /home/bbworker/worker")); + + + # Test stop buildbot master and worker + print($bbmaster->execute(" \ + systemctl -l --no-pager status buildbot-master && \ + systemctl stop buildbot-master \ + ")); + $bbworker->fail("nc -z bbmaster 8010"); + $bbworker->fail("nc -z bbmaster 9989"); + print($bbworker->execute(" \ + systemctl -l --no-pager status buildbot-worker && \ + systemctl stop buildbot-worker && \ + ls -la /home/bbworker/worker \ + ")); + + + # Test buildbot daemon mode + # NOTE: daemon mode tests disabled due to broken PYTHONPATH child inheritence + # + #$bbmaster->execute("buildbot create-master /tmp"); + #$bbmaster->execute("mv -fv /tmp/master.cfg.sample /tmp/master.cfg"); + #$bbmaster->execute("sed -i 's/8010/8011/' /tmp/master.cfg"); + #$bbmaster->execute("buildbot start /tmp"); + #$bbworker->execute("nc -z bbmaster 8011"); + #$bbworker->waitUntilSucceeds("curl -s --head http://bbmaster:8011") =~ /200 OK/; + #$bbmaster->execute("buildbot stop /tmp"); + #$bbworker->fail("nc -z bbmaster 8011"); ''; - meta = with pkgs.stdenv.lib.maintainers; { - maintainers = [ nand0p ]; - }; + meta.maintainers = with pkgs.stdenv.lib.maintainers; [ nand0p ]; }) diff --git a/pkgs/development/tools/build-managers/buildbot/default.nix b/pkgs/development/tools/build-managers/buildbot/default.nix index ed24e917a1c..8c8caf06303 100644 --- a/pkgs/development/tools/build-managers/buildbot/default.nix +++ b/pkgs/development/tools/build-managers/buildbot/default.nix @@ -5,17 +5,19 @@ let buildInputs = [ makeWrapper ] ++ plugins; passthru.withPlugins = moarPlugins: withPlugins (moarPlugins ++ plugins); } '' - makeWrapper ${package}/bin/buildbot $out/bin/buildbot --prefix PYTHONPATH : $PYTHONPATH + makeWrapper ${package}/bin/buildbot $out/bin/buildbot \ + --prefix PYTHONPATH : "${package}/lib/python2.7/site-packages:$PYTHONPATH" + ln -sfv ${package}/lib $out/lib ''; package = pythonPackages.buildPythonApplication (rec { name = "${pname}-${version}"; pname = "buildbot"; - version = "0.9.4"; + version = "0.9.5"; src = pythonPackages.fetchPypi { inherit pname version; - sha256 = "0wklrn4fszac9wi8zw3vbsznwyff6y57cz0i81zvh46skb6n3086"; + sha256 = "11r553nmh87a9pm58wycimapk2pw9hnlc7hffn97xwbqprd8qh66"; }; buildInputs = with pythonPackages; [ @@ -49,6 +51,7 @@ let txaio autobahn pyjwt + distro # tls pyopenssl @@ -68,6 +71,14 @@ let postPatch = '' substituteInPlace buildbot/scripts/logwatcher.py --replace '/usr/bin/tail' "$(type -P tail)" + + # NOTE: secrets management tests currently broken + rm -fv buildbot/test/integration/test_integration_secrets.py + rm -fv buildbot/test/integration/test_integration_secrets_with_vault.py + rm -fv buildbot/test/unit/test_fake_secrets_manager.py + rm -fv buildbot/test/unit/test_interpolate_secrets.py + rm -fv buildbot/test/unit/test_secret_in_file.py + rm -fv buildbot/test/unit/test_secret_in_vault.py ''; passthru = { inherit withPlugins; }; diff --git a/pkgs/development/tools/build-managers/buildbot/plugins.nix b/pkgs/development/tools/build-managers/buildbot/plugins.nix index b22759af8fe..77e97ed7ac3 100644 --- a/pkgs/development/tools/build-managers/buildbot/plugins.nix +++ b/pkgs/development/tools/build-managers/buildbot/plugins.nix @@ -1,14 +1,14 @@ -{ stdenv, fetchurl, pythonPackages }: +{ stdenv, pythonPackages }: let buildbot-pkg = pythonPackages.buildPythonPackage rec { name = "${pname}-${version}"; pname = "buildbot-pkg"; - version = "0.9.4"; + version = "0.9.5"; - src = fetchurl { - url = "mirror://pypi/b/${pname}/${name}.tar.gz"; - sha256 = "09a3yvs5hhf8syrkyydznmymgg86dpvgrwy9rb3bryq00wpjb3wn"; + src = pythonPackages.fetchPypi { + inherit pname version; + sha256 = "1xpi4w0lc6z97pmmms85dvdspacbzlvs8zi3kv1r4rypk3znwmi1"; }; propagatedBuildInputs = with pythonPackages; [ setuptools ]; @@ -25,15 +25,14 @@ in { www = pythonPackages.buildPythonPackage rec { name = "${pname}-${version}"; pname = "buildbot_www"; - version = "0.9.4"; + version = "0.9.5"; # NOTE: wheel is used due to buildbot circular dependency format = "wheel"; src = pythonPackages.fetchPypi { inherit pname version format; - python = "py2"; - sha256 = "08m4h2pf6hgi8igh2j0qzfq49izc2z0qqj6ddxk0di5l306jx4im"; + sha256 = "1d7yjxka6slflm3wbdpq4sr1kagmgbqdv2zgx9bq77jvjh7ga0py"; }; meta = with stdenv.lib; { @@ -47,11 +46,11 @@ in { console-view = pythonPackages.buildPythonPackage rec { name = "${pname}-${version}"; pname = "buildbot-console-view"; - version = "0.9.4"; + version = "0.9.5"; - src = fetchurl { - url = "mirror://pypi/b/${pname}/${name}.tar.gz"; - sha256 = "1w2vv8iyzl7ak4161avp9n6mhh08adav2fl82bbm17a3064apl8n"; + src = pythonPackages.fetchPypi { + inherit pname version; + sha256 = "1s6mvw955dsgk7hvb1xa32bbd7w2yma62py5s0vmi5shv8nwq3hb"; }; propagatedBuildInputs = with pythonPackages; [ buildbot-pkg ]; @@ -67,11 +66,11 @@ in { waterfall-view = pythonPackages.buildPythonPackage rec { name = "${pname}-${version}"; pname = "buildbot-waterfall-view"; - version = "0.9.4"; + version = "0.9.5"; - src = fetchurl { - url = "mirror://pypi/b/${pname}/${name}.tar.gz"; - sha256 = "17xn6vrr0k2xabw6hr9sdyy0ry3llyjfmc79qrpgp5bsly2qv3jf"; + src = pythonPackages.fetchPypi { + inherit pname version; + sha256 = "116846d987wp1bz78f0h4lypqcns5073vzhb4vsqbf08sppgr67k"; }; propagatedBuildInputs = with pythonPackages; [ buildbot-pkg ]; diff --git a/pkgs/development/tools/build-managers/buildbot/worker.nix b/pkgs/development/tools/build-managers/buildbot/worker.nix index b9b4b86aa44..145221c6353 100644 --- a/pkgs/development/tools/build-managers/buildbot/worker.nix +++ b/pkgs/development/tools/build-managers/buildbot/worker.nix @@ -3,11 +3,11 @@ pythonPackages.buildPythonApplication (rec { name = "${pname}-${version}"; pname = "buildbot-worker"; - version = "0.9.4"; + version = "0.9.5"; src = pythonPackages.fetchPypi { inherit pname version; - sha256 = "0rdrr8x7sn2nxl51p6h9ad42s3c28lb6sys84zrg0d7fm4zhv7hj"; + sha256 = "1al7jam351sf781axj4kfhj70cc0g21zv81ynk410kdccjyxp2dy"; }; buildInputs = with pythonPackages; [ setuptoolsTrial mock ]; From 8266c89b55e3ae97ff635a0f9f8aee556ae7b384 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 24 Apr 2017 11:08:33 +0200 Subject: [PATCH 03/38] nixos/xserver: Fix up/refactor xrandrHeads option Using invalid module options in the submodule isn't very nice, because it doesn't give very useful errors in case of type mismatch, also we don't get descriptions of these options as they're effecively nonexistent to the module system. Another downside of this is that merging of these options isn't done correctly as well (eg. for types.lines). So we now have proper submodules for each xrandrHead and we also use corcedTo in the type of xrandrHeads so that we can populate the submodule's "output" option in case a plain string is defined for a list item. Instead of silently skipping multiple primary heads, we now have an assertion, which displays a message and aborts configuration evaluation appropriately. Signed-off-by: aszlig --- nixos/modules/services/x11/xserver.nix | 131 +++++++++++++++---------- 1 file changed, 81 insertions(+), 50 deletions(-) diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index b5fece48820..9ac69195a67 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -31,36 +31,51 @@ let pkgs.xorg.fontadobe75dpi ]; + xrandrOptions = { + output = mkOption { + type = types.str; + example = "DVI-0"; + description = '' + The output name of the monitor, as shown by + xrandr + 1 + invoked without arguments. + ''; + }; + + primary = mkOption { + type = types.bool; + default = false; + description = '' + Whether this head is treated as the primary monitor, + ''; + }; + + monitorConfig = mkOption { + type = types.lines; + default = ""; + example = '' + DisplaySize 408 306 + Option "DPMS" "false" + ''; + description = '' + Extra lines to append to the Monitor section + verbatim. + ''; + }; + }; # Just enumerate all heads without discarding XRandR output information. - xrandrHeads = ( - fold - (nextHead: { index, alreadyPrimary, processedHeads }: - let - processedHead = { name = "multihead${toString index}"; } // - (if isAttrs nextHead then - { - output = nextHead.output; - primary = if alreadyPrimary then false else nextHead.primary || index == 0; - monitorConfig = nextHead.monitorConfig; - } - else - { - output = nextHead; - primary = if alreadyPrimary then false else index == 0; - monitorConfig = ""; - } - ); - primariness = if alreadyPrimary then true else processedHead.primary; - in - { index = index - 1; alreadyPrimary = primariness; processedHeads = ([ processedHead ] ++ processedHeads); }) - { index = (length cfg.xrandrHeads) - 1; alreadyPrimary = false; processedHeads = []; } - cfg.xrandrHeads - ).processedHeads; + xrandrHeads = let + mkHead = num: config: { + name = "multihead${toString num}"; + inherit config; + }; + in imap mkHead cfg.xrandrHeads; xrandrDeviceSection = let monitors = flip map xrandrHeads (h: '' - Option "monitor-${h.output}" "${h.name}" + Option "monitor-${h.config.output}" "${h.name}" ''); # First option is indented through the space in the config but any # subsequent options aren't so we need to apply indentation to @@ -80,13 +95,13 @@ let value = '' Section "Monitor" Identifier "${current.name}" - ${optionalString (current.primary) '' + ${optionalString (current.config.primary) '' Option "Primary" "true" ''} ${optionalString (previous != []) '' Option "RightOf" "${(head previous).name}" ''} - ${current.monitorConfig} + ${current.config.monitorConfig} EndSection ''; } ++ previous; @@ -351,27 +366,36 @@ in xrandrHeads = mkOption { default = []; - example = [ "HDMI-0" { output = "DVI-0"; primary = true; monitorConfig = ""; } ]; - type = with types; listOf (either - str - (submodule { - options.output = str; - options.primary = bool; - options.monitorConfig = lines; - }) - ); + example = [ + "HDMI-0" + { output = "DVI-0"; primary = true; } + { output = "DVI-1"; monitorConfig = "Option \"Rotate\" \"left\""; } + ]; + type = with types; listOf (coercedTo str (output: { + inherit output; + }) (submodule { options = xrandrOptions; })); + apply = heads: let + hasPrimary = any (x: x.primary) heads; + firstPrimary = head heads // { primary = true; }; + newHeads = singleton firstPrimary ++ tail heads; + in if heads != [] && !hasPrimary then newHeads else heads; description = '' - Simple multiple monitor configuration, just specify a list of XRandR - outputs as the values of the list. The monitors will be mapped from - left to right in the order of the list. + Multiple monitor configuration, just specify a list of XRandR + outputs. The individual elements should be either simple strings or + an attribute set of output options. - By default, the first monitor will be set as the primary monitor. - However instead of a list, you can give an attribute set. That set - can contain a primary monitor specification and a custom monitor - configuration section. + If the element is a string, it is denoting the physical output for a + monitor, if it's an attribute set, you must at least provide the + option. - Only one monitor is allowed to be primary. If multiple monitors are - specified as primary, only the last monitor will be primary. + The monitors will be mapped from left to right in the order of the + list. + + By default, the first monitor will be set as the primary monitor if + none of the elements contain an option that has set + to true. + + Only one monitor is allowed to be primary. Be careful using this option with multiple graphic adapters or with drivers that have poor support for XRandR, unexpected things might @@ -506,11 +530,18 @@ in nixpkgs.config.xorg = optionalAttrs (elem "vboxvideo" cfg.videoDrivers) { abiCompat = "1.18"; }; - assertions = - [ { assertion = config.security.polkit.enable; - message = "X11 requires Polkit to be enabled (‘security.polkit.enable = true’)."; - } - ]; + assertions = [ + { assertion = config.security.polkit.enable; + message = "X11 requires Polkit to be enabled (‘security.polkit.enable = true’)."; + } + (let primaryHeads = filter (x: x.primary) cfg.xrandrHeads; in { + assertion = length primaryHeads < 2; + message = "Only one head is allowed to be primary in " + + "‘services.xserver.xrandrHeads’, but there are " + + "${toString (length primaryHeads)} heads set to primary: " + + concatMapStringsSep ", " (x: x.output) primaryHeads; + }) + ]; environment.etc = (optionals cfg.exportConfiguration From d7a8876c13f75e7a55e2f3cbc16346406e9abdf8 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 24 Apr 2017 11:54:38 +0200 Subject: [PATCH 04/38] nixos/doc: Improve release notes for xrandrHeads The xrandrHeads option has been there since a long time, so there is no need to advertise it as a new feature. Instead, let's focus on just what has changed, which is that we now assign one head to be primary. Signed-off-by: aszlig --- nixos/doc/manual/release-notes/rl-1709.xml | 25 ++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-1709.xml b/nixos/doc/manual/release-notes/rl-1709.xml index 46469a4da78..98856236647 100644 --- a/nixos/doc/manual/release-notes/rl-1709.xml +++ b/nixos/doc/manual/release-notes/rl-1709.xml @@ -19,12 +19,25 @@ has the following highlights: - Xserver services module now allows one to specify configuration for each monitor. - This is done via the xrandrHeads property. It is backwards compatible, so your - existing configuration still works. You can replace each monitor designation with - an attribute set containing the monitor designation, whether the monitor is the - primary monitor, and extra configuration for that specific monitor. Only one - monitor can be the primary monitor. + The module option now + causes the first head specified in this list to be set as the primary + head. Apart from that, it's now possible to also set additional options + by using an attribute set, for example: + +{ services.xserver.xrandrHeads = [ + "HDMI-0" + { + output = "DVI-0"; + primary = true; + monitorConfig = '' + Option "Rotate" "right" + ''; + } + ]; +} + + This will set the DVI-0 output to be the primary head, + even though HDMI-0 is the first head in the list. From 79e712822fcfe797c545e2db5bcef9a07b00b2e5 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 24 Apr 2017 12:02:10 +0200 Subject: [PATCH 05/38] nixos/xserver: Document xrandrHeads.apply It was asked by @CMCDragonkai to elaborate on that, so let's just do this by actually providing a code comment. Signed-off-by: aszlig --- nixos/modules/services/x11/xserver.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 9ac69195a67..20028d7eb6a 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -374,6 +374,8 @@ in type = with types; listOf (coercedTo str (output: { inherit output; }) (submodule { options = xrandrOptions; })); + # Set primary to true for the first head if no other has been set + # primary already. apply = heads: let hasPrimary = any (x: x.primary) heads; firstPrimary = head heads // { primary = true; }; From 29969a5ec7df53ca82585d5b7c2e472030c04f54 Mon Sep 17 00:00:00 2001 From: Chris Hodapp Date: Mon, 1 May 2017 08:59:43 -0400 Subject: [PATCH 06/38] rstudio: Fix recompilation issue with custom package set This attempts to fix the issue described at https://github.com/NixOS/nixpkgs/pull/22219#issuecomment-291801133. Any change to the custom packages passed to RStudio causes this to completely rebuild RStudio, which is completely unnecessary and also a bit of a hindrance as it's a fairly slow build. This rolls back most of that old PR, and instead implements something more like rWrapper. Existing configurations with the old useRPackages will break. --- pkgs/applications/editors/rstudio/default.nix | 20 ++--------- pkgs/development/r-modules/README.md | 17 ++++------ .../development/r-modules/wrapper-rstudio.nix | 33 +++++++++++++++++++ pkgs/development/r-modules/wrapper.nix | 20 +---------- pkgs/top-level/all-packages.nix | 9 +++++ 5 files changed, 52 insertions(+), 47 deletions(-) create mode 100644 pkgs/development/r-modules/wrapper-rstudio.nix diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix index f7ede1a8ea5..eab1228da1a 100644 --- a/pkgs/applications/editors/rstudio/default.nix +++ b/pkgs/applications/editors/rstudio/default.nix @@ -1,13 +1,5 @@ { stdenv, fetchurl, makeDesktopItem, cmake, boost163, zlib, openssl, -R, qt5, libuuid, hunspellDicts, unzip, ant, jdk, gnumake, makeWrapper, pandoc, -# If you have set up an R wrapper with other packages by following -# something like https://nixos.org/nixpkgs/manual/#r-packages, RStudio -# by default not be able to access any of those R packages. In order -# to do this, override the argument "R" here with your respective R -# wrapper, and set "useRPackages" to true. This will add the -# environment variable R_PROFILE_USER to the RStudio wrapper, pointing -# to an R script which will allow R to use these packages. -useRPackages ? false +R, qt5, libuuid, hunspellDicts, unzip, ant, jdk, gnumake, makeWrapper, pandoc }: let @@ -111,14 +103,8 @@ stdenv.mkDerivation rec { mimeType = "text/x-r-source;text/x-r;text/x-R;text/x-r-doc;text/x-r-sweave;text/x-r-markdown;text/x-r-html;text/x-r-presentation;application/x-r-data;application/x-r-project;text/x-r-history;text/x-r-profile;text/x-tex;text/x-markdown;text/html;text/css;text/javascript;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src;"; }; - postInstall = let rProfile = - # RStudio seems to bypass the environment variables that the R - # wrapper already applies, and so this sets R_PROFILE_USER to - # again make those R packages accessible: - if useRPackages - then "--set R_PROFILE_USER ${R}/${R.passthru.fixLibsR}" else ""; - in '' - wrapProgram $out/bin/rstudio --suffix PATH : ${gnumake}/bin ${rProfile} + postInstall = '' + wrapProgram $out/bin/rstudio --suffix PATH : ${gnumake}/bin mkdir $out/share cp -r ${desktopItem}/share/applications $out/share mkdir $out/share/icons diff --git a/pkgs/development/r-modules/README.md b/pkgs/development/r-modules/README.md index fc046ed0627..477059cbb2c 100644 --- a/pkgs/development/r-modules/README.md +++ b/pkgs/development/r-modules/README.md @@ -55,28 +55,23 @@ available. ## RStudio -RStudio by default will not use the libraries installed like above. -You must override its R version with your custom R environment, and -set `useRPackages` to `true`, like below: +RStudio uses a standard set of packages and ignores any custom R +environments or installed packages you may have. To create a custom +environment, see `rstudioWrapper`, which functions similarly to +`rWrapper`: ```nix { packageOverrides = super: let self = super.pkgs; in { - rEnv = super.rWrapper.override { + rstudioEnv = super.rstudioWrapper.override { packages = with self.rPackages; [ - devtools + dplyr ggplot2 reshape2 - yaml - optparse ]; }; - rstudioEnv = super.rstudio.override { - R = rEnv; - useRPackages = true; - }; }; } ``` diff --git a/pkgs/development/r-modules/wrapper-rstudio.nix b/pkgs/development/r-modules/wrapper-rstudio.nix new file mode 100644 index 00000000000..dd9b0e9c538 --- /dev/null +++ b/pkgs/development/r-modules/wrapper-rstudio.nix @@ -0,0 +1,33 @@ +{ stdenv, R, rstudio, makeWrapper, recommendedPackages, packages }: + +stdenv.mkDerivation rec { + + name = rstudio.name + "-wrapper"; + + buildInputs = [makeWrapper R rstudio] ++ recommendedPackages ++ packages; + + unpackPhase = ":"; + + # rWrapper points R to a specific set of packages by using a wrapper + # (as in https://nixos.org/nixpkgs/manual/#r-packages) which sets + # R_LIBS_SITE. Ordinarily, it would be possible to make RStudio use + # this same set of packages by simply overriding its version of R + # with the wrapped one, however, RStudio internally overrides + # R_LIBS_SITE. The below works around this by turning R_LIBS_SITE + # into an R file (fixLibsR) which achieves the same effect, then + # uses R_PROFILE_USER to load this code at startup in RStudio. + fixLibsR = "fix_libs.R"; + installPhase = '' + mkdir $out + echo "# Autogenerated by wrapper-rstudio.nix from R_LIBS_SITE" > $out/${fixLibsR} + echo -n ".libPaths(c(.libPaths(), \"" >> $out/${fixLibsR} + echo -n $R_LIBS_SITE | sed -e 's/:/", "/g' >> $out/${fixLibsR} + echo -n "\"))" >> $out/${fixLibsR} + echo >> $out/${fixLibsR} + makeWrapper ${rstudio}/bin/rstudio $out/bin/rstudio --set R_PROFILE_USER $out/${fixLibsR} + ''; + + meta = { + platforms = stdenv.lib.platforms.unix; + }; +} diff --git a/pkgs/development/r-modules/wrapper.nix b/pkgs/development/r-modules/wrapper.nix index 25c76506027..3b9a9b18450 100644 --- a/pkgs/development/r-modules/wrapper.nix +++ b/pkgs/development/r-modules/wrapper.nix @@ -1,19 +1,12 @@ { stdenv, R, makeWrapper, recommendedPackages, packages }: -stdenv.mkDerivation rec { +stdenv.mkDerivation { name = R.name + "-wrapper"; buildInputs = [makeWrapper R] ++ recommendedPackages ++ packages; unpackPhase = ":"; - # This filename is used in 'installPhase', but needs to be - # referenced elsewhere. This will be relative to this package's - # path. - passthru = { - fixLibsR = "fix_libs.R"; - }; - installPhase = '' mkdir -p $out/bin cd ${R}/bin @@ -21,17 +14,6 @@ stdenv.mkDerivation rec { makeWrapper ${R}/bin/$exe $out/bin/$exe \ --prefix "R_LIBS_SITE" ":" "$R_LIBS_SITE" done - # RStudio (and perhaps other packages) overrides the R_LIBS_SITE - # which the wrapper above applies, and as a result packages - # installed in the wrapper (as in the method described in - # https://nixos.org/nixpkgs/manual/#r-packages) aren't visible. - # The below turns R_LIBS_SITE into some R startup code which can - # correct this. - echo "# Autogenerated by wrapper.nix from R_LIBS_SITE" > $out/${passthru.fixLibsR} - echo -n ".libPaths(c(.libPaths(), \"" >> $out/${passthru.fixLibsR} - echo -n $R_LIBS_SITE | sed -e 's/:/", "/g' >> $out/${passthru.fixLibsR} - echo -n "\"))" >> $out/${passthru.fixLibsR} - echo >> $out/${passthru.fixLibsR} ''; meta = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b50973790eb..67215c456aa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10608,6 +10608,15 @@ with pkgs; packages = []; }; + rstudioWrapper = callPackage ../development/r-modules/wrapper-rstudio.nix { + recommendedPackages = with rPackages; [ + boot class cluster codetools foreign KernSmooth lattice MASS + Matrix mgcv nlme nnet rpart spatial survival + ]; + # Override this attribute to register additional libraries. + packages = []; + }; + rPackages = callPackage ../development/r-modules { overrides = (config.rPackageOverrides or (p: {})) pkgs; }; From 5a78bed2bb5b3499d7d160cda2f1413ede0809f7 Mon Sep 17 00:00:00 2001 From: Utku Demir Date: Tue, 2 May 2017 09:52:04 +1200 Subject: [PATCH 07/38] Fix documentation of emacsWithPackages After [this change](https://github.com/NixOS/nixpkgs/commit/901a778c7744b25013168dde1a2a548ad531fd78), it should be `overrideScope` instead of `override`. --- pkgs/build-support/emacs/wrapper.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/emacs/wrapper.nix b/pkgs/build-support/emacs/wrapper.nix index b13def07bb8..4fb77ccfe21 100644 --- a/pkgs/build-support/emacs/wrapper.nix +++ b/pkgs/build-support/emacs/wrapper.nix @@ -21,7 +21,7 @@ set which contains `emacsWithPackages`. For example, to override `emacsPackagesNg.emacsWithPackages`, ``` let customEmacsPackages = - emacsPackagesNg.override (super: self: { + emacsPackagesNg.overrideScope (super: self: { # use a custom version of emacs emacs = ...; # use the unstable MELPA version of magit From 037074920997a3f552c73823cf4d11bda826ad67 Mon Sep 17 00:00:00 2001 From: Volth Date: Tue, 2 May 2017 00:40:19 +0000 Subject: [PATCH 08/38] google-chrome: remove dependency on gcc --- .../networking/browsers/google-chrome/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/browsers/google-chrome/default.nix b/pkgs/applications/networking/browsers/google-chrome/default.nix index 32d3a8e1540..e7b74562bd5 100644 --- a/pkgs/applications/networking/browsers/google-chrome/default.nix +++ b/pkgs/applications/networking/browsers/google-chrome/default.nix @@ -4,7 +4,7 @@ , glib, fontconfig, freetype, pango, cairo, libX11, libXi, atk, gconf, nss, nspr , libXcursor, libXext, libXfixes, libXrender, libXScrnSaver, libXcomposite, libxcb , alsaLib, libXdamage, libXtst, libXrandr, expat, cups -, dbus_libs, gtk2, gtk3, gdk_pixbuf, gcc +, dbus_libs, gtk2, gtk3, gdk_pixbuf, gcc-unwrapped # command line arguments which are always set e.g "--disable-gpu" , commandLineArgs ? "" @@ -43,11 +43,10 @@ let }; deps = [ - stdenv.cc.cc glib fontconfig freetype pango cairo libX11 libXi atk gconf nss nspr libXcursor libXext libXfixes libXrender libXScrnSaver libXcomposite libxcb alsaLib libXdamage libXtst libXrandr expat cups - dbus_libs gdk_pixbuf gcc + dbus_libs gdk_pixbuf gcc-unwrapped.lib systemd libexif liberation_ttf curl utillinux xdg_utils wget From c13e3289161d91afed3308c1c4400e6f4dc980dd Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Tue, 2 May 2017 08:56:20 -0400 Subject: [PATCH 09/38] ammonite: 0.8.3 -> 0.8.4 Also rename package and add alias for the old name. --- pkgs/development/tools/ammonite/default.nix | 9 +++++---- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/ammonite/default.nix b/pkgs/development/tools/ammonite/default.nix index 4c64141fd4d..04916b1ef75 100644 --- a/pkgs/development/tools/ammonite/default.nix +++ b/pkgs/development/tools/ammonite/default.nix @@ -1,12 +1,13 @@ { stdenv, lib, fetchurl, makeWrapper, jre }: stdenv.mkDerivation rec { - name = "ammonite-repl-${version}"; - version = "0.8.3"; + name = "ammonite-${version}"; + version = "0.8.4"; + scalaVersion = "2.12"; src = fetchurl { - url = "https://github.com/lihaoyi/Ammonite/releases/download/${version}/2.12-${version}"; - sha256 = "0y4524y2w7aq300djcazb7ckkr3gqpim2grcgb237mxq3fdvb0r8"; + url = "https://github.com/lihaoyi/Ammonite/releases/download/${version}/${scalaVersion}-${version}"; + sha256 = "04kni08yd53w8dhkkgbydzkka4cnp31l2d8g23iinkn10ckmz5jm"; }; propagatedBuildInputs = [ jre ] ; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 94fedabd562..7fb271682d0 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -20,6 +20,7 @@ doNotDisplayTwice rec { accounts-qt = libsForQt5.accounts-qt; # added 2015-12-19 adobeReader = adobe-reader; aircrackng = aircrack-ng; # added 2016-01-14 + ammonite-repl = ammonite; # added 2017-05-02 arduino_core = arduino-core; # added 2015-02-04 asciidocFull = asciidoc-full; # added 2014-06-22 bar = lemonbar; # added 2015-01-16 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 67014b02d9c..f8f7587d6a4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -402,7 +402,7 @@ with pkgs; amazon-glacier-cmd-interface = callPackage ../tools/backup/amazon-glacier-cmd-interface { }; - ammonite-repl = callPackage ../development/tools/ammonite {}; + ammonite = callPackage ../development/tools/ammonite {}; amtterm = callPackage ../tools/system/amtterm {}; From e026fb485221d8a6e05ec52008766ccf4e7c5589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Tr=C3=B6ger?= Date: Tue, 2 May 2017 16:11:09 +0200 Subject: [PATCH 10/38] kgpg: Added gnupg1 as runtime dependency (#25356) --- pkgs/applications/kde/kgpg.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/kde/kgpg.nix b/pkgs/applications/kde/kgpg.nix index c4428598229..58e9cb0d1e9 100644 --- a/pkgs/applications/kde/kgpg.nix +++ b/pkgs/applications/kde/kgpg.nix @@ -1,7 +1,7 @@ { - kdeApp, lib, + kdeApp, lib, makeQtWrapper, extra-cmake-modules, kdoctools, ki18n, - akonadi-contacts, gpgme, karchive, kcodecs, kcontacts, kcoreaddons, kcrash, + akonadi-contacts, gnupg1, gpgme, karchive, kcodecs, kcontacts, kcoreaddons, kcrash, kdbusaddons, kiconthemes, kjobwidgets, kio, knotifications, kservice, ktextwidgets, kxmlgui, kwidgetsaddons, kwindowsystem }: @@ -10,10 +10,13 @@ kdeApp { name = "kgpg"; nativeBuildInputs = [ extra-cmake-modules kdoctools ki18n ]; buildInputs = [ - akonadi-contacts gpgme karchive kcodecs kcontacts kcoreaddons kcrash kdbusaddons + akonadi-contacts gnupg1 gpgme karchive kcodecs kcontacts kcoreaddons kcrash kdbusaddons kiconthemes kjobwidgets kio knotifications kservice ktextwidgets kxmlgui - kwidgetsaddons kwindowsystem + kwidgetsaddons kwindowsystem makeQtWrapper ]; + postInstall = '' + wrapQtProgram $out/bin/kgpg --suffix PATH : ${lib.makeBinPath [ gnupg1 ]} + ''; meta = { license = [ lib.licenses.gpl2 ]; maintainers = [ lib.maintainers.ttuegel ]; From fe3c12406480f96d235875819ad1d36cf89293f3 Mon Sep 17 00:00:00 2001 From: Rok Garbas Date: Tue, 2 May 2017 12:44:07 +0200 Subject: [PATCH 11/38] neovim: 0.1.7 -> 0.2.0 --- pkgs/applications/editors/neovim/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/editors/neovim/default.nix b/pkgs/applications/editors/neovim/default.nix index 3f2058af133..ca915b3e6d1 100644 --- a/pkgs/applications/editors/neovim/default.nix +++ b/pkgs/applications/editors/neovim/default.nix @@ -24,8 +24,8 @@ let src = fetchFromGitHub { owner = "neovim"; repo = "libvterm"; - rev = "11682793d84668057c5aedc3d7f8071bb54eaf2c"; - sha256 = "0pd90yx6xsagrqjipi26sxri1l4wdnx23ziad1zbxnqx9njxa7g3"; + rev = "5a748f97fbf27003e141002b58933a99f3addf8d"; + sha256 = "1fnd57f5n9h7z50a4vj7g96k6ndsdknjqsibgnxi9ndhyz244qbx"; }; buildInputs = [ perl ]; @@ -81,13 +81,13 @@ let neovim = stdenv.mkDerivation rec { name = "neovim-${version}"; - version = "0.1.7"; + version = "0.2.0"; src = fetchFromGitHub { owner = "neovim"; repo = "neovim"; rev = "v${version}"; - sha256 = "0bk0raxlb1xsqyw9pmqmxvcq5szqhimidrasnvzrci84gld8cwz4"; + sha256 = "0fhjkgjwqqmzbfn9wk10l2vq9v74zkriz5j12b1rx0gdwzlfybn8"; }; enableParallelBuilding = true; From 33960efb136ad00717d8ce34876a3891780f3a32 Mon Sep 17 00:00:00 2001 From: Rok Garbas Date: Tue, 2 May 2017 13:02:42 +0200 Subject: [PATCH 12/38] neovim-qt: 0.2.6 -> 0.2.7 --- pkgs/applications/editors/neovim/qt.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/neovim/qt.nix b/pkgs/applications/editors/neovim/qt.nix index 26f2a3b6941..57f52f0e5fc 100644 --- a/pkgs/applications/editors/neovim/qt.nix +++ b/pkgs/applications/editors/neovim/qt.nix @@ -3,13 +3,13 @@ stdenv.mkDerivation rec { name = "neovim-qt-${version}"; - version = "0.2.6"; + version = "0.2.7"; src = fetchFromGitHub { owner = "equalsraf"; repo = "neovim-qt"; rev = "v${version}"; - sha256 = "1wsxhy8fdayy4dsr2dxgh5k4jysybjlyzj134vk325v6cqz9bsgm"; + sha256 = "1bfni38l7cs0wbd9c6hgz2jfc8h3ixmg94izdvydm8j7amdz0cb6"; }; cmakeFlags = [ @@ -17,7 +17,13 @@ stdenv.mkDerivation rec { "-DMSGPACK_LIBRARIES=${libmsgpack}/lib/libmsgpackc.so" ]; - doCheck = true; + # The following tests FAILED: + # 2 - tst_neovimconnector (Failed) + # 3 - tst_callallmethods (Failed) + # 4 - tst_encoding (Failed) + # + # Tests failed when upgraded to neovim 0.2.0 + doCheck = false; buildInputs = with pythonPackages; [ neovim qtbase libmsgpack From ec7f6208311f839b5b36de8d80b922b758ffd50d Mon Sep 17 00:00:00 2001 From: Rok Garbas Date: Tue, 2 May 2017 13:06:43 +0200 Subject: [PATCH 13/38] neovim-remote: 1.4.0 -> 1.6.0 --- pkgs/applications/editors/neovim/neovim-remote.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/neovim/neovim-remote.nix b/pkgs/applications/editors/neovim/neovim-remote.nix index 487d9c842b8..cf4ea9df544 100644 --- a/pkgs/applications/editors/neovim/neovim-remote.nix +++ b/pkgs/applications/editors/neovim/neovim-remote.nix @@ -4,17 +4,17 @@ with stdenv.lib; pythonPackages.buildPythonPackage rec { name = "neovim-remote-${version}"; - version = "v1.4.0"; + version = "v1.6.0"; disabled = !pythonPackages.isPy3k; src = fetchFromGitHub { owner = "mhinz"; repo = "neovim-remote"; rev = version; - sha256 = "0msvfh27f56xj5ki59ikzavxz863nal5scm57n43618m49qzg8iz"; + sha256 = "0x01zpmxi37jr7j2az2bd8902h7zhkpg6kpvc8xmll9f7703zz2l"; }; - propagatedBuildInputs = [ pythonPackages.neovim ]; + propagatedBuildInputs = with pythonPackages; [ neovim psutil ]; meta = { description = "A tool that helps controlling nvim processes from a terminal"; From 9f18af599164356f5a027da823f4ca67cc0e0329 Mon Sep 17 00:00:00 2001 From: jammerful Date: Mon, 1 May 2017 20:01:39 -0400 Subject: [PATCH 14/38] Add Shibboleth Service Provider Module --- nixos/modules/module-list.nix | 1 + .../services/security/shibboleth-sp.nix | 71 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 nixos/modules/services/security/shibboleth-sp.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 672521166e4..7e523ac483c 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -534,6 +534,7 @@ ./services/security/munge.nix ./services/security/oauth2_proxy.nix ./services/security/physlock.nix + ./services/security/shibboleth-sp.nix ./services/security/sshguard.nix ./services/security/tor.nix ./services/security/torify.nix diff --git a/nixos/modules/services/security/shibboleth-sp.nix b/nixos/modules/services/security/shibboleth-sp.nix new file mode 100644 index 00000000000..9659188349e --- /dev/null +++ b/nixos/modules/services/security/shibboleth-sp.nix @@ -0,0 +1,71 @@ +{pkgs, config, lib, ...}: + +with lib; +let + cfg = config.services.shibboleth-sp; +in { + options = { + services.shibboleth-sp = { + enable = mkOption { + type = types.bool; + default = false; + description = "Whether to enable the shibboleth service"; + }; + + configFile = mkOption { + type = types.path; + example = "${pkgs.shibboleth-sp}/etc/shibboleth/shibboleth2.xml"; + description = "Path to shibboleth config file"; + }; + + fastcgi.enable = mkOption { + type = types.bool; + default = false; + description = "Whether to include the shibauthorizer and shibresponder FastCGI processes"; + }; + + fastcgi.shibAuthorizerPort = mkOption { + type = types.int; + default = 9100; + description = "Port for shibauthorizer FastCGI proccess to bind to"; + }; + + fastcgi.shibResponderPort = mkOption { + type = types.int; + default = 9101; + description = "Port for shibauthorizer FastCGI proccess to bind to"; + }; + }; + }; + + config = mkIf cfg.enable { + systemd.services.shibboleth-sp = { + description = "Provides SSO and federation for web applications"; + after = lib.optionals cfg.fastcgi.enable [ "shibresponder.service" "shibauthorizer.service" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + ExecStart = "${pkgs.shibboleth-sp}/bin/shibd -F -d ${pkgs.shibboleth-sp} -c ${cfg.configFile}"; + }; + }; + + systemd.services.shibresponder = mkIf cfg.fastcgi.enable { + description = "Provides SSO through Shibboleth via FastCGI"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + path = [ "${pkgs.spawn_fcgi}" ]; + serviceConfig = { + ExecStart = "${pkgs.spawn_fcgi}/bin/spawn-fcgi -n -p ${toString cfg.fastcgi.shibResponderPort} ${pkgs.shibboleth-sp}/lib/shibboleth/shibresponder"; + }; + }; + + systemd.services.shibauthorizer = mkIf cfg.fastcgi.enable { + description = "Provides SSO through Shibboleth via FastCGI"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + path = [ "${pkgs.spawn_fcgi}" ]; + serviceConfig = { + ExecStart = "${pkgs.spawn_fcgi}/bin/spawn-fcgi -n -p ${toString cfg.fastcgi.shibAuthorizerPort} ${pkgs.shibboleth-sp}/lib/shibboleth/shibauthorizer"; + }; + }; + }; +} From 75197be585960274fdbcf059e69af86191d3a41c Mon Sep 17 00:00:00 2001 From: Changlin Li Date: Tue, 2 May 2017 12:01:18 -0400 Subject: [PATCH 15/38] bfg repo cleaner: add top-level aliase (#25420) Makes it easier to find and install this package. --- pkgs/top-level/all-packages.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8692977cec2..e56e2bd00cf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1117,6 +1117,8 @@ with pkgs; pythonPackages = python2Packages; }; + bfg-repo-cleaner = gitAndTools.bfg-repo-cleaner; + bgs = callPackage ../tools/X11/bgs { }; biber = callPackage ../tools/typesetting/biber { From 7be790299058fb63f085183dc3395a18d253a33d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 2 May 2017 18:15:03 +0200 Subject: [PATCH 16/38] zfsUnstable: mark as incompatible with 4.11 (since rc3) --- pkgs/os-specific/linux/zfs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix index 5c178f47b50..c70e96aa9fd 100644 --- a/pkgs/os-specific/linux/zfs/default.nix +++ b/pkgs/os-specific/linux/zfs/default.nix @@ -139,7 +139,7 @@ in }; zfsUnstable = common { # comment/uncomment if breaking kernel versions are known - incompatibleKernelVersion = null; + incompatibleKernelVersion = "4.11"; version = "0.7.0-rc3"; From b88296818de1f96745d529317c6047f651bade5b Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 2 May 2017 10:45:31 -0700 Subject: [PATCH 17/38] libidn2: Correct a broken darwin patch --- .../libraries/libidn2/fix-error-darwin.patch | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pkgs/development/libraries/libidn2/fix-error-darwin.patch b/pkgs/development/libraries/libidn2/fix-error-darwin.patch index db3edd6e4a0..e2202abd947 100644 --- a/pkgs/development/libraries/libidn2/fix-error-darwin.patch +++ b/pkgs/development/libraries/libidn2/fix-error-darwin.patch @@ -10,17 +10,6 @@ index 6abbc72..804f0f2 100644 #include "gettext.h" #define _(String) dgettext (PACKAGE, String) #include "progname.h" -@@ -161,9 +160,7 @@ process_input (char *readbuf, int flags) - free (output); - } - else -- error (EXIT_FAILURE, 0, "%s: %s", -- args_info.register_given ? "register" : "lookup", -- idn2_strerror (rc)); -+ perror (idn2_strerror (rc)); - } - - int @@ -222,7 +219,7 @@ main (int argc, char *argv[]) } From 5217969f691e21dc62c6ed16eb6bb6a51afed0ee Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 2 May 2017 20:11:49 +0200 Subject: [PATCH 18/38] python-stevedore: 1.7.0 -> 1.21.0 --- .../python-modules/stevedore/default.nix | 23 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 20 +--------------- 2 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 pkgs/development/python-modules/stevedore/default.nix diff --git a/pkgs/development/python-modules/stevedore/default.nix b/pkgs/development/python-modules/stevedore/default.nix new file mode 100644 index 00000000000..c6ce6c0d922 --- /dev/null +++ b/pkgs/development/python-modules/stevedore/default.nix @@ -0,0 +1,23 @@ +{ stdenv, buildPythonPackage, fetchPypi, oslosphinx, pbr, six, argparse }: + +buildPythonPackage rec { + pname = "stevedore"; + version = "1.21.0"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "12sg88ax0lv2sxr685rqdaxm9gryjrpj4fvax459zvwy1r4n83ma"; + }; + + doCheck = false; + + buildInputs = [ oslosphinx ]; + propagatedBuildInputs = [ pbr six argparse ]; + + meta = with stdenv.lib; { + description = "Manage dynamic plugins for Python applications"; + homepage = "https://pypi.python.org/pypi/stevedore"; + license = licenses.asl20; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 54f1fd46047..f5df1258544 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -23763,25 +23763,7 @@ in { }; }; - stevedore = buildPythonPackage rec { - name = "stevedore-1.7.0"; - - src = pkgs.fetchurl { - url = "mirror://pypi/s/stevedore/${name}.tar.gz"; - sha256 = "149pjc0c3z6khjisn4yil3f94qjnzwafz093wc8rrzbw828qdkv8"; - }; - - doCheck = false; - - buildInputs = with self; [ oslosphinx ]; - propagatedBuildInputs = with self; [ pbr six argparse ]; - - meta = { - description = "Manage dynamic plugins for Python applications"; - homepage = "https://pypi.python.org/pypi/stevedore"; - license = licenses.asl20; - }; - }; + stevedore = callPackage ../development/python-modules/stevedore {}; Theano = self.TheanoWithoutCuda; From aac48708c1a9d5443d11e206fe38b0ebbd4cb930 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 2 May 2017 13:49:27 -0500 Subject: [PATCH 19/38] jing-trang: supports all unix This is needed to build the manual on macOS. --- pkgs/tools/text/xml/jing-trang/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/text/xml/jing-trang/default.nix b/pkgs/tools/text/xml/jing-trang/default.nix index 36ff976a6c1..4c4f6ed7e19 100644 --- a/pkgs/tools/text/xml/jing-trang/default.nix +++ b/pkgs/tools/text/xml/jing-trang/default.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { # The homepage is www.thaiopensource.com, but it links to googlecode.com # for downloads and call it the "project site". homepage = http://www.thaiopensource.com/relaxng/jing.html; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = [ maintainers.bjornfor ]; }; } From cc4e2505e4d5539feb628822883e48dc4c42289f Mon Sep 17 00:00:00 2001 From: Ioannis Koutras Date: Tue, 2 May 2017 19:50:30 +0300 Subject: [PATCH 20/38] efivar: 31 -> 30 According to the release page, version 31 of efivar is still considered as a pre-release and the sha256sum has changed at least once. This commit switches to the last, stable release. --- pkgs/tools/system/efivar/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/system/efivar/default.nix b/pkgs/tools/system/efivar/default.nix index 744e34a9c60..6b062513483 100644 --- a/pkgs/tools/system/efivar/default.nix +++ b/pkgs/tools/system/efivar/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { name = "efivar-${version}"; - version = "31"; + version = "30"; src = fetchFromGitHub { owner = "rhinstaller"; repo = "efivar"; rev = version; - sha256 = "0dhycikylm87jmds4ii5ygwq59g4sa5sv9mzryjzgqlgppw5arli"; + sha256 = "1pghj019qr7qpqd9rxfhsr1hm3s0w1hd5cdndpl07vhys8hy4a8a"; }; nativeBuildInputs = [ pkgconfig ]; From 1234825656bfed1d617d03a32a1a91a97850570b Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 2 May 2017 13:45:36 -0500 Subject: [PATCH 21/38] xsv: fix "has invalid meta attribute" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this there's an eval error, when running nix-env -f '' --query --available --json. derivation ‘xsv-0.11.0’ has invalid meta attribute ‘override’ derivation ‘xsv-0.11.0’ has invalid meta attribute ‘overrideDerivation’ [Bjørn: extend commit message.] --- pkgs/tools/text/xsv/default.nix | 2 +- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/text/xsv/default.nix b/pkgs/tools/text/xsv/default.nix index 388917e6805..9e15649133f 100644 --- a/pkgs/tools/text/xsv/default.nix +++ b/pkgs/tools/text/xsv/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, rustPlatform, makeWrapper }: +{ stdenv, fetchFromGitHub, rustPlatform }: with rustPlatform; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 486972cbe2a..61e36c33aad 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4738,7 +4738,7 @@ with pkgs; xsel = callPackage ../tools/misc/xsel { }; - xsv = callPackages ../tools/text/xsv { }; + xsv = callPackage ../tools/text/xsv { }; xtreemfs = callPackage ../tools/filesystems/xtreemfs {}; From beff1984f4c84435c706244871b65bf1833fbee8 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Tue, 2 May 2017 21:46:54 +0200 Subject: [PATCH 22/38] qtinstaller: build submodule-style --- pkgs/development/libraries/qtinstaller/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/qtinstaller/default.nix b/pkgs/development/libraries/qtinstaller/default.nix index 29db95e6919..3379cbc9acf 100644 --- a/pkgs/development/libraries/qtinstaller/default.nix +++ b/pkgs/development/libraries/qtinstaller/default.nix @@ -2,7 +2,10 @@ stdenv.mkDerivation rec { name = "qtinstaller"; - buildInputs = [ qtdeclarative qttools qtbase qmakeHook ]; + + propagatedBuildInputs = [qtdeclarative qttools]; + nativeBuildInputs = [ qmakeHook ]; + version = "2.0.3"; src = fetchurl { url = "http://download.qt.io/official_releases/qt-installer-framework/${version}/qt-installer-framework-opensource-${version}-src.tar.gz"; @@ -12,6 +15,10 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" "doc" ]; + setOutputFlags = false; + enableParallelBuilding = true; + NIX_QT_SUBMODULE = true; + installPhase = '' mkdir -p $out/{bin,lib,share/qt-installer-framework} cp -a bin/{archivegen,binarycreator,devtool,installerbase,repogen} $out/bin From 516f909acbe0a22d39daf71c3808accc3014202f Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 2 May 2017 22:21:03 +0200 Subject: [PATCH 23/38] gdal: fix darwin build --- pkgs/development/libraries/gdal/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix index e39d39ab81b..599a2c70f13 100644 --- a/pkgs/development/libraries/gdal/default.nix +++ b/pkgs/development/libraries/gdal/default.nix @@ -1,12 +1,12 @@ { stdenv, fetchurl, composableDerivation, unzip, libjpeg, libtiff, zlib , postgresql, mysql, libgeotiff, pythonPackages, proj, geos, openssl , libpng, sqlite, libspatialite -, netcdf, hdf5 , curl -, netcdfSupport ? true - }: +, libiconv +, netcdfSupport ? true, netcdf, hdf5 , curl +}: with stdenv.lib; - + composableDerivation.composableDerivation {} (fixed: rec { version = "2.1.3"; name = "gdal-${version}"; @@ -18,7 +18,8 @@ composableDerivation.composableDerivation {} (fixed: rec { buildInputs = [ unzip libjpeg libtiff libpng proj openssl sqlite libspatialite ] ++ (with pythonPackages; [ python numpy wrapPython ]) - ++ (stdenv.lib.optionals netcdfSupport [ netcdf hdf5 curl ]); + ++ stdenv.lib.optional stdenv.isDarwin libiconv + ++ stdenv.lib.optionals netcdfSupport [ netcdf hdf5 curl ]; hardeningDisable = [ "format" ]; From 572fd3de58f39b17029de857b7023d50be0cc6fb Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Tue, 2 May 2017 16:18:25 -0500 Subject: [PATCH 24/38] dropbox: 24.4.17 -> 25.4.28 --- pkgs/applications/networking/dropbox/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/dropbox/default.nix b/pkgs/applications/networking/dropbox/default.nix index a4bbe15544a..a97b29e3d3a 100644 --- a/pkgs/applications/networking/dropbox/default.nix +++ b/pkgs/applications/networking/dropbox/default.nix @@ -23,11 +23,11 @@ let # NOTE: When updating, please also update in current stable, # as older versions stop working - version = "24.4.17"; + version = "25.4.28"; sha256 = { - "x86_64-linux" = "1wjr92vrbxyjbwyqf134h8fp1zi4d5wyyirii545wqadbgg9grh9"; - "i686-linux" = "1qsdidpy251irzkv0hx0ch0xnrwq6wq6b22g0n8b9d0a7xi08k7h"; + "x86_64-linux" = "0r0bdl37rkar3nijxslp493mic5qd20l125p1kghqbradvh57rl3"; + "i686-linux" = "1difq6ky1klvminbzjivvq6ap3l296gij0ghgyy1n4lca3jqq648"; }."${stdenv.system}" or (throw "system ${stdenv.system} not supported"); arch = From ded7953478eff74d213b39136f269eb8d5eab8c9 Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Tue, 2 May 2017 19:14:03 -0400 Subject: [PATCH 25/38] treewide: meta.platform -> meta.platforms --- pkgs/applications/misc/urh/default.nix | 2 +- pkgs/applications/networking/feedreaders/rawdog/default.nix | 4 ++-- pkgs/applications/networking/irc/qweechat/default.nix | 2 +- pkgs/development/python-modules/pyroute2/default.nix | 2 +- pkgs/servers/radicale/default.nix | 2 +- pkgs/tools/networking/fakeroute/default.nix | 2 +- pkgs/tools/security/encryptr/default.nix | 2 +- pkgs/tools/text/grin/default.nix | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/misc/urh/default.nix b/pkgs/applications/misc/urh/default.nix index e12b95754ed..9015bb9956b 100644 --- a/pkgs/applications/misc/urh/default.nix +++ b/pkgs/applications/misc/urh/default.nix @@ -22,7 +22,7 @@ python3Packages.buildPythonApplication rec { inherit (src.meta) homepage; description = "Universal Radio Hacker: investigate wireless protocols like a boss"; license = licenses.asl20; - platform = platforms.all; + platforms = platforms.all; maintainers = with maintainers; [ fpletz ]; }; } diff --git a/pkgs/applications/networking/feedreaders/rawdog/default.nix b/pkgs/applications/networking/feedreaders/rawdog/default.nix index 39543f256fa..4e22a95d4d8 100644 --- a/pkgs/applications/networking/feedreaders/rawdog/default.nix +++ b/pkgs/applications/networking/feedreaders/rawdog/default.nix @@ -12,12 +12,12 @@ python2Packages.buildPythonApplication rec { propagatedBuildInputs = with python2Packages; [ feedparser ]; namePrefix = ""; - + meta = with stdenv.lib; { homepage = "http://offog.org/code/rawdog/"; description = "RSS Aggregator Without Delusions Of Grandeur"; license = licenses.gpl2; - platform = platforms.unix; + platforms = platforms.unix; maintainers = with maintainers; [ nckx ]; }; } diff --git a/pkgs/applications/networking/irc/qweechat/default.nix b/pkgs/applications/networking/irc/qweechat/default.nix index 83d459a97fe..acf030222a1 100644 --- a/pkgs/applications/networking/irc/qweechat/default.nix +++ b/pkgs/applications/networking/irc/qweechat/default.nix @@ -26,6 +26,6 @@ python27Packages.buildPythonApplication rec { description = "Qt remote GUI for WeeChat"; license = licenses.gpl3; maintainers = with maintainers; [ ramkromberg ]; - platform = with platforms; linux; + platforms = with platforms; linux; }; } diff --git a/pkgs/development/python-modules/pyroute2/default.nix b/pkgs/development/python-modules/pyroute2/default.nix index 91bfa97cb97..1b47b7f3f7d 100644 --- a/pkgs/development/python-modules/pyroute2/default.nix +++ b/pkgs/development/python-modules/pyroute2/default.nix @@ -16,6 +16,6 @@ buildPythonPackage rec { homepage = https://github.com/svinota/pyroute2; license = licenses.asl20; maintainers = [maintainers.mic92]; - platform = platforms.linux; + platforms = platforms.linux; }; } diff --git a/pkgs/servers/radicale/default.nix b/pkgs/servers/radicale/default.nix index a701ad5d833..e49e399194d 100644 --- a/pkgs/servers/radicale/default.nix +++ b/pkgs/servers/radicale/default.nix @@ -28,7 +28,7 @@ pythonPackages.buildPythonApplication rec { on mobile phones or computers. ''; license = licenses.gpl3Plus; - platform = platforms.all; + platforms = platforms.all; maintainers = with maintainers; [ edwtjo pSub aneeshusa ]; }; } diff --git a/pkgs/tools/networking/fakeroute/default.nix b/pkgs/tools/networking/fakeroute/default.nix index 1cb614e88c0..9737108e6ac 100644 --- a/pkgs/tools/networking/fakeroute/default.nix +++ b/pkgs/tools/networking/fakeroute/default.nix @@ -16,6 +16,6 @@ stdenv.mkDerivation rec { ''; homepage = https://moxie.org/software/fakeroute/; license = licenses.bsd3; - platform = platforms.linux; + platforms = platforms.linux; }; } diff --git a/pkgs/tools/security/encryptr/default.nix b/pkgs/tools/security/encryptr/default.nix index 95d0299e873..2cf07c63a84 100644 --- a/pkgs/tools/security/encryptr/default.nix +++ b/pkgs/tools/security/encryptr/default.nix @@ -52,6 +52,6 @@ in stdenv.mkDerivation rec { description = "Free, private and secure password management tool and e-wallet"; license = licenses.unfree; maintainers = with maintainers; [ guillaumekoenig ]; - platform = platforms.linux; + platforms = platforms.linux; }; } diff --git a/pkgs/tools/text/grin/default.nix b/pkgs/tools/text/grin/default.nix index 7c1df7f8819..56ea13de40e 100644 --- a/pkgs/tools/text/grin/default.nix +++ b/pkgs/tools/text/grin/default.nix @@ -15,7 +15,7 @@ python2Packages.buildPythonApplication rec { meta = { homepage = https://pypi.python.org/pypi/grin; description = "A grep program configured the way I like it"; - platform = stdenv.lib.platforms.all; + platforms = stdenv.lib.platforms.all; maintainers = [ stdenv.lib.maintainers.sjagoe ]; }; } From 3d27a84a1ce6516e1b6bc331e96689e7c132af67 Mon Sep 17 00:00:00 2001 From: Victor Calvert Date: Tue, 2 May 2017 19:32:51 -0400 Subject: [PATCH 26/38] tomb: 2.2 -> 2.4 (#25465) --- pkgs/os-specific/linux/tomb/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/tomb/default.nix b/pkgs/os-specific/linux/tomb/default.nix index 5ed7ad5b959..141af86a337 100644 --- a/pkgs/os-specific/linux/tomb/default.nix +++ b/pkgs/os-specific/linux/tomb/default.nix @@ -1,15 +1,15 @@ { stdenv, fetchurl, zsh, pinentry, cryptsetup, gnupg1orig, makeWrapper }: let - version = "2.2"; + version = "2.4"; in stdenv.mkDerivation rec { name = "tomb-${version}"; src = fetchurl { - url = "https://files.dyne.org/tomb/tomb-${version}.tar.gz"; - sha256 = "11msj38fdmymiqcmwq1883kjqi5zr01ybdjj58rfjjrw4zw2w5y0"; + url = "https://files.dyne.org/tomb/Tomb-${version}.tar.gz"; + sha256 = "1hv1w79as7swqj0n137vz8n8mwvcgwlvd91sdyssz41jarg7f1vr"; }; buildInputs = [ makeWrapper ]; From bc4e30a12b1eb3cdf94e4b921978af71e31cef23 Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Tue, 2 May 2017 19:38:44 -0400 Subject: [PATCH 27/38] mosh: 1.2.6 -> 1.3.0 Release announcement is available at http://mailman.mit.edu/pipermail/mosh-users/2017-March/000341.html. --- pkgs/tools/networking/mosh/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/networking/mosh/default.nix b/pkgs/tools/networking/mosh/default.nix index 7ef00197118..5f3975a1df8 100644 --- a/pkgs/tools/networking/mosh/default.nix +++ b/pkgs/tools/networking/mosh/default.nix @@ -2,11 +2,11 @@ , makeWrapper, perl, openssl, autoreconfHook, openssh }: stdenv.mkDerivation rec { - name = "mosh-1.2.6"; + name = "mosh-1.3.0"; src = fetchurl { url = "https://mosh.org/${name}.tar.gz"; - sha256 = "118fhpm754wpklf1blnlq5xbvrxqml6rdfs3b07wg666zkxvg0ky"; + sha256 = "0xikz40q873g9ihvz3x6bwkcb9hb8kcnp5wpcmb72pg5c7s143ij"; }; buildInputs = [ autoreconfHook protobuf ncurses zlib pkgconfig IOTty makeWrapper perl openssl ]; From d8c1977bb55a8db63e25b2ede84e25796f88d6b1 Mon Sep 17 00:00:00 2001 From: jammerful Date: Tue, 2 May 2017 19:55:11 -0400 Subject: [PATCH 28/38] shibboleth-sp module: Set Config File Path for FastCGI Units Without this environment variable both shibauthorizer and shibresponder default to ${pkgs.shibboleth-sp}etc/shibboleth/shibboleth2.xml --- nixos/modules/services/security/shibboleth-sp.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/services/security/shibboleth-sp.nix b/nixos/modules/services/security/shibboleth-sp.nix index 9659188349e..07acf27f0f6 100644 --- a/nixos/modules/services/security/shibboleth-sp.nix +++ b/nixos/modules/services/security/shibboleth-sp.nix @@ -53,6 +53,7 @@ in { after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; path = [ "${pkgs.spawn_fcgi}" ]; + environment.SHIBSP_CONFIG = "${cfg.configFile}"; serviceConfig = { ExecStart = "${pkgs.spawn_fcgi}/bin/spawn-fcgi -n -p ${toString cfg.fastcgi.shibResponderPort} ${pkgs.shibboleth-sp}/lib/shibboleth/shibresponder"; }; @@ -63,6 +64,7 @@ in { after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; path = [ "${pkgs.spawn_fcgi}" ]; + environment.SHIBSP_CONFIG = "${cfg.configFile}"; serviceConfig = { ExecStart = "${pkgs.spawn_fcgi}/bin/spawn-fcgi -n -p ${toString cfg.fastcgi.shibAuthorizerPort} ${pkgs.shibboleth-sp}/lib/shibboleth/shibauthorizer"; }; From a7b206bb89ab1dc5b36b184768ec24ba02e9188a Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Fri, 10 Feb 2017 08:55:07 +0100 Subject: [PATCH 29/38] pythonPackages.certifi: move to separate file --- .../python-modules/certifi/default.nix | 22 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 17 +------------- 2 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 pkgs/development/python-modules/certifi/default.nix diff --git a/pkgs/development/python-modules/certifi/default.nix b/pkgs/development/python-modules/certifi/default.nix new file mode 100644 index 00000000000..8658c76df79 --- /dev/null +++ b/pkgs/development/python-modules/certifi/default.nix @@ -0,0 +1,22 @@ +{ lib +, fetchPypi +, buildPythonPackage +}: + +buildPythonPackage rec { + pname = "certifi"; + version = "2017.1.23"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "1klrzl3hgvcf2mjk00g0k3kk1p2z27vzwnxivwar4vhjmjvpz1w1"; + }; + + meta = { + homepage = http://certifi.io/; + description = "Python package for providing Mozilla's CA Bundle"; + license = lib.licenses.isc; + maintainers = with lib.maintainers; [ koral ]; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 54f1fd46047..f40df8ca96d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3695,22 +3695,7 @@ in { }; }; - certifi = buildPythonPackage rec { - name = "certifi-${version}"; - version = "2017.1.23"; - - src = pkgs.fetchurl { - url = "mirror://pypi/c/certifi/${name}.tar.gz"; - sha256 = "1klrzl3hgvcf2mjk00g0k3kk1p2z27vzwnxivwar4vhjmjvpz1w1"; - }; - - meta = { - homepage = http://certifi.io/; - description = "Python package for providing Mozilla's CA Bundle"; - license = licenses.isc; - maintainers = with maintainers; [ koral ]; - }; - }; + certifi = callPackage ../development/python-modules/certifi { }; characteristic = buildPythonPackage rec { name = "characteristic-14.1.0"; From 6d1408153c516827c737c5f0f27e511f31f0118b Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Wed, 3 May 2017 08:30:08 +0200 Subject: [PATCH 30/38] pythonPackages.setuptoolsTrial: do not depend on old pytest --- pkgs/top-level/python-packages.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f40df8ca96d..9a069600ddd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -23299,11 +23299,15 @@ in { url = "mirror://pypi/s/${pname}/${name}.tar.gz"; sha256 = "14220f8f761c48ba1e2526f087195077cf54fad7098b382ce220422f0ff59b12"; }; - buildInputs = with self; [ pytest_29 virtualenv pytestrunner pytest-virtualenv ]; + buildInputs = with self; [ pytest virtualenv pytestrunner pytest-virtualenv ]; propagatedBuildInputs = with self; [ twisted pathlib2 ]; postPatch = '' sed -i '12,$d' tests/test_main.py ''; + + # Couldn't get tests working + doCheck = false; + meta = { description = "Setuptools plugin that makes unit tests execute with trial instead of pyunit."; homepage = "https://github.com/rutsky/setuptools-trial"; From d317e834c10599cb0d48de8cc8d22adefee6a19e Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Wed, 3 May 2017 08:34:47 +0200 Subject: [PATCH 31/38] pythonPackages.pytestcov: never propagate pytest Because we have multiple versions of pytest and we do not want to end up with multiple in one closure. --- pkgs/top-level/python-packages.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9a069600ddd..f2a6eab2d23 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5424,8 +5424,8 @@ in { sha256 = "fa0a212283cdf52e2eecc24dd6459bb7687cc29adb60cb84258fab73be8dda0f"; }; - propagatedBuildInputs = with self; [ pytest coverage ]; - buildInputs = with self; [ covCore virtualenv process-tests helper ]; + propagatedBuildInputs = with self; [ coverage ]; + buildInputs = with self; [ pytest covCore virtualenv process-tests helper ]; doCheck = false; checkPhase = '' From 97630b21c9242aeb777116eda5f407cb33443473 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Wed, 3 May 2017 08:42:24 +0200 Subject: [PATCH 32/38] pythonPackages.pydot: fix build --- .../python-modules/pydot/default.nix | 27 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 15 +---------- 2 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 pkgs/development/python-modules/pydot/default.nix diff --git a/pkgs/development/python-modules/pydot/default.nix b/pkgs/development/python-modules/pydot/default.nix new file mode 100644 index 00000000000..38123acd32e --- /dev/null +++ b/pkgs/development/python-modules/pydot/default.nix @@ -0,0 +1,27 @@ +{ lib +, buildPythonPackage +, fetchPypi +, chardet +, pyparsing +, graphviz +}: + +buildPythonPackage rec { + pname = "pydot"; + version = "1.2.3"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "edb5d3f249f97fbd9c4bb16959e61bc32ecf40eee1a9f6d27abe8d01c0a73502"; + }; + checkInputs = [ chardet ]; + # No tests in archive + doCheck = false; + propagatedBuildInputs = [pyparsing graphviz]; + meta = { + homepage = https://github.com/erocarrera/pydot; + description = "Allows to easily create both directed and non directed graphs from Python"; + licenses = with lib.licenses; [ mit ]; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f2a6eab2d23..73cee10e873 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -19838,20 +19838,7 @@ in { }; }); - pydot = buildPythonPackage rec { - name = "pydot-1.2.3"; - disabled = isPy3k; - - src = pkgs.fetchurl { - url = "mirror://pypi/p/pydot/${name}.tar.gz"; - sha256 = "edb5d3f249f97fbd9c4bb16959e61bc32ecf40eee1a9f6d27abe8d01c0a73502"; - }; - propagatedBuildInputs = with self; [pyparsing pkgs.graphviz]; - meta = { - homepage = https://github.com/erocarrera/pydot; - description = "Allows to easily create both directed and non directed graphs from Python"; - }; - }; + pydot = callPackage ../development/python-modules/pydot { }; pydot_ng = buildPythonPackage rec { name = "pydot_ng-1.0.0"; From 3dfa709706db3fcfb69c6907d2a29dca269caa0a Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Wed, 3 May 2017 08:50:48 +0200 Subject: [PATCH 33/38] pythonPackages.line_profiler: fix build --- pkgs/development/python-modules/line_profiler/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/python-modules/line_profiler/default.nix b/pkgs/development/python-modules/line_profiler/default.nix index e6d6f1e1d7e..570bba2a8c4 100644 --- a/pkgs/development/python-modules/line_profiler/default.nix +++ b/pkgs/development/python-modules/line_profiler/default.nix @@ -3,6 +3,8 @@ , fetchPypi , cython , isPyPy +, ipython +, python }: buildPythonPackage rec { @@ -17,8 +19,14 @@ buildPythonPackage rec { buildInputs = [ cython ]; + propagatedBuildInputs = [ ipython ]; + disabled = isPyPy; + checkPhase = '' + ${python.interpreter} -m unittest discover -s tests + ''; + meta = { description = "Line-by-line profiler"; homepage = https://github.com/rkern/line_profiler; From 82e99edf3195ff6184b06a3bbeb0b98e074af603 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Wed, 3 May 2017 08:53:58 +0200 Subject: [PATCH 34/38] pythonpackages.pywinrm: broken --- pkgs/top-level/python-packages.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c0ef147a529..d57c47a4141 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -21708,6 +21708,8 @@ in { homepage = "http://github.com/diyan/pywinrm/"; description = "Python library for Windows Remote Management"; license = licenses.mit; + # error: libgssapi_krb5.so: cannot open shared object file: No such file or directory + broken = true; # }; }; From a6175a477cee80ae0dafeecc10fef2f200644de4 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Wed, 3 May 2017 08:57:06 +0200 Subject: [PATCH 35/38] pythonPackages.pivy: disable on 3.x --- pkgs/top-level/python-packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d57c47a4141..c368a47487b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -31302,6 +31302,7 @@ EOF rev = "8eab90908f2a3adcc414347566f4434636202344"; sha256 = "18n14ha2d3j3ghg2f2aqnf2mks94nn7ma9ii7vkiwcay93zm82cf"; }; + disabled = isPy3k; # Judging from SyntaxError buildInputs = with self; [ pkgs.swig1 pkgs.coin3d pkgs.soqt pkgs.mesa pkgs.xorg.libXi ]; }; From cebce78be926f936ac3bd3a9f813c961b5d2d4a4 Mon Sep 17 00:00:00 2001 From: Cray Elliott Date: Wed, 3 May 2017 00:05:08 -0700 Subject: [PATCH 36/38] mwprocapture: fix compile on linux 4.11 --- .../linux/mwprocapture/default.nix | 2 ++ .../mwprocapture/linux_4_11_include_fix.patch | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/os-specific/linux/mwprocapture/linux_4_11_include_fix.patch diff --git a/pkgs/os-specific/linux/mwprocapture/default.nix b/pkgs/os-specific/linux/mwprocapture/default.nix index f09e9543c48..bed40fd02e4 100644 --- a/pkgs/os-specific/linux/mwprocapture/default.nix +++ b/pkgs/os-specific/linux/mwprocapture/default.nix @@ -23,6 +23,8 @@ stdenv.mkDerivation rec { sha256 = "0i1y50mf559flhxgaxy2gdpa7dvpp12ix9xfzgxa61rc135x0im4"; }; + patches = [ ./linux_4_11_include_fix.patch ]; + preConfigure = '' cd ./src diff --git a/pkgs/os-specific/linux/mwprocapture/linux_4_11_include_fix.patch b/pkgs/os-specific/linux/mwprocapture/linux_4_11_include_fix.patch new file mode 100644 index 00000000000..726efd9f537 --- /dev/null +++ b/pkgs/os-specific/linux/mwprocapture/linux_4_11_include_fix.patch @@ -0,0 +1,30 @@ +diff -Naur ProCaptureForLinux_3269/src/sources/avstream/capture.c ProCaptureForLinux_3269_new/src/sources/avstream/capture.c +--- ProCaptureForLinux_3269/src/sources/avstream/capture.c 2016-12-12 17:17:18.000000000 -0800 ++++ ProCaptureForLinux_3269_new/src/sources/avstream/capture.c 2017-05-02 23:58:28.270827491 -0700 +@@ -154,7 +154,9 @@ + if (IS_ERR_OR_NULL(fp)) + return IS_ERR(fp) ? PTR_ERR(fp) : -1; + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0) ++ ret = vfs_getattr(&fp->f_path, &stat, STATX_BASIC_STATS, AT_STATX_SYNC_AS_STAT); ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0) + ret = vfs_getattr(&fp->f_path, &stat); + #else + ret = vfs_getattr(fp->f_path.mnt, fp->f_path.dentry, &stat); +diff -Naur ProCaptureForLinux_3269/src/sources/ospi/ospi-linux.c ProCaptureForLinux_3269_new/src/sources/ospi/ospi-linux.c +--- ProCaptureForLinux_3269/src/sources/ospi/ospi-linux.c 2016-12-12 17:17:18.000000000 -0800 ++++ ProCaptureForLinux_3269_new/src/sources/ospi/ospi-linux.c 2017-05-02 23:51:02.197633628 -0700 +@@ -21,6 +21,12 @@ + #include + #include + ++// some functions were moved from linux/sched.h out to their own headers in 4.11.x ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0) ++#include ++#include ++#endif ++ + unsigned int debug_level = 0; + + struct kmem_cache *g_spin_cache = NULL; From 52b1995250c5dd7443c69818d469ef7db0299ffd Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Wed, 3 May 2017 09:42:09 +0200 Subject: [PATCH 37/38] pythonPackages.os-testr: mark as broken --- pkgs/top-level/python-packages.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c368a47487b..0c03eed465e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16668,6 +16668,11 @@ in { propagatedBuildInputs = with self; [ pbr Babel testrepository subunit testtools ]; buildInputs = with self; [ coverage oslosphinx oslotest testscenarios six ddt ]; + + # Requires pbr < 2 + # Or update to latest version but that requires updating the whole of openstack / oslo + meta.broken = true; + }; bandit = buildPythonPackage rec { From 664ff4069cb87aa4ab94f0e885ed1dab127bee15 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Wed, 3 May 2017 09:52:53 +0200 Subject: [PATCH 38/38] pythonPackages.magic-wormhole: fix build - fixes build - use buildPythonPackage and pass in individual packages As mentioned in https://github.com/NixOS/nixpkgs/pull/20722 this packages is both an application and a library. If a package is both then we use buildPythonPackage and put it in python-packages.nix. That way we can guarantee we use the correct version of dependencies when using it as a library. Unfortunately, it does mean the name of the package is prefixed with `pythonX.X-`. --- .../python-modules/magic-wormhole/default.nix | 34 ++++++++++++++----- pkgs/top-level/python-packages.nix | 4 +-- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/magic-wormhole/default.nix b/pkgs/development/python-modules/magic-wormhole/default.nix index 483e9aa3a3b..99da5e83a87 100644 --- a/pkgs/development/python-modules/magic-wormhole/default.nix +++ b/pkgs/development/python-modules/magic-wormhole/default.nix @@ -1,18 +1,34 @@ -{ stdenv, fetchurl, nettools, glibcLocales, pythonPackages }: +{ lib +, buildPythonPackage +, fetchPypi +, nettools +, glibcLocales +, autobahn +, cffi +, click +, hkdf +, pynacl +, spake2 +, tqdm +, python +, mock +}: -pythonPackages.buildPythonApplication rec { - name = "magic-wormhole-${version}"; +buildPythonPackage rec { + pname = "magic-wormhole"; version = "0.8.1"; + name = "${pname}-${version}"; - src = fetchurl { - url = "mirror://pypi/m/magic-wormhole/${name}.tar.gz"; + src = fetchPypi { + inherit pname version; sha256 = "1yh5nbhh9z1am2pqnb5qqyq1zjl1m7z6jnkmvry2q14qwspw9had"; }; + checkInputs = [ mock ]; buildInputs = [ nettools glibcLocales ]; - propagatedBuildInputs = with pythonPackages; [ autobahn cffi click hkdf pynacl spake2 tqdm ]; + propagatedBuildInputs = [ autobahn cffi click hkdf pynacl spake2 tqdm ]; - patchPhase = '' + postPatch = '' sed -i -e "s|'ifconfig'|'${nettools}/bin/ifconfig'|" src/wormhole/ipaddrs.py sed -i -e "s|if (os.path.dirname(os.path.abspath(wormhole))|if not os.path.abspath(wormhole).startswith('/nix/store') and (os.path.dirname(os.path.abspath(wormhole))|" src/wormhole/test/test_scripts.py # XXX: disable one test due to warning: @@ -24,10 +40,10 @@ pythonPackages.buildPythonApplication rec { export PATH="$PATH:$out/bin" export LANG="en_US.UTF-8" export LC_ALL="en_US.UTF-8" - ${pythonPackages.python.interpreter} -m wormhole.test.run_trial wormhole + ${python.interpreter} -m wormhole.test.run_trial wormhole ''; - meta = with stdenv.lib; { + meta = with lib; { description = "Securely transfer data between computers"; homepage = "https://github.com/warner/magic-wormhole"; license = licenses.mit; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0c03eed465e..774ef2fb0fc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -26804,9 +26804,7 @@ EOF }; }); - magic-wormhole = callPackage ../development/python-modules/magic-wormhole { - pythonPackages = self; - }; + magic-wormhole = callPackage ../development/python-modules/magic-wormhole { }; wsgiproxy2 = buildPythonPackage rec { name = "WSGIProxy2-0.4.2";