{ stdenv
, buildPythonPackage
, fetchPypi
, cython
, isPy3k
, simplejson
}:

buildPythonPackage rec {
  pname = "meliae";
  version = "0.4.0.final.0";
  name = "${pname}-${version}";

  src = fetchPypi {
    inherit pname version;
    sha256 = "976519ab02aaa6a8fb5f596dc4dd9f64fc9510b00e054979566e51c9be7cec99";
  };

  disabled = isPy3k;

  doCheck = true;

  checkPhase = ''
    python setup.py build_ext -i
    python run_tests.py
  '';

  checkInputs = [ simplejson ];

  propagatedBuildInputs = [ cython ];

  meta = with stdenv.lib; {
    description = "Python Memory Usage Analyzer";
    homepage = http://launchpad.net/meliae;
    license = licenses.gpl3;
    maintainers = with maintainers; [ xvapx ];
  };
}

Fix version string for download URL

{ stdenv
, buildPythonPackage
, fetchPypi
, cython
, isPy3k
, simplejson
}:

buildPythonPackage rec {
  pname = "meliae";
  version = "0.4.0.final.0";
  name = "${pname}-${version}";

  src = fetchPypi {
    inherit pname;
    # FIXME when updating to the next version: The tarball on pypi is called
    # "meliae-0.4.0.tar.gz" while the version within that tarball is
    # "0.4.0.final.0".
    version = "0.4.0";
    sha256 = "976519ab02aaa6a8fb5f596dc4dd9f64fc9510b00e054979566e51c9be7cec99";
  };

  disabled = isPy3k;

  doCheck = true;

  checkPhase = ''
    python setup.py build_ext -i
    python run_tests.py
  '';

  checkInputs = [ simplejson ];

  propagatedBuildInputs = [ cython ];

  meta = with stdenv.lib; {
    description = "Python Memory Usage Analyzer";
    homepage = http://launchpad.net/meliae;
    license = licenses.gpl3;
    maintainers = with maintainers; [ xvapx ];
  };
}


{ stdenv, fetchFromGitHub, python3Packages }:

let
  pythonPackages = python3Packages;

in pythonPackages.buildPythonPackage rec {
  name = "${pname}-0.1.0";
  pname = "evdevremapkeys";

  src = fetchFromGitHub {
    owner = "philipl";
    repo = pname;
    rev = "68fb618b8142e1b45d7a1e19ea9a5a9bbb206144";
    sha256 = "0c9slflakm5jqd8s1zpxm7gmrrk0335m040d7m70hnsak42jvs2f";
  };

  propagatedBuildInputs = with pythonPackages; [
    pyyaml
    pyxdg
    python-daemon
    evdev
  ];

  meta = with stdenv.lib; {
    homepage = "https://github.com/philipl/evdevremapkeys";
    description = "Daemon to remap events on linux input devices";
    license = licenses.mit;
    maintainers = [ maintainers.q3k ];
    platforms = platforms.linux;
  };
}

Disable tests, remove name use

{ stdenv, fetchFromGitHub, python3Packages }:

python3Packages.buildPythonPackage rec {
  pname = "evdevremapkeys";
  version = "0.1.0";

  src = fetchFromGitHub {
    owner = "philipl";
    repo = pname;
    rev = "68fb618b8142e1b45d7a1e19ea9a5a9bbb206144";
    sha256 = "0c9slflakm5jqd8s1zpxm7gmrrk0335m040d7m70hnsak42jvs2f";
  };

  propagatedBuildInputs = with python3Packages; [
    pyyaml
    pyxdg
    python-daemon
    evdev
  ];

  # hase no tests
  doCheck = false;

  pythonImportsCheck = [ "evdevremapkeys" ];

  meta = with stdenv.lib; {
    homepage = "https://github.com/philipl/evdevremapkeys";
    description = "Daemon to remap events on linux input devices";
    license = licenses.mit;
    maintainers = [ maintainers.q3k ];
    platforms = platforms.linux;
  };
}


{ lib, stdenv, fetchurl, libogg, pkg-config }:

stdenv.mkDerivation rec {
  pname = "libvorbis";
  version = "1.3.7";

  src = fetchurl {
    url = "http://downloads.xiph.org/releases/vorbis/${pname}-${version}.tar.xz";
    sha256 = "0jwmf87x5sdis64rbv0l87mdpah1rbilkkxszipbzg128f9w8g5k";
  };

  outputs = [ "out" "dev" "doc" ];

  nativeBuildInputs = [ pkg-config ];
  propagatedBuildInputs = [ libogg ];

  doCheck = true;

  meta = with lib; {
    description = "Vorbis audio compression reference implementation";
    homepage = "https://xiph.org/vorbis/";
    license = licenses.bsd3;
    maintainers = [ maintainers.ehmry ];
    platforms = platforms.all;
  };
}

Remove flags not recognized by clang

{ lib, stdenv, fetchurl, libogg, pkg-config }:

stdenv.mkDerivation rec {
  pname = "libvorbis";
  version = "1.3.7";

  src = fetchurl {
    url =
      "http://downloads.xiph.org/releases/vorbis/${pname}-${version}.tar.xz";
    sha256 = "0jwmf87x5sdis64rbv0l87mdpah1rbilkkxszipbzg128f9w8g5k";
  };

  outputs = [ "out" "dev" "doc" ];

  nativeBuildInputs = [ pkg-config ];
  propagatedBuildInputs = [ libogg ];

  doCheck = true;

  preConfigure = lib.optionalString (stdenv.cc.isClang or false) ''
    sed s/\-mno\-ieee\-fp// -i {configure,configure.ac}
  '';

  meta = with lib; {
    description = "Vorbis audio compression reference implementation";
    homepage = "https://xiph.org/vorbis/";
    license = licenses.bsd3;
    maintainers = [ maintainers.ehmry ];
    platforms = platforms.all;
  };
}


{stdenv, fetchurl, libnice, pkgconfig, python, glib, gstreamer, gstPluginsBase}:

stdenv.mkDerivation {
  name = "farsight2-0.0.16";

  src = fetchurl {
    url = http://farsight.freedesktop.org/releases/farsight2/farsight2-0.0.16.tar.gz;
    sha256 = "07yjndkx1p7ij1ifxsnbqbr8943wmq768x4812khka7dx6ii1sv9";
  };

  buildInputs = [ libnice pkgconfig python glib gstreamer gstPluginsBase ];

  configureFlags = "--disable-python";

  patches = [./makefile.patch];

  meta = {
    homepage = http://farsight.freedesktop.org/wiki/;
    description = "Audio/Video Communications Framework";
  };
}

Update farsight2 and enable python bindings

{stdenv, fetchurl, libnice, pkgconfig, python, glib, gstreamer, gstPluginsBase,
  pygobject, gst_python}:

stdenv.mkDerivation rec {
  name = "farsight2-0.0.22";

  src = fetchurl {
    url = "http://farsight.freedesktop.org/releases/farsight2/${name}.tar.gz";
    sha256 = "07yjndkx1p7ij1ifxsnbqbr8943wmq768x4812khka7dx6ii1sv9";
  };

  buildInputs = [ libnice pkgconfig python glib gstreamer gstPluginsBase
    pygobject gst_python ];

  preBuild = ''
    sed -e '/^[[] -z/d' -i python/Makefile
    find . -name Makefile -execdir sed -e '/^[.]NOEXPORT:/d' -i '{}' ';'
    find . -name Makefile -execdir sed -r -e 's/^ {8,8}/\t/' -i '{}' ';'
  '';

  patches = [./makefile.patch];

  meta = {
    homepage = http://farsight.freedesktop.org/wiki/;
    description = "Audio/Video Communications Framework";
  };
}


{lib, stdenv, fetchurl}:

stdenv.mkDerivation rec {
  version = "3.99-u4-b5";
  pname = "monkeys-audio";

  patches = [ ./buildfix.diff ];

  src = fetchurl {
    url = "https://deb-multimedia.org/pool/main/m/${pname}/${pname}_${version}.orig.tar.gz";
    sha256 = "0kjfwzfxfx7f958b2b1kf8yj655lp0ppmn0sh57gbkjvj8lml7nz";
  };

  meta = with lib; {
    description = "Lossless audio codec";
    platforms = platforms.linux;
    license = licenses.lgpl2;
    maintainers = [ ];
  };
}

Fix compilation using an older version of gcc

{lib, gcc10Stdenv, fetchurl}:

gcc10Stdenv.mkDerivation rec {
  version = "3.99-u4-b5";
  pname = "monkeys-audio";

  patches = [ ./buildfix.diff ];

  src = fetchurl {
    url = "https://deb-multimedia.org/pool/main/m/${pname}/${pname}_${version}.orig.tar.gz";
    sha256 = "0kjfwzfxfx7f958b2b1kf8yj655lp0ppmn0sh57gbkjvj8lml7nz";
  };

  meta = with lib; {
    description = "Lossless audio codec";
    platforms = platforms.linux;
    license = licenses.lgpl2;
    maintainers = [ ];
  };
}


{ lib, stdenv, fetchFromGitHub, cmake, fetchpatch }:

stdenv.mkDerivation rec {
  pname = "aws-checksums";
  version = "0.1.7";

  src = fetchFromGitHub {
    owner = "awslabs";
    repo = pname;
    rev = "v${version}";
    sha256 = "0am1hfzqir44zcx6y6c7jw74qvbsav8ppr9dahpdh3ac95cjf38a";
  };

  nativeBuildInputs = [ cmake ];

  # can be removed once https://github.com/awslabs/aws-checksums/pull/40 gets merged, and version bumped
  patches = [
    (fetchpatch {
      url = "https://github.com/awslabs/aws-checksums/pull/40/commits/fb5a57b3c072bd88e45de76fbb76bdc89c67b193.patch";
      sha256 = "056f9kyg1c4lwjq8n0r28w1n3zbwrwpi1wbqabk99gaayg46x35a";
    })
  ];

  cmakeFlags = [ "-DBUILD_SHARED_LIBS:BOOL=ON" ];

  meta = with lib; {
    description = "HW accelerated CRC32c and CRC32";
    homepage = "https://github.com/awslabs/aws-checksums";
    license = licenses.asl20;
    platforms = platforms.unix;
    maintainers = with maintainers; [ orivej eelco ];
  };
}

Revert "aws-checksums: fix build with cmake 3.19"

{ lib, stdenv, fetchFromGitHub, cmake }:

stdenv.mkDerivation rec {
  pname = "aws-checksums";
  version = "0.1.7";

  src = fetchFromGitHub {
    owner = "awslabs";
    repo = pname;
    rev = "v${version}";
    sha256 = "0am1hfzqir44zcx6y6c7jw74qvbsav8ppr9dahpdh3ac95cjf38a";
  };

  nativeBuildInputs = [ cmake ];

  cmakeFlags = [ "-DBUILD_SHARED_LIBS:BOOL=ON" ];

  meta = with lib; {
    description = "HW accelerated CRC32c and CRC32";
    homepage = "https://github.com/awslabs/aws-checksums";
    license = licenses.asl20;
    platforms = platforms.unix;
    maintainers = with maintainers; [ orivej eelco ];
  };
}


{ stdenv, fetchurl, pkgconfig, cairo, libxml2, libxslt, glib, gtk, pango, atk
, gnome-doc-utils, intltool, libglade, libX11, which }:

stdenv.mkDerivation {
  name = "zenity-2.32.1";

  src = fetchurl {
    url = mirror://gnome/sources/zenity/2.32/zenity-2.32.1.tar.bz2;
    sha256 = "1b0qxb07wif0ds1pl8xk3fq9p874j89rf718lii4ndh7382bwf48";
  };

  configureFlags = "--disable-scrollkeeper";
  buildInputs = [ gtk libglade libxml2 libxslt libX11 ];

  nativeBuildInputs = [ pkgconfig intltool gnome-doc-utils which ];
}

Add docbook_xml_dtd_412 to prevent build from attempting to reference DTD from network and failing.

{ stdenv, fetchurl, pkgconfig, cairo, libxml2, libxslt, glib, gtk, pango, atk
, gnome-doc-utils, intltool, libglade, libX11, which, docbook_xml_dtd_412 }:

stdenv.mkDerivation {
  name = "zenity-2.32.1";

  src = fetchurl {
    url = mirror://gnome/sources/zenity/2.32/zenity-2.32.1.tar.bz2;
    sha256 = "1b0qxb07wif0ds1pl8xk3fq9p874j89rf718lii4ndh7382bwf48";
  };

  configureFlags = "--disable-scrollkeeper";
  buildInputs = [ gtk libglade libxml2 libxslt libX11 docbook_xml_dtd_412 ];

  nativeBuildInputs = [ pkgconfig intltool gnome-doc-utils which ];
}


{stdenv, fetchurl}:

stdenv.mkDerivation rec {
  name = "rcs-5.8";

  src = fetchurl {
    url = "mirror://gnu/rcs/${name}.tar.gz";
    sha256 = "0q12nlghv4khxw5lk0y4949caghzg4jg0ripddi2h3q75vmfh6vh";
  };

  doCheck = true;

  meta = {
    homepage = http://www.gnu.org/software/rcs/;
    description = "GNU RCS, a revision control system";
    longDescription =
      '' The GNU Revision Control System (RCS) manages multiple revisions of
         files. RCS automates the storing, retrieval, logging,
         identification, and merging of revisions.  RCS is useful for text
         that is revised frequently, including source code, programs,
         documentation, graphics, papers, and form letters.
      '';

    license = "GPLv3+";
    maintainers = with stdenv.lib.maintainers; [ eelco simons ludo ];
    platforms = stdenv.lib.platforms.all;
  };
}

Update to 5.8.1 and fix build

{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "rcs-5.8.1";

  src = fetchurl {
    url = "mirror://gnu/rcs/${name}.tar.gz";
    sha256 = "1b1y6s4gy3miv2bvx0z01kvnv58h35sw766lccdkxkalk43cml04";
  };

  doCheck = true;

  meta = {
    homepage = http://www.gnu.org/software/rcs/;
    description = "GNU RCS, a revision control system";
    longDescription =
      '' The GNU Revision Control System (RCS) manages multiple revisions of
         files. RCS automates the storing, retrieval, logging,
         identification, and merging of revisions.  RCS is useful for text
         that is revised frequently, including source code, programs,
         documentation, graphics, papers, and form letters.
      '';

    license = "GPLv3+";
    maintainers = with stdenv.lib.maintainers; [ eelco simons ludo ];
    platforms = stdenv.lib.platforms.all;
  };
}


{ stdenv
, buildPythonPackage
, fetchPypi
, mock
, nose
, pep8
, pylint
, mccabe
}:

buildPythonPackage rec {
  version = "3.0.1";
  pname = "pamqp";

  src = fetchPypi {
    inherit pname version;
    sha256 = "0a9b49bde3f554ec49b47ebdb789133979985f24d5f4698935ed589a2d4392a4";
  };

  buildInputs = [ mock nose pep8 pylint mccabe ];

  meta = with stdenv.lib; {
    description = "RabbitMQ Focused AMQP low-level library";
    homepage = "https://pypi.python.org/pypi/pamqp";
    license = licenses.bsd3;
  };

}

Revert "python: pamqp: 2.3.0 -> 3.0.1"

{ stdenv
, buildPythonPackage
, fetchPypi
, mock
, nose
, pep8
, pylint
, mccabe
}:

buildPythonPackage rec {
  version = "2.3.0";
  pname = "pamqp";

  src = fetchPypi {
    inherit pname version;
    sha256 = "1s4lwbsiikz3czqad7jarb7k303q0wamla0rirghvwl9bslgbl2w";
  };

  buildInputs = [ mock nose pep8 pylint mccabe ];

  meta = with stdenv.lib; {
    description = "RabbitMQ Focused AMQP low-level library";
    homepage = "https://pypi.python.org/pypi/pamqp";
    license = licenses.bsd3;
  };

}


{ buildRubyGem, makeWrapper, ruby, coreutils }:

buildRubyGem rec {
  inherit ruby;
  name = "${gemName}-${version}";
  gemName = "bundler";
  version = "1.16.1";
  source.sha256 = "1s2nq4qnffxg3kwrk7cnwxcvfihlhxm9absl2l6d3qckf3sy1f22";
  dontPatchShebangs = true;

  postFixup = ''
    sed -i -e "s/activate_bin_path/bin_path/g" $out/bin/bundle
  '';
}

Revert "bundler: 1.14.6 -> 1.16.1"

{ buildRubyGem, makeWrapper, ruby, coreutils }:

buildRubyGem rec {
  inherit ruby;
  name = "${gemName}-${version}";
  gemName = "bundler";
  version = "1.14.6";
  source.sha256 = "0h3x2csvlz99v2ryj1w72vn6kixf7rl35lhdryvh7s49brnj0cgl";
  dontPatchShebangs = true;

  postFixup = ''
    sed -i -e "s/activate_bin_path/bin_path/g" $out/bin/bundle
  '';
}


{stdenv, fetchurl, libtool}:

stdenv.mkDerivation {
  name = "libxmi-1.2";

  src = fetchurl {
    url = mirror://gnu/libxmi/libxmi-1.2.tar.gz;
    sha256 = "03d4ikh29l38rl1wavb0icw7m5pp7yilnv7bb2k8qij1dinsymlx";
  };

  # For the x86_64 linux arch to be recognized by 'configure'
  preConfigure = "cp ${libtool}/share/libtool/config.sub .";

  meta = {
    description = "Library for rasterizing 2-D vector graphics";
    homepage = http://www.gnu.org/software/libxmi/;
    license = "GPLv2";
  };
}

Fix for GNU Libtool 2.2.6a.

{stdenv, fetchurl, libtool}:

stdenv.mkDerivation {
  name = "libxmi-1.2";

  src = fetchurl {
    url = mirror://gnu/libxmi/libxmi-1.2.tar.gz;
    sha256 = "03d4ikh29l38rl1wavb0icw7m5pp7yilnv7bb2k8qij1dinsymlx";
  };

  # For the x86_64 linux arch to be recognized by 'configure'
  preConfigure = "cp ${libtool}/share/libtool/config/config.sub .";

  meta = {
    description = "Library for rasterizing 2-D vector graphics";
    homepage = http://www.gnu.org/software/libxmi/;
    license = "GPLv2";
  };
}


{ stdenv
, fetchurl
, bzip2
, freetype
, graphviz
, ghostscript
, libjpeg
, libpng
, libtiff
, libxml2
, zlib
, libtool
, jasper
, libX11
, tetex ? null
, librsvg ? null
}:

let
  version = "6.5.9-1";
in
stdenv.mkDerivation rec {
  name = "ImageMagick-${version}";

  src = fetchurl {
    url = "mirror://imagemagick/${name}.tar.bz2";
    sha256 = "0a4yhhfqagz28yccydngi31050101jfmq5ljln61g69yy6m47ifg";
  };

  configureFlags = ''
    --with-gs-font-dir=${ghostscript}/share/ghostscript/fonts
    --with-gslib
    ${if tetex != null then "--with-frozenpaths" else ""}
  '';

  buildInputs =
    [ bzip2 freetype graphviz ghostscript libjpeg libpng
      libtiff libxml2 zlib tetex librsvg libtool jasper libX11
    ];

  preConfigure = if tetex != null then
    ''
      export DVIDecodeDelegate=${tetex}/bin/dvips
    '' else "";

  meta = {
    homepage = http://www.imagemagick.org;
  };
}

Advance version of Imagemagick to 6.6.5-4 .

{ stdenv
, fetchurl
, bzip2
, freetype
, graphviz
, ghostscript
, libjpeg
, libpng
, libtiff
, libxml2
, zlib
, libtool
, jasper
, libX11
, tetex ? null
, librsvg ? null
}:

let
  version = "6.6.5-4";
in
stdenv.mkDerivation rec {
  name = "ImageMagick-${version}";

  src = fetchurl {
    url = "mirror://imagemagick/${name}.tar.bz2";
    sha256 = "1s3l98xc1gnxi2wdg3sy9723f6qf5yk81wln8ghn2z9kvi09w7gw";
  };

  configureFlags = ''
    --with-gs-font-dir=${ghostscript}/share/ghostscript/fonts
    --with-gslib
    --with-frozenpaths
    ${if librsvg != null then "--with-rsvg" else ""}
  '';

  buildInputs =
    [ bzip2 freetype graphviz ghostscript libjpeg libpng
      libtiff libxml2 zlib tetex librsvg libtool jasper libX11
    ];

  preConfigure = if tetex != null then
    ''
      export DVIDecodeDelegate=${tetex}/bin/dvips
    '' else "";

  meta = {
    homepage = http://www.imagemagick.org;
  };
}


{ stdenv, buildPythonPackage
, aiohttp
, aiozeroconf
, asynctest
, cryptography
, deepdiff
, netifaces
, protobuf
, pytest
, pytest-aiohttp
, pytest-asyncio
, pytestrunner
, srptools
, zeroconf
, fetchFromGitHub
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "pyatv";
  version = "0.7.5";
  src = fetchFromGitHub {
    owner = "postlund";
    repo = pname;
    rev = "v${version}";
    sha256 = "06qj6r9kcal2nimg8rpjfid8rnlz43l7hn0v9v1mpayjmv2fl8sp";
  };

  nativeBuildInputs = [ pytestrunner];

  propagatedBuildInputs = [
    aiozeroconf
    srptools
    aiohttp
    protobuf
    cryptography
    netifaces
    zeroconf
  ];

  checkInputs = [
    deepdiff
    pytest
    pytest-aiohttp
    pytest-asyncio
    pytestCheckHook
  ];

  meta = with stdenv.lib; {
    description = "A python client library for the Apple TV";
    homepage = "https://github.com/postlund/pyatv";
    license = licenses.mit;
    maintainers = with maintainers; [ elseym ];
  };
}

Fix test hangs on darwin with sandbox

{ stdenv, buildPythonPackage
, aiohttp
, aiozeroconf
, asynctest
, cryptography
, deepdiff
, netifaces
, protobuf
, pytest
, pytest-aiohttp
, pytest-asyncio
, pytestrunner
, srptools
, zeroconf
, fetchFromGitHub
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "pyatv";
  version = "0.7.5";
  src = fetchFromGitHub {
    owner = "postlund";
    repo = pname;
    rev = "v${version}";
    sha256 = "06qj6r9kcal2nimg8rpjfid8rnlz43l7hn0v9v1mpayjmv2fl8sp";
  };

  nativeBuildInputs = [ pytestrunner];

  propagatedBuildInputs = [
    aiozeroconf
    srptools
    aiohttp
    protobuf
    cryptography
    netifaces
    zeroconf
  ];

  checkInputs = [
    deepdiff
    pytest
    pytest-aiohttp
    pytest-asyncio
    pytestCheckHook
  ];

  __darwinAllowLocalNetworking = true;

  meta = with stdenv.lib; {
    description = "A python client library for the Apple TV";
    homepage = "https://github.com/postlund/pyatv";
    license = licenses.mit;
    maintainers = with maintainers; [ elseym ];
  };
}


{ lib, fetchPypi, buildPythonPackage, pythonOlder, attrs }:

buildPythonPackage rec {
  pname = "aiorpcx";
  version = "0.18.3";

  src = fetchPypi {
    inherit version;
    pname = "aiorpcX";
    sha256 = "0k545hc7wl6sh1svydzbv6x7sx5pig2pqkl3yxs9riwmvzawx9xp";
  };

  propagatedBuildInputs = [ attrs ];

  disabled = pythonOlder "3.6";

  # Checks needs internet access
  doCheck = false;

  meta = {
    description = "Transport, protocol and framing-independent async RPC client and server implementation";
    license = lib.licenses.mit;
    homepage = https://github.com/kyuupichan/aiorpcX;
  };
}

Revert "python37Packages.aiorpcx: 0.17.0 -> 0.18.3"

{ lib, fetchPypi, buildPythonPackage, pythonOlder, attrs }:

buildPythonPackage rec {
  pname = "aiorpcx";
  version = "0.17.0";

  src = fetchPypi {
    inherit version;
    pname = "aiorpcX";
    sha256 = "14np5r75rs0v45vsv20vbzmnv3qisvm9mdllj1j9s1633cvcik0k";
  };

  propagatedBuildInputs = [ attrs ];

  disabled = pythonOlder "3.6";

  # Checks needs internet access
  doCheck = false;

  meta = {
    description = "Transport, protocol and framing-independent async RPC client and server implementation";
    license = lib.licenses.mit;
    homepage = https://github.com/kyuupichan/aiorpcX;
  };
}


{ buildPythonPackage
, lib
, fetchPypi
, mock
, pytest_27
, sh
, coverage
, docopt
, requests
, git
}:

buildPythonPackage rec {
  pname = "coveralls";
  name = "${pname}-python-${version}";
  version = "1.2.0";

  # wanted by tests
  src = fetchPypi {
    inherit pname version;
    sha256 = "510682001517bcca1def9f6252df6ce730fcb9831c62d9fff7c7d55b6fdabdf3";
  };

  buildInputs = [
    mock
    sh
    pytest_27
    git
  ];

  # FIXME: tests requires .git directory to be present
  doCheck = false;

  checkPhase = ''
    python setup.py test
  '';

  propagatedBuildInputs = [
    coverage
    docopt
    requests
  ];

  meta = {
    description = "Show coverage stats online via coveralls.io";
    homepage = https://github.com/coveralls-clients/coveralls-python;
    license = lib.licenses.mit;
  };
}

Add missing dependencies to fix build

{ buildPythonPackage
, lib
, fetchPypi
, mock
, pytest
, pytestrunner
, sh
, coverage
, docopt
, requests
, urllib3
, git
, isPy3k
}:

buildPythonPackage rec {
  pname = "coveralls";
  name = "${pname}-python-${version}";
  version = "1.2.0";

  # wanted by tests
  src = fetchPypi {
    inherit pname version;
    sha256 = "510682001517bcca1def9f6252df6ce730fcb9831c62d9fff7c7d55b6fdabdf3";
  };

  checkInputs = [
    mock
    sh
    pytest
    git
  ];

  buildInputs = [
    pytestrunner
  ];

  # FIXME: tests requires .git directory to be present
  doCheck = false;

  checkPhase = ''
    python setup.py test
  '';

  propagatedBuildInputs = [
    coverage
    docopt
    requests
  ] ++ lib.optional (!isPy3k) urllib3;

  meta = {
    description = "Show coverage stats online via coveralls.io";
    homepage = https://github.com/coveralls-clients/coveralls-python;
    license = lib.licenses.mit;
  };
}


{ lib
, buildPythonPackage
, fetchFromGitHub
, click
, h11
, httptools
, uvloop
, websockets
, wsproto
, pytest
, requests
, isPy27
}:

buildPythonPackage rec {
  pname = "uvicorn";
  version = "0.11.5";
  disabled = isPy27;

  src = fetchFromGitHub {
    owner = "encode";
    repo = pname;
    rev = version;
    sha256 = "0cf0vw6kzxwlkvk5gw85wv3kg1kdil0wkq3s7rmxpvrk6gjk8jvq";
  };

  propagatedBuildInputs = [
    click
    h11
    httptools
    uvloop
    websockets
    wsproto
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace "h11==0.8.*" "h11" \
      --replace "httptools==0.0.13" "httptools"
  '';

  checkInputs = [ pytest requests ];
  # watchgod required the watchgod package, which isn't available in nixpkgs
  checkPhase = ''
    pytest --ignore=tests/supervisors/test_watchgodreload.py
  '';

  meta = with lib; {
    homepage = "https://www.uvicorn.org/";
    description = "The lightning-fast ASGI server";
    license = licenses.bsd3;
    maintainers = with maintainers; [ wd15 ];
  };
}

Disable hanging tests on Darwin

{ stdenv
, buildPythonPackage
, fetchFromGitHub
, click
, h11
, httptools
, uvloop
, websockets
, wsproto
, pytest
, requests
, isPy27
}:

buildPythonPackage rec {
  pname = "uvicorn";
  version = "0.11.5";
  disabled = isPy27;

  src = fetchFromGitHub {
    owner = "encode";
    repo = pname;
    rev = version;
    sha256 = "0cf0vw6kzxwlkvk5gw85wv3kg1kdil0wkq3s7rmxpvrk6gjk8jvq";
  };

  propagatedBuildInputs = [
    click
    h11
    httptools
    uvloop
    websockets
    wsproto
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace "h11==0.8.*" "h11" \
      --replace "httptools==0.0.13" "httptools"
  '';

  checkInputs = [ pytest requests ];

  doCheck = !stdenv.isDarwin;

  # watchgod required the watchgod package, which isn't available in nixpkgs
  checkPhase = ''
    pytest --ignore=tests/supervisors/test_watchgodreload.py
  '';

  meta = with stdenv.lib; {
    homepage = "https://www.uvicorn.org/";
    description = "The lightning-fast ASGI server";
    license = licenses.bsd3;
    maintainers = with maintainers; [ wd15 ];
  };
}


{stdenv, fetchurl, cmake, bison, ncurses, openssl, readline, zlib, darwinInstallNameToolUtility, perl}:

# Note: zlib is not required; MySQL can use an internal zlib.

stdenv.mkDerivation {
  name = "mysql-5.5.20";

  src = fetchurl {
    url = ftp://mirror.leaseweb.com/mysql/Downloads/MySQL-5.5/mysql-5.5.20.tar.gz;
    sha256 = "03jl60mzrsd1jb8fvkz6c8j2239b37k8n1i07jk1q4yk58aq8ynh";
  };

  buildInputs = [ cmake bison ncurses openssl readline zlib ] ++ stdenv.lib.optionals stdenv.isDarwin [ darwinInstallNameToolUtility perl ];

  cmakeFlags = "-DWITH_SSL=yes -DWITH_READLINE=yes -DWITH_EMBEDDED_SERVER=yes -DWITH_ZLIB=yes -DINSTALL_SCRIPTDIR=bin -DHAVE_IPV6=yes";

  NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";

  postInstall = ''
    sed -i -e "s|basedir=\"\"|basedir=\"$out\"|" $out/bin/mysql_install_db
    rm -rf $out/mysql-test $out/sql-bench
  '';

  meta = {
    homepage = http://www.mysql.com/;
    description = "The world's most popular open source database";
  };
}

Update mysql 5.5 to 5.5.23 and fix no longer responding URL.

{stdenv, fetchurl, cmake, bison, ncurses, openssl, readline, zlib, darwinInstallNameToolUtility, perl}:

# Note: zlib is not required; MySQL can use an internal zlib.

stdenv.mkDerivation {
  name = "mysql-5.5.23";

  src = fetchurl {
    url = ftp://ftp.inria.fr/pub/MySQL/Downloads/MySQL-5.5/mysql-5.5.23.tar.gz;
    sha256 = "0sklcz6miff7nb6bi1pqncgjv819255y7if6jxcqgiqs50z319i0";
  };

  buildInputs = [ cmake bison ncurses openssl readline zlib ] ++ stdenv.lib.optionals stdenv.isDarwin [ darwinInstallNameToolUtility perl ];

  cmakeFlags = "-DWITH_SSL=yes -DWITH_READLINE=yes -DWITH_EMBEDDED_SERVER=yes -DWITH_ZLIB=yes -DINSTALL_SCRIPTDIR=bin -DHAVE_IPV6=yes";

  NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";

  postInstall = ''
    sed -i -e "s|basedir=\"\"|basedir=\"$out\"|" $out/bin/mysql_install_db
    rm -rf $out/mysql-test $out/sql-bench
  '';

  meta = {
    homepage = http://www.mysql.com/;
    description = "The world's most popular open source database";
  };
}


{ cabal, bytestringLexing, cairo, Chart, colour, dataAccessor
, dataAccessorTemplate, regexTdfa, strptime, time, transformers
, vcsRevision
}:

cabal.mkDerivation (self: {
  pname = "timeplot";
  version = "1.0.21";
  sha256 = "0x9f95w235yijp98xx9nry0ibsxr0iyshk6cd89n51xrk1zpk41l";
  isLibrary = false;
  isExecutable = true;
  buildDepends = [
    bytestringLexing cairo Chart colour dataAccessor
    dataAccessorTemplate regexTdfa strptime time transformers
    vcsRevision
  ];
  meta = {
    homepage = "http://haskell.org/haskellwiki/Timeplot";
    description = "A tool for visualizing time series from log files";
    license = self.stdenv.lib.licenses.bsd3;
    platforms = self.ghc.meta.platforms;
  };
})

Update timeplot to 1.0.22 to fix building with Chart-1.0

{ cabal, bytestringLexing, cairo, Chart, ChartCairo, colour
, dataDefault, regexTdfa, strptime, time, transformers
, vcsRevision
}:

cabal.mkDerivation (self: {
  pname = "timeplot";
  version = "1.0.22";
  sha256 = "1dp1prcx3d6a0fr3xrdj6flp27sy7qbng5bbdjgjbb7rq8497if9";
  isLibrary = false;
  isExecutable = true;
  buildDepends = [
    bytestringLexing cairo Chart ChartCairo colour
    dataDefault regexTdfa strptime time transformers
    vcsRevision
  ];
  meta = {
    homepage = "http://haskell.org/haskellwiki/Timeplot";
    description = "A tool for visualizing time series from log files";
    license = self.stdenv.lib.licenses.bsd3;
    platforms = self.ghc.meta.platforms;
  };
})


{ lib
, fetchFromGitHub
, stdenv
, cmake
, gperftools

, withGPerfTools ? true
}:

stdenv.mkDerivation rec {
  pname = "sentencepiece";
  version = "0.1.95";

  src = fetchFromGitHub {
    owner = "google";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-xpVihdSpjO/mJWM5nzVg9CND3oAEdfCwXQW0jqLVDBA=";
  };

  nativeBuildInputs = [ cmake ];

  buildInputs = lib.optionals withGPerfTools [ gperftools ];

  outputs = [ "bin" "dev" "out" ];

  meta = with stdenv.lib; {
    homepage = "https://github.com/google/sentencepiece";
    description = "Unsupervised text tokenizer for Neural Network-based text generation";
    license = licenses.asl20;
    platforms = platforms.unix;
    maintainers = with maintainers; [ danieldk pashashocky ];
  };
}

Revert "sentencepiece: 0.1.94 -> 0.1.95"

{ lib
, fetchFromGitHub
, stdenv
, cmake
, gperftools

, withGPerfTools ? true
}:

stdenv.mkDerivation rec {
  pname = "sentencepiece";
  version = "0.1.94";

  src = fetchFromGitHub {
    owner = "google";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256:11cqw4hx33gw2jmrg11jyp7fj9pwzwjwzqcn24jfsbgh6n8gks5x";
  };

  nativeBuildInputs = [ cmake ];

  buildInputs = lib.optionals withGPerfTools [ gperftools ];

  outputs = [ "bin" "dev" "out" ];

  meta = with stdenv.lib; {
    homepage = "https://github.com/google/sentencepiece";
    description = "Unsupervised text tokenizer for Neural Network-based text generation";
    license = licenses.asl20;
    platforms = platforms.unix;
    maintainers = with maintainers; [ danieldk pashashocky ];
  };
}


{ stdenv, fetchurl }:

let version = "0.03.13"; in
stdenv.mkDerivation rec {
  name = "stress-ng-${version}";

  src = fetchurl {
    url = "http://kernel.ubuntu.com/~cking/tarballs/stress-ng/${name}.tar.gz";
    sha256 = "1ppf50rwq784qri62s2yvxif7gcrazhd6xin04yzavjdmwjayggz";
  };

  patchPhase = ''
    substituteInPlace Makefile --replace "/usr" ""
  '';

  enableParallelBuilding = true;

  makeFlags = "DESTDIR=$(out)";

  meta = with stdenv.lib; {
    description = "Stress test a computer system";
    longDescription = ''
      Stress test a computer system in various selectable ways, by exercising
      various physical subsystems of a computer as well as the various
      operating system kernel interfaces. Stress-ng features:
      - over 60 different stress tests
      - over 50 CPU specific stress tests that exercise floating point,
        integer, bit manipulation and control flow
      - over 20 virtual memory stress tests
      stress-ng was originally intended to make a machine work hard and trip
      hardware issues such as thermal overruns as well as operating system
      bugs that only occur when a system is being thrashed hard.
    '';
    homepage = http://kernel.ubuntu.com/~cking/stress-ng;
    license = with licenses; gpl2Plus;
    platforms = with platforms; linux;
    maintainers = with maintainers; [ nckx ];
  };
}

Update stress-ng 0.03.13 -> 0.03.14

{ stdenv, fetchurl }:

let version = "0.03.14"; in
stdenv.mkDerivation rec {
  name = "stress-ng-${version}";

  src = fetchurl {
    url = "http://kernel.ubuntu.com/~cking/tarballs/stress-ng/${name}.tar.gz";
    sha256 = "049c541p2m6mjgvi8nri6rmc1yjvyg1x0gkgdq9axzvbxh7bcgh1";
  };

  patchPhase = ''
    substituteInPlace Makefile --replace "/usr" ""
  '';

  enableParallelBuilding = true;

  makeFlags = "DESTDIR=$(out)";

  meta = with stdenv.lib; {
    description = "Stress test a computer system";
    longDescription = ''
      Stress test a computer system in various selectable ways, by exercising
      various physical subsystems of a computer as well as the various
      operating system kernel interfaces. Stress-ng features:
      - over 60 different stress tests
      - over 50 CPU specific stress tests that exercise floating point,
        integer, bit manipulation and control flow
      - over 20 virtual memory stress tests
      stress-ng was originally intended to make a machine work hard and trip
      hardware issues such as thermal overruns as well as operating system
      bugs that only occur when a system is being thrashed hard.
    '';
    homepage = http://kernel.ubuntu.com/~cking/stress-ng;
    license = with licenses; gpl2Plus;
    platforms = with platforms; linux;
    maintainers = with maintainers; [ nckx ];
  };
}


{ stdenv, fetchurl, makeWrapper, jre, utillinux }:
stdenv.mkDerivation rec {
  name = "elasticsearch-1.0.1";

  src = fetchurl {
    url = "https://download.elasticsearch.org/elasticsearch/elasticsearch/${name}.tar.gz";
    sha256 = "0nwv7llw7gk94alfcpxxy0lybhnw7fggv30v7ylsxn20id9g7kba";
  };

  patches = [ ./es-home.patch ];

  buildInputs = [ makeWrapper jre utillinux ];

  installPhase = ''
    mkdir -p $out
    cp -R bin config lib $out

    # don't want to have binary with name plugin
    mv $out/bin/plugin $out/bin/elasticsearch-plugin

    # set ES_CLASSPATH and JAVA_HOME
    wrapProgram $out/bin/elasticsearch \
      --prefix ES_CLASSPATH : "$out/lib/${name}.jar":"$out/lib/*":"$out/lib/sigar/*" \
      --prefix PATH : "${utillinux}/bin/" \
      --set JAVA_HOME "${jre}"
    wrapProgram $out/bin/elasticsearch-plugin \
      --prefix ES_CLASSPATH : "$out/lib/${name}.jar":"$out/lib/*":"$out/lib/sigar/*" --set JAVA_HOME "${jre}"
  '';

  meta = {
    description = "Open Source, Distributed, RESTful Search Engine";
    license = "ASL2.0";
  };
}

Revert "Revert "elasticsearch: update from 1.0.1 to 1.2.1, potentially fixes CVE-2013-5307""

{ stdenv, fetchurl, makeWrapper, jre, utillinux }:
stdenv.mkDerivation rec {
  name = "elasticsearch-1.2.1";

  src = fetchurl {
    url = "https://download.elasticsearch.org/elasticsearch/elasticsearch/${name}.tar.gz";
    sha256 = "11lirxl0hb0xfd57accsgldq1adrlv9pak2520jll2sj5gg71cmj";
  };

  patches = [ ./es-home.patch ];

  buildInputs = [ makeWrapper jre utillinux ];

  installPhase = ''
    mkdir -p $out
    cp -R bin config lib $out

    # don't want to have binary with name plugin
    mv $out/bin/plugin $out/bin/elasticsearch-plugin

    # set ES_CLASSPATH and JAVA_HOME
    wrapProgram $out/bin/elasticsearch \
      --prefix ES_CLASSPATH : "$out/lib/${name}.jar":"$out/lib/*":"$out/lib/sigar/*" \
      --prefix PATH : "${utillinux}/bin/" \
      --set JAVA_HOME "${jre}"
    wrapProgram $out/bin/elasticsearch-plugin \
      --prefix ES_CLASSPATH : "$out/lib/${name}.jar":"$out/lib/*":"$out/lib/sigar/*" --set JAVA_HOME "${jre}"
  '';

  meta = {
    description = "Open Source, Distributed, RESTful Search Engine";
    license = "ASL2.0";
  };
}


{ lib
, buildPythonPackage
, fetchPypi
}:

buildPythonPackage rec {
  pname = "simplejson";
  version = "3.10.0";
  name = "${pname}-${version}";

  src = fetchPypi {
    inherit pname version;
    sha256 = "953be622e88323c6f43fad61ffd05bebe73b9fd9863a46d68b052d2aa7d71ce2";
  };

  meta = {
    description = "A simple, fast, extensible JSON encoder/decoder for Python";
    longDescription = ''
      simplejson is compatible with Python 2.4 and later with no
      external dependencies.  It covers the full JSON specification
      for both encoding and decoding, with unicode support.  By
      default, encoding is done in an encoding neutral fashion (plain
      ASCII with \uXXXX escapes for unicode characters).
    '';
    homepage = http://code.google.com/p/simplejson/;
    license = lib.licenses.mit;
  };
}

Disable simplejson test on Darwin otherwise build fails.

{ lib
, buildPythonPackage
, fetchPypi
, stdenv
}:

buildPythonPackage rec {
  pname = "simplejson";
  version = "3.10.0";
  name = "${pname}-${version}";
  doCheck = !stdenv.isDarwin;

  src = fetchPypi {
    inherit pname version;
    sha256 = "953be622e88323c6f43fad61ffd05bebe73b9fd9863a46d68b052d2aa7d71ce2";
  };

  meta = {
    description = "A simple, fast, extensible JSON encoder/decoder for Python";
    longDescription = ''
      simplejson is compatible with Python 2.4 and later with no
      external dependencies.  It covers the full JSON specification
      for both encoding and decoding, with unicode support.  By
      default, encoding is done in an encoding neutral fashion (plain
      ASCII with \uXXXX escapes for unicode characters).
    '';
    homepage = http://code.google.com/p/simplejson/;
    license = lib.licenses.mit;
  };
}


# This module contains the basic configuration for building a NixOS
# installation CD.

{ config, pkgs, ... }:

with pkgs.lib;

{
  imports =
    [ ./channel.nix
      ./iso-image.nix

      # Profiles of this basic installation CD.
      ../../profiles/all-hardware.nix
      ../../profiles/base.nix
      ../../profiles/installation-device.nix
    ];

  # ISO naming.
  isoImage.isoName = "${config.isoImage.isoBaseName}-${config.system.nixosVersion}-${pkgs.stdenv.system}.iso";

  isoImage.volumeID = substring 0 11 "NIXOS_${config.system.nixosVersion}";

  # Make the installer more likely to succeed in low memory
  # environments.  The kernel's overcommit heustistics bite us
  # fairly often, preventing processes such as nix-worker or
  # download-using-manifests.pl from forking even if there is
  # plenty of free memory.
  boot.kernel.sysctl."vm.overcommit_memory" = "1";

  # To speed up installation a little bit, include the complete stdenv
  # in the Nix store on the CD.
  isoImage.storeContents = [ pkgs.stdenv pkgs.busybox ];

  # EFI booting
  isoImage.makeEfiBootable = true;

  # Add Memtest86+ to the CD.
  boot.loader.grub.memtest86.enable = true;

  # Get a console as soon as the initrd loads fbcon on EFI boot
  boot.initrd.kernelModules = [ "fbcon" ];
}

Include Archive::Cpio in the installation CD

# This module contains the basic configuration for building a NixOS
# installation CD.

{ config, pkgs, ... }:

with pkgs.lib;

{
  imports =
    [ ./channel.nix
      ./iso-image.nix

      # Profiles of this basic installation CD.
      ../../profiles/all-hardware.nix
      ../../profiles/base.nix
      ../../profiles/installation-device.nix
    ];

  # ISO naming.
  isoImage.isoName = "${config.isoImage.isoBaseName}-${config.system.nixosVersion}-${pkgs.stdenv.system}.iso";

  isoImage.volumeID = substring 0 11 "NIXOS_${config.system.nixosVersion}";

  # Make the installer more likely to succeed in low memory
  # environments.  The kernel's overcommit heustistics bite us
  # fairly often, preventing processes such as nix-worker or
  # download-using-manifests.pl from forking even if there is
  # plenty of free memory.
  boot.kernel.sysctl."vm.overcommit_memory" = "1";

  # To speed up installation a little bit, include the complete stdenv
  # in the Nix store on the CD.  Archive::Cpio is needed for the
  # initrd builder.
  isoImage.storeContents = [ pkgs.stdenv pkgs.busybox pkgs.perlPackages.ArchiveCpio ];

  # EFI booting
  isoImage.makeEfiBootable = true;

  # Add Memtest86+ to the CD.
  boot.loader.grub.memtest86.enable = true;

  # Get a console as soon as the initrd loads fbcon on EFI boot
  boot.initrd.kernelModules = [ "fbcon" ];
}


{ cabal, caseInsensitive, hspec, httpTypes, QuickCheck
, quickcheckInstances
}:

cabal.mkDerivation (self: {
  pname = "http-kit";
  version = "0.2.1";
  sha256 = "1x3wqjbgs605wrl2dgvszdkvpkfrin4j9azkaa57hza6bgwpidra";
  buildDepends = [ caseInsensitive httpTypes ];
  testDepends = [ hspec httpTypes QuickCheck quickcheckInstances ];
  meta = {
    description = "A low-level HTTP library";
    license = self.stdenv.lib.licenses.mit;
    platforms = self.ghc.meta.platforms;
  };
})

Update haskell-http-kit to version 0.2.2

{ cabal, caseInsensitive, hspec, httpTypes, QuickCheck
, quickcheckInstances
}:

cabal.mkDerivation (self: {
  pname = "http-kit";
  version = "0.2.2";
  sha256 = "09pq3wzcg8piil6bcp713dfscrfald155456dfir9dljviamhvsv";
  buildDepends = [ caseInsensitive httpTypes ];
  testDepends = [ hspec httpTypes QuickCheck quickcheckInstances ];
  meta = {
    description = "A low-level HTTP library";
    license = self.stdenv.lib.licenses.mit;
    platforms = self.ghc.meta.platforms;
  };
})


{
  packageOverrides = pkgs: with pkgs; {
    myPackages = pkgs.buildEnv {
      name = "my-packages";
      paths = [
        ag
        augeas
        bridge-utils
        curl
        dnsmasq
        file
        git
        gnused
        gptfdisk
        homesick
        htop
        inetutils
        less
        lxc
        lxd
        man-pages
        man
        nodejs-11_x
        openssh
        qemu
        rclone
        readline70
        (ruby_2_6.overrideAttrs (attrs: {
          meta.priority = 3;
        }))
        socat
        tig
        tmux
        vim
        wget
        xorg.xset
        zsh
      ];
    };
  };
}

Add fuse package to Nix

{
  packageOverrides = pkgs: with pkgs; {
    myPackages = pkgs.buildEnv {
      name = "my-packages";
      paths = [
        ag
        augeas
        bridge-utils
        curl
        dnsmasq
        file
        fuse
        git
        gnused
        gptfdisk
        homesick
        htop
        inetutils
        less
        lxc
        lxd
        man-pages
        man
        nodejs-11_x
        openssh
        qemu
        rclone
        readline70
        (ruby_2_6.overrideAttrs (attrs: {
          meta.priority = 3;
        }))
        socat
        tig
        tmux
        vim
        wget
        xorg.xset
        zsh
      ];
    };
  };
}


{stdenv, xcodewrapper}:
{ name, appName ? null, app
, device ? "iPhone", baseDir ? ""
, sdkVersion ? "6.1"
}:

let
  _appName = if appName == null then name else appName;
in
stdenv.mkDerivation {
  name = stdenv.lib.replaceChars [" "] [""] name;
  buildCommand = ''
    ensureDir $out/bin
    cat > $out/bin/run-test-simulator << "EOF"
    #! ${stdenv.shell} -e

    cd "${app}/${baseDir}/${_appName}.app"
    "$(readlink "${xcodewrapper}/bin/iPhone Simulator")" -SimulateApplication './${_appName}' -SimulateDevice '${device}' -currentSDKRoot "$(readlink "${xcodewrapper}/SDKs")/iPhoneSimulator${sdkVersion}.sdk"
    EOF
    chmod +x $out/bin/run-test-simulator
  '';
}

Make iphone SDK 7.0 the default

{stdenv, xcodewrapper}:
{ name, appName ? null, app
, device ? "iPhone", baseDir ? ""
, sdkVersion ? "7.0"
}:

let
  _appName = if appName == null then name else appName;
in
stdenv.mkDerivation {
  name = stdenv.lib.replaceChars [" "] [""] name;
  buildCommand = ''
    ensureDir $out/bin
    cat > $out/bin/run-test-simulator << "EOF"
    #! ${stdenv.shell} -e

    cd "${app}/${baseDir}/${_appName}.app"
    "$(readlink "${xcodewrapper}/bin/iPhone Simulator")" -SimulateApplication './${_appName}' -SimulateDevice '${device}' -currentSDKRoot "$(readlink "${xcodewrapper}/SDKs")/iPhoneSimulator${sdkVersion}.sdk"
    EOF
    chmod +x $out/bin/run-test-simulator
  '';
}


args : with args;

if ! bazaar.python.readlineSupport then
  throw "Bazaar Tools require readline support in python."
else

rec {
  src = fetchurl {
    url = http://launchpad.net/bzrtools/stable/1.5.0/+download/bzrtools-1.5.0.tar.gz;
    sha256 = "0lm4qhsjy3k8zp9hcahlf37v69w6lhhz2x3hjskgm3rk6b0bngjz";
  };

  buildInputs = [];
  configureFlags = [];

  /* doConfigure should be specified separately */
  phaseNames = [(simplyShare "bzrtools")];

  name = "bzr-tools-1.5";
  meta = {
    description = "Bazaar plugins.";
  };
}

Update BzrTools together with Bazaar

args : with args;

if ! bazaar.python.readlineSupport then
  throw "Bazaar Tools require readline support in python."
else

rec {
  version = "2.2.0";
  src = fetchurl {
    url = "http://launchpad.net/bzrtools/stable/${version}/+download/bzrtools-${version}.tar.gz";
    sha256 = "835e0dc2b3b798d3c88b960bf719fe3b4cec7ae241908aafeb6aafe4c83f591b";
  };

  buildInputs = [];
  configureFlags = [];

  /* doConfigure should be specified separately */
  phaseNames = [(simplyShare "bzrtools")];

  name = "bzr-tools-${version}";
  meta = {
    description = "Bazaar plugins.";
  };
}


{ stdenv, fetchurl, glib, flex, bison, pkgconfig, libffi, python, cairo }:

let
  baseName = "gobject-introspection";
  v = "0.6.10";
in

stdenv.mkDerivation rec {
  name = "${baseName}-${v}";

  buildInputs = [ flex bison glib pkgconfig python cairo ];
  propagatedBuildInputs = [ libffi ];
  configureFlags = "--enable-gcov";

  src = fetchurl {
    url = "mirror://gnome/sources/${baseName}/0.6/${name}.tar.bz2";
    sha256 = "0jwd7bybgvg6dwhg64da8k9yjrs37y5p153gaaapz5j59ld53g9n";
  };

  meta = with stdenv.lib; {
    maintainers = [ maintainers.urkud ];
    platforms = [ platforms.linux ];
    homepage = http://live.gnome.org/GObjectIntrospection;
  };
}

Fix a typo in gobject-introspection

{ stdenv, fetchurl, glib, flex, bison, pkgconfig, libffi, python, cairo }:

let
  baseName = "gobject-introspection";
  v = "0.6.10";
in

stdenv.mkDerivation rec {
  name = "${baseName}-${v}";

  buildInputs = [ flex bison glib pkgconfig python cairo ];
  propagatedBuildInputs = [ libffi ];
  configureFlags = "--enable-gcov";

  src = fetchurl {
    url = "mirror://gnome/sources/${baseName}/0.6/${name}.tar.bz2";
    sha256 = "0jwd7bybgvg6dwhg64da8k9yjrs37y5p153gaaapz5j59ld53g9n";
  };

  meta = with stdenv.lib; {
    maintainers = [ maintainers.urkud ];
    platforms = platforms.linux;
    homepage = http://live.gnome.org/GObjectIntrospection;
  };
}


{
  allowUnfree = true;
  packageOverrides = pkgs: with pkgs; {
    myPackages = pkgs.buildEnv {
      name = "my-packages";
      paths = [
        ag
        appimage-run
        augeas
        (autojump.overrideAttrs (attrs: {
          meta.priority = 3;
        }))
        aws
        bridge-utils
        cloc
        curl
        dnsmasq
        docker
        docker-compose
        file
        fontconfig
        fuse
        fzf
        git
        git-lfs
        gnused
        go
        gptfdisk
        gnugrep
        grml-zsh-config
        homesick
        htop
        inetutils
        less
        lxc
        lxd
        man
        man-pages
        ncurses5
        nodejs-11_x
        open-sans
        openbox
        openconnect
        openssh
        papirus-icon-theme
        python
        python27Packages.supervisor
        python3
        qemu
        rclone
        rclone-browser
        readline70
        ripgrep
        rmlint
        (ruby_2_6.overrideAttrs (attrs: {
          meta.priority = 3;
        }))
        s3cmd
        shellcheck
        socat
        sqlite
        terraform
        tig
        tigervnc
        tmux
        tree
        unzip
        vagrant
        (vimHugeX.overrideAttrs (attrs: {
          meta.priority = 3;
        }))
        wget
        xorg.xset
        zip
        zsh
        zsh-autosuggestions
        zsh-syntax-highlighting
      ];
    };
  };
}

Add Jetbrains JDK and some Xorg libs

{
  allowUnfree = true;
  packageOverrides = pkgs: with pkgs; {
    myPackages = pkgs.buildEnv {
      name = "my-packages";
      paths = [
        ag
        appimage-run
        augeas
        (autojump.overrideAttrs (attrs: {
          meta.priority = 3;
        }))
        aws
        bridge-utils
        cloc
        curl
        dnsmasq
        docker
        docker-compose
        file
        fontconfig
        fuse
        fzf
        git
        git-lfs
        gnused
        go
        gptfdisk
        gnugrep
        grml-zsh-config
        homesick
        htop
        inetutils
        jetbrains.jdk
        less
        lxc
        lxd
        man
        man-pages
        ncurses5
        nodejs-11_x
        open-sans
        openbox
        openconnect
        openssh
        papirus-icon-theme
        python
        python27Packages.supervisor
        python3
        qemu
        rclone
        rclone-browser
        readline70
        ripgrep
        rmlint
        (ruby_2_6.overrideAttrs (attrs: {
          meta.priority = 3;
        }))
        s3cmd
        shellcheck
        socat
        sqlite
        terraform
        tig
        tigervnc
        tmux
        tree
        unzip
        vagrant
        (vimHugeX.overrideAttrs (attrs: {
          meta.priority = 3;
        }))
        wget
        xorg.libXtst
        xorg.libXi
        xorg.xset
        zip
        zsh
        zsh-autosuggestions
        zsh-syntax-highlighting
      ];
    };
  };
}


x@{builderDefsPackage
  , ...}:
builderDefsPackage
(a :
let
  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
    [];

  buildInputs = map (n: builtins.getAttr n x)
    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
  sourceInfo = rec {
    version="0.99";
    baseName="barcode";
    name="${baseName}-${version}";
    url="mirror://gnu/${baseName}/${name}.tar.gz";
    hash="0r2b2lwg7a9i9ic5spkbnavy1ynrppmrldv46vsl44l1xgriq0vw";
  };
in
rec {
  src = a.fetchurl {
    url = sourceInfo.url;
    sha256 = sourceInfo.hash;
  };

  inherit (sourceInfo) name version;
  inherit buildInputs;

  /* doConfigure should be removed if not needed */
  phaseNames = ["doConfigure" "doMakeInstall"];

  meta = {
    description = "GNU barcode generator";
    maintainers = with a.lib.maintainers;
    [
      raskin
    ];
    platforms = with a.lib.platforms; allBut darwin;
  };
  passthru = {
    updateInfo = {
      downloadPage = "ftp://ftp.gnu.org/gnu/barcode/";
    };
  };
}) x

Allow search for updates for GNU Barcode

x@{builderDefsPackage
  , ...}:
builderDefsPackage
(a :
let
  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
    [];

  buildInputs = map (n: builtins.getAttr n x)
    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
  sourceInfo = rec {
    version = "0.99";
    baseName="barcode";
    name="${baseName}-${version}";
    url="mirror://gnu/${baseName}/${name}.tar.gz";
  };
in
rec {
  src = a.fetchurl {
    url = sourceInfo.url;
    sha256 = "1indapql5fjz0bysyc88cmc54y8phqrbi7c76p71fgjp45jcyzp8";
  };

  inherit (sourceInfo) name version;
  inherit buildInputs;

  /* doConfigure should be removed if not needed */
  phaseNames = ["doConfigure" "doMakeInstall"];

  meta = {
    description = "GNU barcode generator";
    maintainers = with a.lib.maintainers;
    [
      raskin
    ];
    platforms = with a.lib.platforms; allBut darwin;
    downloadPage = "http://ftp.gnu.org/gnu/barcode/";
    updateWalker = true;
    inherit version;
  };
}) x


{ cabal, aeson, haskellSrcMeta, hspec, parsec, text, vector }:

cabal.mkDerivation (self: {
  pname = "aeson-qq";
  version = "0.7.1";
  sha256 = "1b2ham1h6mlm49ax9k2agf8yymbgkk094nq2apn703i2d9v00im6";
  buildDepends = [ aeson haskellSrcMeta parsec text vector ];
  testDepends = [ aeson hspec ];
  meta = {
    homepage = "http://github.com/zalora/aeson-qq";
    description = "JSON quasiquoter for Haskell";
    license = self.stdenv.lib.licenses.mit;
    platforms = self.ghc.meta.platforms;
  };
})

Update haskell-aeson-qq to version 0.7.2

{ cabal, aeson, haskellSrcMeta, hspec, parsec, text, vector }:

cabal.mkDerivation (self: {
  pname = "aeson-qq";
  version = "0.7.2";
  sha256 = "1h4agwl8kr6qpy4775pxmaizhlzbwjqb23pxn2vvz9wbm2vnixwk";
  buildDepends = [ aeson haskellSrcMeta parsec text vector ];
  testDepends = [ aeson haskellSrcMeta hspec parsec text vector ];
  meta = {
    homepage = "http://github.com/zalora/aeson-qq";
    description = "JSON quasiquoter for Haskell";
    license = self.stdenv.lib.licenses.mit;
    platforms = self.ghc.meta.platforms;
  };
})


# This file is autogenerated from update.sh in the same directory.
{
  dev = {
    version = "25.0.1364.29";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-25.0.1364.29.tar.bz2";
    sha256 = "0da3in98b65rb9wkj9jxb3n07d5k7s1xpqwpvk1jz9jbp0hw7ijp";
  };
  beta = {
    version = "24.0.1312.35";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-24.0.1312.35.tar.bz2";
    sha256 = "0mb6xz5lrnzjk1zqr83jyprsxv20svy3a7lyxv9iwdb2bh1i13ci";
  };
  stable = {
    version = "23.0.1271.97";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-23.0.1271.97.tar.bz2";
    sha256 = "1qf21n6msj1jmxhnlw8fapsz7q6dd851rxdqv4334v06ny4i5fip";
  };
}

Update stable and beta to v24.0.1312.52.

# This file is autogenerated from update.sh in the same directory.
{
  dev = {
    version = "25.0.1364.29";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-25.0.1364.29.tar.bz2";
    sha256 = "0da3in98b65rb9wkj9jxb3n07d5k7s1xpqwpvk1jz9jbp0hw7ijp";
  };
  beta = {
    version = "24.0.1312.52";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-24.0.1312.52.tar.bz2";
    sha256 = "04fp04591dszx07wwdsgxf0wb2sxm863z1qxn5dii6f9yjqgh3gk";
  };
  stable = {
    version = "24.0.1312.52";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-24.0.1312.52.tar.bz2";
    sha256 = "04fp04591dszx07wwdsgxf0wb2sxm863z1qxn5dii6f9yjqgh3gk";
  };
}


{ stdenv, fetchFromGitHub, pkgconfig, cmake, curl, boost, eigen
, freeimage, freetype, mesa, SDL2, alsaLib, libarchive }:

stdenv.mkDerivation rec {
  name = "emulationstation-${version}";
  version = "2.0.0-rc1";

  src = fetchFromGitHub {
    owner = "Aloshi";
    repo = "EmulationStation";
    rev = "8739519e1591819cab85e1d2056804d20c197dac";
    sha256 = "1psq5cqyq2yy1lqxrcj7pfp8szfmzhamxf3111l97w2h2zzcgvq9";
  };

  buildInputs = [ pkgconfig cmake alsaLib boost curl eigen freeimage freetype libarchive mesa SDL2 ];

  buildPhase = "cmake . && make";
  installPhase = ''
    install -D ../emulationstation $out/bin/emulationstation
  '';

  meta = {
    description = "A flexible emulator front-end supporting keyboardless navigation and custom system themes";
    homepage = "http://emulationstation.org";
    maintainers = [ stdenv.lib.maintainers.edwtjo ];
    license = stdenv.lib.licenses.mit;
  };
}

Update emulationstation 2.0.0.rc1 -> 2.0.1a

{ stdenv, fetchFromGitHub, pkgconfig, cmake, curl, boost, eigen
, freeimage, freetype, mesa, SDL2, alsaLib, libarchive }:

stdenv.mkDerivation rec {
  name = "emulationstation-${version}";
  version = "2.0.1a";

  src = fetchFromGitHub {
    owner = "Aloshi";
    repo = "EmulationStation";
    rev = "646bede3d9ec0acf0ae378415edac136774a66c5";
    sha256 = "0cm0sq2wri2l9cvab1l0g02za59q7klj0h3p028vr96n6njj4w9v";
  };

  buildInputs = [ pkgconfig cmake alsaLib boost curl eigen freeimage freetype libarchive mesa SDL2 ];

  buildPhase = "cmake . && make";
  installPhase = ''
    install -D ../emulationstation $out/bin/emulationstation
  '';

  meta = {
    description = "A flexible emulator front-end supporting keyboardless navigation and custom system themes";
    homepage = "http://emulationstation.org";
    maintainers = [ stdenv.lib.maintainers.edwtjo ];
    license = stdenv.lib.licenses.mit;
  };
}


{stdenv, fetchurl, libav, flac, libvorbis, libogg, libid3tag, libexif, libjpeg, sqlite }:
stdenv.mkDerivation rec {
  name = "minidlna-1.0.24";
  src = fetchurl {
    url = mirror://sourceforge/project/minidlna/minidlna/1.0.24/minidlna_1.0.24_src.tar.gz;
    sha256 = "0hmrrrq7d8940rckwj93bcdpdxxy3qfkjl17j5k31mi37hqc42l4";
  };

  preConfigure = ''
    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libav}/include/libavutil -I${libav}/include/libavcodec -I${libav}/include/libavformat"
    export makeFlags="INSTALLPREFIX=$out"
  '';

  buildInputs = [ libav flac libvorbis libogg libid3tag libexif libjpeg sqlite ];
  patches = [ ./config.patch ];

  meta = {
    description = "MiniDLNA Media Server";
    longDescription = ''
      MiniDLNA (aka ReadyDLNA) is server software with the aim of being fully
      compliant with DLNA/UPnP-AV clients.
    '';
    homepage = http://sourceforge.net/projects/minidlna/;
    license = stdenv.lib.licenses.gpl2;

    platforms = stdenv.lib.platforms.all;
  };
}

Update to 1.0.25 and use ffmpeg instead of libav

{ stdenv, fetchurl, ffmpeg, flac, libvorbis, libogg, libid3tag, libexif, libjpeg, sqlite }:

let version = "1.0.25"; in

stdenv.mkDerivation rec {
  name = "minidlna-${version}";

  src = fetchurl {
    url = "mirror://sourceforge/project/minidlna/minidlna/${version}/minidlna_${version}_src.tar.gz";
    sha256 = "0l987x3bx2apnlihnjbhywgk5b2g9ysiapwclz5vphj2w3xn018p";
  };

  patches = [ ./config.patch ];

  preConfigure = ''
    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${ffmpeg}/include/libavutil -I${ffmpeg}/include/libavcodec -I${ffmpeg}/include/libavformat"
    export makeFlags="INSTALLPREFIX=$out"
  '';

  buildInputs = [ ffmpeg flac libvorbis libogg libid3tag libexif libjpeg sqlite ];

  meta = {
    description = "MiniDLNA Media Server";
    longDescription = ''
      MiniDLNA (aka ReadyDLNA) is server software with the aim of being fully
      compliant with DLNA/UPnP-AV clients.
    '';
    homepage = http://sourceforge.net/projects/minidlna/;
    license = stdenv.lib.licenses.gpl2;
    platforms = stdenv.lib.platforms.linux;
  };
}


# This file is autogenerated from update.sh in the same directory.
{
  beta = {
    sha256 = "1lix5wzcwf666vsdbdzz071rynswlxg5414k3nsrmlxwxhyh6qi4";
    sha256bin64 = "02cv9vc1l2nlwa4a0lc7cj9c9czrwp1jd8d024bq16a5fvmhl01l";
    version = "54.0.2840.50";
  };
  dev = {
    sha256 = "06kcymwi0wfir7w10g8viayk2h0b5a66dav76mlia4lm30p502kz";
    sha256bin64 = "0mgamiffnnkaw8c68b5kyna84x7hlhrzmqfc36kzf434fmm8v5d6";
    version = "55.0.2873.0";
  };
  stable = {
    sha256 = "1hyw0z7dsfaxyy8b4mvnfjy5yj0160hzz9m0wj3vn9zvkfvmhan5";
    sha256bin64 = "0n0px7yi94gdxq7p6pjqfdz04bnh3mcvbaccjaglj6h5p0jc8abq";
    version = "53.0.2785.143";
  };
}

Fix wrong hash for beta channel

# This file is autogenerated from update.sh in the same directory.
{
  beta = {
    sha256 = "0f6cqvhlg06lrf4bzaiwzm9yi3fi1dk5jrzvjcg7alw3mzrmh2wv";
    sha256bin64 = "02cv9vc1l2nlwa4a0lc7cj9c9czrwp1jd8d024bq16a5fvmhl01l";
    version = "54.0.2840.50";
  };
  dev = {
    sha256 = "06kcymwi0wfir7w10g8viayk2h0b5a66dav76mlia4lm30p502kz";
    sha256bin64 = "0mgamiffnnkaw8c68b5kyna84x7hlhrzmqfc36kzf434fmm8v5d6";
    version = "55.0.2873.0";
  };
  stable = {
    sha256 = "1hyw0z7dsfaxyy8b4mvnfjy5yj0160hzz9m0wj3vn9zvkfvmhan5";
    sha256bin64 = "0n0px7yi94gdxq7p6pjqfdz04bnh3mcvbaccjaglj6h5p0jc8abq";
    version = "53.0.2785.143";
  };
}


{ stdenv, buildPerlPackage, fetchurl, perlPackages, iproute }:

buildPerlPackage rec {
  name = "ddclient-${version}";
  version = "3.8.3";

  src = fetchurl {
    url = "mirror://sourceforge/ddclient/${name}.tar.gz";
    sha256 = "1j8zdn7fy7i0bjk3jf0hxnbnshc2yf054vxq64imxdpfd7n5zgfy";
  };

  buildInputs = [ perlPackages.IOSocketSSL perlPackages.DigestSHA1 ];

  patches = [ ./ddclient-line-buffer-stdout.patch ];

  # Use iproute2 instead of ifconfig
  preConfigure = ''
    touch Makefile.PL
    substituteInPlace ddclient --replace 'in the output of ifconfig' 'in the output of ip addr show'
    substituteInPlace ddclient --replace 'ifconfig -a' '${iproute}/sbin/ip addr show'
    substituteInPlace ddclient --replace 'ifconfig $arg' '${iproute}/sbin/ip addr show $arg'
  '';

  installPhase = ''
    mkdir -p $out/bin
    cp ddclient $out/bin
  '';

  doCheck = false;

  meta = with stdenv.lib; {
    homepage = https://sourceforge.net/p/ddclient/wiki/Home/;
    description = "Client for updating dynamic DNS service entries";
    license = licenses.gpl2Plus;

    # Mostly since `iproute` is Linux only.
    platforms = platforms.linux;
  };
}

Fix build after multiple outputs merge

{ stdenv, buildPerlPackage, fetchurl, perlPackages, iproute }:

buildPerlPackage rec {
  name = "ddclient-${version}";
  version = "3.8.3";

  src = fetchurl {
    url = "mirror://sourceforge/ddclient/${name}.tar.gz";
    sha256 = "1j8zdn7fy7i0bjk3jf0hxnbnshc2yf054vxq64imxdpfd7n5zgfy";
  };

  outputs = [ "out" ];

  buildInputs = [ perlPackages.IOSocketSSL perlPackages.DigestSHA1 ];

  patches = [ ./ddclient-line-buffer-stdout.patch ];

  # Use iproute2 instead of ifconfig
  preConfigure = ''
    touch Makefile.PL
    substituteInPlace ddclient --replace 'in the output of ifconfig' 'in the output of ip addr show'
    substituteInPlace ddclient --replace 'ifconfig -a' '${iproute}/sbin/ip addr show'
    substituteInPlace ddclient --replace 'ifconfig $arg' '${iproute}/sbin/ip addr show $arg'
  '';

  installPhase = ''
    mkdir -p $out/bin
    cp ddclient $out/bin
  '';

  doCheck = false;

  meta = with stdenv.lib; {
    homepage = https://sourceforge.net/p/ddclient/wiki/Home/;
    description = "Client for updating dynamic DNS service entries";
    license = licenses.gpl2Plus;

    # Mostly since `iproute` is Linux only.
    platforms = platforms.linux;
  };
}


{ options, config, lib, pkgs, ... }:

with lib;
with lib.my;
let cfg = config.modules.hardware.ergodox;
in {
  options.modules.hardware.ergodox = {
    enable = mkBoolOpt false;
  };

  config = mkIf cfg.enable {
    user.packages = [ pkgs.teensy-loader-cli ];
    # 'teensyload FILE' to load a new config into the ergodox
    environment.shellAliases.teensyload =
      "sudo teensy-loader-cli -w -v --mcu=atmega32u4";
    # Make right-alt the compose key, so ralt+a+a = å or ralt+o+/ = ø
    services.xserver.xkbOptions = "compose:ralt";
  };
}

Use wally-cli & new hardware.keyboard.zsa module for ergodx

{ options, config, lib, pkgs, ... }:

with lib;
with lib.my;
let cfg = config.modules.hardware.ergodox;
in {
  options.modules.hardware.ergodox = {
    enable = mkBoolOpt false;
  };

  config = mkIf cfg.enable {
    user.packages = [ pkgs.unstable.wally-cli ];

    hardware.keyboard.zsa.enable = true;

    user.extraGroups = [ "plugdev" ];

    services.xserver.xkbOptions = "compose:ralt";
  };
}


# This file is autogenerated from update.sh in the same directory.
{
  beta = {
    sha256 = "0l1434wqhi6c24qyb5ysg1wnd0s9l9i1k6kh6wr3s4acrsbb7p12";
    sha256bin64 = "1ssw92l8zwj8x0zs5h6vxl7d7gj0lqb0x71vsazgd4d0p23nglb1";
    version = "51.0.2704.47";
  };
  dev = {
    sha256 = "0czp4p434yqr5rv3w2vypkyis13x8lc4xph8yh84r9big1ga6fqs";
    sha256bin64 = "0hahamx9k14czswqdh8iwh69lsml0acca5kxvp2kw471g3s55n78";
    version = "52.0.2729.3";
  };
  stable = {
    sha256 = "1ijpbmn38znjjb3h8579x5gsclgjx122lvm0afv17gf2j3w5w4qj";
    sha256bin64 = "17vqvxmy6llg7dpc3pxi0qhwpm9qc9rsq8lgknhwwygvkl8g14sb";
    version = "50.0.2661.102";
  };
}

Update to latest stable and beta channel

# This file is autogenerated from update.sh in the same directory.
{
  beta = {
    sha256 = "1sgfwh2b0aw6l5v4ggk7frcy306x3ygxk81p3h6zdy5s1rpf8hxj";
    sha256bin64 = "1kjnxxf2ak8v1akzxz46r7a7r6bhxjb2y9fhr1fqvks3m4jc5zqw";
    version = "51.0.2704.63";
  };
  dev = {
    sha256 = "0czp4p434yqr5rv3w2vypkyis13x8lc4xph8yh84r9big1ga6fqs";
    sha256bin64 = "0hahamx9k14czswqdh8iwh69lsml0acca5kxvp2kw471g3s55n78";
    version = "52.0.2729.3";
  };
  stable = {
    sha256 = "1sgfwh2b0aw6l5v4ggk7frcy306x3ygxk81p3h6zdy5s1rpf8hxj";
    sha256bin64 = "1kjnxxf2ak8v1akzxz46r7a7r6bhxjb2y9fhr1fqvks3m4jc5zqw";
    version = "51.0.2704.63";
  };
}


{ stdenv, fetchurl, pkgconfig, intltool, glib, gobjectIntrospection
  # just for passthru
, gnome3, gtk3, gsettings_desktop_schemas }:

stdenv.mkDerivation rec {

  versionMajor = gnome3.version;
  versionMinor = "1";
  moduleName   = "gsettings-desktop-schemas";

  name = "${moduleName}-${versionMajor}.${versionMinor}";

  src = fetchurl {
    url = "mirror://gnome/sources/${moduleName}/${versionMajor}/${name}.tar.xz";
    sha256 = "0q9l9fr90pcb3s6crbxkj3wiwn7wp9zfpv7bdxkadj0hspd9zzkl";
  };

  buildInputs = [ glib gobjectIntrospection ];

  nativeBuildInputs = [ pkgconfig intltool ];

  meta = with stdenv.lib; {
    maintainers = gnome3.maintainers;
  };
}

Fix path to background images

{ stdenv, fetchurl, pkgconfig, intltool, glib, gobjectIntrospection
  # just for passthru
, gnome3, gtk3, gsettings_desktop_schemas }:

stdenv.mkDerivation rec {

  versionMajor = gnome3.version;
  versionMinor = "1";
  moduleName   = "gsettings-desktop-schemas";

  name = "${moduleName}-${versionMajor}.${versionMinor}";

  src = fetchurl {
    url = "mirror://gnome/sources/${moduleName}/${versionMajor}/${name}.tar.xz";
    sha256 = "0q9l9fr90pcb3s6crbxkj3wiwn7wp9zfpv7bdxkadj0hspd9zzkl";
  };

  postPatch = ''
    for file in "background" "screensaver"; do
      substituteInPlace "schemas/org.gnome.desktop.$file.gschema.xml.in" \
        --replace "@datadir@" "${gnome3.gnome-backgrounds}/share/"
    done
  '';

  buildInputs = [ glib gobjectIntrospection ];

  nativeBuildInputs = [ pkgconfig intltool ];

  meta = with stdenv.lib; {
    maintainers = gnome3.maintainers;
  };
}


{ lib, buildPythonPackage, fetchPypi, aiohttp, future-fstrings, pythonOlder
, sqlalchemy, ruamel_yaml, CommonMark, lxml, fetchpatch
}:

buildPythonPackage rec {
  pname = "mautrix";
  version = "0.6.1";

  src = fetchPypi {
    inherit pname version;
    sha256 = "a86c6448fb3c0f5e149f3347fbf0cd776431aec16a137a9b45298b6fe5991e42";
  };

  propagatedBuildInputs = [
    aiohttp
    future-fstrings

    # defined in optional-requirements.txt
    sqlalchemy
    ruamel_yaml
    CommonMark
    lxml
  ];

  disabled = pythonOlder "3.5";

  # no tests available
  doCheck = false;

  meta = with lib; {
    homepage = "https://github.com/tulir/mautrix-python";
    description = "A Python 3 asyncio Matrix framework.";
    license = licenses.mpl20;
    maintainers = with maintainers; [ nyanloutre ma27 ];
  };
}

Revert "python: mautrix: 0.5.8 -> 0.6.1"

{ lib, buildPythonPackage, fetchPypi, aiohttp, future-fstrings, pythonOlder
, sqlalchemy, ruamel_yaml, CommonMark, lxml, fetchpatch
}:

buildPythonPackage rec {
  pname = "mautrix";
  version = "0.5.8";

  src = fetchPypi {
    inherit pname version;
    sha256 = "1hqg32n7pmjhap0ybfcf05zgfcyyirb4fm1m7gf44dwh40da6qz0";
  };

  propagatedBuildInputs = [
    aiohttp
    future-fstrings

    # defined in optional-requirements.txt
    sqlalchemy
    ruamel_yaml
    CommonMark
    lxml
  ];

  disabled = pythonOlder "3.5";

  # no tests available
  doCheck = false;

  meta = with lib; {
    homepage = "https://github.com/tulir/mautrix-python";
    description = "A Python 3 asyncio Matrix framework.";
    license = licenses.mpl20;
    maintainers = with maintainers; [ nyanloutre ma27 ];
  };
}


{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "dmidecode-2.11";

  src = fetchurl {
    url = "mirror://savannah/dmidecode/${name}.tar.bz2";
    sha256 = "0l9v8985piykc98hmbg1cq5r4xwvp0jjl4li3avr3ddkg4s699bd";
  };

  makeFlags = "prefix=$(out)";

  meta = {
    homepage = http://www.nongnu.org/dmidecode/;
    description = "A tool that reads information about your system's hardware from the BIOS according to the SMBIOS/DMI standard";
  };
}

Upgrade dmidecode from 2.11 -> 2.12

{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "dmidecode-2.12";

  src = fetchurl {
    url = "mirror://savannah/dmidecode/${name}.tar.bz2";
    sha256 = "122hgaw8mpqdfra159lfl6pyk3837giqx6vq42j64fjnbl2z6gwi";
  };

  makeFlags = "prefix=$(out)";

  meta = {
    homepage = http://www.nongnu.org/dmidecode/;
    description = "A tool that reads information about your system's hardware from the BIOS according to the SMBIOS/DMI standard";
  };
}


{ stdenv, fetchurl, kernel, perl }:

assert kernel.features ? aufsBase;

let version = "20100522"; in

stdenv.mkDerivation {
  name = "aufs2-${version}";

  src = fetchurl {
    url = "http://nixos.org/tarballs/aufs2-standalone-git-${version}.tar.bz2";
    sha256 = "1g4mw4qx2xzpygdwjiw36bkhfz1hi7wxx7w79n2h0lr5grzzdnd6";
  };

  buildInputs = [ perl ];

  makeFlags = "KDIR=${kernel}/lib/modules/${kernel.version}/build";

  installPhase =
    ''
      ensureDir $out/lib/modules/${kernel.version}/misc
      cp aufs.ko $out/lib/modules/${kernel.version}/misc

      # Install the headers because aufs2-util requires them.
      cp -prvd include $out/
    '';

  meta = {
    description = "Another Unionfs implementation for Linux (second generation)";
    homepage = http://aufs.sourceforge.net/;
    maintainers = [ stdenv.lib.maintainers.eelco ];
    platforms = stdenv.lib.platforms.linux;
  };
}

Update AUFS2 to latest git for 2.6.35 - old version does not work with newer kernels

{ stdenv, fetchurl, kernel, perl, fetchgit }:

assert kernel.features ? aufsBase;

let version = "20100522"; in

stdenv.mkDerivation {
  name = "aufs2-${version}";

  src = fetchgit {
    url = "http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git";
    rev = "d950eef373ff1e0448ad3945b734da6ab050571d";
    sha256 = "816145b0341bd7862df50c058144cf6ebc25c05d2976f781ff0fe10d4559b853";
  };

  buildInputs = [ perl ];

  makeFlags = "KDIR=${kernel}/lib/modules/${kernel.version}/build";

  installPhase =
    ''
      ensureDir $out/lib/modules/${kernel.version}/misc
      cp aufs.ko $out/lib/modules/${kernel.version}/misc

      # Install the headers because aufs2-util requires them.
      cp -prvd include $out/
    '';

  meta = {
    description = "Another Unionfs implementation for Linux (second generation)";
    homepage = http://aufs.sourceforge.net/;
    maintainers = [ stdenv.lib.maintainers.eelco ];
    platforms = stdenv.lib.platforms.linux;
  };
}


{ stdenv, coreutils, fetchurl, python, dropbox }:

stdenv.mkDerivation {
  name = "dropbox-cli";

  src = fetchurl {
    # Note: dropbox doesn't version this file. Annoying.
    url = "https://linux.dropbox.com/packages/dropbox.py";
    sha256 = "0p1pg8bw6mlhqi5k8y3pgs7byg0kfvq57s53sh188lb5sxvlg7yz";
  };

  buildInputs = [ coreutils python ];

  phases = "installPhase fixupPhase";

  installPhase = ''
    mkdir -pv $out/bin/
    cp $src $out/bin/dropbox-cli
  '';

  fixupPhase = ''
    substituteInPlace $out/bin/dropbox-cli \
      --replace "/usr/bin/python" ${python}/bin/python \
      --replace "use dropbox help" "use dropbox-cli help" \
      --replace "~/.dropbox-dist/dropboxd" ${dropbox}/bin/dropbox

    chmod +x $out/bin/dropbox-cli
  '';

  meta = {
    homepage = http://dropbox.com;
    description = "Command line client for the dropbox daemon.";
    license = stdenv.lib.licenses.gpl3;
    # NOTE: Dropbox itself only works on linux, so this is ok.
    platforms = stdenv.lib.platforms.linux;
  };
}

Add myself as a maintainer of dropbox-cli.

{ stdenv, coreutils, fetchurl, python, dropbox }:

stdenv.mkDerivation {
  name = "dropbox-cli";

  src = fetchurl {
    # Note: dropbox doesn't version this file. Annoying.
    url = "https://linux.dropbox.com/packages/dropbox.py";
    sha256 = "0p1pg8bw6mlhqi5k8y3pgs7byg0kfvq57s53sh188lb5sxvlg7yz";
  };

  buildInputs = [ coreutils python ];

  phases = "installPhase fixupPhase";

  installPhase = ''
    mkdir -pv $out/bin/
    cp $src $out/bin/dropbox-cli
  '';

  fixupPhase = ''
    substituteInPlace $out/bin/dropbox-cli \
      --replace "/usr/bin/python" ${python}/bin/python \
      --replace "use dropbox help" "use dropbox-cli help" \
      --replace "~/.dropbox-dist/dropboxd" ${dropbox}/bin/dropbox

    chmod +x $out/bin/dropbox-cli
  '';

  meta = {
    homepage = http://dropbox.com;
    description = "Command line client for the dropbox daemon.";
    license = stdenv.lib.licenses.gpl3;
    maintainers = with stdenv.lib.maintainers; [ the-kenny ];
    # NOTE: Dropbox itself only works on linux, so this is ok.
    platforms = stdenv.lib.platforms.linux;
  };
}


{ buildPythonPackage
, fetchPypi
, dateutil
, jmespath
, docutils
, ordereddict
, simplejson
, mock
, nose
, urllib3
}:

buildPythonPackage rec {
  pname = "botocore";
  version = "1.12.101"; # N.B: if you change this, change boto3 and awscli to a matching version

  src = fetchPypi {
    inherit pname version;
    sha256 = "46e4daaa7c8cb29237802b63699c16a116f96f301ad2fcfef800574333b58b98";
  };

  propagatedBuildInputs = [
    dateutil
    jmespath
    docutils
    ordereddict
    simplejson
    urllib3
  ];

  checkInputs = [ mock nose ];

  checkPhase = ''
    nosetests -v
  '';

  # Network access
  doCheck = false;

  meta = {
    homepage = https://github.com/boto/botocore;
    license = "bsd";
    description = "A low-level interface to a growing number of Amazon Web Services";
  };
}

Revert "python: botocore: 1.12.96 -> 1.12.101"

{ buildPythonPackage
, fetchPypi
, dateutil
, jmespath
, docutils
, ordereddict
, simplejson
, mock
, nose
, urllib3
}:

buildPythonPackage rec {
  pname = "botocore";
  version = "1.12.96"; # N.B: if you change this, change boto3 and awscli to a matching version

  src = fetchPypi {
    inherit pname version;
    sha256 = "55c1594041e6716847d5a8b38181e3cc44e245edbf4598ae2b99e3040073b2cf";
  };

  propagatedBuildInputs = [
    dateutil
    jmespath
    docutils
    ordereddict
    simplejson
    urllib3
  ];

  checkInputs = [ mock nose ];

  checkPhase = ''
    nosetests -v
  '';

  # Network access
  doCheck = false;

  meta = {
    homepage = https://github.com/boto/botocore;
    license = "bsd";
    description = "A low-level interface to a growing number of Amazon Web Services";
  };
}


fetchTarball {
  url = "https://github.com/NixOS/nixpkgs/archive/56b9f6fc8e1c3a4ad10ff7c61e461d7b7e038833.tar.gz";
  sha256 = "0v5y4wjfxbappsaibw88h7n1flcx7kpvg51mjv3h9m4aa3fn2c8q";
}

Upgrade to latest commit in nixos-18.09 channel

fetchTarball {
  url = "https://github.com/NixOS/nixpkgs/archive/c1427bf45ffd9f738cb811f980a7a4accf342783.tar.gz";
  sha256 = "16xmd9zlbiyqd90y5a2jqwvkmbn95wcxqk0qnxlf2lkryg8cvc89";
}


x@{builderDefsPackage
  , ncurses
  , ...}:
builderDefsPackage
(a :
let
  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
    [];

  buildInputs = map (n: builtins.getAttr n x)
    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
  sourceInfo = rec {
    baseName="wavemon";
    version = "0.7.6";
    name="${baseName}-${version}";
    url="http://eden-feed.erg.abdn.ac.uk/wavemon/stable-releases/${name}.tar.bz2";
  };
in
rec {
  src = a.fetchurl {
    url = sourceInfo.url;
    sha256 = "18cwlzgmwzy7z9dfr6lwd8kmkv0pqiihizm4gi0kkm52bzz6836y";
  };

  inherit (sourceInfo) name version;
  inherit buildInputs;

  /* doConfigure should be removed if not needed */
  phaseNames = ["doConfigure" "doMakeInstall"];

  meta = {
    description = "WiFi state monitor";
    maintainers = with a.lib.maintainers;
    [
      raskin
    ];
    platforms = with a.lib.platforms;
      linux;
    license = a.lib.licenses.gpl2Plus;
    downloadPage = "http://eden-feed.erg.abdn.ac.uk/wavemon/";
    inherit version;
    updateWalker = true;
  };
}) x

Update wavemon to git version, which has some nl80211 support

{stdenv, fetchgit, ncurses, libnl, pkgconfig}:
stdenv.mkDerivation rec {
  version = "0.7.6.20151001";
  baseName="wavemon";
  name="${baseName}-${version}";
  buildInputs = [ncurses libnl pkgconfig];
  src = fetchgit {
    url = https://github.com/uoaerg/wavemon.git ;
    rev = "05753aed2ec5a786d602c7903c89fc6a230f8d42";
    sha256 = "13y4bi4qz4596f11ng6zaqir5j234wv64z4670q3pzh3fqmzmpm4";
  };
  meta = {
    inherit version;
    description = "WiFi state monitor";
    license = stdenv.lib.licenses.gpl3Plus ;
    maintainers = [stdenv.lib.maintainers.raskin];
    platforms = stdenv.lib.platforms.linux;
    downloadPage = https://github.com/uoaerg/wavemon.git ;
  };
}


# This file is autogenerated from update.sh in the same directory.
{
  beta = {
    sha256 = "1sgfwh2b0aw6l5v4ggk7frcy306x3ygxk81p3h6zdy5s1rpf8hxj";
    sha256bin64 = "1kjnxxf2ak8v1akzxz46r7a7r6bhxjb2y9fhr1fqvks3m4jc5zqw";
    version = "51.0.2704.63";
  };
  dev = {
    sha256 = "0czp4p434yqr5rv3w2vypkyis13x8lc4xph8yh84r9big1ga6fqs";
    sha256bin64 = "0hahamx9k14czswqdh8iwh69lsml0acca5kxvp2kw471g3s55n78";
    version = "52.0.2729.3";
  };
  stable = {
    sha256 = "1sgfwh2b0aw6l5v4ggk7frcy306x3ygxk81p3h6zdy5s1rpf8hxj";
    sha256bin64 = "1kjnxxf2ak8v1akzxz46r7a7r6bhxjb2y9fhr1fqvks3m4jc5zqw";
    version = "51.0.2704.63";
  };
}

Fix hash for beta Debian package

# This file is autogenerated from update.sh in the same directory.
{
  beta = {
    sha256 = "1sgfwh2b0aw6l5v4ggk7frcy306x3ygxk81p3h6zdy5s1rpf8hxj";
    sha256bin64 = "14qj8l5dapha87ndyzcs3spaxp3s9sapcjcplkisbivis09a29cb";
    version = "51.0.2704.63";
  };
  dev = {
    sha256 = "0czp4p434yqr5rv3w2vypkyis13x8lc4xph8yh84r9big1ga6fqs";
    sha256bin64 = "0hahamx9k14czswqdh8iwh69lsml0acca5kxvp2kw471g3s55n78";
    version = "52.0.2729.3";
  };
  stable = {
    sha256 = "1sgfwh2b0aw6l5v4ggk7frcy306x3ygxk81p3h6zdy5s1rpf8hxj";
    sha256bin64 = "1kjnxxf2ak8v1akzxz46r7a7r6bhxjb2y9fhr1fqvks3m4jc5zqw";
    version = "51.0.2704.63";
  };
}


{stdenv, fetchurl, ruby}:

stdenv.mkDerivation {
  name = "rake-0.8.1";
  src = fetchurl {
    url = "http://rubyforge.org/frs/download.php/29752/rake-0.8.1.tgz";
    sha256 = "1kggvkkj609hj1xvpadzchki66i7ynz3qq4nc2hmfkf536fx8c03";
  };
  buildInputs = [ruby];
  buildPhase = "true";
  installPhase = ''
    ensureDir $out/lib
    ensureDir $out/bin
    ruby setup.rb config --prefix=$out
    # --bindir $out/bin --libdir $out/lib
    ruby setup.rb setup
    ruby setup.rb install
  '';
}

Fix build. Patch by Ilya Cassina.

{stdenv, fetchurl, ruby}:

stdenv.mkDerivation {
  name = "rake-0.8.1";
  src = fetchurl {
    url = "http://rubyforge.org/frs/download.php/29752/rake-0.8.1.tgz";
    sha256 = "1kggvkkj609hj1xvpadzchki66i7ynz3qq4nc2hmfkf536fx8c03";
  };
  buildInputs = [ruby];
  patchPhase = ''
    sed -i install.rb \
        -e 's/$bindir  = destdir + $bindir/prefix = CONFIG["prefix"];$bindir = $bindir.slice(prefix.length..$bindir.length);$bindir = destdir + $bindir/' \
        -e 's/$sitedir = destdir + $sitedir/$sitedir = $sitedir.slice(prefix.length..$sitedir.length);$sitedir = destdir + $sitedir/'
  '';
  buildPhase = "true";
  installPhase = ''
    ensureDir $out/lib
    ensureDir $out/bin
    export DESTDIR=$out
    ruby install.rb
  '';
}


{ stdenv, fetchurl, pkgconfig, libgphoto2, libexif, popt, gettext
, libjpeg, readline, libtool
}:

stdenv.mkDerivation rec {
  name = "gphoto2-2.5.26";

  src = fetchurl {
    url = "mirror://sourceforge/gphoto/${name}.tar.bz2";
    sha256 = "0bxbcn31xalsvjp8fra324hf2105y3ps7zlyfz11v71j0lxj2lvn";
  };

  nativeBuildInputs = [ pkgconfig gettext libtool ];
  buildInputs = [ libgphoto2 libexif popt libjpeg readline ];

  meta = with stdenv.lib; {
    description = "A ready to use set of digital camera software applications";
    longDescription = ''

      A set of command line utilities for manipulating over 1400 different
      digital cameras. Through libgphoto2, it supports PTP, MTP, and much more..

    '';
    homepage = "http://www.gphoto.org/";
    license = licenses.gpl2Plus;
    platforms = platforms.unix;
    maintainers = [ maintainers.jcumming ];
  };
}

Switch to Github, allow building from repo.

{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
, gettext
, libexif
, libgphoto2
, libjpeg
, libtool
, popt
, readline
}:

stdenv.mkDerivation rec {
  pname = "gphoto2";
  version = "2.5.26";

  src = fetchFromGitHub {
    owner = "gphoto";
    repo = "gphoto2";
    rev = "v${version}";
    sha256 = "1w01j3qvjl2nlfs38rnsmjvn3r0r2xf7prxz1i6yarbpj3fzwqqc";
  };

  nativeBuildInputs = [
    autoreconfHook
    pkgconfig
    gettext
    libtool
  ];

  buildInputs = [
    libexif
    libgphoto2
    libjpeg
    popt
    readline
  ];

  meta = with stdenv.lib; {
    description = "A ready to use set of digital camera software applications";
    longDescription = ''

      A set of command line utilities for manipulating over 1400 different
      digital cameras. Through libgphoto2, it supports PTP, MTP, and much more..

    '';
    homepage = "http://www.gphoto.org/";
    license = licenses.gpl2Plus;
    platforms = platforms.unix;
    maintainers = [ maintainers.jcumming ];
  };
}


{ fetchurl, stdenv, intltool, pkgconfig, glib, json_glib, libsoup, geoip
, dbus, dbus_glib, modemmanager, avahi
}:

stdenv.mkDerivation rec {
  name = "geoclue-2.4.3";

  src = fetchurl {
    url = "http://www.freedesktop.org/software/geoclue/releases/2.4/${name}.tar.xz";
    sha256 = "0pk07k65dlw37nz8z5spksivsv5nh96xmbi336rf2yfxf2ldpadd";
  };

  buildInputs =
   [ intltool pkgconfig glib json_glib libsoup geoip
     dbus dbus_glib modemmanager avahi
   ];

  preConfigure = ''
     substituteInPlace configure --replace "-Werror" ""
  '';

  configureFlags = [ "--with-systemdsystemunitdir=$(out)/etc/systemd/system" ];

  propagatedBuildInputs = [ dbus dbus_glib glib ];

  meta = with stdenv.lib; {
    description = "Geolocation framework and some data providers";
    maintainers = with maintainers; [ raskin garbas ];
    platforms = platforms.linux;
    license = licenses.lgpl2;
  };
}

Fix geoclue build on Darwin

{ fetchurl, stdenv, intltool, libintlOrEmpty, pkgconfig, glib, json_glib, libsoup, geoip
, dbus, dbus_glib, modemmanager, avahi
}:

with stdenv.lib;

stdenv.mkDerivation rec {
  name = "geoclue-2.4.3";

  src = fetchurl {
    url = "http://www.freedesktop.org/software/geoclue/releases/2.4/${name}.tar.xz";
    sha256 = "0pk07k65dlw37nz8z5spksivsv5nh96xmbi336rf2yfxf2ldpadd";
  };

  buildInputs = libintlOrEmpty ++
   [ intltool pkgconfig glib json_glib libsoup geoip
     dbus dbus_glib avahi
   ] ++ optionals (!stdenv.isDarwin) [ modemmanager ];

  preConfigure = ''
     substituteInPlace configure --replace "-Werror" ""
  '';

  configureFlags = [ "--with-systemdsystemunitdir=$(out)/etc/systemd/system" ] ++
                   optionals stdenv.isDarwin [
                       "--disable-silent-rules"
                       "--disable-3g-source"
                       "--disable-cdma-source"
                       "--disable-modem-gps-source"
                       "--disable-nmea-source" ];

  NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin " -lintl";

  propagatedBuildInputs = [ dbus dbus_glib glib ];

  meta = with stdenv.lib; {
    description = "Geolocation framework and some data providers";
    maintainers = with maintainers; [ raskin garbas ];
    platforms = with platforms; linux ++ darwin;
    license = licenses.lgpl2;
  };
}


# This file is autogenerated from update.sh in the same directory.
{
  dev = {
    version = "26.0.1410.12";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-26.0.1410.12.tar.xz";
    sha256 = "1cfzvlldzgm53jwys5zbrd4rszkinsr4n5ky5rcg6p6nw73b4hmj";
  };
  beta = {
    version = "26.0.1410.12";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-26.0.1410.12.tar.xz";
    sha256 = "1cfzvlldzgm53jwys5zbrd4rszkinsr4n5ky5rcg6p6nw73b4hmj";
  };
  stable = {
    version = "25.0.1364.97";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-25.0.1364.97.tar.bz2";
    sha256 = "1r8khcic82m6g5i7669q8fxsfhjrlvp99iggqc5qpihljsz33ghm";
  };
}

Update all channels to latest versions.

# This file is autogenerated from update.sh in the same directory.
{
  dev = {
    version = "26.0.1410.28";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-26.0.1410.28.tar.xz";
    sha256 = "1g32xyh06xsqkli0g83flqr1qvx2yxb7vaqshf9wcyqgkyzvy7il";
  };
  beta = {
    version = "26.0.1410.28";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-26.0.1410.28.tar.xz";
    sha256 = "1g32xyh06xsqkli0g83flqr1qvx2yxb7vaqshf9wcyqgkyzvy7il";
  };
  stable = {
    version = "25.0.1364.152";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-25.0.1364.152.tar.bz2";
    sha256 = "1v8zpqk3q21d5hars1clss75n187hlg4zxbr68jj1ysmqclzbni8";
  };
}


{stdenv, fetchurl, flvstreamer, ffmpeg, makeWrapper, perl}:

stdenv.mkDerivation {
  name = "get_iplayer-2.80";

  buildInputs = [makeWrapper perl];

  installPhase = ''
    mkdir -p $out/bin
    cp get_iplayer $out/bin
    wrapProgram $out/bin/get_iplayer --suffix PATH ${ffmpeg}/bin:${flvstreamer}/bin
  '';

  src = fetchurl {
    url = ftp://ftp.infradead.org/pub/get_iplayer/get_iplayer-2.80.tar.gz;
    sha256 = "1hnadryyzca3bv1hfk2q3np9ihwvyxa3prwcrply6ywy4vnayjf8";
  };

}

Update get_iplayer to 2.83, and fix the package.

{stdenv, fetchurl, flvstreamer, ffmpeg, makeWrapper, perl, buildPerlPackage, perlPackages, vlc, rtmpdump}:
buildPerlPackage {
  name = "get_iplayer-2.83";

  buildInputs = [makeWrapper perl];
  propagatedBuildInputs = with perlPackages; [HTMLParser HTTPCookies LWP];

  preConfigure = "touch Makefile.PL";
  doCheck = false;

  installPhase = ''
    mkdir -p $out/bin
    cp get_iplayer $out/bin
    sed -i 's|^update_script|#update_script|' $out/bin/get_iplayer
    wrapProgram $out/bin/get_iplayer --suffix PATH : ${ffmpeg}/bin:${flvstreamer}/bin:${vlc}/bin:${rtmpdump}/bin
  '';

  src = fetchurl {
    url = ftp://ftp.infradead.org/pub/get_iplayer/get_iplayer-2.83.tar.gz;
    sha256 = "169zji0rr3z5ng6r4cyzvs89779m4iklln9gsqpryvm81ipalfga";
  };

}


{ stdenv, fetchurl, perl }:

stdenv.mkDerivation {
  name = "cowsay-3.03";
  src = fetchurl {
    url = http://www.nog.net/~tony/warez/cowsay-3.03.tar.gz;
    sha256 = "1bxj802na2si2bk5zh7n0b7c33mg8a5n2wnvh0vihl9bmjkp51hb";
  };
  buildInputs = [perl];
  installPhase = ''
    bash ./install.sh $out
  '';

  meta = {
    description = "cowsay is a program which generates ASCII pictures of a cow with a message.";
    homepage = http://www.nog.net/~tony/warez/cowsay.shtml;
  };
}

Add cowsay to the channel

{ stdenv, fetchurl, perl }:

stdenv.mkDerivation {
  name = "cowsay-3.03";

  src = fetchurl {
    url = http://www.nog.net/~tony/warez/cowsay-3.03.tar.gz;
    sha256 = "1s3c0g5vmsadicc4lrlkmkm8znm4y6wnxd8kyv9xgm676hban1il";
  };

  buildInputs = [ perl ];

  installPhase = ''
    bash ./install.sh $out
  '';

  meta = {
    description = "A program which generates ASCII pictures of a cow with a message";
    homepage = http://www.nog.net/~tony/warez/cowsay.shtml;
    platforms = stdenv.lib.platforms.all;
    maintainers = [ stdenv.lib.maintainers.rob ];
  };
}


{ reflex-platform }:

let
  skeletonSrc = reflex-platform.nixpkgs.fetchFromGitHub {
    owner = "ElvishJerricco";
    repo = "reflex-project-skeleton";
    rev = "d1cf6b26a9aa08b192e3e81ae07a4ba00064d6d2";
    sha256 = "05a3rq4ar77fpwl05z7niz025lp5wrwxzzz804jvwkamvyjxsyf2";
    fetchSubmodules = false; # Not interested in its reflex-platform checkout
  };

  skeleton = import skeletonSrc { inherit reflex-platform; };

  mkCabalProject = { shellDrv, projectFile }: shellDrv.overrideAttrs (old: {
    name = "reflex-project-skeleton-${projectFile}";
    phases = [ "unpackPhase" "buildPhase" "installPhase" ];
    src = skeletonSrc;
    CABAL_CONFIG = builtins.toFile "cabal.config" ''
    '';
    buildPhase = ''
      HOME=$NIX_BUILD_TOP
      cabal new-build all --project-file=${projectFile} ${if reflex-platform.nixpkgs.stdenv.isDarwin then "--ghc-option=-dynamic" else ""}
    '';
    installPhase = ''
      mv ./dist-newstyle $out
    '';
  });
in {
  project = skeleton;
  ghc = mkCabalProject {
    shellDrv = skeleton.shells.ghc;
    projectFile = "cabal.project";
  };
  ghcjs = mkCabalProject {
    shellDrv = skeleton.shells.ghcjs;
    projectFile = "cabal-ghcjs.project";
  };
}

Update skeleton.nix to use thunk src

{ reflex-platform }:

let
  skeletonSrc = reflex-platform.nixpkgs.fetchFromGitHub (builtins.fromJSON (builtins.readFile ./examples/project/reflex-project-skeleton/github.json))
  // {
    fetchSubmodules = false; # Not interested in its reflex-platform checkout
  };

  skeleton = import skeletonSrc { inherit reflex-platform; };

  mkCabalProject = { shellDrv, projectFile }: shellDrv.overrideAttrs (old: {
    name = "reflex-project-skeleton-${projectFile}";
    phases = [ "unpackPhase" "buildPhase" "installPhase" ];
    src = skeletonSrc;
    CABAL_CONFIG = builtins.toFile "cabal.config" ''
    '';
    buildPhase = ''
      HOME=$NIX_BUILD_TOP
      cabal new-build all --project-file=${projectFile} ${if reflex-platform.nixpkgs.stdenv.isDarwin then "--ghc-option=-dynamic" else ""}
    '';
    installPhase = ''
      mv ./dist-newstyle $out
    '';
  });
in {
  project = skeleton;
  ghc = mkCabalProject {
    shellDrv = skeleton.shells.ghc;
    projectFile = "cabal.project";
  };
  ghcjs = mkCabalProject {
    shellDrv = skeleton.shells.ghcjs;
    projectFile = "cabal-ghcjs.project";
  };
}


{ config, pkgs, ... }:

{
  require = [ ./installation-cd-minimal.nix ];

  boot.kernelPackages = pkgs.linuxPackages_3_7;
  boot.vesa = false;

  # What follows should probably move into base once the base kernel has the
  # efi boot stub

  # Get a console as soon as the initrd loads fbcon on EFI boot
  boot.initrd.kernelModules = [ "fbcon" ];

  # Enable reading EFI variables via sysfs
  boot.kernelModules = [ "efivars" ];

  # efi-related tools
  environment.systemPackages = [ pkgs.efibootmgr ];

  isoImage.makeEfiBootable = true;
}

Update EFI installation CD to meet the requirements of the new gummiboot

{ config, pkgs, ... }:

{
  require = [ ./installation-cd-minimal.nix ];

  boot.kernelPackages = pkgs.linuxPackages_3_8;
  boot.vesa = false;

  # What follows should probably move into base once the base kernel has the
  # efi boot stub

  # Get a console as soon as the initrd loads fbcon on EFI boot
  # Enable reading EFI variables via sysfs
  # !!! Needing efivars will only be necessary until http://article.gmane.org/gmane.linux.kernel.efi/773 is merged
  boot.initrd.kernelModules = [ "fbcon" "efivars" ];

  # efi-related tools
  environment.systemPackages = [ pkgs.efibootmgr ];

  isoImage.makeEfiBootable = true;
}


{ kde, kdelibs }:

kde rec {
  name = "kde-wallpapers";

  buildInputs = [ kdelibs ];

  meta = {
    description = "Additional KDE wallpapers";
  };
}

Fix a name collision between two distinct KDE wallpaper packages

{ kde, kdelibs }:

kde rec {
  name = "kdeartwork-wallpapers";

  buildInputs = [ kdelibs ];

  meta = {
    description = "Additional KDE wallpapers";
  };
}


{ lib, stdenv, fetchurl, libogg, pkg-config }:

stdenv.mkDerivation rec {
  pname = "libvorbis";
  version = "1.3.7";

  src = fetchurl {
    url = "https://downloads.xiph.org/releases/vorbis/${pname}-${version}.tar.xz";
    sha256 = "0jwmf87x5sdis64rbv0l87mdpah1rbilkkxszipbzg128f9w8g5k";
  };

  outputs = [ "out" "dev" "doc" ];

  nativeBuildInputs = [ pkg-config ];
  propagatedBuildInputs = [ libogg ];

  doCheck = true;

  preConfigure = lib.optionalString (stdenv.cc.isClang or false) ''
    sed s/\-mno\-ieee\-fp// -i {configure,configure.ac}
  '';

  meta = with lib; {
    description = "Vorbis audio compression reference implementation";
    homepage = "https://xiph.org/vorbis/";
    license = licenses.bsd3;
    maintainers = [ maintainers.ehmry ];
    platforms = platforms.all;
  };
}

Add comment on -mno-ieee-fp flag strip

{ lib, stdenv, fetchurl, libogg, pkg-config }:

stdenv.mkDerivation rec {
  pname = "libvorbis";
  version = "1.3.7";

  src = fetchurl {
    url = "https://downloads.xiph.org/releases/vorbis/${pname}-${version}.tar.xz";
    sha256 = "0jwmf87x5sdis64rbv0l87mdpah1rbilkkxszipbzg128f9w8g5k";
  };

  outputs = [ "out" "dev" "doc" ];

  nativeBuildInputs = [ pkg-config ];
  propagatedBuildInputs = [ libogg ];

  doCheck = true;

  # strip -mno-ieee-fp flag from configure and configure.ac when using
  # clang as the flag is not recognized by the compiler
  preConfigure = lib.optionalString (stdenv.cc.isClang or false) ''
    sed s/\-mno\-ieee\-fp// -i {configure,configure.ac}
  '';

  meta = with lib; {
    description = "Vorbis audio compression reference implementation";
    homepage = "https://xiph.org/vorbis/";
    license = licenses.bsd3;
    maintainers = [ maintainers.ehmry ];
    platforms = platforms.all;
  };
}


{ stdenv, fetchurl, pkgconfig, glib, libxml2, libxslt, getopt, nixUnstable, dysnomia, libintl, libiconv }:

stdenv.mkDerivation {
  name = "disnix-0.9";

  src = fetchurl {
    url = https://github.com/svanderburg/disnix/releases/download/disnix-0.9/disnix-0.9.tar.gz;
    sha256 = "1kc4520zjc1z72mknylfvrsyda9rbmm5c9mw8w13zhdwg3zbna06";
  };

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ glib libxml2 libxslt getopt nixUnstable libintl libiconv dysnomia ];

  meta = {
    description = "A Nix-based distributed service deployment tool";
    license = stdenv.lib.licenses.lgpl21Plus;
    maintainers = [ stdenv.lib.maintainers.sander ];
    platforms = stdenv.lib.platforms.unix;
  };
}

Move D-Bus conf file to share/dbus-1/system.d

{ stdenv, fetchurl, pkgconfig, glib, libxml2, libxslt, getopt, nixUnstable, dysnomia, libintl, libiconv }:

stdenv.mkDerivation {
  name = "disnix-0.9";

  src = fetchurl {
    url = https://github.com/svanderburg/disnix/releases/download/disnix-0.9/disnix-0.9.tar.gz;
    sha256 = "1kc4520zjc1z72mknylfvrsyda9rbmm5c9mw8w13zhdwg3zbna06";
  };

  configureFlags = [
    " --with-dbus-sys=${placeholder "out"}/share/dbus-1/system.d"
  ];

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ glib libxml2 libxslt getopt nixUnstable libintl libiconv dysnomia ];

  meta = {
    description = "A Nix-based distributed service deployment tool";
    license = stdenv.lib.licenses.lgpl21Plus;
    maintainers = [ stdenv.lib.maintainers.sander ];
    platforms = stdenv.lib.platforms.unix;
  };
}


{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "xdg-utils-1.0.2";

  src = fetchurl {
    url = "http://portland.freedesktop.org/download/${name}.tgz";
    sha256 = "1b019d3r1379b60p33d6z44kx589xjgga62ijz9vha95dg8vgbi1";
  };

  meta = {
    homepage = http://portland.freedesktop.org/wiki/;
    description = "A set of command line tools that assist applications with a variety of desktop integration tasks";
    license = "free";
    maintainers = [ stdenv.lib.maintainers.eelco ];
    platforms = stdenv.lib.platforms.linux;
  };
}

Fix reference to /usr/bin/file in xdg-mime

{ stdenv, fetchurl, file }:

stdenv.mkDerivation rec {
  name = "xdg-utils-1.0.2";

  src = fetchurl {
    url = "http://portland.freedesktop.org/download/${name}.tgz";
    sha256 = "1b019d3r1379b60p33d6z44kx589xjgga62ijz9vha95dg8vgbi1";
  };

  postInstall = ''
    substituteInPlace $out/bin/xdg-mime --replace /usr/bin/file ${file}/bin/file
  '';

  meta = {
    homepage = http://portland.freedesktop.org/wiki/;
    description = "A set of command line tools that assist applications with a variety of desktop integration tasks";
    license = "free";
    maintainers = [ stdenv.lib.maintainers.eelco ];
    platforms = stdenv.lib.platforms.linux;
  };
}


{
  packageOverrides = pkgs: with pkgs; {
    myPackages = pkgs.buildEnv {
      name = "my-packages";
      paths = [
        ag
        appimage-run
        augeas
        (autojump.overrideAttrs (attrs: {
          meta.priority = 3;
        }))
        bridge-utils
        curl
        dnsmasq
        file
        fuse
        fzf
        git
        gnused
        gptfdisk
        homesick
        htop
        inetutils
        less
        lxc
        lxd
        man
        man-pages
        nodejs-11_x
        openssh
        qemu
        rclone
        readline70
        (ruby_2_6.overrideAttrs (attrs: {
          meta.priority = 3;
        }))
        socat
        tig
        tmux
        tree
        (vimHugeX.overrideAttrs (attrs: {
          meta.priority = 3;
        }))
        wget
        xorg.xset
        zsh
      ];
    };
  };
}

Add ZSH packages to Nix

{
  packageOverrides = pkgs: with pkgs; {
    myPackages = pkgs.buildEnv {
      name = "my-packages";
      paths = [
        ag
        appimage-run
        augeas
        (autojump.overrideAttrs (attrs: {
          meta.priority = 3;
        }))
        bridge-utils
        curl
        dnsmasq
        file
        fuse
        fzf
        git
        gnused
        gptfdisk
        grml-zsh-config
        homesick
        htop
        inetutils
        less
        lxc
        lxd
        man
        man-pages
        nodejs-11_x
        openssh
        qemu
        rclone
        readline70
        (ruby_2_6.overrideAttrs (attrs: {
          meta.priority = 3;
        }))
        socat
        tig
        tmux
        tree
        (vimHugeX.overrideAttrs (attrs: {
          meta.priority = 3;
        }))
        wget
        xorg.xset
        zsh
        zsh-autosuggestions
        zsh-syntax-highlighting
      ];
    };
  };
}


{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "xz-5.0.5";

  src = fetchurl {
    url = "http://tukaani.org/xz/${name}.tar.bz2";
    sha256 = "1404i59bp6rzxya0br1q9njdv32z4sggyfrkjr7vq695hk94hv0n";
  };

  doCheck = true;

  # In stdenv-linux, prevent a dependency on bootstrap-tools.
  preHook = "unset CONFIG_SHELL";

  meta = {
    homepage = http://tukaani.org/xz/;
    description = "XZ, general-purpose data compression software, successor of LZMA";

    longDescription =
      '' XZ Utils is free general-purpose data compression software with high
         compression ratio.  XZ Utils were written for POSIX-like systems,
         but also work on some not-so-POSIX systems.  XZ Utils are the
         successor to LZMA Utils.

         The core of the XZ Utils compression code is based on LZMA SDK, but
         it has been modified quite a lot to be suitable for XZ Utils.  The
         primary compression algorithm is currently LZMA2, which is used
         inside the .xz container format.  With typical files, XZ Utils
         create 30 % smaller output than gzip and 15 % smaller output than
         bzip2.
      '';

    license = [ "GPLv2+" "LGPLv2.1+" ];
    maintainers = with stdenv.lib.maintainers; [ sander ];
    platforms = stdenv.lib.platforms.all;
  };
}

Fix xz to not depend on bootstrap-tools

{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "xz-5.0.5";

  src = fetchurl {
    url = "http://tukaani.org/xz/${name}.tar.bz2";
    sha256 = "1404i59bp6rzxya0br1q9njdv32z4sggyfrkjr7vq695hk94hv0n";
  };

  doCheck = true;

  # In stdenv-linux, prevent a dependency on bootstrap-tools.
  preConfigure = "unset CONFIG_SHELL";

  meta = {
    homepage = http://tukaani.org/xz/;
    description = "XZ, general-purpose data compression software, successor of LZMA";

    longDescription =
      '' XZ Utils is free general-purpose data compression software with high
         compression ratio.  XZ Utils were written for POSIX-like systems,
         but also work on some not-so-POSIX systems.  XZ Utils are the
         successor to LZMA Utils.

         The core of the XZ Utils compression code is based on LZMA SDK, but
         it has been modified quite a lot to be suitable for XZ Utils.  The
         primary compression algorithm is currently LZMA2, which is used
         inside the .xz container format.  With typical files, XZ Utils
         create 30 % smaller output than gzip and 15 % smaller output than
         bzip2.
      '';

    license = [ "GPLv2+" "LGPLv2.1+" ];
    maintainers = with stdenv.lib.maintainers; [ sander ];
    platforms = stdenv.lib.platforms.all;
  };
}