{ stdenv, fetchFromGitHub }:

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

  src = fetchFromGitHub {
    owner = "kohler";
    repo = "t1utils";
    rev = "v${version}";
    sha256 = "02n4dzxa8fz0dbxari7xh6cq66x3az6g55fq8ix2bfmww42s4v2r";
  };

  meta = with stdenv.lib; {
    description = "Collection of simple Type 1 font manipulation programs";
    longDescription = ''
      t1utils is a collection of simple type-1 font manipulation programs.
      Together, they allow you to convert between PFA (ASCII) and PFB (binary)
      formats, disassemble PFA or PFB files into human-readable form,
      reassemble them into PFA or PFB format. Additionally you can extract font
      resources from a Macintosh font file or create a Macintosh Type 1 font
      file from a PFA or PFB font.
    '';
    homepage = http://www.lcdf.org/type/;
    # README from tarball says "BSD-like" and points to non-existing LICENSE
    # file...
    license = "Click"; # MIT with extra clause, https://github.com/kohler/t1utils/blob/master/LICENSE
    platforms = platforms.all;
    maintainers = [ maintainers.bjornfor ];
  };
}

Revert "t1utils: use github cache and allow build on darwin"

{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "t1utils-1.39";

  src = fetchurl {
    url = "http://www.lcdf.org/type/${name}.tar.gz";
    sha256 = "1i6ln194ns2g4j5zjlj4bfzxpkfpnxvy37n9baq3hywjqkjz7bhg";
  };

  meta = with stdenv.lib; {
    description = "Collection of simple Type 1 font manipulation programs";
    longDescription = ''
      t1utils is a collection of simple type-1 font manipulation programs.
      Together, they allow you to convert between PFA (ASCII) and PFB (binary)
      formats, disassemble PFA or PFB files into human-readable form,
      reassemble them into PFA or PFB format. Additionally you can extract font
      resources from a Macintosh font file or create a Macintosh Type 1 font
      file from a PFA or PFB font.
    '';
    homepage = http://www.lcdf.org/type/;
    # README from tarball says "BSD-like" and points to non-existing LICENSE
    # file...
    license = "Click"; # MIT with extra clause, https://github.com/kohler/t1utils/blob/master/LICENSE
    platforms = platforms.linux;
    maintainers = [ maintainers.bjornfor ];
  };
}


args :
let
  lib = args.lib;
  fetchurl = args.fetchurl;
  doPatchShebangs = args.doPatchShebangs;
  makeManyWrappers = args.makeManyWrappers;

  version = lib.attrByPath ["version"] "0.1.7" args;
  buildInputs = with args; [
    intltool python imagemagick gtk glib webkit libxml2
    gtksourceview pkgconfig which gettext makeWrapper
    file libidn sqlite docutils libnotify libsoup
  ];
in
rec {
  src = fetchurl {
    url = "http://goodies.xfce.org/releases/midori/midori-${version}.tar.bz2";
    sha256 = if version == "0.1.7" then
      "1bxs4nlwvhzwiq73lf1gvx7qqdm1hm4x1hym1b0q0dhwhdvafx4v"
    else null;
  };

  inherit buildInputs;
  configureFlags = [];

  /* doConfigure should be specified separately */
  phaseNames = ["doUnpack" "shebangsHere" "doConfigure"
    "doMakeInstall" "shebangsInstalled" "wrapWK"
    ];

  shebangsHere = (doPatchShebangs ".");
  shebangsInstalled = (doPatchShebangs "$out/bin");
  wrapWK = (makeManyWrappers "$out/bin/*" "--set WEBKIT_IGNORE_SSL_ERRORS 1");

  name = "midori-" + version;
  meta = {
    description = "Light WebKit-based web browser with GTK GUI.";
  };
}

Add myself as midori maintainer

args :
let
  lib = args.lib;
  fetchurl = args.fetchurl;
  doPatchShebangs = args.doPatchShebangs;
  makeManyWrappers = args.makeManyWrappers;

  version = lib.attrByPath ["version"] "0.1.7" args;
  buildInputs = with args; [
    intltool python imagemagick gtk glib webkit libxml2
    gtksourceview pkgconfig which gettext makeWrapper
    file libidn sqlite docutils libnotify libsoup
  ];
in
rec {
  src = fetchurl {
    url = "http://goodies.xfce.org/releases/midori/midori-${version}.tar.bz2";
    sha256 = if version == "0.1.7" then
      "1bxs4nlwvhzwiq73lf1gvx7qqdm1hm4x1hym1b0q0dhwhdvafx4v"
    else null;
  };

  inherit buildInputs;
  configureFlags = [];

  /* doConfigure should be specified separately */
  phaseNames = ["doUnpack" "shebangsHere" "doConfigure"
    "doMakeInstall" "shebangsInstalled" "wrapWK"
    ];

  shebangsHere = (doPatchShebangs ".");
  shebangsInstalled = (doPatchShebangs "$out/bin");
  wrapWK = (makeManyWrappers "$out/bin/*" "--set WEBKIT_IGNORE_SSL_ERRORS 1");

  name = "midori-" + version;
  meta = {
    description = "Light WebKit-based web browser with GTK GUI.";
    maintainers = [args.lib.maintainers.raskin];
    platforms = with args.lib.platforms;
      linux;
  };
}


{ config, lib, ... }:

with lib;

{

  options = {

    environment.enableDebugInfo = mkOption {
      type = types.bool;
      default = false;
      description = ''
        Some NixOS packages provide debug symbols. However, these are
        not included in the system closure by default to save disk
        space. Enabling this option causes the debug symbols to appear
        in <filename>/run/current-system/sw/lib/debug/.build-id</filename>,
        where tools such as <command>gdb</command> can find them.
        If you need debug symbols for a package that doesn't
        provide them by default, you can enable them as follows:
        <programlisting>
        nixpkgs.config.packageOverrides = pkgs: {
          hello = pkgs.hello.overrideAttrs (oldAttrs: {
            separateDebugInfo = true;
          });
        };
        </programlisting>
      '';
    };

  };

  config = {

    # FIXME: currently disabled because /lib is already in
    # environment.pathsToLink, and we can't have both.
    #environment.pathsToLink = [ "/lib/debug/.build-id" ];

    environment.extraOutputsToInstall =
      optional config.environment.enableDebugInfo "debug";

  };

}

Set $NIX_DEBUG_INFO_DIRS when environment.enableDebugInfo is enabled

{ config, lib, ... }:

with lib;

{

  options = {

    environment.enableDebugInfo = mkOption {
      type = types.bool;
      default = false;
      description = ''
        Some NixOS packages provide debug symbols. However, these are
        not included in the system closure by default to save disk
        space. Enabling this option causes the debug symbols to appear
        in <filename>/run/current-system/sw/lib/debug/.build-id</filename>,
        where tools such as <command>gdb</command> can find them.
        If you need debug symbols for a package that doesn't
        provide them by default, you can enable them as follows:
        <programlisting>
        nixpkgs.config.packageOverrides = pkgs: {
          hello = pkgs.hello.overrideAttrs (oldAttrs: {
            separateDebugInfo = true;
          });
        };
        </programlisting>
      '';
    };

  };

  config = mkIf config.environment.enableDebugInfo {

    # FIXME: currently disabled because /lib is already in
    # environment.pathsToLink, and we can't have both.
    #environment.pathsToLink = [ "/lib/debug/.build-id" ];

    environment.extraOutputsToInstall = [ "debug" ];

    environment.variables.NIX_DEBUG_INFO_DIRS = [ "/run/current-system/sw/lib/debug" ];

  };

}


{ stdenv, fetchurl, cmake, pkgconfig }:

stdenv.mkDerivation rec {
  name = "uid_wrapper-1.2.0";

  src = fetchurl {
    url = "mirror://samba/cwrap/${name}.tar.gz";
    sha256 = "0sfznk53kmz9m3rxwbv4pwwqs4bw3kr917y4n53h5jaxjym0m4c0";
  };

  nativeBuildInputs = [ cmake pkgconfig ];
  buildInputs = [ (stdenv.cc.libc.out or null) ];

  meta = with stdenv.lib; {
    description = "a wrapper for the user, group and hosts NSS API";
    homepage = "https://git.samba.org/?p=uid_wrapper.git;a=summary";
    license = licenses.bsd3;
    maintainers = with maintainers; [ wkennington ];
    platforms = platforms.all;
  };
}

Remove glibc from build inputs hack

{ stdenv, fetchurl, cmake, pkgconfig }:

stdenv.mkDerivation rec {
  name = "uid_wrapper-1.2.0";

  src = fetchurl {
    url = "mirror://samba/cwrap/${name}.tar.gz";
    sha256 = "0sfznk53kmz9m3rxwbv4pwwqs4bw3kr917y4n53h5jaxjym0m4c0";
  };

  nativeBuildInputs = [ cmake pkgconfig ];

  meta = with stdenv.lib; {
    description = "a wrapper for the user, group and hosts NSS API";
    homepage = "https://git.samba.org/?p=uid_wrapper.git;a=summary";
    license = licenses.bsd3;
    maintainers = with maintainers; [ wkennington ];
    platforms = platforms.all;
  };
}


{ lib
, buildPythonPackage
, fetchPypi
, configobj
, six
, fastimport
, dulwich
, launchpadlib
, testtools
}:

buildPythonPackage rec {
  pname = "breezy";
  version = "3.1.0";

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

  propagatedBuildInputs = [ configobj six fastimport dulwich launchpadlib ];

  checkInputs = [ testtools ];

  # There is a conflict with their `lazy_import` and plugin tests
  doCheck = false;

  # symlink for bazaar compatibility
  postInstall = ''
    ln -s "$out/bin/brz" "$out/bin/bzr"
  '';

  pythonImportsCheck = [ "breezy" ];

  meta = with lib; {
    description = "Friendly distributed version control system";
    homepage = "https://www.breezy-vcs.org/";
    license = licenses.gpl2;
    maintainers = [ maintainers.marsam ];
  };
}

Revert "python: breezy: 3.0.2 -> 3.1.0"

{ lib
, buildPythonPackage
, fetchPypi
, configobj
, six
, fastimport
, dulwich
, launchpadlib
, testtools
}:

buildPythonPackage rec {
  pname = "breezy";
  version = "3.0.2";

  src = fetchPypi {
    inherit pname version;
    sha256 = "50f16bc7faf299f98fe58573da55b0664078f94b1a0e7f0ce9e1e6a0d47e68e0";
  };

  propagatedBuildInputs = [ configobj six fastimport dulwich launchpadlib ];

  checkInputs = [ testtools ];

  # There is a conflict with their `lazy_import` and plugin tests
  doCheck = false;

  # symlink for bazaar compatibility
  postInstall = ''
    ln -s "$out/bin/brz" "$out/bin/bzr"
  '';

  pythonImportsCheck = [ "breezy" ];

  meta = with lib; {
    description = "Friendly distributed version control system";
    homepage = "https://www.breezy-vcs.org/";
    license = licenses.gpl2;
    maintainers = [ maintainers.marsam ];
  };
}


let self = {
  "14.12" = "gs://nixos-cloud-images/nixos-14.12.471.1f09b77-x86_64-linux.raw.tar.gz";
  "15.09" = "gs://nixos-cloud-images/nixos-15.09.425.7870f20-x86_64-linux.raw.tar.gz";
  "16.03" = "gs://nixos-cloud-images/nixos-image-16.03.847.8688c17-x86_64-linux.raw.tar.gz";
  "17.03" = "gs://nixos-cloud-images/nixos-image-17.03.1082.4aab5c5798-x86_64-linux.raw.tar.gz";

  latest = self."17.03";
}; in self

Update GCE image for 18.03

let self = {
  "14.12" = "gs://nixos-cloud-images/nixos-14.12.471.1f09b77-x86_64-linux.raw.tar.gz";
  "15.09" = "gs://nixos-cloud-images/nixos-15.09.425.7870f20-x86_64-linux.raw.tar.gz";
  "16.03" = "gs://nixos-cloud-images/nixos-image-16.03.847.8688c17-x86_64-linux.raw.tar.gz";
  "17.03" = "gs://nixos-cloud-images/nixos-image-17.03.1082.4aab5c5798-x86_64-linux.raw.tar.gz";
  "18.03" = "gs://nixos-cloud-images/nixos-image-18.03.132536.fdb5ba4cdf9-x86_64-linux.raw.tar.gz";

  latest = self."18.03";
}; in self


{ stdenv, lib, fetchFromGitHub, cmake }:

stdenv.mkDerivation rec {
  pname = "libobjc2";
  version = "2.0";

  src = fetchFromGitHub {
    owner = "gnustep";
    repo = "libobjc2";
    rev = "v${version}";
    sha256 = "1b4h0a4pqr8j6300qr2wmi33r7ysvp705gs0ypx69hbmifln0mlf";
  };

  nativeBuildInputs = [ cmake ];

  cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" ];

  meta = with lib; {
    description = "Objective-C runtime for use with GNUstep";
    homepage = "http://gnustep.org/";
    license = licenses.mit;
    maintainers = with maintainers; [ ashalkhakov matthewbauer ];
    platforms = platforms.unix;
    badPlatforms = [ "aarch64-linux" ];
  };
}

Revert "gnustep.libobjc: 1.9 -> 2.0"

{ stdenv, lib, fetchFromGitHub, cmake }:

stdenv.mkDerivation rec {
  pname = "libobjc2";
  version = "1.9";

  src = fetchFromGitHub {
    owner = "gnustep";
    repo = "libobjc2";
    rev = "v${version}";
    sha256 = "00pscl3ly3rv6alf9vk70kxnnxq2rfgpc1ylcv6cgjs9jxdnrqmn";
  };

  nativeBuildInputs = [ cmake ];

  cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" ];

  meta = with lib; {
    description = "Objective-C runtime for use with GNUstep";
    homepage = "http://gnustep.org/";
    license = licenses.mit;
    maintainers = with maintainers; [ ashalkhakov matthewbauer ];
    platforms = platforms.unix;
    badPlatforms = [ "aarch64-linux" ];
  };
}


{ lib, buildGoModule, fetchFromGitHub, makeWrapper, kubernetes-helm }:

buildGoModule rec {
  pname = "helmfile";
  version = "0.141.0";

  src = fetchFromGitHub {
    owner = "roboll";
    repo = "helmfile";
    rev = "v${version}";
    sha256 = "sha256-UwjV3xgnZa0Emzw4FP/+gHh1ES6MTihrrlGKUBH6O9Q=";
  };

  vendorSha256 = "sha256-HKHMeDnIDmQ7AjuS2lYCMphTHGD1JgQuBYDJe2+PEk4=";

  doCheck = false;

  nativeBuildInputs = [ makeWrapper ];

  subPackages = [ "." ];

  ldflags = [ "-s" "-w" "-X github.com/roboll/helmfile/pkg/app/version.Version=${version}" ];

  postInstall = ''
    wrapProgram $out/bin/helmfile \
      --prefix PATH : ${lib.makeBinPath [ kubernetes-helm ]}
  '';

  meta = {
    description = "Deploy Kubernetes Helm charts";
    homepage = "https://github.com/roboll/helmfile";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ pneumaticat yurrriq ];
    platforms = lib.platforms.unix;
  };
}

Stop prefixing PATH with kubernetes-helm

{ lib, buildGoModule, fetchFromGitHub }:

buildGoModule rec {
  pname = "helmfile";
  version = "0.141.0";

  src = fetchFromGitHub {
    owner = "roboll";
    repo = "helmfile";
    rev = "v${version}";
    sha256 = "sha256-UwjV3xgnZa0Emzw4FP/+gHh1ES6MTihrrlGKUBH6O9Q=";
  };

  vendorSha256 = "sha256-HKHMeDnIDmQ7AjuS2lYCMphTHGD1JgQuBYDJe2+PEk4=";

  doCheck = false;

  subPackages = [ "." ];

  ldflags = [ "-s" "-w" "-X github.com/roboll/helmfile/pkg/app/version.Version=${version}" ];

  meta = {
    description = "Deploy Kubernetes Helm charts";
    homepage = "https://github.com/roboll/helmfile";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ pneumaticat yurrriq ];
    platforms = lib.platforms.unix;
  };
}


{ lib, buildPythonPackage, fetchPypi
, amqp
, botocore
, case
, Pyro4
, pytest
, pytz
, sqlalchemy
, importlib-metadata
, pythonOlder
}:

buildPythonPackage rec {
  pname = "kombu";
  version = "5.0.0";

  src = fetchPypi {
    inherit pname version;
    sha256 = "7c949fe33573a971f06c8836ca025390088f3747533b78438f9a57344a142b59";
  };

  postPatch = ''
    substituteInPlace requirements/test.txt \
      --replace "pytest-sugar" ""
    substituteInPlace requirements/default.txt \
      --replace "amqp==2.5.1" "amqp~=2.5"
  '';

  propagatedBuildInputs = [
    amqp
  ] ++ lib.optionals (pythonOlder "3.8") [
    importlib-metadata
  ];

  checkInputs = [ botocore pytest case pytz Pyro4 sqlalchemy ];
  # test_redis requires fakeredis, which isn't trivial to package
  checkPhase = ''
    pytest --ignore t/unit/transport/test_redis.py
  '';

  meta = with lib; {
    description = "Messaging library for Python";
    homepage    = "https://github.com/celery/kombu";
    license     = licenses.bsd3;
  };
}

Revert "python: kombu: 4.6.11 -> 5.0.0"

{ lib, buildPythonPackage, fetchPypi
, amqp
, botocore
, case
, Pyro4
, pytest
, pytz
, sqlalchemy
, importlib-metadata
, pythonOlder
}:

buildPythonPackage rec {
  pname = "kombu";
  version = "4.6.11";

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

  postPatch = ''
    substituteInPlace requirements/test.txt \
      --replace "pytest-sugar" ""
    substituteInPlace requirements/default.txt \
      --replace "amqp==2.5.1" "amqp~=2.5"
  '';

  propagatedBuildInputs = [
    amqp
  ] ++ lib.optionals (pythonOlder "3.8") [
    importlib-metadata
  ];

  checkInputs = [ botocore pytest case pytz Pyro4 sqlalchemy ];
  # test_redis requires fakeredis, which isn't trivial to package
  checkPhase = ''
    pytest --ignore t/unit/transport/test_redis.py
  '';

  meta = with lib; {
    description = "Messaging library for Python";
    homepage    = "https://github.com/celery/kombu";
    license     = licenses.bsd3;
  };
}


{ lib, fetchurl, appimageTools }:

let
  pname = "bootstrap-studio";
  version = "6.0.1";
  name = "bootstrap-studio-${version}";
  nameExecutable = pname;
  src = fetchurl {
    url = "https://bootstrapstudio.io/releases/desktop/${version}/Bootstrap%20Studio.AppImage";
    sha256 = "sha256-piRqIB/bCF0IBZfXdlXrc7gmPTIUDbk8xhP7X5ozyWg=";
  };
  appimageContents = appimageTools.extractType2 { inherit name src; };
in
appimageTools.wrapType2 {
  inherit pname version src;

  extraInstallCommands = ''
    mv $out/bin/${name} $out/bin/${pname}

    install -m 444 -D ${appimageContents}/bstudio.desktop -t $out/share/applications

    substituteInPlace $out/share/applications/bstudio.desktop \
      --replace 'Exec=AppRun' 'Exec=${pname}'

    install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/0x0/apps/bstudio.png \
      $out/share/icons/hicolor/512x512/apps/bstudio.png
  '';

  meta = with lib; {
    description = "Drag-and-drop designer for bootstrap";
    homepage = "https://bootstrapstudio.io/";
    license = licenses.unfree;
    maintainers = with maintainers; [ khushraj ];
    platforms = [ "x86_64-linux" ];
  };
}

Use pname and version without declaring name

{ lib, fetchurl, appimageTools }:

let
  pname = "bootstrap-studio";
  version = "6.0.1";
  src = fetchurl {
    url = "https://bootstrapstudio.io/releases/desktop/${version}/Bootstrap%20Studio.AppImage";
    sha256 = "sha256-piRqIB/bCF0IBZfXdlXrc7gmPTIUDbk8xhP7X5ozyWg=";
  };
  appimageContents = appimageTools.extractType2 { inherit pname version src; };
in
appimageTools.wrapType2 {
  inherit pname version src;

  extraInstallCommands = ''
    mv $out/bin/${pname}-${version} $out/bin/${pname}

    install -m 444 -D ${appimageContents}/bstudio.desktop -t $out/share/applications

    substituteInPlace $out/share/applications/bstudio.desktop \
      --replace 'Exec=AppRun' 'Exec=${pname}'

    install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/0x0/apps/bstudio.png \
      $out/share/icons/hicolor/512x512/apps/bstudio.png
  '';

  meta = with lib; {
    description = "Drag-and-drop designer for bootstrap";
    homepage = "https://bootstrapstudio.io/";
    license = licenses.unfree;
    maintainers = with maintainers; [ khushraj ];
    platforms = [ "x86_64-linux" ];
  };
}


# This file is autogenerated from update.sh in the same directory.
{
  dev = {
    version = "29.0.1541.2";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-29.0.1541.2.tar.xz";
    sha256 = "0i3vp2zrk1sjdhkwdhig08jh0qmzahn96pm0i22r63cp8i9vny1p";
  };
  beta = {
    version = "28.0.1500.52";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-28.0.1500.52.tar.xz";
    sha256 = "1d0q8lsvwqkaninmnyc8jjj0pnqxc5rr3lr3mgzj37avksxvyg3v";
  };
  stable = {
    version = "28.0.1500.52";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-28.0.1500.52.tar.xz";
    sha256 = "1d0q8lsvwqkaninmnyc8jjj0pnqxc5rr3lr3mgzj37avksxvyg3v";
  };
}

Update dev channel to v29.0.1547.0.

# This file is autogenerated from update.sh in the same directory.
{
  dev = {
    version = "29.0.1547.0";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-29.0.1547.0.tar.xz";
    sha256 = "0ydinl0zrsm995rcpph4i56335nzhp1fqnlz39lg4vbjsshchh9x";
  };
  beta = {
    version = "28.0.1500.52";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-28.0.1500.52.tar.xz";
    sha256 = "1d0q8lsvwqkaninmnyc8jjj0pnqxc5rr3lr3mgzj37avksxvyg3v";
  };
  stable = {
    version = "28.0.1500.52";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-28.0.1500.52.tar.xz";
    sha256 = "1d0q8lsvwqkaninmnyc8jjj0pnqxc5rr3lr3mgzj37avksxvyg3v";
  };
}


{ stdenv, fetchurl, gmp, readline, openssl, libjpeg, unixODBC, zlib,
   libXinerama, libXft, libXpm, libSM, libXt, freetype, pkgconfig,
   fontconfig }:

let
  version = "6.2.6";
in
stdenv.mkDerivation {
  name = "swi-prolog-${version}";

  src = fetchurl {
    url = "http://www.swi-prolog.org/download/stable/src/pl-${version}.tar.gz";
    sha256 = "0ii14ghmky91kkh017khahl00s4igkz03b5gy6y0vhv179sz04ll";
  };

  buildInputs = [gmp readline openssl libjpeg unixODBC libXinerama
    libXft libXpm libSM libXt zlib freetype pkgconfig fontconfig];
  configureFlags = "--with-world --enable-gmp --enable-shared";
  makeFlags = "world";

  meta = {
    homepage = http://www.swi-prolog.org/;
    description = "A Prolog compiler and interpreter";
    license = "LGPL";

    platforms = stdenv.lib.platforms.unix;
    maintainers = [ stdenv.lib.maintainers.simons ];
  };
}

Update SWI-Prolog to version 6.4.1

{ stdenv, fetchurl, gmp, readline, openssl, libjpeg, unixODBC, zlib,
   libXinerama, libXft, libXpm, libSM, libXt, freetype, pkgconfig,
   fontconfig }:

let
  version = "6.4.1";
in
stdenv.mkDerivation {
  name = "swi-prolog-${version}";

  src = fetchurl {
    url = "http://www.swi-prolog.org/download/stable/src/pl-${version}.tar.gz";
    sha256 = "1szqqwypqfd0qr3sk0qlip1ar22kpqgba6b44klmr1aag0lrahs8";
  };

  buildInputs = [gmp readline openssl libjpeg unixODBC libXinerama
    libXft libXpm libSM libXt zlib freetype pkgconfig fontconfig];
  configureFlags = "--with-world --enable-gmp --enable-shared";
  makeFlags = "world";

  meta = {
    homepage = http://www.swi-prolog.org/;
    description = "A Prolog compiler and interpreter";
    license = "LGPL";

    platforms = stdenv.lib.platforms.unix;
    maintainers = [ stdenv.lib.maintainers.simons ];
  };
}


{ fetchurl, stdenv }:

stdenv.mkDerivation rec {
  name = "pax-utils-${version}";
  version = "0.8.1";

  src = fetchurl {
    url = "http://dev.gentoo.org/~vapier/dist/${name}.tar.xz";
    sha256 = "1fgm70s52x48dxjihs0rcwmpfsi2dxbjzcilxy9fzg0i39dz4kw4";
  };

  makeFlags = [
    "DESTDIR=$(out)"
    "PREFIX=$(out)"
  ];

  meta = with stdenv.lib; {
    description = "A suite of tools for PaX/grsecurity";
    homepage    = "http://dev.gentoo.org/~vapier/dist/";
    license     = licenses.gpl2;
    platforms   = platforms.linux;
    maintainers = with maintainers; [ thoughtpolice wizeman ];
  };
}

Update from 0.8.1 -> 0.9.1

{ fetchurl, stdenv }:

stdenv.mkDerivation rec {
  name = "pax-utils-${version}";
  version = "0.9.1";

  src = fetchurl {
    url = "http://dev.gentoo.org/~vapier/dist/${name}.tar.xz";
    sha256 = "034b365il58bd01ld8r5493x7qkxbxzavmgwm916r0rgjpvclg34";
  };

  makeFlags = [
    "DESTDIR=$(out)"
    "PREFIX=$(out)"
  ];

  meta = with stdenv.lib; {
    description = "A suite of tools for PaX/grsecurity";
    homepage    = "http://dev.gentoo.org/~vapier/dist/";
    license     = licenses.gpl2;
    platforms   = platforms.linux;
    maintainers = with maintainers; [ thoughtpolice wizeman ];
  };
}


{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "fcgi-2.4.0";

  src = fetchurl {
    url = "http://www.fastcgi.com/dist/${name}.tar.gz";
    sha256 = "1f857wnl1d6jfrgfgfpz3zdaj8fch3vr13mnpcpvy8bang34bz36";
  };

  patches = [ ./gcc-4.4.diff ];

  postInstall = "ln -s . $out/include/fastcgi";

  meta = with stdenv.lib; {
    description = "A language independent, scalable, open extension to CG";
    homepage = http://www.fastcgi.com/;
    license = "FastCGI see LICENSE.TERMS";
    platforms = platforms.all;
    maintainers = with maintainers; [ wkennington ];
  };
}

Patch to protect against stack smashing

{ stdenv, fetchurl, fetchpatch }:

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

  src = fetchurl {
    url = "https://launchpad.net/debian/+archive/primary/+files/libfcgi_${version}.orig.tar.gz";
    #    url = "http://www.fastcgi.com/dist/${name}.tar.gz";
    sha256 = "1f857wnl1d6jfrgfgfpz3zdaj8fch3vr13mnpcpvy8bang34bz36";
  };

  patches = [
    ./gcc-4.4.diff
    (fetchpatch {
      # Fix a stack-smashing bug:
      # xhttps://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681591
      url = "https://bugs.launchpad.net/ubuntu/+source/libfcgi/+bug/933417/+attachment/2745025/+files/poll.patch";
      sha256 = "0v3gw0smjvrxh1bv3zx9xp633gbv5dd5bcn3ipj6ckqjyv4i6i7m";
    })
  ];

  postInstall = "ln -s . $out/include/fastcgi";

  meta = with stdenv.lib; {
    description = "A language independent, scalable, open extension to CG";
    homepage = http://www.fastcgi.com/;
    license = "FastCGI see LICENSE.TERMS";
    platforms = platforms.all;
    maintainers = with maintainers; [ wkennington ];
  };
}


{ testers, lib, pkgs, ... }:
let
  pkgs-with-overlay = pkgs.extend(final: prev: {
    proof-of-overlay-hello = prev.hello;
  });

  dummyVersioning = {
    revision = "test";
    versionSuffix = "test";
    label = "test";
  };

in
lib.recurseIntoAttrs {
  # Check that the wiring of nixosTest is correct.
  # Correct operation of the NixOS test driver should be asserted elsewhere.
  nixosTest-example = pkgs-with-overlay.testers.nixosTest ({ lib, pkgs, figlet, ... }: {
    name = "nixosTest-test";
    nodes.machine = { pkgs, ... }: {
      system.nixos = dummyVersioning;
      environment.systemPackages = [ pkgs.proof-of-overlay-hello figlet ];
      system.stateVersion = lib.trivial.release;
    };
    testScript = ''
      machine.succeed("hello | figlet >/dev/console")
    '';
  });
}

Remove redundant system.stateVersion = lib.trivial.release;

{ testers, lib, pkgs, ... }:
let
  pkgs-with-overlay = pkgs.extend(final: prev: {
    proof-of-overlay-hello = prev.hello;
  });

  dummyVersioning = {
    revision = "test";
    versionSuffix = "test";
    label = "test";
  };

in
lib.recurseIntoAttrs {
  # Check that the wiring of nixosTest is correct.
  # Correct operation of the NixOS test driver should be asserted elsewhere.
  nixosTest-example = pkgs-with-overlay.testers.nixosTest ({ lib, pkgs, figlet, ... }: {
    name = "nixosTest-test";
    nodes.machine = { pkgs, ... }: {
      system.nixos = dummyVersioning;
      environment.systemPackages = [ pkgs.proof-of-overlay-hello figlet ];
    };
    testScript = ''
      machine.succeed("hello | figlet >/dev/console")
    '';
  });
}


{ stdenv, fetchurl, fetchpatch, lib, openssl }:

stdenv.mkDerivation rec {
  pname = "ibm-sw-tpm2";
  version = "1682";

  src = fetchurl {
    url = "mirror://sourceforge/ibmswtpm2/ibmtpm${version}.tar.gz";
    hash = "sha256-PLZC+HGheyPVCwRuX5X0ScIodBX8HnrrS9u4kg28s48=";
  };

  patches = [
    (fetchpatch {
      url = "https://github.com/kgoldman/ibmswtpm2/commit/e6684009aff9c1bad38875e3319c2e02ef791424.patch";
      sha256 = "1flzlri807c88agmpb0w8xvh5f16mmqv86xw4ic4z272iynzd40j";
    })
  ];

  patchFlags = [ "-p2" ];

  buildInputs = [ openssl ];

  sourceRoot = "src";

  prePatch = ''
    # Fix hardcoded path to GCC.
    substituteInPlace makefile --replace /usr/bin/gcc "${stdenv.cc}/bin/cc"

    # Remove problematic default CFLAGS.
    substituteInPlace makefile \
      --replace -Werror "" \
      --replace -O0 "" \
      --replace -ggdb ""
  '';

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

  meta = with lib; {
    description = "IBM's Software TPM 2.0, an implementation of the TCG TPM 2.0 specification";
    homepage = "https://sourceforge.net/projects/ibmswtpm2/";
    platforms = platforms.linux;
    maintainers = with maintainers; [ delroth ];
    license = licenses.bsd3;
  };
}

Revert "ibm-sw-tpm2: Fix build on RISC-V"

{ stdenv, fetchurl, lib, openssl }:

stdenv.mkDerivation rec {
  pname = "ibm-sw-tpm2";
  version = "1682";

  src = fetchurl {
    url = "mirror://sourceforge/ibmswtpm2/ibmtpm${version}.tar.gz";
    hash = "sha256-PLZC+HGheyPVCwRuX5X0ScIodBX8HnrrS9u4kg28s48=";
  };

  buildInputs = [ openssl ];

  sourceRoot = "src";

  prePatch = ''
    # Fix hardcoded path to GCC.
    substituteInPlace makefile --replace /usr/bin/gcc "${stdenv.cc}/bin/cc"

    # Remove problematic default CFLAGS.
    substituteInPlace makefile \
      --replace -Werror "" \
      --replace -O0 "" \
      --replace -ggdb ""
  '';

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

  meta = with lib; {
    description = "IBM's Software TPM 2.0, an implementation of the TCG TPM 2.0 specification";
    homepage = "https://sourceforge.net/projects/ibmswtpm2/";
    platforms = platforms.linux;
    maintainers = with maintainers; [ delroth ];
    license = licenses.bsd3;
  };
}


{stdenv, fetchurl, SDL, qt, pkgconfig, ffmpeg, libdv, libxml2, libsamplerate,
libvorbis, sox}:

stdenv.mkDerivation {
  name = "mlt-0.6.2";

  src = fetchurl {
    url = mirror://sourceforge/mlt/mlt-0.6.2.tar.gz;
    sha256 = "0rvyblxyp52mdjl4aicrk16k56yb24ic4ir3n145cxdarwi98r7i";
  };

  buildInputs = [ qt SDL ffmpeg libdv libxml2 libsamplerate libvorbis sox ];

  # Mostly taken from:
  # http://www.kdenlive.org/user-manual/downloading-and-installing-kdenlive/installing-source/installing-mlt-rendering-engine
  configureFlags = [ "--enable-gpl" "--avformat-swscale" ];

  meta = {
    homepage = http://www.mltframework.org/;
    description = "Open source multimedia framework, designed for television broadcasting";
    license = "GPLv2+";
  };
}

Advance version of mlt; prior version no longer builds.

{stdenv, fetchurl, SDL, qt, pkgconfig, ffmpeg, libdv, libxml2, libsamplerate,
libvorbis, sox}:

stdenv.mkDerivation {
  name = "mlt-0.7.4";

  src = fetchurl {
    url = mirror://sourceforge/mlt/mlt-0.7.4.tar.gz;
    sha256 = "1xcrrd3xbz9hmahgl7xf610cm97chwpxwgcajkd10mpcxbqs08i0";
  };

  buildInputs = [ qt SDL ffmpeg libdv libxml2 libsamplerate libvorbis sox ];

  # Mostly taken from:
  # http://www.kdenlive.org/user-manual/downloading-and-installing-kdenlive/installing-source/installing-mlt-rendering-engine
  configureFlags = [ "--enable-gpl" "--avformat-swscale" ];

  meta = {
    homepage = http://www.mltframework.org/;
    description = "Open source multimedia framework, designed for television broadcasting";
    license = "GPLv2+";
  };
}


{stdenv, fetchurl, perl}:

stdenv.mkDerivation rec {
  name = "aspell-0.60.6.1";

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

  buildInputs = [ perl ];

  doCheck = true;

  # Note: Users should define the `ASPELL_CONF' environment variable to
  # `dict-dir $HOME/.nix-profile/lib/aspell/' so that they can access
  # dictionaries installed in their profile.
  #
  # We can't use `$out/etc/aspell.conf' for that purpose since Aspell
  # doesn't expand environment variables such as `$HOME'.

  meta = {
    description = "Spell checker for many languages";
    homepage = http://aspell.net/;
    license = "LGPLv2+";
    maintainers = [ ];
  };
}

Change aspell configure to use $out/lib/aspell

{stdenv, fetchurl, perl}:

stdenv.mkDerivation rec {
  name = "aspell-0.60.6.1";

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

  buildInputs = [ perl ];

  doCheck = true;

  preConfigure = ''
    configureFlagsArray=(
      --enable-pkglibdir=$out/lib/aspell
      --enable-pkgdatadir=$out/lib/aspell
    );
  '';

  # Note: Users should define the `ASPELL_CONF' environment variable to
  # `dict-dir $HOME/.nix-profile/lib/aspell/' so that they can access
  # dictionaries installed in their profile.
  #
  # We can't use `$out/etc/aspell.conf' for that purpose since Aspell
  # doesn't expand environment variables such as `$HOME'.

  meta = {
    description = "Spell checker for many languages";
    homepage = http://aspell.net/;
    license = "LGPLv2+";
    maintainers = [ ];
  };
}


# /etc files related to networking, such as /etc/services.

{config, pkgs, ...}:

let

  options = {

    networking.extraHosts = pkgs.lib.mkOption {
      default = "";
      example = "192.168.0.1 lanlocalhost";
      description = ''
        Additional entries to be appended to <filename>/etc/hosts</filename>.
      '';
    };

  };

in

{
  require = [options];

  environment.etc =
    [ { # /etc/services: TCP/UDP port assignments.
        source = pkgs.iana_etc + "/etc/services";
        target = "services";
      }

      { # /etc/protocols: IP protocol numbers.
        source = pkgs.iana_etc + "/etc/protocols";
        target = "protocols";
      }

      { # /etc/rpc: RPC program numbers.
        source = pkgs.glibc + "/etc/rpc";
        target = "rpc";
      }

      { # /etc/hosts: Hostname-to-IP mappings.
        source = pkgs.writeText "hosts"
          ''
            ${config.networking.extraHosts}
            127.0.0.1 localhost
          '';
        target = "hosts";
      }
    ];
}

Add `localhost' under its "real" host name to /etc/hosts.

# /etc files related to networking, such as /etc/services.

{config, pkgs, ...}:

let

  options = {

    networking.extraHosts = pkgs.lib.mkOption {
      default = "";
      example = "192.168.0.1 lanlocalhost";
      description = ''
        Additional entries to be appended to <filename>/etc/hosts</filename>.
      '';
    };

  };

in

{
  require = [options];

  environment.etc =
    [ { # /etc/services: TCP/UDP port assignments.
        source = pkgs.iana_etc + "/etc/services";
        target = "services";
      }

      { # /etc/protocols: IP protocol numbers.
        source = pkgs.iana_etc + "/etc/protocols";
        target = "protocols";
      }

      { # /etc/rpc: RPC program numbers.
        source = pkgs.glibc + "/etc/rpc";
        target = "rpc";
      }

      { # /etc/hosts: Hostname-to-IP mappings.
        source = pkgs.writeText "hosts"
          ''
            ${config.networking.extraHosts}
            ${if config.networking.hostName != ""
              then "127.0.0.1 ${config.networking.hostName}"
              else ""}
            127.0.0.1 localhost
          '';
        target = "hosts";
      }
    ];
}


{ lib, buildGoModule, fetchFromGitHub }:

buildGoModule rec {
  pname = "aws-iam-authenticator";
  version = "0.5.2";

  src = fetchFromGitHub {
    owner = "kubernetes-sigs";
    repo = pname;
    rev = "v${version}";
    sha256 = "1xfc3a0dik4930va30sbl6687v6i5irv96fwis9lrqh5rjqnblqp";
  };

  vendorSha256 = null;

  meta = with lib; {
    homepage = "https://github.com/kubernetes-sigs/aws-iam-authenticator";
    description = "AWS IAM credentials for Kubernetes authentication";
    license = licenses.asl20;
    maintainers = [ maintainers.srhb ];
  };
}

Add ldflags options and release version

{ lib, buildGoModule, fetchFromGitHub }:

buildGoModule rec {
  pname = "aws-iam-authenticator";
  version = "0.5.2";

  src = fetchFromGitHub {
    owner = "kubernetes-sigs";
    repo = pname;
    rev = "v${version}";
    sha256 = "1xfc3a0dik4930va30sbl6687v6i5irv96fwis9lrqh5rjqnblqp";
  };

  vendorSha256 = null;

  buildFlagsArray = [ "-ldflags=-s -w -X pkg.Version=v${version}" ];

  meta = with lib; {
    homepage = "https://github.com/kubernetes-sigs/aws-iam-authenticator";
    description = "AWS IAM credentials for Kubernetes authentication";
    license = licenses.asl20;
    maintainers = [ maintainers.srhb ];
  };
}


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

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

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

  propagatedBuildInputs = [
    dateutil
    jmespath
    docutils
    ordereddict
    simplejson
    urllib3
  ];

  postPatch = ''
    substituteInPlace setup.py --replace ",<0.16" ""
  '';

  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 "Revert "python: botocore: 1.16.6 -> 1.16.23""

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

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

  src = fetchPypi {
    inherit pname version;
    sha256 = "5831068c9b49b4c91b0733e0ec784a7733d8732359d73c67a07a0b0868433cae";
  };

  propagatedBuildInputs = [
    dateutil
    jmespath
    docutils
    ordereddict
    simplejson
    urllib3
  ];

  postPatch = ''
    substituteInPlace setup.py --replace ",<0.16" ""
  '';

  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";
  };
}


{ config, lib, stdenv, fetchurl, zlib, pkg-config, mpg123, libogg, libvorbis, portaudio, libsndfile, flac
, usePulseAudio ? config.pulseaudio or false, libpulseaudio }:

let
  version = "0.5.8";
in stdenv.mkDerivation {
  pname = "openmpt123";
  inherit version;

  src = fetchurl {
    url = "https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-${version}+release.autotools.tar.gz";
    sha256 = "sha256-KeLCEXS3P2fyul7naAjWLxgrEw5PcE7i2a6Cg5gtis0=";
  };

  enableParallelBuilding = true;
  doCheck = true;

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [ zlib mpg123 libogg libvorbis portaudio libsndfile flac ]
  ++ lib.optional usePulseAudio libpulseaudio;

  configureFlags = lib.optional (!usePulseAudio) "--without-pulseaudio";

  meta = with lib; {
    description = "A cross-platform command-line based module file player";
    homepage = "https://lib.openmpt.org/libopenmpt/";
    license = licenses.bsd3;
    maintainers = with maintainers; [ ];
    platforms = platforms.linux;
  };
}

Add maintainer, 0.5.8 -> 0.5.9

{ config, lib, stdenv, fetchurl, zlib, pkg-config, mpg123, libogg, libvorbis, portaudio, libsndfile, flac
, usePulseAudio ? config.pulseaudio or false, libpulseaudio }:

stdenv.mkDerivation rec {
  pname = "openmpt123";
  version = "0.5.9";

  src = fetchurl {
    url = "https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-${version}+release.autotools.tar.gz";
    sha256 = "0h86p8mnpm98vc4v6jbvrmm02fch7dnn332i26fg3a2s1738m04d";
  };

  enableParallelBuilding = true;

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [ zlib mpg123 libogg libvorbis portaudio libsndfile flac ]
  ++ lib.optional usePulseAudio libpulseaudio;

  configureFlags = lib.optional (!usePulseAudio) "--without-pulseaudio";

  doCheck = true;

  meta = with lib; {
    description = "A cross-platform command-line based module file player";
    homepage = "https://lib.openmpt.org/libopenmpt/";
    license = licenses.bsd3;
    maintainers = with maintainers; [ OPNA2608 ];
    platforms = platforms.unix;
  };
}


{stdenv, fetchurl, ncurses}:

stdenv.mkDerivation {
  name = "libcaca-0.99-beta13b";
  src = fetchurl {
    url = http://libcaca.zoy.org/files/libcaca-0.99.beta13b.tar.gz;
    sha256 = "0xy8pcnljnj5la97bzbwwyzyqa7dr3v9cyw8gdjzdfgqywvac1vg";
  };
  configureFlags = "--disable-x11 --disable-imlib2 --disable-doc";
  propagatedBuildInputs = [ncurses];
}

Fix the url of libcaca.

{stdenv, fetchurl, ncurses}:

stdenv.mkDerivation rec {
  name = "libcaca-0.99-beta13b";
  src = fetchurl {
	  name = "${name}.tar.gz";
    url = http://libcaca.zoy.org/attachment/wiki/libcaca/libcaca-0.99.beta13b.tar.gz?format=raw;
    sha256 = "0xy8pcnljnj5la97bzbwwyzyqa7dr3v9cyw8gdjzdfgqywvac1vg";
  };
  configureFlags = "--disable-x11 --disable-imlib2 --disable-doc";
  propagatedBuildInputs = [ncurses];

	meta = {
	  homepage = http://libcaca.zoy.org/;
		description = "A graphics library that outputs text instead of pixels.";
	  license = "WTFPL"; # http://sam.zoy.org/wtfpl/
	};
}


{ lib, stdenv, fetchurl, fetchgit, gmp }:

stdenv.mkDerivation rec {
  pname = "cln";
  version = "1.3.6";

  src = if stdenv.isDarwin then fetchgit {
    url = "git://www.ginac.de/cln.git";
    rev = "cln_${builtins.replaceStrings [ "." ] [ "-" ] version}";
    sha256 = "sha256-P32F4TIDhE2Dwzydq8iFK6ch3kICJcXeeXHs5PBQG88=";
  } else fetchurl {
    url = "${meta.homepage}${pname}-${version}.tar.bz2";
    sha256 = "0jlq9l4hphk7qqlgqj9ihjp4m3rwjbhk6q4v00lsbgbri07574pl";
  };

  buildInputs = [ gmp ];

  meta = with lib; {
    description = "C/C++ library for numbers, a part of GiNaC";
    homepage = "https://www.ginac.de/CLN/";
    license = licenses.gpl2;
    platforms = platforms.unix; # Once had cygwin problems
  };
}

Revert "cln: fix build on darwin"

{ lib, stdenv, fetchurl, gmp }:

stdenv.mkDerivation rec {
  pname = "cln";
  version = "1.3.6";

  src = fetchurl {
    url = "${meta.homepage}${pname}-${version}.tar.bz2";
    sha256 = "0jlq9l4hphk7qqlgqj9ihjp4m3rwjbhk6q4v00lsbgbri07574pl";
  };

  buildInputs = [ gmp ];

  meta = with lib; {
    description = "C/C++ library for numbers, a part of GiNaC";
    homepage = "https://www.ginac.de/CLN/";
    license = licenses.gpl2;
    platforms = platforms.unix; # Once had cygwin problems
  };
}


{ fetchurl, stdenv }:

stdenv.mkDerivation rec {
  name = "gsl-1.16";

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

  doCheck = true;

  meta = {
    description = "The GNU Scientific Library, a large numerical library";

    longDescription = ''
      The GNU Scientific Library (GSL) is a numerical library for C
      and C++ programmers.  It is free software under the GNU General
      Public License.

      The library provides a wide range of mathematical routines such
      as random number generators, special functions and least-squares
      fitting.  There are over 1000 functions in total with an
      extensive test suite.
    '';

    homepage = http://www.gnu.org/software/gsl/;
    license = "GPLv3+";

    maintainers = [ ];
  };
}

Revert "gsl: update from 1.15 to 1.16"

{ fetchurl, stdenv }:

stdenv.mkDerivation rec {
  name = "gsl-1.15";

  src = fetchurl {
    url = "mirror://gnu/gsl/${name}.tar.gz";
    sha256 = "18qf6jzz1r3mzb5qynywv4xx3z9g61hgkbpkdrhbgqh2g7jhgfc5";
  };

  doCheck = true;

  meta = {
    description = "The GNU Scientific Library, a large numerical library";

    longDescription = ''
      The GNU Scientific Library (GSL) is a numerical library for C
      and C++ programmers.  It is free software under the GNU General
      Public License.

      The library provides a wide range of mathematical routines such
      as random number generators, special functions and least-squares
      fitting.  There are over 1000 functions in total with an
      extensive test suite.
    '';

    homepage = http://www.gnu.org/software/gsl/;
    license = "GPLv3+";

    maintainers = [ ];
  };
}


{ stdenv, fetchFromGitHub, meson, pkg-config, ninja }:

stdenv.mkDerivation rec {
  pname = "aml";
  version = "0.1.0";

  src = fetchFromGitHub {
    owner = "any1";
    repo = pname;
    rev = "v${version}";
    sha256 = "1pmiflkd9idnf6p0rnmccqqlj87k8crz9ixpx6rix671vnpk0xzi";
  };

  nativeBuildInputs = [ meson pkg-config ninja ];

  meta = with stdenv.lib; {
    description = "Another main loop";
    inherit (src.meta) homepage;
    license = licenses.isc;
    platforms = platforms.unix;
    maintainers = with maintainers; [ primeos ];
  };
}

Mark as broken on Darwin

{ stdenv, fetchFromGitHub, meson, pkg-config, ninja }:

stdenv.mkDerivation rec {
  pname = "aml";
  version = "0.1.0";

  src = fetchFromGitHub {
    owner = "any1";
    repo = pname;
    rev = "v${version}";
    sha256 = "1pmiflkd9idnf6p0rnmccqqlj87k8crz9ixpx6rix671vnpk0xzi";
  };

  nativeBuildInputs = [ meson pkg-config ninja ];

  meta = with stdenv.lib; {
    description = "Another main loop";
    inherit (src.meta) homepage;
    license = licenses.isc;
    platforms = platforms.unix;
    maintainers = with maintainers; [ primeos ];
    broken = stdenv.isDarwin;
  };
}


{stdenv, fetchurl}:

stdenv.mkDerivation {
  name = "chkrootkit-0.50";

  src = fetchurl {
    url = ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz;
    sha256 = "1ivclp7ixndacjmf7xgj8lfa6h7ihx44mzzsapqdvf0c5f9gqj4m";
  };

  installPhase = "
    mkdir -p $out/sbin
    cp check_wtmpx chkdirs chklastlog chkproc chkrootkit chkutmp chkwtmp ifpromisc strings-static $out/sbin
  ";
}

Use versioned tarball URL for chkrootkit.

{stdenv, fetchurl}:

stdenv.mkDerivation {
  name = "chkrootkit-0.50";

  src = fetchurl {
    url = ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit-0.50.tar.gz;
    sha256 = "1ivclp7ixndacjmf7xgj8lfa6h7ihx44mzzsapqdvf0c5f9gqj4m";
  };

  installPhase = "
    mkdir -p $out/sbin
    cp check_wtmpx chkdirs chklastlog chkproc chkrootkit chkutmp chkwtmp ifpromisc strings-static $out/sbin
  ";
}


# This file is autogenerated from update.sh in the same directory.
{
  dev = {
    version = "25.0.1323.1";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-25.0.1323.1.tar.bz2";
    sha256 = "1i7ga1qhnjvnw2gynmpmsvvl5pxcb5z9sgldp87d9yalim5sra6s";
  };
  beta = {
    version = "24.0.1312.27";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-24.0.1312.27.tar.bz2";
    sha256 = "0w3yq3c1kf3z6k4xdgmny7l5yxyl8zidq698nsf4fm70pgav2zj1";
  };
  stable = {
    version = "23.0.1271.95";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-23.0.1271.95.tar.bz2";
    sha256 = "0g7ig49790szn8kal8jkf97qbm2qhn2bprpbq2ylq4zzvwhps29h";
  };
}

Update stable and beta channel.

# This file is autogenerated from update.sh in the same directory.
{
  dev = {
    version = "25.0.1323.1";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-25.0.1323.1.tar.bz2";
    sha256 = "1i7ga1qhnjvnw2gynmpmsvvl5pxcb5z9sgldp87d9yalim5sra6s";
  };
  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";
  };
}


{ stdenv, buildGoPackage, fetchFromGitHub }:

buildGoPackage rec {
  pname = "nomad";
  version = "0.12.1";
  rev = "v${version}";

  goPackagePath = "github.com/hashicorp/nomad";
  subPackages = [ "." ];

  src = fetchFromGitHub {
    owner = "hashicorp";
    repo = pname;
    inherit rev;
    sha256 = "05q8k2kpbknjwxw893v7p50hgrdljfgx80h8bhnny8q7vrshn51s";
  };

  # ui:
  #  Nomad release commits include the compiled version of the UI, but the file
  #  is only included if we build with the ui tag.
  # nonvidia:
  #  We disable Nvidia GPU scheduling on Linux, as it doesn't work there:
  #  Ref: https://github.com/hashicorp/nomad/issues/5535
  preBuild = let
    tags = ["ui"]
      ++ stdenv.lib.optional stdenv.isLinux "nonvidia";
    tagsString = stdenv.lib.concatStringsSep " " tags;
  in ''
    export buildFlagsArray=(
      -tags="${tagsString}"
    )
 '';

  meta = with stdenv.lib; {
    homepage = "https://www.nomadproject.io/";
    description = "A Distributed, Highly Available, Datacenter-Aware Scheduler";
    platforms = platforms.unix;
    license = licenses.mpl20;
    maintainers = with maintainers; [ rushmorem pradeepchhetri endocrimes ];
  };
}

Revert "nomad: 0.11.3 -> 0.12.1"

{ stdenv, buildGoPackage, fetchFromGitHub }:

buildGoPackage rec {
  pname = "nomad";
  version = "0.11.3";
  rev = "v${version}";

  goPackagePath = "github.com/hashicorp/nomad";
  subPackages = [ "." ];

  src = fetchFromGitHub {
    owner = "hashicorp";
    repo = pname;
    inherit rev;
    sha256 = "1p7g7x2gl77h1w7aip3xji3s530fj46gspargz4j3i6h4wkyvafb";
  };

  # ui:
  #  Nomad release commits include the compiled version of the UI, but the file
  #  is only included if we build with the ui tag.
  # nonvidia:
  #  We disable Nvidia GPU scheduling on Linux, as it doesn't work there:
  #  Ref: https://github.com/hashicorp/nomad/issues/5535
  preBuild = let
    tags = ["ui"]
      ++ stdenv.lib.optional stdenv.isLinux "nonvidia";
    tagsString = stdenv.lib.concatStringsSep " " tags;
  in ''
    export buildFlagsArray=(
      -tags="${tagsString}"
    )
 '';

  meta = with stdenv.lib; {
    homepage = "https://www.nomadproject.io/";
    description = "A Distributed, Highly Available, Datacenter-Aware Scheduler";
    platforms = platforms.unix;
    license = licenses.mpl20;
    maintainers = with maintainers; [ rushmorem pradeepchhetri endocrimes ];
  };
}


{ lib, stdenv, fetchFromGitHub, pkg-config }:

stdenv.mkDerivation rec {
  pname = "nvme-cli";
  version = "1.13";

  src = fetchFromGitHub {
    owner = "linux-nvme";
    repo = "nvme-cli";
    rev = "v${version}";
    sha256 = "1d538kp841bjh8h8d9q7inqz56rdcwb3m78zfx8607ddykv7wcqb";
  };

  nativeBuildInputs = [ pkg-config ];

  makeFlags = [ "DESTDIR=$(out)" "PREFIX=" ];

  # To omit the hostnqn and hostid files that are impure and should be unique
  # for each target host:
  installTargets = [ "install-spec" ];

  meta = with lib; {
    inherit (src.meta) homepage; # https://nvmexpress.org/
    description = "NVM-Express user space tooling for Linux";
    longDescription = ''
      NVM-Express is a fast, scalable host controller interface designed to
      address the needs for not only PCI Express based solid state drives, but
      also NVMe-oF(over fabrics).
      This nvme program is a user space utility to provide standards compliant
      tooling for NVM-Express drives. It was made specifically for Linux as it
      relies on the IOCTLs defined by the mainline kernel driver.
    '';
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
    maintainers = with maintainers; [ primeos tavyc ];
  };
}

Build with libuuid (for gen-hostnqn)

{ lib, stdenv, fetchFromGitHub, pkg-config
, libuuid
}:

stdenv.mkDerivation rec {
  pname = "nvme-cli";
  version = "1.13";

  src = fetchFromGitHub {
    owner = "linux-nvme";
    repo = "nvme-cli";
    rev = "v${version}";
    sha256 = "1d538kp841bjh8h8d9q7inqz56rdcwb3m78zfx8607ddykv7wcqb";
  };

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [ libuuid ];

  makeFlags = [ "DESTDIR=$(out)" "PREFIX=" ];

  # To omit the hostnqn and hostid files that are impure and should be unique
  # for each target host:
  installTargets = [ "install-spec" ];

  meta = with lib; {
    inherit (src.meta) homepage; # https://nvmexpress.org/
    description = "NVM-Express user space tooling for Linux";
    longDescription = ''
      NVM-Express is a fast, scalable host controller interface designed to
      address the needs for not only PCI Express based solid state drives, but
      also NVMe-oF(over fabrics).
      This nvme program is a user space utility to provide standards compliant
      tooling for NVM-Express drives. It was made specifically for Linux as it
      relies on the IOCTLs defined by the mainline kernel driver.
    '';
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
    maintainers = with maintainers; [ primeos tavyc ];
  };
}


# This function downloads and normalizes a patch/diff file.
# This is primarily useful for dynamically generated patches,
# such as GitHub's or cgit's, where the non-significant content parts
# often change with updating of git or cgit.
# stripLen acts as the -p parameter when applying a patch.

{ fetchurl, patchutils }:
{ stripLen ? 0, ... }@args:

fetchurl ({
  postFetch = ''
    tmpfile="$TMPDIR/${args.sha256}"
    "${patchutils}/bin/lsdiff" "$out" \
      | sort -u | sed -e 's/[*?]/\\&/g' \
      | xargs -I{} \
        "${patchutils}/bin/filterdiff" \
        --include={} \
        --strip=${toString stripLen} \
        --clean "$out" > "$tmpfile"
    mv "$tmpfile" "$out"
  '';
} // builtins.removeAttrs args ["stripLen"])

Allow to pass a postFetch attribute.

# This function downloads and normalizes a patch/diff file.
# This is primarily useful for dynamically generated patches,
# such as GitHub's or cgit's, where the non-significant content parts
# often change with updating of git or cgit.
# stripLen acts as the -p parameter when applying a patch.

{ fetchurl, patchutils }:
{ stripLen ? 0, ... }@args:

fetchurl ({
  postFetch = ''
    tmpfile="$TMPDIR/${args.sha256}"
    "${patchutils}/bin/lsdiff" "$out" \
      | sort -u | sed -e 's/[*?]/\\&/g' \
      | xargs -I{} \
        "${patchutils}/bin/filterdiff" \
        --include={} \
        --strip=${toString stripLen} \
        --clean "$out" > "$tmpfile"
    mv "$tmpfile" "$out"
    ${args.postFetch or ""}
  '';
} // builtins.removeAttrs args ["stripLen"])


{ stdenv, buildGoPackage, fetchFromGitHub }:

buildGoPackage rec {
  version = "1.6.1";
  name = "certmgr-${version}";

  goPackagePath = "github.com/cloudflare/certmgr/";

  src = fetchFromGitHub {
    owner = "cloudflare";
    repo = "certmgr";
    rev = "v${version}";
    sha256 = "1ky2pw1wxrb2fxfygg50h0mid5l023x6xz9zj5754a023d01qqr2";
  };

  meta = with stdenv.lib; {
    homepage = https://cfssl.org/;
    description = "Cloudflare's certificate manager";
    platforms = platforms.linux;
    license = licenses.bsd2;
    maintainers = with maintainers; [ johanot srhb ];
  };
}

Add patch for optional trust of self-signed certificates at remote cfssl apiserver

{ stdenv, buildGoPackage, fetchFromGitHub, fetchpatch }:

buildGoPackage rec {
  version = "1.6.1";
  name = "certmgr-${version}";

  goPackagePath = "github.com/cloudflare/certmgr/";

  src = fetchFromGitHub {
    owner = "cloudflare";
    repo = "certmgr";
    rev = "v${version}";
    sha256 = "1ky2pw1wxrb2fxfygg50h0mid5l023x6xz9zj5754a023d01qqr2";
  };

  # The following patch makes it possible to use a self-signed x509 cert
  # for the cfssl apiserver.
  # TODO: remove patch when PR is merged.
  patches = [
    (fetchpatch {
      url    = "https://github.com/cloudflare/certmgr/pull/51.patch";
      sha256 = "0jhsw159d2mgybvbbn6pmvj4yqr5cwcal5fjwkcn9m4f4zlb6qrs";
    })
  ];

  meta = with stdenv.lib; {
    homepage = https://cfssl.org/;
    description = "Cloudflare's certificate manager";
    platforms = platforms.linux;
    license = licenses.bsd2;
    maintainers = with maintainers; [ johanot srhb ];
  };
}


{ callPackage }:
  {
    org = callPackage ({ elpaBuild, fetchurl, lib }:
      elpaBuild {
        pname = "org";
        ename = "org";
        version = "20210315";
        src = fetchurl {
          url = "https://orgmode.org/elpa/org-20210315.tar";
          sha256 = "128agds82kfmvxshzrs61802vgwlf2dsm79hq9x2bljrnvf8p14l";
        };
        packageRequires = [];
        meta = {
          homepage = "https://elpa.gnu.org/packages/org.html";
          license = lib.licenses.free;
        };
      }) {};
    org-plus-contrib = callPackage ({ elpaBuild, fetchurl, lib }:
      elpaBuild {
        pname = "org-plus-contrib";
        ename = "org-plus-contrib";
        version = "20210315";
        src = fetchurl {
          url = "https://orgmode.org/elpa/org-plus-contrib-20210315.tar";
          sha256 = "0dih4690pbbnwlphjnv1kgvsw43pkcgk41xjjiphy9sf7w9gr11j";
        };
        packageRequires = [];
        meta = {
          homepage = "https://elpa.gnu.org/packages/org-plus-contrib.html";
          license = lib.licenses.free;
        };
      }) {};
  }

Update Org Mode Emacs packages

{ callPackage }:
  {
    org = callPackage ({ elpaBuild, fetchurl, lib }:
      elpaBuild {
        pname = "org";
        ename = "org";
        version = "20210322";
        src = fetchurl {
          url = "https://orgmode.org/elpa/org-20210322.tar";
          sha256 = "0iv54rhwa0972yr1wqzmlkggs5vc6qajz8mmyfhynp65ap088g6v";
        };
        packageRequires = [];
        meta = {
          homepage = "https://elpa.gnu.org/packages/org.html";
          license = lib.licenses.free;
        };
      }) {};
    org-plus-contrib = callPackage ({ elpaBuild, fetchurl, lib }:
      elpaBuild {
        pname = "org-plus-contrib";
        ename = "org-plus-contrib";
        version = "20210322";
        src = fetchurl {
          url = "https://orgmode.org/elpa/org-plus-contrib-20210322.tar";
          sha256 = "0riswc3ira8hsawm37yypji55z47bw2477kaw3qx7ghz3n62r9nf";
        };
        packageRequires = [];
        meta = {
          homepage = "https://elpa.gnu.org/packages/org-plus-contrib.html";
          license = lib.licenses.free;
        };
      }) {};
  }


{stdenv, fetchurl, writeScript, pkgconfig, cmake, qt4, seafile-shared, ccnet, makeWrapper}:

stdenv.mkDerivation rec
{
  version = "2.1.1";
  name = "seafile-client-${version}";

  src = fetchurl
  {
    url = "https://github.com/haiwen/seafile-client/archive/v${version}.tar.gz";
    sha256 = "d98515ea229df702cbe973d85ec0bd5cf3f5282ef1022ba0157d5301b521c8e0";
  };

  buildInputs = [ pkgconfig cmake qt4 seafile-shared makeWrapper ];

  builder = writeScript "${name}-builder.sh" ''
  source $stdenv/setup

  tar xvfz $src
  cd seafile-client-*

  cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DCMAKE_INSTALL_PREFIX="$out" .
  make -j1

  make install

  wrapProgram $out/bin/seafile-applet \
    --suffix PATH : ${ccnet}/bin:${seafile-shared}/bin
  '';

  meta =
  {
    homepage = "https://github.com/haiwen/seafile-clients";
    description = "Desktop client for Seafile, the Next-generation Open Source Cloud Storage";
    license = stdenv.lib.licenses.asl20;
    maintainers = [ stdenv.lib.maintainers.calrama ];
  };
}

Add indentation for multi-line strings in seafile-client expression


{ pkgs, lib, ... }:

{
  programs.git.enable = true;
  programs.git.ignores = [
    "*~"
  ];

  # TODO multiple "insteadOf"
  programs.git.userName = "John Ericson";

  # Need to override on work machines
  programs.git.userEmail = lib.mkDefault "git@JohnEricson.me";

  programs.git.iniContent = {
    "push" = {
      default = "simple";
    };
    "merge" = {
      conflictstyle = "diff3";
    };
    "rerere" = {
      enabled = true;
    };
    "url \"ssh://git@gist.github.com\"" = {
      insteadOf = git://gist.github.com;
      "insteadOf " = https://gist.github.com;
      "insteadOf  " = http://gist.github.com;
    };
    "url \"ssh://git@github.com\"" = {
      insteadOf = git://github.com;
      "insteadOf " = https://github.com;
      "insteadOf  " = http://github.com;
    };
    "url \"ssh://git@gitlab.com\"" = {
      insteadOf = git://gitlab.com;
      "insteadOf " = https://gitlab.com;
      "insteadOf  " = http://gitlab.com;
    };
    "url \"ssh://git@bitbucket.com\"" = {
      insteadOf = git://bitbucket.com;
      "insteadOf " = https://bitbucket.com;
      "insteadOf  " = http://bitbucket.com;
    };
  };
  programs.git.package = pkgs.gitFull.override { guiSupport = true; };
}

Rewrite gitlab links from any domain

{ pkgs, lib, ... }:

{
  programs.git.enable = true;
  programs.git.ignores = [
    "*~"
  ];

  # TODO multiple "insteadOf"
  programs.git.userName = "John Ericson";

  # Need to override on work machines
  programs.git.userEmail = lib.mkDefault "git@JohnEricson.me";

  programs.git.iniContent = {
    "push" = {
      default = "simple";
    };
    "merge" = {
      conflictstyle = "diff3";
    };
    "rerere" = {
      enabled = true;
    };
    "url \"ssh://git@gist.github.com\"" = {
      insteadOf = git://gist.github.com;
      "insteadOf " = https://gist.github.com;
      "insteadOf  " = http://gist.github.com;
    };
    "url \"ssh://git@github.com\"" = {
      insteadOf = git://github.com;
      "insteadOf " = https://github.com;
      "insteadOf  " = http://github.com;
    };
    "url \"ssh://git@gitlab.\"" = {
      insteadOf = git://gitlab.;
      "insteadOf " = https://gitlab.;
      "insteadOf  " = http://gitlab.;
    };
    "url \"ssh://git@bitbucket.com\"" = {
      insteadOf = git://bitbucket.com;
      "insteadOf " = https://bitbucket.com;
      "insteadOf  " = http://bitbucket.com;
    };
  };
  programs.git.package = pkgs.gitFull.override { guiSupport = true; };
}


{ lib, stdenv, fetchurl, flex, bison, bluez, pkg-config, withBluez ? false }:

with lib;

stdenv.mkDerivation rec {
  pname = "libpcap";
  version = "1.10.1";

  outputs = [ "out" "dev" ];

  src = fetchurl {
    url = "https://www.tcpdump.org/release/${pname}-${version}.tar.gz";
    sha256 = "sha256-7ShfSsyvBTRPkJdXV7Pb/ncrpB0cQBwmSLf6RbcRvdQ=";
  };

  nativeBuildInputs = [ flex bison ]
    ++ optionals withBluez [ bluez.dev pkg-config ];

  # We need to force the autodetection because detection doesn't
  # work in pure build environments.
  configureFlags = [
    "--with-pcap=${if stdenv.isLinux then "linux" else "bpf"}"
  ] ++ optionals stdenv.isDarwin [
    "--disable-universal"
  ] ++ optionals (stdenv.hostPlatform == stdenv.buildPlatform)
    [ "ac_cv_linux_vers=2" ];

  postInstall = ''
    if [ "$dontDisableStatic" -ne "1" ]; then
      rm -f $out/lib/libpcap.a
    fi

    moveToOutput "bin/pcap-config" "$dev"
  '';

  meta = {
    homepage = "https://www.tcpdump.org";
    description = "Packet Capture Library";
    platforms = platforms.unix;
    maintainers = with maintainers; [ fpletz ];
    license = licenses.bsd3;
  };
}

Revert "libpcap: move dev things to extra output"

{ lib, stdenv, fetchurl, flex, bison, bluez, pkg-config, withBluez ? false }:

with lib;

stdenv.mkDerivation rec {
  pname = "libpcap";
  version = "1.10.1";

  src = fetchurl {
    url = "https://www.tcpdump.org/release/${pname}-${version}.tar.gz";
    sha256 = "sha256-7ShfSsyvBTRPkJdXV7Pb/ncrpB0cQBwmSLf6RbcRvdQ=";
  };

  nativeBuildInputs = [ flex bison ]
    ++ optionals withBluez [ bluez.dev pkg-config ];

  # We need to force the autodetection because detection doesn't
  # work in pure build environments.
  configureFlags = [
    "--with-pcap=${if stdenv.isLinux then "linux" else "bpf"}"
  ] ++ optionals stdenv.isDarwin [
    "--disable-universal"
  ] ++ optionals (stdenv.hostPlatform == stdenv.buildPlatform)
    [ "ac_cv_linux_vers=2" ];

  postInstall = ''
    if [ "$dontDisableStatic" -ne "1" ]; then
      rm -f $out/lib/libpcap.a
    fi
  '';

  meta = {
    homepage = "https://www.tcpdump.org";
    description = "Packet Capture Library";
    platforms = platforms.unix;
    maintainers = with maintainers; [ fpletz ];
    license = licenses.bsd3;
  };
}


{ buildPythonPackage, fetchPypi, stdenv, py4j }:

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

  src = fetchPypi {
    inherit pname version;
    sha256 = "38b485d3634a86c9a2923c39c8f08f003fdd0e0a3d7f07114b2fb4392ce60479";
  };

  # pypandoc is broken with pandoc2, so we just lose docs.
  postPatch = ''
    sed -i "s/'pypandoc'//" setup.py

    # Current release works fine with py4j 0.10.8.1
    substituteInPlace setup.py --replace py4j==0.10.7 'py4j>=0.10.7,<0.11'
  '';

  propagatedBuildInputs = [ py4j ];

  # Tests assume running spark...
  doCheck = false;

  meta = with stdenv.lib; {
    description = "Apache Spark";
    homepage = "https://github.com/apache/spark/tree/master/python";
    license = licenses.asl20;
    maintainers = [ maintainers.shlevy ];
  };
}

Fix out of date postPatch

{ buildPythonPackage, fetchPypi, stdenv, py4j }:

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

  src = fetchPypi {
    inherit pname version;
    sha256 = "38b485d3634a86c9a2923c39c8f08f003fdd0e0a3d7f07114b2fb4392ce60479";
  };

  # pypandoc is broken with pandoc2, so we just lose docs.
  postPatch = ''
    sed -i "s/'pypandoc'//" setup.py

    substituteInPlace setup.py --replace py4j==0.10.9 'py4j>=0.10.9,<0.11'
  '';

  propagatedBuildInputs = [ py4j ];

  # Tests assume running spark...
  doCheck = false;

  meta = with stdenv.lib; {
    description = "Apache Spark";
    homepage = "https://github.com/apache/spark/tree/master/python";
    license = licenses.asl20;
    maintainers = [ maintainers.shlevy ];
  };
}


{ lib, buildPythonPackage, fetchPypi }:

buildPythonPackage rec {
  pname = "pycodestyle";
  version = "2.4.0";

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

  meta = with lib; {
    description = "Python style guide checker (formerly called pep8)";
    homepage = https://pycodestyle.readthedocs.io;
    license = licenses.mit;
    maintainers = with maintainers; [ garbas ];
  };
}

Revert "python.pkgs.pycodestyle: 2.3.1 -> 2.4.0"

{ lib, buildPythonPackage, fetchPypi }:

buildPythonPackage rec {
  pname = "pycodestyle";
  version = "2.3.1";

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

  meta = with lib; {
    description = "Python style guide checker (formerly called pep8)";
    homepage = https://pycodestyle.readthedocs.io;
    license = licenses.mit;
    maintainers = with maintainers; [ garbas ];
  };
}


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

with lib;

{

  ###### interface

  options = {

    hardware.cpu.amd.updateMicrocode = mkOption {
      default = false;
      type = types.bool;
      description = ''
        Update the CPU microcode for AMD processors.
      '';
    };

  };

  ###### implementation

  config = mkIf config.hardware.cpu.amd.updateMicrocode {
    hardware.firmware = [ "${pkgs.amdUcode}/lib/firmware" ];
    boot.kernelModules = [ "microcode" ];
  };

}

Update to early initrd loader

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

with lib;

{

  ###### interface

  options = {

    hardware.cpu.amd.updateMicrocode = mkOption {
      default = false;
      type = types.bool;
      description = ''
        Update the CPU microcode for AMD processors.
      '';
    };

  };

  ###### implementation

  config = mkIf config.hardware.cpu.amd.updateMicrocode {
    boot.initrd.prepend = [ "${pkgs.microcodeAmd}/amd-ucode.img" ];
  };

}


{ pkgs, config, lib, ... }:
with lib; let
  cfg = config.ggazzi.applications;
  systemCfg = config.machineData.systemConfig;
in {

  imports = [
    ./vscode
    ./vivaldi.nix
  ];

  config = mkIf (cfg.enable && systemCfg.desktop.enable) {
    home.packages = with pkgs; [
      # Password manager
      keepassxc

      # Cloud Storage
      seafile-client

      # Communication tools
      tdesktop discord

      # Fonts
      fira fira-mono fira-code fira-code-symbols
    ];

    # Visual Studio Code as a text editor
    programs.vscode.enable = true;

    # Make discord work even when the latest version isn't available on nix
    xdg.configFile."discord/settings.json".text = ''
      { "SKIP_HOST_UPDATE": true }
    '';

    fonts.fontconfig.enable = systemCfg.desktop.enable;
  };

}

Add a graphical diff tool

{ pkgs, config, lib, ... }:
with lib; let
  cfg = config.ggazzi.applications;
  systemCfg = config.machineData.systemConfig;
in {

  imports = [
    ./vscode
    ./vivaldi.nix
  ];

  config = mkIf (cfg.enable && systemCfg.desktop.enable) {
    home.packages = with pkgs; [
      # Password manager
      keepassxc

      # Cloud Storage
      seafile-client

      # Communication tools
      tdesktop discord

      # Fonts
      fira fira-mono fira-code fira-code-symbols

      # Text tools
      meld
    ];

    # Visual Studio Code as a text editor
    programs.vscode.enable = true;

    # Make discord work even when the latest version isn't available on nix
    xdg.configFile."discord/settings.json".text = ''
      { "SKIP_HOST_UPDATE": true }
    '';

    fonts.fontconfig.enable = systemCfg.desktop.enable;
  };

}


{ lib, buildPythonPackage, fetchPypi
, traitlets

# tests
, ipython
}:

buildPythonPackage rec {
  pname = "matplotlib-inline";
  version = "0.1.3";

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

  propagatedBuildInputs = [
    traitlets
  ];

  # wants to import ipython, which creates a circular dependency
  doCheck = false;
  pythonImportsCheck = [ "matplotlib_inline" ];

  passthru.tests = { inherit ipython; };

  meta = with lib; {
    description = "Matplotlib Inline Back-end for IPython and Jupyter";
    homepage = "https://github.com/ipython/matplotlib-inline";
    license = licenses.bsd3;
    maintainers = with maintainers; [ jonringer ];
  };
}

Revert "matplotlib-inline: Don't depend on matplotlib -> smaller ipython closure"

{ lib, buildPythonPackage, fetchPypi
, matplotlib
, traitlets

# tests
, ipython
}:

buildPythonPackage rec {
  pname = "matplotlib-inline";
  version = "0.1.3";

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

  propagatedBuildInputs = [
    matplotlib # not documented, but required
    traitlets
  ];

  # wants to import ipython, which creates a circular dependency
  doCheck = false;
  pythonImportsCheck = [ "matplotlib_inline" ];

  passthru.tests = { inherit ipython; };

  meta = with lib; {
    description = "Matplotlib Inline Back-end for IPython and Jupyter";
    homepage = "https://github.com/ipython/matplotlib-inline";
    license = licenses.bsd3;
    maintainers = with maintainers; [ jonringer ];
  };
}


{stdenv, fetchurl, leptonica, zlib, libwebp, giflib, libjpeg, libpng, libtiff }: stdenv.mkDerivation {
  name = "jbig2enc-0.28";

  src = fetchurl {
    url = http://github.com/agl/jbig2enc/archive/0.28-dist.tar.gz;
    sha256 = "1wc0lmqz4jag3rhhk1xczlqpfv2qqp3fz7wzic2lba3vsbi1rrw3";
  };

  propagatedBuildInputs = [ leptonica zlib libwebp giflib libjpeg libpng libtiff ];

  # This is necessary, because the resulting library has
  # /tmp/nix-build-jbig2enc/src/.libs before /nix/store/jbig2enc/lib
  # in its rpath, which means that patchelf --shrink-rpath removes
  # the /nix/store one.  By cleaning up before fixup, we ensure that
  # the /tmp/nix-build-jbig2enc/src/.libs directory is gone.
  preFixup = ''
    make clean
  '';
}

Add meta attributes for jbig2enc

{stdenv, fetchurl, leptonica, zlib, libwebp, giflib, libjpeg, libpng, libtiff }: stdenv.mkDerivation {
  name = "jbig2enc-0.28";

  src = fetchurl {
    url = http://github.com/agl/jbig2enc/archive/0.28-dist.tar.gz;
    sha256 = "1wc0lmqz4jag3rhhk1xczlqpfv2qqp3fz7wzic2lba3vsbi1rrw3";
  };

  propagatedBuildInputs = [ leptonica zlib libwebp giflib libjpeg libpng libtiff ];

  # This is necessary, because the resulting library has
  # /tmp/nix-build-jbig2enc/src/.libs before /nix/store/jbig2enc/lib
  # in its rpath, which means that patchelf --shrink-rpath removes
  # the /nix/store one.  By cleaning up before fixup, we ensure that
  # the /tmp/nix-build-jbig2enc/src/.libs directory is gone.
  preFixup = ''
    make clean
  '';

  meta = {
    description = "Encoder for the JBIG2 image compression format";
    license = stdenv.lib.licenses.asl20;
    platforms = stdenv.lib.platforms.all;
  };
}


{stdenv, fetchurl, pcre, ocaml, findlib}:

let
  ocaml_version = (builtins.parseDrvName ocaml.name).version;
  version = "6.2.5";
in

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

  src = fetchurl {
    url = "http://www.ocaml.info/ocaml_sources/pcre-ocaml-${version}.tar.gz";
    sha256 = "f1774028a4525d22d1f4cf4ce0121c99d85a75aed7a498c3e8ab0f5e39888e47";
  };

  buildInputs = [pcre ocaml findlib];

  createFindlibDestdir = true;

  configurePhase = "true";	# Skip configure phase

  meta = {
    homepage = "http://www.ocaml.info/home/ocaml_sources.html";
    description = "An efficient C-library for pattern matching with Perl-style regular expressions in OCaml";
    license = "LGPL";
    platforms = ocaml.meta.platforms;
    maintainers = [
      stdenv.lib.maintainers.z77z
    ];
  };
}

Fix of the ocaml pcre nix expr. Added 'pcre' as propagated build input.

{stdenv, fetchurl, pcre, ocaml, findlib}:

let
  ocaml_version = (builtins.parseDrvName ocaml.name).version;
  version = "6.2.5";
in

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

  src = fetchurl {
    url = "http://www.ocaml.info/ocaml_sources/pcre-ocaml-${version}.tar.gz";
    sha256 = "f1774028a4525d22d1f4cf4ce0121c99d85a75aed7a498c3e8ab0f5e39888e47";
  };

  buildInputs = [ocaml findlib];
  propagatedBuildInputs = [pcre];

  createFindlibDestdir = true;

  configurePhase = "true";	# Skip configure phase

  meta = {
    homepage = "http://www.ocaml.info/home/ocaml_sources.html";
    description = "An efficient C-library for pattern matching with Perl-style regular expressions in OCaml";
    license = "LGPL";
    platforms = ocaml.meta.platforms;
    maintainers = [
      stdenv.lib.maintainers.z77z
    ];
  };
}


{ stdenv, fetchFromGitHub, rustPlatform, darwin }:

rustPlatform.buildRustPackage rec {
  name = "rustfmt-${version}";
  version = "1.2.1";

  src = fetchFromGitHub {
    owner = "rust-lang";
    repo = "rustfmt";
    rev = "v${version}";
    sha256 = "153pas7d5fchkmiw6mkbhn75lv3y69k85spzmm5i4lqnq7f0yqap";
  };

  cargoSha256 = "08x6vy5v2vgrk3gsw3qcvv52a7hifsgcsnsg1phlk1ikaff21y4z";

  buildInputs = stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;

  # As of 1.0.0 and rustc 1.30 rustfmt requires a nightly compiler
  RUSTC_BOOTSTRAP = 1;

  # we run tests in debug mode so tests look for a debug build of
  # rustfmt. Anyway this adds nearly no compilation time.
  preCheck = ''
    cargo build
  '';

  meta = with stdenv.lib; {
    description = "A tool for formatting Rust code according to style guidelines";
    homepage = https://github.com/rust-lang-nursery/rustfmt;
    license = with licenses; [ mit asl20 ];
    maintainers = [ maintainers.globin ];
    broken = stdenv.isDarwin;
    platforms = platforms.all;
  };
}

Revert "rustfmt: mark as broken on darwin"

{ stdenv, fetchFromGitHub, rustPlatform, darwin }:

rustPlatform.buildRustPackage rec {
  name = "rustfmt-${version}";
  version = "1.2.1";

  src = fetchFromGitHub {
    owner = "rust-lang";
    repo = "rustfmt";
    rev = "v${version}";
    sha256 = "153pas7d5fchkmiw6mkbhn75lv3y69k85spzmm5i4lqnq7f0yqap";
  };

  cargoSha256 = "08x6vy5v2vgrk3gsw3qcvv52a7hifsgcsnsg1phlk1ikaff21y4z";

  buildInputs = stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;

  # As of 1.0.0 and rustc 1.30 rustfmt requires a nightly compiler
  RUSTC_BOOTSTRAP = 1;

  # we run tests in debug mode so tests look for a debug build of
  # rustfmt. Anyway this adds nearly no compilation time.
  preCheck = ''
    cargo build
  '';

  meta = with stdenv.lib; {
    description = "A tool for formatting Rust code according to style guidelines";
    homepage = https://github.com/rust-lang-nursery/rustfmt;
    license = with licenses; [ mit asl20 ];
    maintainers = [ maintainers.globin ];
    platforms = platforms.all;
  };
}


{ pkgs
, buildPythonPackage
, fetchPypi
, python
, azure-mgmt-common
}:

buildPythonPackage rec {
  version = "2.0.0";
  pname = "azure-mgmt-resource";

  src = fetchPypi {
    inherit pname version;
    extension = "zip";
    sha256 = "2e83289369be88d0f06792118db5a7d4ed7150f956aaae64c528808da5518d7f";
  };

  preConfigure = ''
    # Patch to make this package work on requests >= 2.11.x
    # CAN BE REMOVED ON NEXT PACKAGE UPDATE
    sed -i 's|len(request_content)|str(len(request_content))|' azure/mgmt/resource/resourcemanagement.py
  '';

  postInstall = ''
    echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/__init__.py
    echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/mgmt/__init__.py
  '';

  propagatedBuildInputs = [ azure-mgmt-common ];

  meta = with pkgs.lib; {
    description = "Microsoft Azure SDK for Python";
    homepage = "https://azure.microsoft.com/en-us/develop/python/";
    license = licenses.asl20;
    maintainers = with maintainers; [ olcai ];
  };
}

Revert "python: azure-mgmt-resource: 0.20.1 -> 2.0.0"

{ pkgs
, buildPythonPackage
, fetchPypi
, python
, azure-mgmt-common
}:

buildPythonPackage rec {
  version = "0.20.1";
  pname = "azure-mgmt-resource";

  src = fetchPypi {
    inherit pname version;
    extension = "zip";
    sha256 = "0slh9qfm5nfacrdm3lid0sr8kwqzgxvrwf27laf9v38kylkfqvml";
  };

  preConfigure = ''
    # Patch to make this package work on requests >= 2.11.x
    # CAN BE REMOVED ON NEXT PACKAGE UPDATE
    sed -i 's|len(request_content)|str(len(request_content))|' azure/mgmt/resource/resourcemanagement.py
  '';

  postInstall = ''
    echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/__init__.py
    echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/mgmt/__init__.py
  '';

  propagatedBuildInputs = [ azure-mgmt-common ];

  meta = with pkgs.lib; {
    description = "Microsoft Azure SDK for Python";
    homepage = "https://azure.microsoft.com/en-us/develop/python/";
    license = licenses.asl20;
    maintainers = with maintainers; [ olcai ];
  };
}


{stdenv, fetchurl, readline, bison, libX11, libICE, libXaw, libXext}:

stdenv.mkDerivation {
  name = "ngspice-26";

  src = fetchurl {
    url = "mirror://sourceforge/ngspice/ngspice-26.tar.gz";
    sha256 = "51e230c8b720802d93747bc580c0a29d1fb530f3dd06f213b6a700ca9a4d0108";
  };

  buildInputs = [ readline libX11 bison libICE libXaw libXext ];

  configureFlags = [ "--enable-x" "--with-x" "--with-readline" ];

  meta = with stdenv.lib; {
    description = "The Next Generation Spice (Electronic Circuit Simulator)";
    homepage = "http://ngspice.sourceforge.net";
    license = with licenses; [ "BSD" gpl2 ];
    maintainers = with maintainers; [ viric rongcuid ];
    platforms = platforms.linux;
  };
}

Add XSpice and Cider support

{stdenv, fetchurl, readline, bison, flex, libX11, libICE, libXaw, libXext}:

stdenv.mkDerivation {
  name = "ngspice-26";

  src = fetchurl {
    url = "mirror://sourceforge/ngspice/ngspice-26.tar.gz";
    sha256 = "51e230c8b720802d93747bc580c0a29d1fb530f3dd06f213b6a700ca9a4d0108";
  };

  buildInputs = [ readline libX11 flex bison libICE libXaw libXext ];

  configureFlags = [ "--enable-x" "--with-x" "--with-readline" "--enable-xspice" "--enable-cider" ];

  meta = with stdenv.lib; {
    description = "The Next Generation Spice (Electronic Circuit Simulator)";
    homepage = "http://ngspice.sourceforge.net";
    license = with licenses; [ "BSD" gpl2 ];
    maintainers = with maintainers; [ viric rongcuid ];
    platforms = platforms.linux;
  };
}


{ stdenv, fetchurl, libgpgerror, gnupg, pkgconfig, glib, pth, libassuan
, useGnupg1 ? false, gnupg1 ? null }:

assert useGnupg1 -> gnupg1 != null;
assert !useGnupg1 -> gnupg != null;

let
  gpgPath = if useGnupg1 then
    "${gnupg1}/bin/gpg"
  else
    "${gnupg}/bin/gpg2";
in
stdenv.mkDerivation rec {
  name = "gpgme-1.3.1";

  src = fetchurl {
    url = "ftp://ftp.gnupg.org/gcrypt/gpgme/${name}.tar.bz2";
    sha256 = "1m7l7nicn6gd952cgspv9xr8whqivbg33nbg8kbpj3dffnl2gvqm";
  };

  propagatedBuildInputs = [ libgpgerror glib libassuan pth ];

  nativeBuildInputs = [ pkgconfig ];

  configureFlags = "--with-gpg=${gpgPath}";
}

Update to latest upstream version 1.4.1.

{ stdenv, fetchurl, libgpgerror, gnupg, pkgconfig, glib, pth, libassuan
, useGnupg1 ? false, gnupg1 ? null }:

assert useGnupg1 -> gnupg1 != null;
assert !useGnupg1 -> gnupg != null;

let
  gpgPath = if useGnupg1 then
    "${gnupg1}/bin/gpg"
  else
    "${gnupg}/bin/gpg2";
in
stdenv.mkDerivation rec {
  name = "gpgme-1.4.1";

  src = fetchurl {
    url = "ftp://ftp.gnupg.org/gcrypt/gpgme/${name}.tar.bz2";
    sha1 = "d6110763e7459214fd72705e87ebc682e3b5815e";
  };

  propagatedBuildInputs = [ libgpgerror glib libassuan pth ];

  nativeBuildInputs = [ pkgconfig gnupg ];

  configureFlags = "--with-gpg=${gpgPath}";
}


{ config, pkgs, ... }:
{
  home.packages = with pkgs; [
    ( pass.withExtensions (ext: [ ext.pass-otp ext.pass-import ext.pass-genphrase ext.pass-audit ext.pass-update ]))
    apvlv
    aria
    atop
    binutils
    bitwarden-cli
    btrfs-progs
    curl
    dnsutils
    docker-compose
    du-dust
    fd
    file
    fontconfig
    git
    hsetroot
    htop
    imagemagick
    jq
    keybase
    lm_sensors
    mercurial
    nixops
    pciutils
    powertop
    ranger
    restic
    ripgrep
    rustup
    terraform
    tmux
    unstable.genpass
    unzip
    veracrypt
    wget
    wirelesstools
  ];
}

Add topgrade, remove nixops as fails to build on ubuntu

{ config, pkgs, ... }:
{
  home.packages = with pkgs; [
    ( pass.withExtensions (ext: [ ext.pass-otp ext.pass-import ext.pass-genphrase ext.pass-audit ext.pass-update ]))
    apvlv
    aria
    atop
    binutils
    bitwarden-cli
    btrfs-progs
    curl
    dnsutils
    docker-compose
    du-dust
    fd
    file
    fontconfig
    git
    hsetroot
    htop
    imagemagick
    jq
    keybase
    lm_sensors
    mercurial
    pciutils
    powertop
    ranger
    restic
    ripgrep
    rustup
    terraform
    tmux
    unstable.genpass
    unstable.topgrade
    unzip
    veracrypt
    wget
    wirelesstools
  ];
}


{ stdenv, fetchurl, makeWrapper, jre }:

let version = "4.355"; in

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

  jar = fetchurl {
    url = "http://launcher.technicpack.net/launcher${stdenv.lib.replaceStrings ["."] ["/"] version}/TechnicLauncher.jar";
    sha256 = "0f6f094d7m7bhg7h4fwpv1iillp5fsmk3rwy06lmg9pfp9gq9ixc";
  };

  buildInputs = [ makeWrapper ];

  phases = "installPhase";

  installPhase = ''
    mkdir -p $out/share/java
    ln -s $jar $out/share/java/technic.jar
    makeWrapper ${jre}/bin/java $out/bin/technic --add-flags "-jar $out/share/java/technic.jar"
  '';

  meta = with stdenv.lib; {
    description = "Minecraft Mod Launcher";
    homepage = https://www.technicpack.net/;
    license = licenses.unfree;
  };
}

Fix technic not having sound

{ stdenv, fetchurl, makeWrapper, jre, openal }:

let version = "4.355"; in

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

  jar = fetchurl {
    url = "http://launcher.technicpack.net/launcher${stdenv.lib.replaceStrings ["."] ["/"] version}/TechnicLauncher.jar";
    sha256 = "0f6f094d7m7bhg7h4fwpv1iillp5fsmk3rwy06lmg9pfp9gq9ixc";
  };

  nativeBuildInputs = [ makeWrapper ];
  buildInputs = [ openal ];

  phases = "installPhase";

  installPhase = ''
    mkdir -p $out/share/java
    ln -s $jar $out/share/java/technic.jar
    makeWrapper ${jre}/bin/java $out/bin/technic --add-flags "-jar $out/share/java/technic.jar" --prefix LD_LIBRARY_PATH : ${openal}/lib
  '';

  meta = with stdenv.lib; {
    description = "Minecraft Mod Launcher";
    homepage = https://www.technicpack.net/;
    license = licenses.unfree;
  };
}


{ stdenv, fetchurl, garmintools, libgcrypt, libusb, pkgconfig, tinyxml, zlib }:
stdenv.mkDerivation {
  name = "garmin-plugin-0.3.26";
  src = fetchurl {
    url = https://github.com/adiesner/GarminPlugin/archive/V0.3.26.tar.gz;
    sha256 = "15gads1fj4sj970m5960dgnhys41ksi4cm53ldkf67wn8dc9i4k0";
  };
  sourceRoot = "GarminPlugin-0.3.26/src";
  buildInputs = [ garmintools libusb libgcrypt pkgconfig tinyxml zlib ];
  configureFlags = [
    "--with-libgcrypt-prefix=${libgcrypt}"
    "--with-garmintools-incdir=${garmintools}/include"
    "--with-garmintools-libdir=${garmintools}/lib"
  ];
  installPhase = ''
    mkdir -p $out/lib/mozilla/plugins
    cp npGarminPlugin.so $out/lib/mozilla/plugins
  '';
  meta = {
    homepage = http://www.andreas-diesner.de/garminplugin;
    license = stdenv.lib.licenses.gpl3;
    maintainers = [ stdenv.lib.maintainers.ocharles ];
  };
}

Make explicit that 'dev' output of libgcrypt is used

{ stdenv, fetchurl, garmintools, libgcrypt, libusb, pkgconfig, tinyxml, zlib }:
stdenv.mkDerivation {
  name = "garmin-plugin-0.3.26";
  src = fetchurl {
    url = https://github.com/adiesner/GarminPlugin/archive/V0.3.26.tar.gz;
    sha256 = "15gads1fj4sj970m5960dgnhys41ksi4cm53ldkf67wn8dc9i4k0";
  };
  sourceRoot = "GarminPlugin-0.3.26/src";
  buildInputs = [ garmintools libusb libgcrypt pkgconfig tinyxml zlib ];
  configureFlags = [
    "--with-libgcrypt-prefix=${libgcrypt.dev}"
    "--with-garmintools-incdir=${garmintools}/include"
    "--with-garmintools-libdir=${garmintools}/lib"
  ];
  installPhase = ''
    mkdir -p $out/lib/mozilla/plugins
    cp npGarminPlugin.so $out/lib/mozilla/plugins
  '';
  meta = {
    homepage = http://www.andreas-diesner.de/garminplugin;
    license = stdenv.lib.licenses.gpl3;
    maintainers = [ stdenv.lib.maintainers.ocharles ];
  };
}


{ cabal, attoparsec, attoparsecEnumerator, blazeBuilder
, blazeBuilderEnumerator, caseInsensitive, enumerator
, MonadCatchIOTransformers, mtl, network, snapCore, text, time
, unixCompat
}:

cabal.mkDerivation (self: {
  pname = "snap-server";
  version = "0.9.4.2";
  sha256 = "05na8gqbqy0nznasaxfkp4hr7h0s6ypm8000mhn50d27v8nk526m";
  buildDepends = [
    attoparsec attoparsecEnumerator blazeBuilder blazeBuilderEnumerator
    caseInsensitive enumerator MonadCatchIOTransformers mtl network
    snapCore text time unixCompat
  ];
  meta = {
    homepage = "http://snapframework.com/";
    description = "A fast, iteratee-based, epoll-enabled web server for the Snap Framework";
    license = self.stdenv.lib.licenses.bsd3;
    platforms = self.ghc.meta.platforms;
    maintainers = [ self.stdenv.lib.maintainers.andres ];
  };
})

Add ssl support to snapServer package.

{ cabal, attoparsec, attoparsecEnumerator, blazeBuilder
, blazeBuilderEnumerator, caseInsensitive, enumerator
, MonadCatchIOTransformers, mtl, network, snapCore, text, time
, unixCompat, HsOpenSSL, useOpenssl ? false
}:

cabal.mkDerivation (self: {
  pname = "snap-server";
  version = "0.9.4.2";
  sha256 = "05na8gqbqy0nznasaxfkp4hr7h0s6ypm8000mhn50d27v8nk526m";
  buildDepends = [
    attoparsec attoparsecEnumerator blazeBuilder blazeBuilderEnumerator
    caseInsensitive enumerator MonadCatchIOTransformers mtl network
    snapCore text time unixCompat
  ] ++ self.stdenv.lib.optional useOpenssl HsOpenSSL;
  configureFlags = [ ] ++ self.stdenv.lib.optional useOpenssl "-fopenssl";
  meta = {
    homepage = "http://snapframework.com/";
    description = "A fast, iteratee-based, epoll-enabled web server for the Snap Framework";
    license = self.stdenv.lib.licenses.bsd3;
    platforms = self.ghc.meta.platforms;
    maintainers = [ self.stdenv.lib.maintainers.andres ];
  };
})


{ stdenv, pkgs, fetchurl, openssl }:

stdenv.mkDerivation rec {
  majorVersion = "1.5";
  version = "${majorVersion}.14";
  name = "haproxy-${version}";

  src = fetchurl {
    url = "http://haproxy.1wt.eu/download/${majorVersion}/src/${name}.tar.gz";
    sha256 = "16cg1jmy2d8mq2ypwifsvhbyp4pyrj0zm0r818sx0r4hchwdsrcm";
  };

  buildInputs = [ openssl ];

  # TODO: make it work on darwin/bsd as well
  preConfigure = ''
    export makeFlags="TARGET=${if stdenv.isSunOS then "solaris" else "linux2628"} PREFIX=$out USE_OPENSSL=yes"
  '';

  meta = {
    description = "Reliable, high performance TCP/HTTP load balancer";
    longDescription = ''
      HAProxy is a free, very fast and reliable solution offering high
      availability, load balancing, and proxying for TCP and HTTP-based
      applications. It is particularly suited for web sites crawling under very
      high loads while needing persistence or Layer7 processing. Supporting
      tens of thousands of connections is clearly realistic with todays
      hardware.
    '';
    homepage = http://haproxy.1wt.eu;
    maintainers = [ stdenv.lib.maintainers.garbas ];
    platforms = stdenv.lib.platforms.linux;
    license = stdenv.lib.licenses.gpl2;
  };
}

Add support for gzip compression

{ stdenv, pkgs, fetchurl, openssl, zlib }:

stdenv.mkDerivation rec {
  majorVersion = "1.5";
  version = "${majorVersion}.14";
  name = "haproxy-${version}";

  src = fetchurl {
    url = "http://haproxy.1wt.eu/download/${majorVersion}/src/${name}.tar.gz";
    sha256 = "16cg1jmy2d8mq2ypwifsvhbyp4pyrj0zm0r818sx0r4hchwdsrcm";
  };

  buildInputs = [ openssl zlib ];

  # TODO: make it work on darwin/bsd as well
  preConfigure = ''
    export makeFlags="TARGET=${if stdenv.isSunOS then "solaris" else "linux2628"} PREFIX=$out USE_OPENSSL=yes USE_ZLIB=yes"
  '';

  meta = {
    description = "Reliable, high performance TCP/HTTP load balancer";
    longDescription = ''
      HAProxy is a free, very fast and reliable solution offering high
      availability, load balancing, and proxying for TCP and HTTP-based
      applications. It is particularly suited for web sites crawling under very
      high loads while needing persistence or Layer7 processing. Supporting
      tens of thousands of connections is clearly realistic with todays
      hardware.
    '';
    homepage = http://haproxy.1wt.eu;
    maintainers = [ stdenv.lib.maintainers.garbas ];
    platforms = stdenv.lib.platforms.linux;
    license = stdenv.lib.licenses.gpl2;
  };
}


# This file was auto-generated by cabal2nix. Please do NOT edit manually!

{ cabal, Cabal, lens, unorderedContainers }:

cabal.mkDerivation (self: {
  pname = "cabal-lenses";
  version = "0.3";
  sha256 = "13nx9cn81cx9cj7fk07akqvz4qkl49dlgb5wl5wanag6bafa6vhl";
  buildDepends = [ Cabal lens unorderedContainers ];
  jailbreak = true;
  meta = {
    description = "Lenses and traversals for the Cabal library";
    license = self.stdenv.lib.licenses.bsd3;
    platforms = self.ghc.meta.platforms;
  };
})

Update cabal-lenses to v3.1, no longer needs to be jailbroken

# This file was auto-generated by cabal2nix. Please do NOT edit manually!

{ cabal, Cabal, lens, unorderedContainers }:

cabal.mkDerivation (self: {
  pname = "cabal-lenses";
  version = "0.3.1";
  sha256 = "17piwqyzd33shp12qa6j4s579rrs34l44x19p2nzz69anhc4g1j7";
  buildDepends = [ Cabal lens unorderedContainers ];
  meta = {
    description = "Lenses and traversals for the Cabal library";
    license = self.stdenv.lib.licenses.bsd3;
    platforms = self.ghc.meta.platforms;
  };
})


{stdenv, fetchurl, jdk}:

stdenv.mkDerivation {
  name = "libmatthew-java-0.8";
  src = fetchurl {
    url = http://www.matthew.ath.cx/projects/java/libmatthew-java-0.8.tar.gz;
    sha256 = "1yldkhsdzm0a41a0i881bin2jklhp85y3ah245jd6fz3npcx7l85";
  };
  JAVA_HOME=jdk;
  PREFIX=''''${out}'';
  buildInputs = [ jdk ];
  maintainers = [ stdenv.lib.maintainers.sander ];
}

Change location of libmatthew-java to fedora's mirror. Original one is unreachable

{stdenv, fetchurl, jdk}:

stdenv.mkDerivation {
  name = "libmatthew-java-0.8";
  src = fetchurl {
    url = http://pkgs.fedoraproject.org/repo/pkgs/libmatthew-java/libmatthew-java-0.8.tar.gz/8455b8751083ce25c99c2840609271f5/libmatthew-java-0.8.tar.gz;
    sha256 = "1yldkhsdzm0a41a0i881bin2jklhp85y3ah245jd6fz3npcx7l85";
  };
  JAVA_HOME=jdk;
  PREFIX=''''${out}'';
  buildInputs = [ jdk ];
  maintainers = [ stdenv.lib.maintainers.sander ];
}


{ fetchurl, stdenv, zip, zlib, qt5 }:

stdenv.mkDerivation rec {
  name = "quazip-0.7";

  src = fetchurl {
    url = "mirror://sourceforge/quazip/${name}.tar.gz";
    sha256 = "8af5e7f9bff98b5a2982800a292eae0176c2b41a98a8deab14f4e1cbe07674a4";
  };

  configurePhase = "cd quazip && qmake quazip.pro";

  installFlags = "INSTALL_ROOT=$out";

  buildInputs = [ zlib qt5 ];

  meta = {
    description = "Provides access to ZIP archives from Qt programs";
    license = stdenv.lib.licenses.gpl2Plus;
    homepage = http://quazip.sourceforge.net/;
    platforms = stdenv.lib.platforms.linux;
  };
}

Fix $out variable in installFlags.

{ fetchurl, stdenv, zip, zlib, qt5 }:

stdenv.mkDerivation rec {
  name = "quazip-0.7";

  src = fetchurl {
    url = "mirror://sourceforge/quazip/${name}.tar.gz";
    sha256 = "8af5e7f9bff98b5a2982800a292eae0176c2b41a98a8deab14f4e1cbe07674a4";
  };

  configurePhase = "cd quazip && qmake quazip.pro";

  installFlags = "INSTALL_ROOT=$(out)";

  buildInputs = [ zlib qt5 ];

  meta = {
    description = "Provides access to ZIP archives from Qt programs";
    license = stdenv.lib.licenses.gpl2Plus;
    homepage = http://quazip.sourceforge.net/;
    platforms = stdenv.lib.platforms.linux;
  };
}


{ lib, buildGoModule, fetchFromGitHub }:

buildGoModule rec {
  pname = "oh-my-posh";
  version = "9.4.0";

  src = fetchFromGitHub {
    owner = "jandedobbeleer";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-biMqihvGW+rsNhM/kXQb3px5aRtyvAI0cxDQ9KDK7y4=";
  };

  vendorSha256 = "sha256-A4+sshIzPla7udHfnMmbFqn+fW3SOCrI6g7tArzmh1E=";

  sourceRoot = "source/src";

  ldflags = [ "-s" "-w" "-X" "main.Version=${version}" ];

  meta = with lib; {
    description = "A prompt theme engine for any shell";
    homepage = "https://ohmyposh.dev";
    license = licenses.mit;
    maintainers = with maintainers; [ lucperkins ];
  };
}

Add themes from source package to store

{ lib, buildGoModule, fetchFromGitHub }:

buildGoModule rec {
  pname = "oh-my-posh";
  version = "9.4.0";

  src = fetchFromGitHub {
    owner = "jandedobbeleer";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-biMqihvGW+rsNhM/kXQb3px5aRtyvAI0cxDQ9KDK7y4=";
  };

  vendorSha256 = "sha256-A4+sshIzPla7udHfnMmbFqn+fW3SOCrI6g7tArzmh1E=";

  sourceRoot = "source/src";

  ldflags = [ "-s" "-w" "-X" "main.Version=${version}" ];

  tags = [ "netgo" "osusergo" "static_build" ];

  postInstall = ''
    mkdir -p $out/share/oh-my-posh
    cp -r ${src}/themes $out/share/oh-my-posh/
  '';

  meta = with lib; {
    description = "A prompt theme engine for any shell";
    homepage = "https://ohmyposh.dev";
    license = licenses.mit;
    maintainers = with maintainers; [ lucperkins ];
  };
}


{ lib, stdenv, fetchzip, bison, flex, which, perl
, sensord ? false, rrdtool ? null
}:

assert sensord -> rrdtool != null;

stdenv.mkDerivation rec {
  pname = "lm-sensors";
  version = "3.6.0";
  dashedVersion = lib.replaceStrings ["."] ["-"] version;

  src = fetchzip {
    url = "https://github.com/lm-sensors/lm-sensors/archive/V${dashedVersion}.tar.gz";
    sha256 = "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn";
  };

  nativeBuildInputs = [ bison flex which ];
  buildInputs = [ perl ]
   ++ lib.optional sensord rrdtool;

  makeFlags = [
    "PREFIX=${placeholder "out"}"
    "ETCDIR=${placeholder "out"}/etc"
    "CC=${stdenv.cc.targetPrefix}cc"
    "AR=${stdenv.cc.targetPrefix}ar"
  ] ++ lib.optional sensord "PROG_EXTRA=sensord";

  meta = with lib; {
    homepage = "https://hwmon.wiki.kernel.org/lm_sensors";
    changelog = "https://raw.githubusercontent.com/lm-sensors/lm-sensors/V${dashedVersion}/CHANGES";
    description = "Tools for reading hardware sensors";
    license = with licenses; [ lgpl21Plus gpl2Plus ];
    platforms = platforms.linux;
  };
}

Read system configuration files from /etc directory

{ lib, stdenv, fetchzip, bison, flex, which, perl
, sensord ? false, rrdtool ? null
}:

assert sensord -> rrdtool != null;

stdenv.mkDerivation rec {
  pname = "lm-sensors";
  version = "3.6.0";
  dashedVersion = lib.replaceStrings ["."] ["-"] version;

  src = fetchzip {
    url = "https://github.com/lm-sensors/lm-sensors/archive/V${dashedVersion}.tar.gz";
    sha256 = "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn";
  };

  nativeBuildInputs = [ bison flex which ];
  buildInputs = [ perl ]
   ++ lib.optional sensord rrdtool;

  makeFlags = [
    "PREFIX=${placeholder "out"}"
    "CC=${stdenv.cc.targetPrefix}cc"
    "AR=${stdenv.cc.targetPrefix}ar"
  ] ++ lib.optional sensord "PROG_EXTRA=sensord";

  installFlags = [
    "ETCDIR=${placeholder "out"}/etc"
  ];

  meta = with lib; {
    homepage = "https://hwmon.wiki.kernel.org/lm_sensors";
    changelog = "https://raw.githubusercontent.com/lm-sensors/lm-sensors/V${dashedVersion}/CHANGES";
    description = "Tools for reading hardware sensors";
    license = with licenses; [ lgpl21Plus gpl2Plus ];
    maintainers = with maintainers; [ pengmeiyu ];
    platforms = platforms.linux;
  };
}


{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
, acl, librsync, ncurses, openssl, zlib, uthash }:

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

  src = fetchFromGitHub {
    owner = "grke";
    repo = "burp";
    rev = version;
    sha256 = "0y63z1vcm5h7s0q5lv94gpdqnfgi2qb0g0h81idai5p0yqw09v8h";
  };

  nativeBuildInputs = [ autoreconfHook pkgconfig ];
  buildInputs = [ librsync ncurses openssl zlib uthash ]
    ++ stdenv.lib.optional (!stdenv.isDarwin) acl;

  configureFlags = [ "--localstatedir=/var" ];

  installFlags = [ "localstatedir=/tmp" ];

  meta = with stdenv.lib; {
    description = "BURP - BackUp and Restore Program";
    homepage    = https://burp.grke.org;
    license     = licenses.agpl3;
    maintainers = with maintainers; [ tokudan ];
    platforms   = platforms.all;
  };
}

Revert "burp: 2.1.32 -> 2.2.4"

{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
, acl, librsync, ncurses, openssl, zlib, uthash }:

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

  src = fetchFromGitHub {
    owner = "grke";
    repo = "burp";
    rev = version;
    sha256 = "1izs5vavffvj6z478s5x1shg71p2v5bnnrsam1avs21ylxbfnxi5";
  };

  nativeBuildInputs = [ autoreconfHook pkgconfig ];
  buildInputs = [ librsync ncurses openssl zlib uthash ]
    ++ stdenv.lib.optional (!stdenv.isDarwin) acl;

  configureFlags = [ "--localstatedir=/var" ];

  installFlags = [ "localstatedir=/tmp" ];

  meta = with stdenv.lib; {
    description = "BURP - BackUp and Restore Program";
    homepage    = https://burp.grke.org;
    license     = licenses.agpl3;
    maintainers = with maintainers; [ tokudan ];
    platforms   = platforms.all;
  };
}


{ lib
, buildPythonPackage
, fetchPypi
, six
, isPyPy
}:

buildPythonPackage rec {
  pname = "greenlet";
  version = "0.4.17";
  disabled = isPyPy;  # builtin for pypy

  src = fetchPypi {
    inherit pname version;
    sha256 = "41d8835c69a78de718e466dd0e6bfd4b46125f21a67c3ff6d76d8d8059868d6b";
  };

  propagatedBuildInputs = [ six ];

  # see https://github.com/python-greenlet/greenlet/issues/85
  preCheck = ''
    rm tests/test_leaks.py
  '';

  meta = {
    homepage = "https://pypi.python.org/pypi/greenlet";
    description = "Module for lightweight in-process concurrent programming";
    license = lib.licenses.lgpl2;
  };
}

Revert "python3Packages.greenlet: 0.4.16 -> 0.4.17"

{ lib
, buildPythonPackage
, fetchPypi
, six
, isPyPy
}:

buildPythonPackage rec {
  pname = "greenlet";
  version = "0.4.16";
  disabled = isPyPy;  # builtin for pypy

  src = fetchPypi {
    inherit pname version;
    sha256 = "6e06eac722676797e8fce4adb8ad3dc57a1bb3adfb0dd3fdf8306c055a38456c";
  };

  propagatedBuildInputs = [ six ];

  # see https://github.com/python-greenlet/greenlet/issues/85
  preCheck = ''
    rm tests/test_leaks.py
  '';

  meta = {
    homepage = "https://pypi.python.org/pypi/greenlet";
    description = "Module for lightweight in-process concurrent programming";
    license = lib.licenses.lgpl2;
  };
}