args: with args;
(stdenv.mkDerivation ({
  name = "ImageMagick-6.3.7-9";

  src = fetchurl {
    url = ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.3.7-9.tar.bz2;
    sha256 = "1s38s78xvzm20ib22zypsb9vvzva0kbqjf0pf4c1q89jzg205pk0";
  };

  configureFlags = " --with-dots --with-gs-font-dir="+ ghostscript +
		"/share/ghostscript/fonts --with-gslib " +(
		if args ? tetex then " --with-frozenpaths " else ""
		);

  buildInputs = [bzip2 freetype ghostscript graphviz libjpeg libpng
		libtiff libX11 libxml2 zlib libtool] ++ (if args ? tetex then [args.tetex] else [])
		 ++ (if args ? librsvg then [args.librsvg] else []);

  meta = {
    homepage = http://www.imagemagick.org;
  };
} // (if args ? tetex then {
	preConfigure = "
		export DVIDecodeDelegate=${args.tetex}/bin/dvips
	";
} else {})))

Update ImageMagick since the previous source tarball is no longer available (!).

args: with args;
(stdenv.mkDerivation ({
  name = "ImageMagick-6.3.7-10";

  src = fetchurl {
    # Warning: Source tarballs seem to vanish very quickly from this site!
    url = ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.3.7-10.tar.bz2;
    sha256 = "c00fb0d21baa292a55bb0e30ca30ffe2571e0d3df9e692da441aa81ff1cdde10";
  };

  configureFlags = " --with-dots --with-gs-font-dir="+ ghostscript +
		"/share/ghostscript/fonts --with-gslib " +(
		if args ? tetex then " --with-frozenpaths " else ""
		);

  buildInputs = [bzip2 freetype ghostscript graphviz libjpeg libpng
		libtiff libX11 libxml2 zlib libtool] ++ (if args ? tetex then [args.tetex] else [])
		 ++ (if args ? librsvg then [args.librsvg] else []);

  meta = {
    description = ''ImageMagick(R) is a software suite to create, edit, and compose bitmap
                    images.  It can read, convert and write images in a variety of
		    formats (over 100).'';
    homepage = http://www.imagemagick.org;
  };
} // (if args ? tetex then {
	preConfigure = "
		export DVIDecodeDelegate=${args.tetex}/bin/dvips
	";
} else {})))


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

buildPythonPackage rec {
  pname = "h11";
  version = "0.14.0";
  disabled = pythonOlder "3.6";

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-jxn7vpnnJCD/NcALJ6NMuZN+kCqLgQ4siDAMbwo7aZ0=";
  };

  checkInputs = [ pytestCheckHook ];

  # Some of the tests use localhost networking.
  __darwinAllowLocalNetworking = true;

  meta = with lib; {
    description = "Pure-Python, bring-your-own-I/O implementation of HTTP/1.1";
    homepage = "https://github.com/python-hyper/h11";
    license = licenses.mit;
    maintainers = with maintainers; [ SuperSandro2000 ];
  };
}

Revert "python310Packages.h11: 0.13.0 -> 0.14.0"

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

buildPythonPackage rec {
  pname = "h11";
  version = "0.13.0";
  disabled = pythonOlder "3.6";

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-cIE8ETUIeiSKTTjMDhoBgf+rIYgUGpPq9WeUDDlX/wY=";
  };

  checkInputs = [ pytestCheckHook ];

  # Some of the tests use localhost networking.
  __darwinAllowLocalNetworking = true;

  meta = with lib; {
    description = "Pure-Python, bring-your-own-I/O implementation of HTTP/1.1";
    homepage = "https://github.com/python-hyper/h11";
    license = licenses.mit;
    maintainers = with maintainers; [ SuperSandro2000 ];
  };
}


{ stdenv, fetchFromGitLab
, meson, ninja, nasm, pkgconfig
, withTools ? false, SDL2
}:

stdenv.mkDerivation rec {
  pname = "dav1d";
  version = "0.4.0";

  src = fetchFromGitLab {
    domain = "code.videolan.org";
    owner = "videolan";
    repo = pname;
    rev = version;
    sha256 = "1fbalfzw8j00vwbrh9h8kjdx6h99dr10vmvbpg3rhsspmxq9h66h";
  };

  nativeBuildInputs = [ meson ninja nasm pkgconfig ];
  # TODO: doxygen (currently only HTML and not build by default).
  buildInputs = stdenv.lib.optional withTools SDL2;

  mesonFlags= [
    "-Denable_tools=${stdenv.lib.boolToString withTools}"
  ];

  meta = with stdenv.lib; {
    description = "A cross-platform AV1 decoder focused on speed and correctness";
    longDescription = ''
      The goal of this project is to provide a decoder for most platforms, and
      achieve the highest speed possible to overcome the temporary lack of AV1
      hardware decoder. It supports all features from AV1, including all
      subsampling and bit-depth parameters.
    '';
    inherit (src.meta) homepage;
    license = licenses.bsd2;
    platforms = platforms.unix;
    maintainers = with maintainers; [ primeos ];
  };
}

Add optional Vulkan support (experimental)

{ stdenv, fetchFromGitLab
, meson, ninja, nasm, pkgconfig
, withTools ? false, SDL2
, useVulkan ? false, libplacebo, vulkan-loader, vulkan-headers
}:

assert useVulkan -> withTools;

stdenv.mkDerivation rec {
  pname = "dav1d";
  version = "0.4.0";

  src = fetchFromGitLab {
    domain = "code.videolan.org";
    owner = "videolan";
    repo = pname;
    rev = version;
    sha256 = "1fbalfzw8j00vwbrh9h8kjdx6h99dr10vmvbpg3rhsspmxq9h66h";
  };

  nativeBuildInputs = [ meson ninja nasm pkgconfig ];
  # TODO: doxygen (currently only HTML and not build by default).
  buildInputs = stdenv.lib.optional withTools SDL2
    ++ stdenv.lib.optionals useVulkan [ libplacebo vulkan-loader vulkan-headers ];

  mesonFlags= [
    "-Denable_tools=${stdenv.lib.boolToString withTools}"
  ];

  meta = with stdenv.lib; {
    description = "A cross-platform AV1 decoder focused on speed and correctness";
    longDescription = ''
      The goal of this project is to provide a decoder for most platforms, and
      achieve the highest speed possible to overcome the temporary lack of AV1
      hardware decoder. It supports all features from AV1, including all
      subsampling and bit-depth parameters.
    '';
    inherit (src.meta) homepage;
    license = licenses.bsd2;
    platforms = platforms.unix;
    maintainers = with maintainers; [ primeos ];
  };
}


{ stdenv, fetchurl }:

stdenv.mkDerivation {
  name = "freetds-0.91";

  src = fetchurl {
    url = ftp://ftp.astron.com/pub/freetds/stable/freetds-stable.tgz;
    sha256 = "0r946axzxs0czsmr7283w7vmk5jx3jnxxc32d2ncxsrsh2yli0ba";
  };

  doDist = true;

  distPhase = ''
    touch $out/include/tds.h
    touch $out/lib/libtds.a
  '';

  meta = {
    description =
      "Libraries to natively talk to Microsoft SQL Server and Sybase databases";
    homepage = "http://www.freetds.org";
    license = "lgpl";
    platforms = stdenv.lib.platforms.all;
  };
}

Allow to configure freetds for unixODBC support

{ stdenv, fetchurl
, odbcSupport ? false, unixODBC ? null }:

assert odbcSupport -> unixODBC != null;

stdenv.mkDerivation {
  name = "freetds-0.91";

  src = fetchurl {
    url = ftp://ftp.astron.com/pub/freetds/stable/freetds-stable.tgz;
    sha256 = "0r946axzxs0czsmr7283w7vmk5jx3jnxxc32d2ncxsrsh2yli0ba";
  };

  buildInputs = stdenv.lib.optional odbcSupport [ unixODBC ];

  configureFlags = stdenv.lib.optionalString odbcSupport "--with-odbc=${unixODBC}";

  doDist = true;

  distPhase = ''
    touch $out/include/tds.h
    touch $out/lib/libtds.a
  '';

  meta = {
    description =
      "Libraries to natively talk to Microsoft SQL Server and Sybase databases";
    homepage = "http://www.freetds.org";
    license = "lgpl";
    platforms = stdenv.lib.platforms.all;
  };
}


{stdenv, fetchurl, libpng, libjpeg}:

stdenv.mkDerivation rec {
  name = "libwebp-0.4.0";

  src = fetchurl {
    url = "http://webp.googlecode.com/files/${name}.tar.gz";
    sha256 = "0sadjkx8m6sf064r5gngjvz4b5246q3j27dlaml5b1k3x5vkb49i";
  };

  buildInputs = [ libpng libjpeg ];

  meta = {
    homepage = http://code.google.com/p/webp/;
    description = "Tools and library for the WebP image format";

    /* It has its own licence, google-related, but that looks like BSD */
    license = "free";
  };
}

Build with support for GIF and TIFF.

{ stdenv, fetchurl, libpng, libjpeg, giflib, libtiff }:

stdenv.mkDerivation rec {
  name = "libwebp-0.4.0";

  src = fetchurl {
    url = "http://webp.googlecode.com/files/${name}.tar.gz";
    sha256 = "0sadjkx8m6sf064r5gngjvz4b5246q3j27dlaml5b1k3x5vkb49i";
  };

  buildInputs = [ libpng libjpeg giflib libtiff ];

  meta = {
    homepage = http://code.google.com/p/webp/;
    description = "Tools and library for the WebP image format";

    /* It has its own licence, google-related, but that looks like BSD */
    license = "free";
  };
}


a :
let
  fetchurl = a.fetchurl;

  s = import ./src-for-default.nix;

  buildInputs = with a; [
    libsoup pkgconfig webkit gtk makeWrapper
    kbproto
  ];
in
rec {
  src = (a.fetchUrlFromSrcInfo s);
  inherit (s) name;

  inherit buildInputs;
  configureFlags = [];

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

  setVars = a.noDepEntry (''
    export NIX_LDFLAGS="$NIX_LDFLAGS -L${a.libX11}/lib -lX11"
  '');

  doWrap = a.makeManyWrappers "$out/bin/uzbl-core"
    ''
      --prefix GST_PLUGIN_PATH : ${a.webkit.gstreamer}/lib/gstreamer-* \
      --prefix GST_PLUGIN_PATH : ${a.webkit.gstPluginsBase}/lib/gstreamer-* \
      --prefix GST_PLUGIN_PATH : ${a.webkit.gstPluginsGood}/lib/gstreamer-* \
      --prefix GST_PLUGIN_PATH : ${a.webkit.gstFfmpeg}/lib/gstreamer-*
    '';

  installFlags = "PREFIX=$out";

  meta = {
    description = "Tiny externally controllable webkit browser";
    maintainers = [a.lib.maintainers.raskin];
  };
}

Fix glib networking system update

a :
let
  fetchurl = a.fetchurl;

  s = import ./src-for-default.nix;

  buildInputs = with a; [
    libsoup pkgconfig webkit gtk makeWrapper
    kbproto
  ];
in
rec {
  src = (a.fetchUrlFromSrcInfo s);
  inherit (s) name;

  inherit buildInputs;
  configureFlags = [];

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

  setVars = a.noDepEntry (''
    export NIX_LDFLAGS="$NIX_LDFLAGS -L${a.libX11}/lib -lX11"
  '');

  doWrap = a.makeManyWrappers "$out/bin/uzbl-core"
    ''
      --prefix GST_PLUGIN_PATH : ${a.webkit.gstreamer}/lib/gstreamer-* \
      --prefix GST_PLUGIN_PATH : ${a.webkit.gstPluginsBase}/lib/gstreamer-* \
      --prefix GST_PLUGIN_PATH : ${a.webkit.gstPluginsGood}/lib/gstreamer-* \
      --prefix GST_PLUGIN_PATH : ${a.webkit.gstFfmpeg}/lib/gstreamer-* \
      --prefix GIO_EXTRA_MODULES : ${a.glib_networking}/lib/gio/modules
    '';

  installFlags = "PREFIX=$out";

  meta = {
    description = "Tiny externally controllable webkit browser";
    maintainers = [a.lib.maintainers.raskin];
  };
}


{stdenv, fetchurl, transfig, texLiveAggregationFun, texLive, texLiveExtra, ghostscript
, build-manual ? false
}:

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

  src = fetchurl {
    url = "http://www.colm.net/wp-content/uploads/2014/10/${name}.tar.gz";
    sha256 = "02k6rwh8cr95f1p5sjjr3wa6dilg06572xz1v71dk8awmc7vw1vf";
  };

  buildInputs = stdenv.lib.optional build-manual [ transfig ghostscript (texLiveAggregationFun { paths=[ texLive texLiveExtra ]; }) ];

  preConfigure = stdenv.lib.optional build-manual ''
    sed -i "s/build_manual=no/build_manual=yes/g" DIST
  '';

  meta = with stdenv.lib; {
    homepage = http://www.complang.org/ragel;
    description = "State machine compiler";
    license = licenses.gpl2;
    maintainers = with maintainers; [ pSub ];
  };
}

Fix the URL to fetch the sources for ragel

{stdenv, fetchurl, transfig, texLiveAggregationFun, texLive, texLiveExtra, ghostscript
, build-manual ? false
}:

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

  src = fetchurl {
    url = "http://www.colm.net/files/ragel/${name}.tar.gz";
    sha256 = "02k6rwh8cr95f1p5sjjr3wa6dilg06572xz1v71dk8awmc7vw1vf";
  };

  buildInputs = stdenv.lib.optional build-manual [ transfig ghostscript (texLiveAggregationFun { paths=[ texLive texLiveExtra ]; }) ];

  preConfigure = stdenv.lib.optional build-manual ''
    sed -i "s/build_manual=no/build_manual=yes/g" DIST
  '';

  meta = with stdenv.lib; {
    homepage = http://www.complang.org/ragel;
    description = "State machine compiler";
    license = licenses.gpl2;
    maintainers = with maintainers; [ pSub ];
  };
}


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

with lib;

{
  meta.maintainers = [ maintainers.mic92 ];

  ###### interface
  options = {
    programs.adb = {
      enable = mkOption {
        default = false;
        type = types.bool;
        description = ''
          Whether to configure system to use Android Debug Bridge (adb).
          To grant access to a user, it must be part of adbusers group:
          users.users.alice.extraGroups = ["adbusers"];
        '';
        relatedPackages = [ ["androidenv" "androidPkgs_9_0" "platform-tools"] ];
      };
    };
  };

  ###### implementation
  config = mkIf config.programs.adb.enable {
    services.udev.packages = [ pkgs.android-udev-rules ];
    environment.systemPackages = [ pkgs.androidenv.androidPkgs_9_0.platform-tools ];
    users.groups.adbusers = {};
  };
}

Remove relatedPackages to fix ofborg evaluation

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

with lib;

{
  meta.maintainers = [ maintainers.mic92 ];

  ###### interface
  options = {
    programs.adb = {
      enable = mkOption {
        default = false;
        type = types.bool;
        description = ''
          Whether to configure system to use Android Debug Bridge (adb).
          To grant access to a user, it must be part of adbusers group:
          users.users.alice.extraGroups = ["adbusers"];
        '';
      };
    };
  };

  ###### implementation
  config = mkIf config.programs.adb.enable {
    services.udev.packages = [ pkgs.android-udev-rules ];
    environment.systemPackages = [ pkgs.androidenv.androidPkgs_9_0.platform-tools ];
    users.groups.adbusers = {};
  };
}


{ stdenv, fetchurl, jdk, gtk2, xulrunner, zip, pkgconfig, perl, npapi_sdk, bash }:

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

  version = "1.5.2";

  src = fetchurl {
    url = "http://icedtea.wildebeest.org/download/source/${name}.tar.gz";

    sha256 = "1wrvl66qj0yhaqqhcq24005ci5sc3w005809cld55iiwagr8z7mj";
  };

  buildInputs = [ gtk2 xulrunner zip pkgconfig npapi_sdk ];

  preConfigure = ''
    substituteInPlace javac.in --replace '#!/usr/bin/perl' '#!${perl}/bin/perl'

    configureFlags="BIN_BASH=${bash}/bin/bash $configureFlags"
  '';

  configureFlags = [
    "--with-jdk-home=${jdk.home}"
  ];

  mozillaPlugin = "/lib";

  meta = {
    description = "Java web browser plugin and an implementation of Java Web Start";
    longDescription = ''
      A Free Software web browser plugin running applets written in the Java
      programming language and an implementation of Java Web Start, originally
      based on the NetX project.
    '';
    homepage = http://icedtea.classpath.org/wiki/IcedTea-Web;
    maintainers = with stdenv.lib.maintainers; [ wizeman ];
    platforms = stdenv.lib.platforms.linux;
  };
}

Update from 1.5.2 -> 1.6

{ stdenv, fetchurl, jdk, gtk2, xulrunner, zip, pkgconfig, perl, npapi_sdk, bash }:

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

  version = "1.6";

  src = fetchurl {
    url = "http://icedtea.wildebeest.org/download/source/${name}.tar.gz";

    sha256 = "0z8iirvpciai55s4vhpfkhyx4h4hm6dqy4pg4c61pia3innqd4qn";
  };

  buildInputs = [ gtk2 xulrunner zip pkgconfig npapi_sdk ];

  preConfigure = ''
    substituteInPlace javac.in --replace '#!/usr/bin/perl' '#!${perl}/bin/perl'

    configureFlags="BIN_BASH=${bash}/bin/bash $configureFlags"
  '';

  configureFlags = [
    "--with-jdk-home=${jdk.home}"
  ];

  mozillaPlugin = "/lib";

  meta = {
    description = "Java web browser plugin and an implementation of Java Web Start";
    longDescription = ''
      A Free Software web browser plugin running applets written in the Java
      programming language and an implementation of Java Web Start, originally
      based on the NetX project.
    '';
    homepage = http://icedtea.classpath.org/wiki/IcedTea-Web;
    maintainers = with stdenv.lib.maintainers; [ wizeman ];
    platforms = stdenv.lib.platforms.linux;
  };
}


# Misc configuration:
{
  # Actually, we don't care about rollback for this VM
  # network.enableRollback = true;

  defaults = {
    programs = {
      # Make sysadminning easier
      bash.enableCompletion = true;
    };
  };
}

Use hardlinks in Nix store

# Misc configuration:
{
  # Actually, we don't care about rollback for this VM
  # network.enableRollback = true;

  defaults = {
    programs = {
      # Make sysadminning easier
      bash.enableCompletion = true;
    };

    nix = {
      extraOptions = ''
        auto-optimise-store = true
      '';
    };

  };
}


{ pkgs, ... }:

{
  environment.systemPackages = with pkgs; [
    stack
    #haskellPackages.intero # needed by Haskelly
    #haskellPackages.stack-run # doesn't work # needed by Haskelly
  ];
  my-config.vscodeExtensions = with (import ../vscode-extensions.nix); [
    language-haskell
  ];
}

Install GHC in Haskell role

{ pkgs, ... }:

{
  environment.systemPackages = with pkgs; [
    stack
    ghc
    #haskellPackages.intero # needed by Haskelly
    #haskellPackages.stack-run # doesn't work # needed by Haskelly
  ];
  my-config.vscodeExtensions = with (import ../vscode-extensions.nix); [
    language-haskell
  ];
}


{ stdenv, fetchurl, libxml2 }:

stdenv.mkDerivation rec {
  name = "libxslt-1.1.28";

  src = fetchurl {
    url = "ftp://xmlsoft.org/libxml2/${name}.tar.gz";
    sha256 = "13029baw9kkyjgr7q3jccw2mz38amq7mmpr5p3bh775qawd1bisz";
  };

  buildInputs = [ libxml2 ];

  patches = stdenv.lib.optionals stdenv.isSunOS [ ./patch-ah.patch ];

  configureFlags = [
    "--with-libxml-prefix=${libxml2}"
    "--without-python"
    "--without-crypto"
    "--without-debug"
    "--without-mem-debug"
    "--without-debugger"
  ];

  postInstall = ''
    mkdir -p $out/nix-support
    ln -s ${libxml2}/nix-support/setup-hook $out/nix-support/
  '';

  meta = {
    homepage = http://xmlsoft.org/XSLT/;
    description = "A C library and tools to do XSL transformations";
    license = "bsd";
    platforms = stdenv.lib.platforms.unix;
    maintainers = [ stdenv.lib.maintainers.eelco ];
  };
}

Fix propagation of the libxml2 setup hook

{ stdenv, fetchurl, libxml2, findXMLCatalogs }:

stdenv.mkDerivation rec {
  name = "libxslt-1.1.28";

  src = fetchurl {
    url = "ftp://xmlsoft.org/libxml2/${name}.tar.gz";
    sha256 = "13029baw9kkyjgr7q3jccw2mz38amq7mmpr5p3bh775qawd1bisz";
  };

  buildInputs = [ libxml2 ];

  propagatedBuildInputs = [ findXMLCatalogs ];

  patches = stdenv.lib.optionals stdenv.isSunOS [ ./patch-ah.patch ];

  configureFlags = [
    "--with-libxml-prefix=${libxml2}"
    "--without-python"
    "--without-crypto"
    "--without-debug"
    "--without-mem-debug"
    "--without-debugger"
  ];

  meta = {
    homepage = http://xmlsoft.org/XSLT/;
    description = "A C library and tools to do XSL transformations";
    license = "bsd";
    platforms = stdenv.lib.platforms.unix;
    maintainers = [ stdenv.lib.maintainers.eelco ];
  };
}


{ lib
, async-timeout
, buildPythonPackage
, curio
, fetchFromGitHub
, flask
, pytest-asyncio
, pytest-trio
, pythonOlder
, pytestCheckHook
, trio
, yarl
}:

buildPythonPackage rec {
  pname = "python-socks";
  version = "2.0.3";
  format = "setuptools";

  disabled = pythonOlder "3.6.1";

  src = fetchFromGitHub {
    owner = "romis2012";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-tVoBon9HF9MTOK+dN9g58fQO706ElNlCeULx//7hPWA=";
  };

  propagatedBuildInputs = [
    trio
    curio
    async-timeout
  ];

  checkInputs = [
    flask
    pytest-asyncio
    pytest-trio
    pytestCheckHook
    yarl
  ];

  pythonImportsCheck = [
    "python_socks"
  ];

  meta = with lib; {
    description = "Core proxy client (SOCKS4, SOCKS5, HTTP) functionality for Python";
    homepage = "https://github.com/romis2012/python-socks";
    license = licenses.asl20;
    maintainers = with maintainers; [ ];
  };
}

Fix sandboxed build on Darwin

{ lib
, async-timeout
, buildPythonPackage
, curio
, fetchFromGitHub
, flask
, pytest-asyncio
, pytest-trio
, pythonOlder
, pytestCheckHook
, trio
, yarl
}:

buildPythonPackage rec {
  pname = "python-socks";
  version = "2.0.3";
  format = "setuptools";

  disabled = pythonOlder "3.6.1";

  __darwinAllowLocalNetworking = true;

  src = fetchFromGitHub {
    owner = "romis2012";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-tVoBon9HF9MTOK+dN9g58fQO706ElNlCeULx//7hPWA=";
  };

  propagatedBuildInputs = [
    trio
    curio
    async-timeout
  ];

  checkInputs = [
    flask
    pytest-asyncio
    pytest-trio
    pytestCheckHook
    yarl
  ];

  pythonImportsCheck = [
    "python_socks"
  ];

  meta = with lib; {
    description = "Core proxy client (SOCKS4, SOCKS5, HTTP) functionality for Python";
    homepage = "https://github.com/romis2012/python-socks";
    license = licenses.asl20;
    maintainers = with maintainers; [ ];
  };
}


{ config, pkgs, ... }:

###### implementation

let

  tempConf = "/var/run/mdadm.conf";
  modprobe = config.system.sbin.modprobe;
  inherit (pkgs) mdadm;

in

{

  jobs.swraid =
    { startOn = "started udev or new-devices";

      script =
        ''
          # Load the necessary RAID personalities.
          # !!! hm, doesn't the kernel load these automatically?
          for mod in raid0 raid1 raid5; do
              ${modprobe}/sbin/modprobe $mod || true
          done

          # Scan /proc/partitions for RAID devices.
          ${mdadm}/sbin/mdadm --examine --brief --scan -c partitions > ${tempConf}

          if ! test -s ${tempConf}; then exit 0; fi

          # Activate each device found.
          ${mdadm}/sbin/mdadm --assemble -c ${tempConf} --scan

          initctl emit -n new-devices
        '';

      task = true;
    };

}

Remove loop of new-device messages. Add a shell script to watch new devices.

{ config, pkgs, ... }:

###### implementation

let

  tempConf = "/var/run/mdadm.conf";
  logFile = "/var/log/mdadmEvents.log";
  modprobe = config.system.sbin.modprobe;
  inherit (pkgs) mdadm;

  mdadmEventHandler = pkgs.writeScript "mdadmEventHandler.sh" ''
    #!/bin/sh

    echo "$@" >> ${logFile}
    case $1 in
      (NewArray)
        initctl emit -n new-devices
        ;;
      (*) ;;
    esac
  '';

in

{

  jobs.swraid =
    { startOn = [ "startup" "new-devices" ];

      script =
        ''
          # Load the necessary RAID personalities.
          # !!! hm, doesn't the kernel load these automatically?
          for mod in raid0 raid1 raid5; do
              ${modprobe}/sbin/modprobe $mod || true
          done

          # Scan /proc/partitions for RAID devices.
          ${mdadm}/sbin/mdadm --examine --brief --scan -c partitions > ${tempConf}

          if ! test -s ${tempConf}; then exit 0; fi

          # Activate each device found.
          ${mdadm}/sbin/mdadm --assemble -c ${tempConf} --scan
        '';

      task = true;
    };

  jobs.swraidEvents = {
    name = "swraid-events";
    description = "Watch mdadm events.";
    startOn = [ "startup" ];
    exec = "${mdadm}/sbin/mdadm --monitor --scan --program ${mdadmEventHandler}";
  };

}


{ lib, fetchurl, cmake, pyside, qt4, pysideShiboken, buildPythonPackage }:

# This derivation provides a Python module and should therefore be called via `python-packages.nix`.
buildPythonPackage rec {
  pname = "pyside-tools";
  version = "0.2.15";
  format = "other";

  src = fetchurl {
    url = "https://github.com/PySide/Tools/archive/0.2.15.tar.gz";
    sha256 = "0x4z3aq7jgar74gxzwznl3agla9i1dcskw5gh11jnnwwn63ffzwa";
  };

  enableParallelBuilding = true;

  nativeBuildInputs = [ cmake ];

  buildInputs = [ qt4 ];

  propagatedBuildInputs = [ pyside pysideShiboken ];

  meta = {
    description = "Tools for pyside, the LGPL-licensed Python bindings for the Qt cross-platform application and UI framework";
    license = lib.licenses.gpl2;
    homepage = http://www.pyside.org;
    maintainers = [ ];
    platforms = lib.platforms.all;
  };
}

Use fetchFromGitHub and update meta

{ lib, buildPythonPackage, fetchFromGitHub, cmake, qt4, pyside, pysideShiboken }:

buildPythonPackage rec {
  pname = "pyside-tools";
  version = "0.2.15";
  format = "other";

  src = fetchFromGitHub {
    owner = "PySide";
    repo = "Tools";
    rev = version;
    sha256 = "017i2yxgjrisaifxqnl3ym8ijl63l2yl6a3474dsqhlyqz2nx2ll";
  };

  nativeBuildInputs = [ cmake ];

  buildInputs = [ qt4 ];

  propagatedBuildInputs = [ pyside pysideShiboken ];

  meta = with lib; {
    description = "Development tools (pyside-uic/rcc/lupdate) for PySide, the LGPL-licensed Python bindings for the Qt framework";
    license = licenses.gpl2;
    homepage = https://wiki.qt.io/PySide;
    maintainers = [ ];
    platforms = platforms.all;
  };
}


{ stdenv, fetchurl, git, perl, libxcb, libXinerama, xcbutil, xcbutilwm, xcbutilkeysyms }:

stdenv.mkDerivation rec {
  name = "bar-1.0";

  src = fetchurl {
    url = "https://github.com/LemonBoy/bar/archive/v1.0.tar.gz";
    sha256 = "1n2vak2acs37sslxl250cnz9c3irif5z4s54wi9qjyxbfzr2h2nc";
  };

  buildInputs = [ libxcb git perl libXinerama xcbutil xcbutilkeysyms xcbutilwm ];

  prePatch = ''sed -i "s@/usr@$out@" Makefile'';

  meta = {
    description = "A lightweight xcb based bar";
    homepage = "https://github.com/LemonBoy/bar";
    maintainers = stdenv.lib.maintainers.meisternu;
    license = "Custom";
    platforms = stdenv.lib.platforms.linux;
  };
}

Remove unnecessary dependencies and centralize version string.

{ stdenv, fetchurl, perl, libxcb }:

let
  version = "1.0";
in
  stdenv.mkDerivation rec {
    name = "bar-${version}";

    src = fetchurl {
      url = "https://github.com/LemonBoy/bar/archive/v${version}.tar.gz";
      sha256 = "1n2vak2acs37sslxl250cnz9c3irif5z4s54wi9qjyxbfzr2h2nc";
    };

    buildInputs = [ libxcb perl ];

    prePatch = ''sed -i "s@/usr@$out@" Makefile'';

    meta = {
      description = "A lightweight xcb based bar";
      homepage = "https://github.com/LemonBoy/bar";
      maintainers = stdenv.lib.maintainers.meisternu;
      license = "Custom";
      platforms = stdenv.lib.platforms.linux;
    };
}


# This module defines a small NixOS installation CD.  It does not
# contain any graphical stuff.

{config, pkgs, ...}:

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

  installer.configModule = "./nixos/modules/installer/cd-dvd/installation-cd-minimal.nix";

  # allow using of firmware without rebuilding the system
  hardware.firmware = [ "/root/my-firmware" ];

  # Don't include X libraries.
  services.sshd.forwardX11 = false;
  services.dbus.enable = false; # depends on libX11
  services.hal.enable = false; # depends on dbus
  fonts.enableFontConfig = false;
  fonts.enableCoreFonts = false;
}

Revert "add /root/my-firmware to the list of firmware directories"

# This module defines a small NixOS installation CD.  It does not
# contain any graphical stuff.

{config, pkgs, ...}:

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

  installer.configModule = "./nixos/modules/installer/cd-dvd/installation-cd-minimal.nix";

  # Don't include X libraries.
  services.sshd.forwardX11 = false;
  services.dbus.enable = false; # depends on libX11
  services.hal.enable = false; # depends on dbus
  fonts.enableFontConfig = false;
  fonts.enableCoreFonts = false;
}


{ lib, stdenv, fetchurl, libgcrypt, pkgconfig, glib, linuxHeaders }:

stdenv.mkDerivation rec {
  name = "duperemove-${version}";
  version = "0.09.beta2";

  src = fetchurl {
    url = "https://github.com/markfasheh/duperemove/archive/v${version}.tar.gz";
    sha256 = "0rn7lf9rjf4ypgfwms2y7b459rri4rfn809h6wx8xl9nbm5niil4";
  };

  buildInputs = [ libgcrypt pkgconfig glib linuxHeaders ];

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

  meta = {
    description = "A simple tool for finding duplicated extents and submitting them for deduplication";
    homepage = https://github.com/markfasheh/duperemove;
    license = lib.licenses.gpl2;

    maintainers = [ lib.maintainers.bluescreen303 ];
    platforms = lib.platforms.all;
  };
}

Update from 0.09.beta2 to 0.09.4.

{ lib, stdenv, fetchFromGitHub, libgcrypt, pkgconfig, glib, linuxHeaders }:

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

  src = fetchFromGitHub {
    owner = "markfasheh";
    repo = "duperemove";
    rev = "v${version}";
    sha256 = "1d586k6rbfqb5557i1p5xq8ngbppbwpxlkw8wqm7d900a3hp36nl";
  };

  buildInputs = [ libgcrypt pkgconfig glib linuxHeaders ];

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

  meta = {
    description = "A simple tool for finding duplicated extents and submitting them for deduplication";
    homepage = https://github.com/markfasheh/duperemove;
    license = lib.licenses.gpl2;

    maintainers = [ lib.maintainers.bluescreen303 ];
    platforms = lib.platforms.all;
  };
}


{ stdenv, fetchurl, autoconf, libtool, automake, libsodium, ncurses
, libconfig, pkgconfig }:

let
  version = "388b1229b";
  date = "20140220";
in
stdenv.mkDerivation rec {
  name = "tox-core-${date}-${version}";

  src = fetchurl {
    url = "https://github.com/irungentoo/ProjectTox-Core/tarball/${version}";
    name = "${name}.tar.gz";
    sha256 = "12vggiv0gyv8a2rd5qrv04b7yhfhxb7r0yh75gg5n4jdpcbhvgsd";
  };

  preConfigure = ''
    autoreconf -i
  '';

  configureFlags = [ "--with-libsodium-headers=${libsodium}/include"
    "--with-libsodium-libs=${libsodium}/lib"
    "--enable-ntox" ];

  buildInputs = [ autoconf libtool automake libsodium ncurses libconfig
    pkgconfig ];

  doCheck = true;

  meta = {
    description = "P2P FOSS instant messaging application aimed to replace Skype with crypto";
    license = stdenv.lib.licenses.gpl3Plus;
    maintainers = with stdenv.lib.maintainers; [ viric ];
    platforms = stdenv.lib.platforms.all;
  };
}

Update to latest Git master.

{ stdenv, fetchurl, autoconf, libtool, automake, libsodium, ncurses
, libconfig, pkgconfig }:

let
  version = "e1158be5a6";
  date = "20140728";
in
stdenv.mkDerivation rec {
  name = "tox-core-${date}-${version}";

  src = fetchurl {
    url = "https://github.com/irungentoo/toxcore/tarball/${version}";
    name = "${name}.tar.gz";
    sha256 = "1rsh1pbwvngsx5slmd6608b1zqs3jvq70bjr9zyziap9vxka3z1v";
  };

  preConfigure = ''
    autoreconf -i
  '';

  configureFlags = [
    "--with-libsodium-headers=${libsodium}/include"
    "--with-libsodium-libs=${libsodium}/lib"
    "--enable-ntox"
  ];

  buildInputs = [
    autoconf libtool automake libsodium ncurses libconfig pkgconfig
  ];

  doCheck = true;

  meta = {
    description = "P2P FOSS instant messaging application aimed to replace Skype with crypto";
    license = stdenv.lib.licenses.gpl3Plus;
    maintainers = with stdenv.lib.maintainers; [ viric ];
    platforms = stdenv.lib.platforms.all;
  };
}


{ lib
, libfprint
, fetchFromGitLab
}:

# for the curious, "tod" means "Touch OEM Drivers" meaning it can load
# external .so's.
libfprint.overrideAttrs ({ postPatch ? "", mesonFlags ? [], ... }: let
  version = "1.94.1+tod1";
in  {
  pname = "libfprint-tod";
  inherit version;

  src = fetchFromGitLab {
    domain = "gitlab.freedesktop.org";
    owner = "3v1n0";
    repo = "libfprint";
    rev = "v${version}";
    sha256 = "sha256-IVeTQlZjea4xgbG/N7OTHAj6RT4WutfvQhV8qFEvkKo=";
  };

  mesonFlags = mesonFlags ++ [
    "-Dudev_hwdb_dir=${placeholder "out"}/lib/udev/hwdb.d"
  ];

  postPatch = ''
    ${postPatch}
    patchShebangs ./tests/*.py ./tests/*.sh
  '';

  meta = with lib; {
    homepage = "https://gitlab.freedesktop.org/3v1n0/libfprint";
    description = "A library designed to make it easy to add support for consumer fingerprint readers, with support for loaded drivers";
    license = licenses.lgpl21;
    platforms = platforms.linux;
    maintainers = with maintainers; [ grahamc ];
  };
})

Revert "libfprint-tod: 1.90.7 -> 1.94.1"

{ lib
, libfprint
, fetchFromGitLab
}:

# for the curious, "tod" means "Touch OEM Drivers" meaning it can load
# external .so's.
libfprint.overrideAttrs ({ postPatch ? "", mesonFlags ? [], ... }: let
  version = "1.90.7+git20210222+tod1";
in  {
  pname = "libfprint-tod";
  inherit version;

  src = fetchFromGitLab {
    domain = "gitlab.freedesktop.org";
    owner = "3v1n0";
    repo = "libfprint";
    rev = "v${version}";
    sha256 = "0cj7iy5799pchyzqqncpkhibkq012g3bdpn18pfb19nm43svhn4j";
  };

  mesonFlags = mesonFlags ++ [
    "-Dudev_hwdb_dir=${placeholder "out"}/lib/udev/hwdb.d"
  ];

  postPatch = ''
    ${postPatch}
    patchShebangs ./tests/*.py ./tests/*.sh
  '';

  meta = with lib; {
    homepage = "https://gitlab.freedesktop.org/3v1n0/libfprint";
    description = "A library designed to make it easy to add support for consumer fingerprint readers, with support for loaded drivers";
    license = licenses.lgpl21;
    platforms = platforms.linux;
    maintainers = with maintainers; [ grahamc ];
  };
})


{ stdenv, fetchsvn, writeScript, ocaml, findlib, camlp5 }:

let
  start_script = ''
    #!/bin/sh
    cd "$out/lib/hol_light"
    exec ${ocaml}/bin/ocaml -I \`${camlp5}/bin/camlp5 -where\` -init make.ml
  '';
in
stdenv.mkDerivation rec {
  name     = "hol_light-${version}";
  version  = "189";

  src = fetchsvn {
    url = http://hol-light.googlecode.com/svn/trunk;
    rev = version;
    sha256 = "1v10l64rs7da2kag3wlb651i09pn83icy9n5z84j8h1iwlxzajdh";
  };

  buildInputs = [ ocaml findlib camlp5 ];

  installPhase = ''
    mkdir -p "$out/lib/hol_light" "$out/bin"
    cp -a  . $out/lib/hol_light
    echo "${start_script}" > "$out/bin/hol_light"
    chmod a+x "$out/bin/hol_light"
  '';

  meta = {
    description = "Interactive theorem prover based on Higher-Order Logic";
    homepage    = http://www.cl.cam.ac.uk/~jrh13/hol-light/;
    license     = stdenv.lib.licenses.bsd2;
    platforms   = stdenv.lib.platforms.unix;
    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
  };
}

Update hol_light to r198. Add myself as a maintainer

{ stdenv, fetchsvn, writeScript, ocaml, findlib, camlp5 }:

let
  start_script = ''
    #!/bin/sh
    cd "$out/lib/hol_light"
    exec ${ocaml}/bin/ocaml -I \`${camlp5}/bin/camlp5 -where\` -init make.ml
  '';
in

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

  src = fetchsvn {
    url = http://hol-light.googlecode.com/svn/trunk;
    rev = version;
    sha256 = "1y7vivj5l84fb7wqn38qbykpgs8ql2gmqxxch1yn5mg1cf9iiqsx";
  };

  buildInputs = [ ocaml findlib camlp5 ];

  installPhase = ''
    mkdir -p "$out/lib/hol_light" "$out/bin"
    cp -a  . $out/lib/hol_light
    echo "${start_script}" > "$out/bin/hol_light"
    chmod a+x "$out/bin/hol_light"
  '';

  meta = with stdenv.lib; {
    description = "Interactive theorem prover based on Higher-Order Logic";
    homepage    = http://www.cl.cam.ac.uk/~jrh13/hol-light/;
    license     = licenses.bsd2;
    platforms   = platforms.unix;
    maintainers = with maintainers; [ thoughtpolice z77z ];
  };
}


{ stdenv, fetchurl, fetchpatch }:
let
  version = "0.1.7";
in
stdenv.mkDerivation {
  name = "libyaml-${version}";

  src = fetchurl {
    url = "http://pyyaml.org/download/libyaml/yaml-${version}.tar.gz";
    sha256 = "0a87931cx5m14a1x8rbjix3nz7agrcgndf4h392vm62a4rby9240";
  };

  meta = with stdenv.lib; {
    homepage = http://pyyaml.org/;
    description = "A YAML 1.1 parser and emitter written in C";
    license = licenses.mit;
    platforms = platforms.unix;
    maintainers = with maintainers; [ wkennington ];
  };
}

Allow YAML on other platforms as well.

{ stdenv, fetchurl, fetchpatch }:
let
  version = "0.1.7";
in
stdenv.mkDerivation {
  name = "libyaml-${version}";

  src = fetchurl {
    url = "http://pyyaml.org/download/libyaml/yaml-${version}.tar.gz";
    sha256 = "0a87931cx5m14a1x8rbjix3nz7agrcgndf4h392vm62a4rby9240";
  };

  meta = with stdenv.lib; {
    homepage = http://pyyaml.org/;
    description = "A YAML 1.1 parser and emitter written in C";
    license = licenses.mit;
    platforms = platforms.all;
    maintainers = with maintainers; [ wkennington ];
  };
}


{stdenv, fetchurl, gfortran, readline, ncurses, perl, flex, texinfo, qhull,
libX11, graphicsmagick, pcre, liblapack, texLive, pkgconfig, mesa, fltk,
fftw, fftwSinglePrec, zlib, curl }:

stdenv.mkDerivation rec {
  name = "octave-3.4.3";
  src = fetchurl {
    url = "mirror://gnu/octave/${name}.tar.bz2";
    sha256 = "0j61kpfbv8l8rw3r9cwcmskvvav3q2f6plqdq3lnb153jg61klcl";
  };

  buildInputs = [ gfortran readline ncurses perl flex texinfo qhull libX11
    graphicsmagick pcre liblapack texLive pkgconfig mesa fltk zlib curl
    fftw fftwSinglePrec ];

  enableParallelBuilding = true;

  configureFlags = [ "--enable-readline" "--enable-dl" ];
}

Add make check to octave. Some tests fail, but the build works. We'll have the report this way.

{stdenv, fetchurl, gfortran, readline, ncurses, perl, flex, texinfo, qhull,
libX11, graphicsmagick, pcre, liblapack, texLive, pkgconfig, mesa, fltk,
fftw, fftwSinglePrec, zlib, curl }:

stdenv.mkDerivation rec {
  name = "octave-3.4.3";
  src = fetchurl {
    url = "mirror://gnu/octave/${name}.tar.bz2";
    sha256 = "0j61kpfbv8l8rw3r9cwcmskvvav3q2f6plqdq3lnb153jg61klcl";
  };

  buildInputs = [ gfortran readline ncurses perl flex texinfo qhull libX11
    graphicsmagick pcre liblapack texLive pkgconfig mesa fltk zlib curl
    fftw fftwSinglePrec ];

  doCheck = true;

  enableParallelBuilding = true;

  configureFlags = [ "--enable-readline" "--enable-dl" ];
}


{ cabal, bytestringLexing, cairo, Chart, colour, HUnit, mtl
, strptime, time, vcsRevision
}:

cabal.mkDerivation (self: {
  pname = "splot";
  version = "0.3.9";
  sha256 = "039k6lgwdvpyc8w74zh98wxi1wj2jmin69jnwp7gnmv43kjpbgh5";
  isLibrary = false;
  isExecutable = true;
  buildDepends = [
    bytestringLexing cairo Chart colour HUnit mtl strptime time
    vcsRevision
  ];
  meta = {
    homepage = "http://www.haskell.org/haskellwiki/Splot";
    description = "A tool for visualizing the lifecycle of many concurrent multi-staged processes";
    license = self.stdenv.lib.licenses.bsd3;
    platforms = self.ghc.meta.platforms;
  };
})

Update splot to 0.3.11, so it compiles again

{ cabal, bytestringLexing, cairo, colour, HUnit, mtl
, strptime, time, vcsRevision
}:

cabal.mkDerivation (self: {
  pname = "splot";
  version = "0.3.11";
  sha256 = "0mpyfmafjjcf85v740h69p5mggyqsq3li8m1fa5c0z4rdd0395an";
  isLibrary = false;
  isExecutable = true;
  buildDepends = [
    bytestringLexing cairo colour HUnit mtl strptime time
    vcsRevision
  ];
  meta = {
    homepage = "http://www.haskell.org/haskellwiki/Splot";
    description = "A tool for visualizing the lifecycle of many concurrent multi-staged processes";
    license = self.stdenv.lib.licenses.bsd3;
    platforms = self.ghc.meta.platforms;
  };
})


{ stdenv, cmake, llvmPackages, irony }:

stdenv.mkDerivation {
  pname = "irony-server";
  inherit (irony) version;

  nativeBuildInputs = [ cmake ];
  buildInputs = [ llvmPackages.libclang ];

  dontUseCmakeBuildDir = true;

  cmakeDir = "server";

  cmakeFlags = [
    "-DCMAKE_PREFIX_PATH=${llvmPackages.clang-unwrapped}"
  ];

  src = irony.src;

  meta = {
    description = "The server part of irony.";
    homepage = "https://melpa.org/#/irony";
    maintainers = [ stdenv.lib.maintainers.deepfire ];
    platforms = stdenv.lib.platforms.unix;
    license = stdenv.lib.licenses.free;
  };
}

Fix build with 1.4.0 cmake files

{ stdenv, cmake, llvmPackages, irony }:

stdenv.mkDerivation {
  pname = "irony-server";
  inherit (irony) src version;

  nativeBuildInputs = [ cmake ];
  buildInputs = [ llvmPackages.libclang llvmPackages.llvm ];

  dontUseCmakeBuildDir = true;

  cmakeDir = "server";

  cmakeFlags = [
    "-DCMAKE_PREFIX_PATH=${llvmPackages.clang-unwrapped}"
  ];

  meta = with stdenv.lib; {
    description = "The server part of irony.";
    homepage = "https://melpa.org/#/irony";
    maintainers = [ maintainers.deepfire ];
    platforms = platforms.unix;
    license = licenses.free;
  };
}


{ pkgs, config, ... }:

{
  home.packages = with pkgs; [
    acpi
    ardour
    atool
    audacity
    blueman
    byzanz
    calc
    calibre
    cargo
    coreutils
    ctags
    curl
    dict
    diction
    file
    firefox
    gnome3.adwaita-icon-theme
    gnumake
    gnupg
    golly
    gparted
    hsetroot
    hugo
    imagemagick
    inetutils
    libreoffice.libreoffice
    musescore
    nextcloud-client
    networkmanagerapplet
    nix-repl
    nixops
    nox
    openjdk8
    p7zip
    pandoc
    pass
    psmisc
    pwgen
    python
    python3
    qrencode
    ranger
    rsync
    rustc
    scrot
    spotify
    sshfs
    sxiv
    texlive.combined.scheme-full
    thunderbird
    tomb
    tome4
    transmission_gtk
    trash-cli
    tree
    unclutter
    unrar
    rxvt_unicode-with-plugins
    unzip
    vlc
    w3m
    wget
    xclip
    xdg-user-dirs
    xdg_utils
    xorg.xbacklight
    xorg.xev
    xorg.xwininfo
    xsel
    xxd
    youtube-dl
    zathura
    zip
    zotero
  ];
}

Add mediainfo for video stats in ranger

{ pkgs, config, ... }:

{
  home.packages = with pkgs; [
    acpi
    ardour
    atool
    audacity
    blueman
    byzanz
    calc
    calibre
    cargo
    coreutils
    ctags
    curl
    dict
    diction
    file
    firefox
    gnome3.adwaita-icon-theme
    gnumake
    gnupg
    golly
    gparted
    hsetroot
    hugo
    imagemagick
    inetutils
    libreoffice.libreoffice
    mediainfo
    musescore
    nextcloud-client
    networkmanagerapplet
    nix-repl
    nixops
    nox
    openjdk8
    p7zip
    pandoc
    pass
    psmisc
    pwgen
    python
    python3
    qrencode
    ranger
    rsync
    rustc
    scrot
    spotify
    sshfs
    sxiv
    texlive.combined.scheme-full
    thunderbird
    tomb
    tome4
    transmission_gtk
    trash-cli
    tree
    unclutter
    unrar
    rxvt_unicode-with-plugins
    unzip
    vlc
    w3m
    wget
    xclip
    xdg-user-dirs
    xdg_utils
    xorg.xbacklight
    xorg.xev
    xorg.xwininfo
    xsel
    xxd
    youtube-dl
    zathura
    zip
    zotero
  ];
}


{ stdenv, fetchurl, cpio, zlib, bzip2, file, elfutils, nspr, nss, popt, db4, xz }:

stdenv.mkDerivation rec {
  name = "rpm-4.10.0";

  src = fetchurl {
    url = "http://rpm.org/releases/rpm-4.10.x/${name}.tar.bz2";
    sha256 = "1ag4pz51npiwf6vcksipjxaypm5afzmy8lj19bp0fk5n6mr26bhf";
  };

  buildInputs = [ cpio zlib bzip2 file nspr nss popt db4 xz ];

  # Note: we don't add elfutils to buildInputs, since it provides a
  # bad `ld' and other stuff.
  NIX_CFLAGS_COMPILE = "-I${nspr}/include/nspr -I${nss}/include/nss -I${elfutils}/include";

  NIX_CFLAGS_LINK = "-L${elfutils}/lib";

  configureFlags = "--with-external-db --without-lua";

  meta = {
    homepage = http://www.rpm.org/;
    license = "GPLv2";
    description = "The RPM Package Manager";
  };
}

Revert "Update RPM to 4.10.0."

{ stdenv, fetchurl, cpio, zlib, bzip2, file, elfutils, nspr, nss, popt, db4, xz }:

stdenv.mkDerivation rec {
  name = "rpm-4.7.2";

  src = fetchurl {
    url = "http://rpm.org/releases/rpm-4.7.x/${name}.tar.bz2";
    sha1 = "07b90f653775329ea726ce0005c4c82f56167ca0";
  };

  buildInputs = [ cpio zlib bzip2 file nspr nss popt db4 xz ];

  # Note: we don't add elfutils to buildInputs, since it provides a
  # bad `ld' and other stuff.
  NIX_CFLAGS_COMPILE = "-I${nspr}/include/nspr -I${nss}/include/nss -I${elfutils}/include";

  NIX_CFLAGS_LINK = "-L${elfutils}/lib";

  configureFlags = "--with-external-db --without-lua";

  meta = {
    homepage = http://www.rpm.org/;
    license = "GPLv2";
    description = "The RPM Package Manager";
  };
}


{
  description = "A flake for building Hello World";

  edition = 201909;

  outputs = { self, nixpkgs }: {

    packages.x86_64-linux.hello = nixpkgs.packages.x86_64-linux.hello;

  };
}

Fix attr path to nixpkgs flake in flake template

{
  description = "A flake for building Hello World";

  edition = 201909;

  outputs = { self, nixpkgs }: {

    packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;

  };
}


{ lib
, buildPythonPackage
, fetchPypi
, isPy3k
# propagatedBuildInputs
, aiohttp
, async-timeout
, semantic-version
# buildInputs
, pytestrunner
# checkInputs
, pytest
, pytest-asyncio
, aresponses
}:
buildPythonPackage rec {
  pname = "pyhaversion";
  version = "3.4.2";

  # needs aiohttp which is py3k-only
  disabled = !isPy3k;

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

  propagatedBuildInputs = [
    aiohttp
    async-timeout
    semantic-version
  ];

  buildInputs = [
    pytestrunner
  ];

  checkInputs = [
    pytest
    pytest-asyncio
    aresponses
  ];

  meta = with lib; {
    description = "A python module to the newest version number of Home Assistant";
    homepage = "https://github.com/ludeeus/pyhaversion";
    maintainers = [ maintainers.makefu ];
  };
}

Mark >= Python 3.8 only, disable tests

{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, aiohttp
, async-timeout
, semantic-version
, pytestrunner
}:
buildPythonPackage rec {
  pname = "pyhaversion";
  version = "3.4.2";
  disabled = pythonOlder "3.8";

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

  propagatedBuildInputs = [
    aiohttp
    async-timeout
    semantic-version
  ];

  buildInputs = [
    pytestrunner
  ];

  # no tests
  doCheck = false;
  pythonImportsCheck = [ "pyhaversion" ];

  meta = with lib; {
    description = "A python module to the newest version number of Home Assistant";
    homepage = "https://github.com/ludeeus/pyhaversion";
    license = with licenses; [ mit ];
    maintainers = [ maintainers.makefu ];
  };
}


{ pkgs, haskellLib, fetchFromGitHub }:
with haskellLib;
self: super: {
  cabal-macosx = dontCheck super.cabal-macosx;
  enclosed-exceptions = dontCheck super.enclosed-exceptions; # see https://github.com/jcristovao/enclosed-exceptions/issues/12
  haddock-library-ghcjs = dontCheck super.haddock-library-ghcjs;
  haddock-api-ghcjs = dontCheck super.haddock-api-ghcjs;
  algebraic-graphs = doJailbreak super.algebraic-graphs;
}

Remove a couple of unnecessary overrides

{ pkgs, haskellLib, fetchFromGitHub }:
with haskellLib;
self: super: {
  cabal-macosx = dontCheck super.cabal-macosx;
  haddock-library-ghcjs = dontCheck super.haddock-library-ghcjs;
  haddock-api-ghcjs = dontCheck super.haddock-api-ghcjs;
}


with (import <nixpkgs> {});
{
  inherit gimp;

  inherit myEmacs;
  inherit (haskellPackages) cabal2nix;

  inherit meld;

  inherit qemu;
  inherit gdb;

  inherit ncdu;
  inherit unison;
  inherit htop;

  inherit xsel;

  inherit p7zip;
  inherit unzip;
}

Add unrar to base env

with (import <nixpkgs> {});
{
  inherit gimp;

  inherit myEmacs;
  inherit (haskellPackages) cabal2nix;

  inherit meld;

  inherit qemu;
  inherit gdb;

  inherit ncdu;
  inherit unison;
  inherit htop;

  inherit xsel;

  inherit p7zip;
  inherit unzip;
  inherit unrar;
}


{ stdenv, buildGoPackage, fetchFromGitHub }:

buildGoPackage rec {
  pname = "rclone";
  version = "1.50.0";

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

  goPackagePath = "github.com/rclone/rclone";

  subPackages = [ "." ];

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

  postInstall = ''
    install -D -m644 $src/rclone.1 $man/share/man/man1/rclone.1
  '';

  meta = with stdenv.lib; {
    description = "Command line program to sync files and directories to and from major cloud storage";
    homepage = https://rclone.org;
    license = licenses.mit;
    maintainers = with maintainers; [ danielfullmer ];
    platforms = platforms.all;
  };
}

Revert "rclone: 1.49.5 -> 1.50.0"

{ stdenv, buildGoPackage, fetchFromGitHub }:

buildGoPackage rec {
  pname = "rclone";
  version = "1.49.5";

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

  goPackagePath = "github.com/rclone/rclone";

  subPackages = [ "." ];

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

  postInstall = ''
    install -D -m644 $src/rclone.1 $man/share/man/man1/rclone.1
  '';

  meta = with stdenv.lib; {
    description = "Command line program to sync files and directories to and from major cloud storage";
    homepage = https://rclone.org;
    license = licenses.mit;
    maintainers = with maintainers; [ danielfullmer ];
    platforms = platforms.all;
  };
}


{stdenv, gcc5, fetchurl, xlibs, cmake, subversion, mesa, qt5, boost,
 python27, python27Packages}:

stdenv.mkDerivation rec {
  version = "201707";
  build_nr = "1";
  name = "mcrl2-${version}";

  src = fetchurl {
    url = "http://www.mcrl2.org/download/release/mcrl2-${version}.${build_nr}.tar.gz";
    sha256 = "1c8h94ja7271ph61zrcgnjgblxppld6v22f7f900prjgzbcfy14m";
  };

  buildInputs = [ gcc5 cmake mesa qt5.qtbase boost ];

  enableParallelBuilding = true;

  meta = with stdenv.lib; {
    description = "A toolset for model-checking concurrent systems and protocols";
    longDescription = ''
      A formal specification language with an associated toolset,
      that can be used for modelling, validation and verification of
      concurrent systems and protocols
    '';
    homepage = http://www.mcrl2.org/;
    license = licenses.boost;
    maintainers = with maintainers; [ moretea ];
    platforms = platforms.unix;
  };
}

Revert "mcrl2: force use of gcc5 to prevent compilation errors"

{stdenv, fetchurl, xlibs, cmake, subversion, mesa, qt5, boost,
 python27, python27Packages}:

stdenv.mkDerivation rec {
  version = "201707";
  build_nr = "1";
  name = "mcrl2-${version}";

  src = fetchurl {
    url = "http://www.mcrl2.org/download/release/mcrl2-${version}.${build_nr}.tar.gz";
    sha256 = "1c8h94ja7271ph61zrcgnjgblxppld6v22f7f900prjgzbcfy14m";
  };

  buildInputs = [ cmake mesa qt5.qtbase boost ];

  enableParallelBuilding = true;

  meta = with stdenv.lib; {
    description = "A toolset for model-checking concurrent systems and protocols";
    longDescription = ''
      A formal specification language with an associated toolset,
      that can be used for modelling, validation and verification of
      concurrent systems and protocols
    '';
    homepage = http://www.mcrl2.org/;
    license = licenses.boost;
    maintainers = with maintainers; [ moretea ];
    platforms = platforms.unix;
  };
}


{
  allowUnfreePredicate = with builtins;
  let
    getName = pkg: (parseDrvName pkg.name).name;
  in pkg: elem (getName pkg) [
    "slack"
    "spotify"
  ];
  pulseaudio = true;
}

Fix Nix "unfree" for new `lib.getName` built-in

{
  allowUnfreePredicate =
  let nixpkgs = import <nixpkgs> {};
  in pkg: builtins.elem (nixpkgs.lib.getName pkg) [
    "slack"
    "spotify"
  ];
  pulseaudio = true;
}


{ cabal, filepath, hslogger, MissingH, mtl, regexBase, regexCompat
, regexPosix
}:

cabal.mkDerivation (self: {
  pname = "HSH";
  version = "2.1.0";
  sha256 = "0gz2hzdvf0gqv33jihn67bvry38c6hkjapb1prxmb3w12lisr4l5";
  isLibrary = true;
  isExecutable = true;
  buildDepends = [
    filepath hslogger MissingH mtl regexBase regexCompat regexPosix
  ];
  meta = {
    homepage = "http://software.complete.org/hsh";
    description = "Library to mix shell scripting with Haskell programs";
    license = "LGPL";
    platforms = self.ghc.meta.platforms;
    maintainers = [ self.stdenv.lib.maintainers.andres ];
  };
})

Revert "haskell-HSH: update to version 2.1.0"

{ cabal, filepath, hslogger, MissingH, mtl, regexBase, regexCompat
, regexPosix
}:

cabal.mkDerivation (self: {
  pname = "HSH";
  version = "2.0.4";
  sha256 = "1ddpazmk82716hqd1riqs7vnl4aildgwkjgk80iam49df9p5b8v8";
  isLibrary = true;
  isExecutable = true;
  buildDepends = [
    filepath hslogger MissingH mtl regexBase regexCompat regexPosix
  ];
  meta = {
    homepage = "http://software.complete.org/hsh";
    description = "Library to mix shell scripting with Haskell programs";
    license = "LGPL";
    platforms = self.ghc.meta.platforms;
    maintainers = [ self.stdenv.lib.maintainers.andres ];
  };
})


{ pkgs, config, ... }:

{
  # "The set of packages to appear in the user environment."
  home.packages = with pkgs; [
    acpi
    ardour
    audacity
    blueman
    byzanz
    calc
    calibre
    cargo
    coreutils
    ctags
    curl
    dict
    diction
    exfat
    file
    firefox
    gnome3.adwaita-icon-theme
    gnumake
    gnupg
    golly
    gparted
    hsetroot
    hugo
    imagemagick
    libreoffice
    musescore
    nextcloud-client
    p7zip
    pandoc
    pass
    pasystray
    psmisc
    pwgen
    python
    python3
    qrencode
    ranger
    rofi-pass
    rsync
    rustc
    rxvt_unicode_with-plugins
    scrot
    spotify
    sshfs
    sxiv
    texlive.combined.scheme-full
    thunderbird
    tomb
    transmission_gtk
    trash-cli
    tree
    unclutter
    unzip
    vlc
    w3m
    wget
    xclip
    xdg-user-dirs
    xdg_utils
    xorg.xbacklight
    xorg.xev
    xorg.xwininfo
    xsel
    youtube-dl
    zathura
    zip
    zotero
  ];
}

Fix libreoffice font bug (introducing high cpu usage...)

{ pkgs, config, ... }:

{
  # "The set of packages to appear in the user environment."
  home.packages = with pkgs; [
    acpi
    ardour
    audacity
    blueman
    byzanz
    calc
    calibre
    cargo
    coreutils
    ctags
    curl
    dict
    diction
    exfat
    file
    firefox
    gnome3.adwaita-icon-theme
    gnumake
    gnupg
    golly
    gparted
    hsetroot
    hugo
    imagemagick
    libreoffice.libreoffice
    musescore
    nextcloud-client
    p7zip
    pandoc
    pass
    pasystray
    psmisc
    pwgen
    python
    python3
    qrencode
    ranger
    rofi-pass
    rsync
    rustc
    rxvt_unicode_with-plugins
    scrot
    spotify
    sshfs
    sxiv
    texlive.combined.scheme-full
    thunderbird
    tomb
    transmission_gtk
    trash-cli
    tree
    unclutter
    unzip
    vlc
    w3m
    wget
    xclip
    xdg-user-dirs
    xdg_utils
    xorg.xbacklight
    xorg.xev
    xorg.xwininfo
    xsel
    youtube-dl
    zathura
    zip
    zotero
  ];
}


{ stdenv, buildPythonPackage, fetchPypi, isPy3k
, oset, pybtex, pybtex-docutils, sphinx
}:

buildPythonPackage rec {
  version = "1.0.0";
  pname = "sphinxcontrib-bibtex";

  disabled = !isPy3k;

  src = fetchPypi {
    inherit pname version;
    sha256 = "629612b001f86784669d65e662377a482052decfd9a0a17c46860878eef7b9e0";
  };

  propagatedBuildInputs = [ oset pybtex pybtex-docutils sphinx ];

  meta = {
    description = "A Sphinx extension for BibTeX style citations";
    homepage = "https://github.com/mcmtroffaes/sphinxcontrib-bibtex";
    license = stdenv.lib.licenses.bsd2;
  };

}

Disable tests, add maintainer, cleanups

{ lib
, buildPythonPackage
, fetchPypi
, isPy3k
, oset
, pybtex
, pybtex-docutils
, sphinx
}:

buildPythonPackage rec {
  version = "1.0.0";
  pname = "sphinxcontrib-bibtex";

  disabled = !isPy3k;

  src = fetchPypi {
    inherit pname version;
    sha256 = "629612b001f86784669d65e662377a482052decfd9a0a17c46860878eef7b9e0";
  };

  propagatedBuildInputs = [ oset pybtex pybtex-docutils sphinx ];

  doCheck = false;
  pythonImportsCheck = [ "sphinxcontrib.bibtex" ];

  meta = with lib; {
    description = "A Sphinx extension for BibTeX style citations";
    homepage = "https://github.com/mcmtroffaes/sphinxcontrib-bibtex";
    license = licenses.bsd2;
    maintainers = with maintainers; [ SuperSandro2000 ];
  };
}


{ linux_4_15, fetchFromGitHub, stdenv, ... }:

let kernel_gcc_patch = stdenv.mkDerivation {
  name = "kernel_gcc_patch";
  src = fetchFromGitHub {
    owner = "graysky2";
    repo = "kernel_gcc_patch";
    rev = "bfdcd89603a2894dca229c691b4d35c9e39e2d3b";
    sha256 = "0vmz3gilicl1jwap4jwyz28wqd1n7phs2r9s5gs7dv48yxlnxa6z";
  };
  installPhase = ''
    mkdir -p $out/lib
    mv ./* $out/lib
  '';
}; in

linux_4_15.override {
  extraConfig = ''
    PREEMPT y
  '';
  # MZEN y
  #kernelPatches = [{
  #  name = "gcc_patch";
  #  patch = builtins.toPath "${kernel_gcc_patch}/lib/enable_additional_cpu_optimizations_for_gcc_v4.9+_kernel_v4.13+.patch";
  #}];
}

Add non-working lz4 compression to linux override

{ linux_4_15, fetchFromGitHub, stdenv, lz4, ... }:

let kernel_gcc_patch = stdenv.mkDerivation {
  name = "kernel_gcc_patch";
  src = fetchFromGitHub {
    owner = "graysky2";
    repo = "kernel_gcc_patch";
    rev = "bfdcd89603a2894dca229c691b4d35c9e39e2d3b";
    sha256 = "0vmz3gilicl1jwap4jwyz28wqd1n7phs2r9s5gs7dv48yxlnxa6z";
  };
  installPhase = ''
    mkdir -p $out/lib
    mv ./* $out/lib
  '';
}; in

linux_4_15.override {
  nativeBuildPackages = [ lz4 ];
  extraConfig = ''
    KERNEL_XZ n
    KERNEL_LZ4 y
    MODULE_COMPRESS_XZ n
    MODULE_COMPRESS_GZIP y
    PREEMPT y
    NR_CPUS 12
  '';
}

  # MZEN y
  #kernelPatches = [{
  #  name = "gcc_patch";
  #  patch = builtins.toPath "${kernel_gcc_patch}/lib/enable_additional_cpu_optimizations_for_gcc_v4.9+_kernel_v4.13+.patch";
  #}];


{ lib
, buildPythonPackage
, fetchFromGitHub
, isPy3k
, pytestrunner
, click
, dateparser
, pandas
, py-lru-cache
, six
, pytest
}:

buildPythonPackage rec {
  pname = "csvs-to-sqlite";
  version = "1.2";
  disabled = !isPy3k;

  src = fetchFromGitHub {
    owner = "simonw";
    repo = pname;
    rev = version;
    sha256 = "0p99cg76d3s7jxvigh5ad04dzhmr6g62qzzh4i6h7x9aiyvdhvk4";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace pandas~=0.25.0 pandas
  '';

  propagatedBuildInputs = [
    click
    dateparser
    pandas
    py-lru-cache
    six
  ];

  checkInputs = [
    pytest
  ];

  checkPhase = ''
    pytest
  '';

  meta = with lib; {
    description = "Convert CSV files into a SQLite database";
    homepage = "https://github.com/simonw/csvs-to-sqlite";
    license = licenses.asl20;
    maintainers = [ maintainers.costrouc ];
  };

}

Remove stale substituteInPlace, use pytestCheckHook

{ lib
, buildPythonPackage
, fetchFromGitHub
, isPy3k
, pytestrunner
, click
, dateparser
, pandas
, py-lru-cache
, six
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "csvs-to-sqlite";
  version = "1.2";
  disabled = !isPy3k;

  src = fetchFromGitHub {
    owner = "simonw";
    repo = pname;
    rev = version;
    sha256 = "0p99cg76d3s7jxvigh5ad04dzhmr6g62qzzh4i6h7x9aiyvdhvk4";
  };

  propagatedBuildInputs = [
    click
    dateparser
    pandas
    py-lru-cache
    six
  ];

  checkInputs = [
    pytestCheckHook
  ];

  meta = with lib; {
    description = "Convert CSV files into a SQLite database";
    homepage = "https://github.com/simonw/csvs-to-sqlite";
    license = licenses.asl20;
    maintainers = [ maintainers.costrouc ];
  };

}


{ lib
, buildPythonPackage
, fetchFromGitHub
, poetry-core
, pytestCheckHook
, pythonOlder
}:

buildPythonPackage rec {
  pname = "pyhumps";
  version = "3.7.3";
  format = "pyproject";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "nficano";
    repo = "humps";
    rev = "v${version}";
    hash = "sha256-7jkwf4qGQ+AD4/hOrEe/oAPY+gnSySUVBWFf70rU7xc=";
  };

  nativeBuildInputs = [
    poetry-core
  ];

  checkInputs = [
    pytestCheckHook
  ];

  pythonImportsCheck = [
    "humps"
  ];

  meta = with lib; {
    description = "Module to convert strings (and dictionary keys) between snake case, camel case and pascal case";
    homepage = "https://github.com/nficano/humps";
    license = with licenses; [ unlicense ];
    maintainers = with maintainers; [ fab ];
  };
}

Fix regression in symbols export

{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, poetry-core
, pytestCheckHook
, pythonOlder
}:

buildPythonPackage rec {
  pname = "pyhumps";
  version = "3.7.3";
  format = "pyproject";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "nficano";
    repo = "humps";
    rev = "v${version}";
    hash = "sha256-7jkwf4qGQ+AD4/hOrEe/oAPY+gnSySUVBWFf70rU7xc=";
  };

  patches = [
    (fetchpatch {
      # https://github.com/nficano/humps/pull/281
      url = "https://github.com/nficano/humps/commit/e248c26195804fa04c43e88c5682528f367e27b3.patch";
      hash = "sha256-+TCVfuMgfkDaS1tPu4q6PIOC3Kn1MBWyuoyAO6W0/h4=";
    })
  ];

  nativeBuildInputs = [
    poetry-core
  ];

  checkInputs = [
    pytestCheckHook
  ];

  pythonImportsCheck = [
    "humps"
  ];

  meta = with lib; {
    description = "Module to convert strings (and dictionary keys) between snake case, camel case and pascal case";
    homepage = "https://github.com/nficano/humps";
    license = with licenses; [ unlicense ];
    maintainers = with maintainers; [ fab ];
  };
}


# This file is autogenerated from update.sh in the same directory.
# VHASH: c9500486764a2433d0f059134a981eb9adccd3546a6f779bc0e05cdcb26d2ae6
{
  dev = {
    version = "22.0.1221.1";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-22.0.1221.1.tar.bz2";
    sha256 = "08cx2im0ng1dg83mk8jlx4in7v8f5vsf9y2ild0i22jb20c7h31s";
  };
  beta = {
    version = "21.0.1180.57";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-21.0.1180.57.tar.bz2";
    sha256 = "0idimvkrhs09x93hl8p7rddyb0ymk9f8i5jm6m3lg6ga959aj6ri";
  };
  stable = {
    version = "21.0.1180.57";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-21.0.1180.57.tar.bz2";
    sha256 = "0idimvkrhs09x93hl8p7rddyb0ymk9f8i5jm6m3lg6ga959aj6ri";
  };
}

Update channels to latest versions.

# This file is autogenerated from update.sh in the same directory.
{
  dev = {
    version = "22.0.1229.8";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-22.0.1229.8.tar.bz2";
    sha256 = "0gaa4mqvd0v4y587y6mri2f3b0rc8npmcbs9bfs4wwb8n1cp8kw0";
  };
  beta = {
    version = "21.0.1180.79";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-21.0.1180.79.tar.bz2";
    sha256 = "1jscpibv02pyqpcj6djcx0d1qwq8hcxampfqbsz8dicgjprp22c8";
  };
  stable = {
    version = "21.0.1180.79";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-21.0.1180.79.tar.bz2";
    sha256 = "1jscpibv02pyqpcj6djcx0d1qwq8hcxampfqbsz8dicgjprp22c8";
  };
}


{ cabal, text }:

cabal.mkDerivation (self: {
  pname = "tagsoup";
  version = "0.13";
  sha256 = "1pfkcfrmhzxplfkdzb0zj24dfsddw91plqp3mg2gqkv82y8blzk1";
  isLibrary = true;
  isExecutable = true;
  buildDepends = [ text ];
  meta = {
    homepage = "http://community.haskell.org/~ndm/tagsoup/";
    description = "Parsing and extracting information from (possibly malformed) HTML/XML documents";
    license = self.stdenv.lib.licenses.bsd3;
    platforms = self.ghc.meta.platforms;
    maintainers = [ self.stdenv.lib.maintainers.andres ];
  };
})

Revert "update to version 0.13"

{ cabal, text }:

cabal.mkDerivation (self: {
  pname = "tagsoup";
  version = "0.12.8";
  sha256 = "05cm9h80qmxvk7xhlgly9zcmpbsajagspaa8p6k4ddch6q9lj7m3";
  isLibrary = true;
  isExecutable = true;
  buildDepends = [ text ];
  meta = {
    homepage = "http://community.haskell.org/~ndm/tagsoup/";
    description = "Parsing and extracting information from (possibly malformed) HTML/XML documents";
    license = self.stdenv.lib.licenses.bsd3;
    platforms = self.ghc.meta.platforms;
    maintainers = [ self.stdenv.lib.maintainers.andres ];
  };
})


{ lib, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, lit
, llvm_11
}:

stdenv.mkDerivation rec {
  pname = "SPIRV-LLVM-Translator";
  version = "unstable-2021-06-13";

  src = fetchFromGitHub {
    owner = "KhronosGroup";
    repo = "SPIRV-LLVM-Translator";
    rev = "c67e6f26a7285aa753598ef792593ac4a545adf9";
    sha256 = "sha256-1s3lVNTQDl+pUvbzSMsp3cOUSm6I4DzqJxnLMeeE3F4=";
  };

  nativeBuildInputs = [ pkg-config cmake llvm_11.dev ];

  buildInputs = [ llvm_11 ];

  checkInputs = [ lit ];

  cmakeFlags = [
    "-DLLVM_INCLUDE_TESTS=ON"
  ];

  # FIXME: CMake tries to run "/llvm-lit" which of course doesn't exist
  doCheck = false;

  meta = with lib; {
    homepage    = "https://github.com/KhronosGroup/SPIRV-LLVM-Translator";
    description = "A tool and a library for bi-directional translation between SPIR-V and LLVM IR";
    license     = licenses.ncsa;
    platforms   = platforms.all;
    maintainers = with maintainers; [ gloaming ];
  };
}

Build and install llvm-spirv tool

{ lib, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, lit
, llvm_11
}:

stdenv.mkDerivation rec {
  pname = "SPIRV-LLVM-Translator";
  version = "unstable-2021-06-13";

  src = fetchFromGitHub {
    owner = "KhronosGroup";
    repo = "SPIRV-LLVM-Translator";
    rev = "c67e6f26a7285aa753598ef792593ac4a545adf9";
    sha256 = "sha256-1s3lVNTQDl+pUvbzSMsp3cOUSm6I4DzqJxnLMeeE3F4=";
  };

  nativeBuildInputs = [ pkg-config cmake llvm_11.dev ];

  buildInputs = [ llvm_11 ];

  checkInputs = [ lit ];

  cmakeFlags = [
    "-DLLVM_INCLUDE_TESTS=ON"
  ];

  # FIXME: CMake tries to run "/llvm-lit" which of course doesn't exist
  doCheck = false;

  makeFlags = [ "all" "llvm-spirv" ];

  postInstall = ''
    install -D tools/llvm-spirv/llvm-spirv $out/bin/llvm-spirv
  '';

  meta = with lib; {
    homepage    = "https://github.com/KhronosGroup/SPIRV-LLVM-Translator";
    description = "A tool and a library for bi-directional translation between SPIR-V and LLVM IR";
    license     = licenses.ncsa;
    platforms   = platforms.all;
    maintainers = with maintainers; [ gloaming ];
  };
}


{ lib
, buildPythonPackage
, fetchPypi
, h5py
, pytestCheckHook
, netcdf4
, pythonOlder
}:

buildPythonPackage rec {
  pname = "h5netcdf";
  version = "0.8.1";

  src = fetchPypi {
    inherit pname version;
    sha256 = "09bbnpsvwksb07wijn7flyyza56h5b2g2cw0hb3slmwxz6cgcjmr";
  };

  propagatedBuildInputs = [
    h5py
  ];

  checkInputs = [
    pytestCheckHook
    netcdf4
  ];

  disabled = pythonOlder "3.6";

  dontUseSetuptoolsCheck = true;

  meta = {
    description = "netCDF4 via h5py";
    homepage = "https://github.com/shoyer/h5netcdf";
    license = lib.licenses.bsd3;
  };

}

Fix test issues with h5py >= 3.0

{ lib
, buildPythonPackage
, fetchPypi
, fetchpatch
, h5py
, pytestCheckHook
, netcdf4
, pythonOlder
}:

buildPythonPackage rec {
  pname = "h5netcdf";
  version = "0.8.1";

  src = fetchPypi {
    inherit pname version;
    sha256 = "09bbnpsvwksb07wijn7flyyza56h5b2g2cw0hb3slmwxz6cgcjmr";
  };

  patches = [
    (fetchpatch{
      url = "https://patch-diff.githubusercontent.com/raw/h5netcdf/h5netcdf/pull/82.patch";
    sha256 = "0x9bq9jl4kvw152adkpcyqslhpi7miv80hrnpl2w2y798mmbs0s4";
    })
  ];

  propagatedBuildInputs = [
    h5py
  ];

  checkInputs = [
    pytestCheckHook
    netcdf4
  ];

  disabled = pythonOlder "3.6";

  dontUseSetuptoolsCheck = true;

  meta = {
    description = "netCDF4 via h5py";
    homepage = "https://github.com/shoyer/h5netcdf";
    license = lib.licenses.bsd3;
  };

}


{ lib
, buildPythonPackage
, fetchPypi
, six, h2
, isPy3k
}:

let
  _h2 = h2;
in let
  h2 = _h2.overrideAttrs (x: {
    version = "3.0.1";
    src = fetchPypi {
      pname = "h2";
      version = "3.0.1";
      sha256 = "0r3f43r0v7sqgdjjg5ngw0dndk2v6cyd0jncpwya54m37y42z5mj";
    };
  });
in

buildPythonPackage rec {
  pname = "wptserve";
  version = "2.0";

  disabled = isPy3k;

  src = fetchPypi {
    inherit pname version;
    sha256 = "9d0c6adc279748abea81ac12b7a2cac97ebbdd87826dc11f6dbd85b781e9442a";
  };

  propagatedBuildInputs = [ six h2 ];

  meta = {
    description = "A webserver intended for web browser testing";
    homepage =  http://wptserve.readthedocs.org/;
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ raskin ];
  };
}

Revert "pythonPackages.wptserve: fix build by adding a local h2 3.0.1 instance"

{ lib
, buildPythonPackage
, fetchPypi
, six, h2
, isPy3k
}:

buildPythonPackage rec {
  pname = "wptserve";
  version = "2.0";

  disabled = isPy3k;

  src = fetchPypi {
    inherit pname version;
    sha256 = "9d0c6adc279748abea81ac12b7a2cac97ebbdd87826dc11f6dbd85b781e9442a";
  };

  propagatedBuildInputs = [ six h2 ];

  meta = {
    description = "A webserver intended for web browser testing";
    homepage =  http://wptserve.readthedocs.org/;
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ raskin ];
  };
}


{ config, pkgs, ... }:
{
  imports =
    [
      ../programs/zsh/zsh.nix
      ../programs/neovim/neovim.nix
      ../programs/git.nix
      ../programs/emacs/emacs.nix
    ];

  home = {
    stateVersion = "21.05";
    packages = with pkgs; [
      pandoc
      cabal-install
      ghc
      haskell-language-server
      stack
      ripgrep
      tree
      zathura
      nyxt
      sqlite
      byzanz
      xrectsel
    ];
  };

  programs.fzf.enable = true;
  programs.bat = {
    enable = true;
    config.theme = "ansi-dark";
  };

  xdg.configFile."alacritty/alacritty.yml".source = ../programs/alacritty.yml;
  xdg.configFile."dunst/dunstrc".source = ../programs/dunstrc;
}

Add mypy as home-manager package

{ config, pkgs, ... }:
{
  imports =
    [
      ../programs/zsh/zsh.nix
      ../programs/neovim/neovim.nix
      ../programs/git.nix
      ../programs/emacs/emacs.nix
    ];

  home = {
    stateVersion = "21.05";
    packages = with pkgs; [
      pandoc
      cabal-install
      ghc
      haskell-language-server
      stack
      ripgrep
      tree
      zathura
      nyxt
      sqlite
      byzanz
      xrectsel
      mypy
    ];
  };

  programs.fzf.enable = true;
  programs.bat = {
    enable = true;
    config.theme = "ansi-dark";
  };

  xdg.configFile."alacritty/alacritty.yml".source = ../programs/alacritty.yml;
  xdg.configFile."dunst/dunstrc".source = ../programs/dunstrc;
}


{ stdenv, fetchurl, gnugrep, findutils }:
let
  version = "18-3ubuntu1"; # Vivid
in
stdenv.mkDerivation {
  name = "kmod-blacklist-${version}";

  src = fetchurl {
    url = "https://launchpad.net/ubuntu/+archive/primary/+files/kmod_${version}.debian.tar.xz";
    sha256 = "14ypc1ij9rjnkz4zklbxpgf0ac1bnqlx0mjv0pjjvrrf857fiq94";
  };

  installPhase = ''
    mkdir "$out"
    for f in modprobe.d/*.conf; do
      echo "''\n''\n## file: "`basename "$f"`"''\n''\n" >> "$out"/modprobe.conf
      cat "$f" >> "$out"/modprobe.conf
    done

    substituteInPlace "$out"/modprobe.conf \
      --replace /sbin/lsmod /run/booted-system/sw/bin/lsmod \
      --replace /sbin/rmmod /run/booted-system/sw/bin/rmmod \
      --replace /sbin/modprobe /run/booted-system/sw/bin/modprobe \
      --replace " grep " " ${gnugrep}/bin/grep " \
      --replace " xargs " " ${findutils}/bin/xargs "
  '';

  meta = {
    homepage = http://packages.ubuntu.com/source/saucy/kmod;
    description = "Linux kernel module blacklists from Ubuntu";
  };
}

Revert "kmod-blacklist-ubuntu: update to Vivid"

{ stdenv, fetchurl, gnugrep, findutils }:
let
  version = "3ubuntu1"; # Saucy
in
stdenv.mkDerivation {
  name = "kmod-blacklist-${version}";

  src = fetchurl {
    url = "https://launchpad.net/ubuntu/+archive/primary/+files/kmod_9-${version}.debian.tar.gz";
    sha256 = "0h6h0zw2490iqj9xa2sz4309jyfmcc50jdvkhxa1nw90npxglp67";
  };

  installPhase = ''
    mkdir "$out"
    for f in modprobe.d/*.conf; do
      echo "''\n''\n## file: "`basename "$f"`"''\n''\n" >> "$out"/modprobe.conf
      cat "$f" >> "$out"/modprobe.conf
    done

    substituteInPlace "$out"/modprobe.conf \
      --replace /sbin/lsmod /run/booted-system/sw/bin/lsmod \
      --replace /sbin/rmmod /run/booted-system/sw/bin/rmmod \
      --replace /sbin/modprobe /run/booted-system/sw/bin/modprobe \
      --replace " grep " " ${gnugrep}/bin/grep " \
      --replace " xargs " " ${findutils}/bin/xargs "
  '';

  meta = {
    homepage = http://packages.ubuntu.com/source/saucy/kmod;
    description = "Linux kernel module blacklists from Ubuntu";
  };
}


{ mkDerivation, aeson, array, base, bytestring, containers
, directory, deepseq, filemanip, filepath, ListLike, MissingH, mtl
, optparse-applicative, parsec, pretty, signal, stdenv, uu-parsinglib
, uuagc, uuagc-cabal, vector
, pkgs
}:
mkDerivation {
  pname = "glualint-lib";
  version = "0.1.0.0";
  src = ./.;
  isLibrary = true;
  isExecutable = true;
  buildDepends = [uuagc uuagc-cabal];
  libraryHaskellDepends = [
    aeson array base bytestring containers directory filemanip filepath
    ListLike MissingH mtl optparse-applicative parsec pretty signal
    uu-parsinglib uuagc uuagc-cabal deepseq

    # Require haskellPackages' uuagc and uuagc-cabal specifically
    # Otherwise compilation with ghcjs will fuck up.
    pkgs.haskellPackages.uuagc pkgs.haskellPackages.uuagc-cabal
    vector
  ];
  executableHaskellDepends = [ base directory ];

  preBuild = ''
    printf "Generating attribute grammar haskell files"
    ./AGGenerator.sh
  '';

  homepage = "https://github.com/FPtje/GLuaFixer";
  description = "Attempts to fix your syntax erroring Lua files";
  license = stdenv.lib.licenses.lgpl21;
}

Use lib instead of stdenv.lib

{ mkDerivation, aeson, array, base, bytestring, containers
, directory, deepseq, filemanip, filepath, ListLike, MissingH, mtl
, optparse-applicative, parsec, pretty, signal, lib, uu-parsinglib
, uuagc, uuagc-cabal, vector
, pkgs
}:
mkDerivation {
  pname = "glualint-lib";
  version = "0.1.0.0";
  src = ./.;
  isLibrary = true;
  isExecutable = true;
  buildDepends = [uuagc uuagc-cabal];
  libraryHaskellDepends = [
    aeson array base bytestring containers directory filemanip filepath
    ListLike MissingH mtl optparse-applicative parsec pretty signal
    uu-parsinglib uuagc uuagc-cabal deepseq

    # Require haskellPackages' uuagc and uuagc-cabal specifically
    # Otherwise compilation with ghcjs will fuck up.
    pkgs.haskellPackages.uuagc pkgs.haskellPackages.uuagc-cabal
    vector
  ];
  executableHaskellDepends = [ base directory ];

  preBuild = ''
    printf "Generating attribute grammar haskell files"
    ./AGGenerator.sh
  '';

  homepage = "https://github.com/FPtje/GLuaFixer";
  description = "Attempts to fix your syntax erroring Lua files";
  license = lib.licenses.lgpl21;
}


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

buildPythonPackage rec {
  version = "2.2.1";
  pname = "azure-mgmt-network";

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

  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/network/networkresourceprovider.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-network: 0.20.1 -> 2.2.1"

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

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

  src = fetchPypi {
    inherit pname version;
    extension = "zip";
    sha256 = "10vj22h6nxpw0qpvib5x2g6qs5j8z31142icvh4qk8k40fcrs9hx";
  };

  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/network/networkresourceprovider.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 ];
  };
}


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

Update stable version to v29.0.1547.62.

# This file is autogenerated from update.sh in the same directory.
{
  dev = {
    version = "30.0.1599.10";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-30.0.1599.10.tar.xz";
    sha256 = "1h6wak2sy0cawsk63gdbg7ggq8lg7cahs1v8i0hvzwm9k6apwphs";
  };
  beta = {
    version = "29.0.1547.57";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-29.0.1547.57.tar.xz";
    sha256 = "0xl595fng7qzlc8vh73lslzchr6ayd4vlmz2mpqppb8pai520xxf";
  };
  stable = {
    version = "29.0.1547.62";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-29.0.1547.62.tar.xz";
    sha256 = "0ld7cm287k2lkq3rfnhwgvvnjbm9345wvjbwfn4yzwy7gxzyfld6";
  };
}


{ config, pkgs, ... }:
{
  # remove this after 1st boot
  # see https://nixos.org/nixos/options.html#boot.zfs.forceimportroot
  # boot.kernelParams = ["zfs_force=1"];

  boot.initrd.kernelModules = [
    "icp"
    "spl"
    "zavl"
    "zcommon"
    "zfs"
    "znvpair"
    "zunicode"
  ];

  boot.zfs = {
    enableUnstable = true;
    forceImportRoot = false;
    forceImportAll = false;
  };

  boot.supportedFilesystems = [ "zfs" ];

  networking.hostId = "1cfca9bf";

  services.zfs = {
    autoScrub.enable = true;
    autoSnapshot = {
      enable = true;
      flags = "-k -p --utc";
    };
  };

  virtualisation.docker = {
    storageDriver = "zfs";
  };
}

Add zlua to zfs modules

{ config, pkgs, ... }:
{
  # remove this after 1st boot
  # see https://nixos.org/nixos/options.html#boot.zfs.forceimportroot
  # boot.kernelParams = ["zfs_force=1"];

  boot.initrd.kernelModules = [
    "icp"
    "spl"
    "zavl"
    "zcommon"
    "zfs"
    "zlua"
    "znvpair"
    "zunicode"
  ];

  boot.zfs = {
    enableUnstable = true;
    forceImportRoot = false;
    forceImportAll = false;
  };

  boot.supportedFilesystems = [ "zfs" ];

  networking.hostId = "1cfca9bf";

  services.zfs = {
    autoScrub.enable = true;
    autoSnapshot = {
      enable = true;
      flags = "-k -p --utc";
    };
  };

  virtualisation.docker = {
    storageDriver = "zfs";
  };
}


{ src ? { outPath = ./.; revCount = 0; gitTag = "dirty"; }
, supportedPlatforms ? [ "x86_64-linux" ]
, supportedCompilers ? [ "ghc7103" ]
}:

with (import <nixpkgs> {}).lib;

let
  hnixSrc = (import <nixpkgs> {}).fetchFromGitHub{
    owner = "expipiplus1";
    repo = "hnix";
    rev = "295e26b2081552d3a70e5a249dc61481e7482477";
    sha256 = "01h2vnkwc1izp7nw4j59nl07jnd3s6nrwlmr4ilkkngkxnrcl5vk";
  };

in

genAttrs supportedCompilers (ghcVer:
  genAttrs supportedPlatforms (system:
    let
      pkgs = import <nixpkgs> { inherit system; };

      baseHaskellPackages = getAttrFromPath ["haskell" "packages" ghcVer] pkgs;

      haskellPackages = baseHaskellPackages.override {
        overrides = self: super: {
          hnix = self.callPackage hnixSrc {compiler = ghcVer; };
        };
      };
    in
      haskellPackages.callPackage src {}
  )
)

Add x86_64-darwin" as a supported platform

{ src ? { outPath = ./.; revCount = 0; gitTag = "dirty"; }
, supportedPlatforms ? [ "x86_64-linux" "x86_64-darwin" ]
, supportedCompilers ? [ "ghc7103" ]
}:

with (import <nixpkgs> {}).lib;

let
  hnixSrc = (import <nixpkgs> {}).fetchFromGitHub{
    owner = "expipiplus1";
    repo = "hnix";
    rev = "295e26b2081552d3a70e5a249dc61481e7482477";
    sha256 = "01h2vnkwc1izp7nw4j59nl07jnd3s6nrwlmr4ilkkngkxnrcl5vk";
  };

in

genAttrs supportedCompilers (ghcVer:
  genAttrs supportedPlatforms (system:
    let
      pkgs = import <nixpkgs> { inherit system; };

      baseHaskellPackages = getAttrFromPath ["haskell" "packages" ghcVer] pkgs;

      haskellPackages = baseHaskellPackages.override {
        overrides = self: super: {
          hnix = self.callPackage hnixSrc {compiler = ghcVer; };
        };
      };
    in
      haskellPackages.callPackage src {}
  )
)


{ stdenv, fetchurl, gnugrep, findutils }:
let
  version = "3ubuntu1"; # Saucy
in
stdenv.mkDerivation {
  name = "kmod-blacklist-${version}";

  src = fetchurl {
    url = "http://archive.ubuntu.com/ubuntu/pool/main/k/kmod/kmod_9-${version}.debian.tar.gz";
    sha256 = "0h6h0zw2490iqj9xa2sz4309jyfmcc50jdvkhxa1nw90npxglp67";
  };

  installPhase = ''
    mkdir "$out"
    for f in modprobe.d/*.conf; do
      echo "''\n''\n## file: "`basename "$f"`"''\n''\n" >> "$out"/modprobe.conf
      cat "$f" >> "$out"/modprobe.conf
    done

    substituteInPlace "$out"/modprobe.conf \
      --replace /sbin/lsmod /run/booted-system/sw/bin/lsmod \
      --replace /sbin/rmmod /run/booted-system/sw/bin/rmmod \
      --replace /sbin/modprobe /run/booted-system/sw/bin/modprobe \
      --replace " grep " " ${gnugrep}/bin/grep " \
      --replace " xargs " " ${findutils}/bin/xargs "
  '';

  meta = {
    homepage = http://packages.ubuntu.com/source/saucy/kmod;
    description = "Linux kernel module blacklists from Ubuntu";
  };
}

Fix source package URL returning 404


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

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

Update haskell-http-kit to version 0.3.0

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

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


{stdenv, fetchurl, python, clearsilver, subversion, sqlite, pysqlite, makeWrapper}:

stdenv.mkDerivation {
	name = "trac-0.9.5";
	src = fetchurl {
		url = "http://ftp.edgewall.com/pub/trac/trac-0.9.5.tar.gz";
		md5 = "3b7d708eaf905cc6ba2b6b10a09a8cf4";
	};
	builder = ./builder.sh;
	inherit stdenv python subversion clearsilver sqlite pysqlite makeWrapper;
}

Make sure Trac is built on a Linux machine, since it requires a lot of patching (and therefore doesn't work) on OS X.

{stdenv, fetchurl, python, clearsilver, subversion, sqlite, pysqlite, makeWrapper}:

assert stdenv.system == "i686-linux";

stdenv.mkDerivation {
	name = "trac-0.9.5";
	src = fetchurl {
		url = "http://ftp.edgewall.com/pub/trac/trac-0.9.5.tar.gz";
		md5 = "3b7d708eaf905cc6ba2b6b10a09a8cf4";
	};
	builder = ./builder.sh;
	inherit stdenv python subversion clearsilver sqlite pysqlite makeWrapper;
}


{ stdenv, fetchurl, pkgconfig, udev }:

stdenv.mkDerivation rec {
  name = "dhcpcd-7.0.1";

  src = fetchurl {
    url = "mirror://roy/dhcpcd/${name}.tar.xz";
    sha256 = "1j7kyg9gm5d1k6qjdscjz2rjgpqia0dxgk69lswp21y0pizm6dlb";
  };

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ udev ];

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

  makeFlags = "PREFIX=\${out}";

  # Hack to make installation succeed.  dhcpcd will still use /var/db
  # at runtime.
  installFlags = "DBDIR=\${TMPDIR}/db SYSCONFDIR=$(out)/etc";

  # Check that the udev plugin got built.
  postInstall = stdenv.lib.optional (udev != null) "[ -e $out/lib/dhcpcd/dev/udev.so ]";

  meta = {
    description = "A client for the Dynamic Host Configuration Protocol (DHCP)";
    homepage = https://roy.marples.name/projects/dhcpcd;
    platforms = stdenv.lib.platforms.linux;
    maintainers = with stdenv.lib.maintainers; [ eelco fpletz ];
  };
}

Revert "dhcpcd: 6.11.5 -> 7.0.1"

{ stdenv, fetchurl, pkgconfig, udev }:

stdenv.mkDerivation rec {
  # when updating this to >=7, check, see previous reverts:
  # nix-build -A nixos.tests.networking.scripted.macvlan.x86_64-linux nixos/release-combined.nix
  name = "dhcpcd-6.11.5";

  src = fetchurl {
    url = "mirror://roy/dhcpcd/${name}.tar.xz";
    sha256 = "17nnhxmbdcc7k2mh6sgvxisqcqbic5540xbig363ds97gvf795kg";
  };

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ udev ];

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

  makeFlags = "PREFIX=\${out}";

  # Hack to make installation succeed.  dhcpcd will still use /var/db
  # at runtime.
  installFlags = "DBDIR=\${TMPDIR}/db SYSCONFDIR=$(out)/etc";

  # Check that the udev plugin got built.
  postInstall = stdenv.lib.optional (udev != null) "[ -e $out/lib/dhcpcd/dev/udev.so ]";

  meta = {
    description = "A client for the Dynamic Host Configuration Protocol (DHCP)";
    homepage = https://roy.marples.name/projects/dhcpcd;
    platforms = stdenv.lib.platforms.linux;
    maintainers = with stdenv.lib.maintainers; [ eelco fpletz ];
  };
}


{ stdenv, fetchurl, pkgconfig, udev, dbus_libs, perl }:

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

  src = fetchurl {
    url = "https://alioth.debian.org/frs/download.php/file/3963/pcsc-lite-${version}.tar.bz2";
    sha256 = "04i63zi9ayg38z3cahp6gf3rgx23w17bmcpdccm2hvaj63blnz30";
  };

  # The OS should care on preparing the drivers into this location
  configureFlags = [
    "--enable-usbdropdir=/var/lib/pcsc/drivers"
    "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
    "--enable-confdir=$(out)/etc"
  ];

  buildInputs = [ udev dbus_libs perl ];

  nativeBuildInputs = [ pkgconfig ];

  meta = {
    description = "Middleware to access a smart card using SCard API (PC/SC)";
    homepage = http://pcsclite.alioth.debian.org/;
    license = "BSD";
    maintainers = with stdenv.lib.maintainers; [viric];
    platforms = with stdenv.lib.platforms; linux;
  };
}

Update from 1.8.10 -> 1.8.11

{ stdenv, fetchurl, pkgconfig, udev, dbus_libs, perl }:

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

  src = fetchurl {
    url = "https://alioth.debian.org/frs/download.php/file/3991/pcsc-lite-${version}.tar.bz2";
    sha256 = "945041c94c53959ae5a767616a4ec5099fe67f549bfd344e8bd0cfe7a3c71ac6";
  };

  # The OS should care on preparing the drivers into this location
  configureFlags = [
    "--enable-usbdropdir=/var/lib/pcsc/drivers"
    "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
    "--enable-confdir=$(out)/etc"
  ];

  buildInputs = [ udev dbus_libs perl ];

  nativeBuildInputs = [ pkgconfig ];

  meta = with stdenv.lib; {
    description = "Middleware to access a smart card using SCard API (PC/SC)";
    homepage = http://pcsclite.alioth.debian.org/;
    license = licenses.bsd3;
    maintainers = with maintainers; [viric];
    platforms = with platforms; linux;
  };
}


# This file is autogenerated from update.sh in the same directory.
{
  dev = {
    version = "27.0.1453.12";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-27.0.1453.12.tar.xz";
    sha256 = "1b2vkcynljl799m41aabdsj9k2plchiga6bi4ah3hc0mwyj0lyl7";
  };
  beta = {
    version = "27.0.1453.15";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-27.0.1453.15.tar.xz";
    sha256 = "19y9pbipi4y61avrsgb7y4b1xl8d29v34l403xdghk0d3z2rg65m";
  };
  stable = {
    version = "26.0.1410.43";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-26.0.1410.43.tar.xz";
    sha256 = "110x9cs88gqvqya71bqspx2s7ph6ca0als7sp5fbf911cj0iy0ii";
  };
}

Update all channels to latest versions.

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


{ lib }:
let
  inherit (lib.systems) parse;
  inherit (lib.systems.inspect) patterns;

in rec {
  inherit (lib.systems.doubles) all mesaPlatforms;
  none = [];

  arm     = [ patterns.isArm ];
  aarch64 = [ patterns.isAarch64 ];
  x86     = [ patterns.isx86 ];
  i686    = [ patterns.isi686 ];
  x86_64  = [ patterns.isx86_64 ];
  mips    = [ patterns.isMips ];

  cygwin  = [ patterns.isCygwin ];
  darwin  = [ patterns.isDarwin ];
  freebsd = [ patterns.isFreeBSD ];
  # Should be better, but MinGW is unclear, and HURD is bit-rotted.
  gnu     = [ { kernel = parse.kernels.linux; abi = parse.abis.gnu; } ];
  illumos = [ patterns.isSunOS ];
  linux   = [ patterns.isLinux ];
  netbsd  = [ patterns.isNetBSD ];
  openbsd = [ patterns.isOpenBSD ];
  unix    = patterns.isUnix; # Actually a list
}

Make `platforms.all` actually match all platforms

{ lib }:
let
  inherit (lib.systems) parse;
  inherit (lib.systems.inspect) patterns;

in rec {
  all     = [ {} ]; # `{}` matches anything
  none    = [];

  arm     = [ patterns.isArm ];
  aarch64 = [ patterns.isAarch64 ];
  x86     = [ patterns.isx86 ];
  i686    = [ patterns.isi686 ];
  x86_64  = [ patterns.isx86_64 ];
  mips    = [ patterns.isMips ];

  cygwin  = [ patterns.isCygwin ];
  darwin  = [ patterns.isDarwin ];
  freebsd = [ patterns.isFreeBSD ];
  # Should be better, but MinGW is unclear, and HURD is bit-rotted.
  gnu     = [ { kernel = parse.kernels.linux; abi = parse.abis.gnu; } ];
  illumos = [ patterns.isSunOS ];
  linux   = [ patterns.isLinux ];
  netbsd  = [ patterns.isNetBSD ];
  openbsd = [ patterns.isOpenBSD ];
  unix    = patterns.isUnix; # Actually a list

  inherit (lib.systems.doubles) mesaPlatforms;
}


lib: (lib.recursive-import ./.) // {
  # C compiler
  cc = defnix: "${defnix.nixpkgs.gcc}/bin/cc";

  # C++ compiler
  cxx = defnix: "${defnix.nixpkgs.gcc}/bin/c++";

  libcxx = defnix: defnix.nixpkgs.libcxx;

  # Utility to modify the dynamic linker and RPATH of elf executables
  # See http://nixos.org/patchelf.html
  patchelf = defnix: defnix.nixpkgs.patchelf;

  # Binary utilities
  binutils = defnix: defnix.nixpkgs.binutils;

  # Haskell compiler
  ghc = defnix: "${defnix.nixpkgs.haskellPackages.ghcPlain}/bin/ghc";
}

Add a build-support function to run a series of tests

lib: (lib.recursive-import ./.) // {
  # C compiler
  cc = defnix: "${defnix.nixpkgs.gcc}/bin/cc";

  # C++ compiler
  cxx = defnix: "${defnix.nixpkgs.gcc}/bin/c++";

  libcxx = defnix: defnix.nixpkgs.libcxx;

  # Utility to modify the dynamic linker and RPATH of elf executables
  # See http://nixos.org/patchelf.html
  patchelf = defnix: defnix.nixpkgs.patchelf;

  # Binary utilities
  binutils = defnix: defnix.nixpkgs.binutils;

  # Haskell compiler
  ghc = defnix: "${defnix.nixpkgs.haskellPackages.ghcPlain}/bin/ghc";

  # Run a series of tests
  write-test-script = defnix: let
    inherit (defnix.pkgs) sh;

    inherit (defnix.build-support) write-script;

    inherit (defnix.lib) join map-attrs-to-list;
  in tests: write-script "tests" ''
    #!${sh} -e

    failed=
    ${join "\n" (map-attrs-to-list (test-name: test-command: ''
      echo Running test ${test-name} >&2
      ${test-command} || failed=1
    '') tests)}
    if [ -n "$failed" ]; then
      echo At least one test failed >&2
      exit 1
    fi
  '';
}


{ stdenv, buildPythonPackage, fetchPypi
, pytest_3, cmdline, pytestcov, coverage, setuptools-git, mock, pathpy, execnet
, contextlib2, termcolor }:

buildPythonPackage rec {
  pname = "pytest-shutil";
  version = "1.6.0";

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

  checkInputs = [ cmdline pytest_3 ];
  propagatedBuildInputs = [ pytestcov coverage setuptools-git mock pathpy execnet contextlib2 termcolor ];
  nativeBuildInputs = [ pytest_3 ];

  checkPhase = ''
    py.test
  '';

  meta = with stdenv.lib; {
    description = "A goodie-bag of unix shell and environment tools for py.test";
    homepage = https://github.com/manahl/pytest-plugins;
    maintainers = with maintainers; [ ryansydnor ];
    license = licenses.mit;
  };
}

Disable some tests on PyPy.

{ stdenv, lib, isPyPy, buildPythonPackage, fetchPypi
, pytest_3, cmdline, pytestcov, coverage, setuptools-git, mock, pathpy, execnet
, contextlib2, termcolor }:

buildPythonPackage rec {
  pname = "pytest-shutil";
  version = "1.6.0";

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

  checkInputs = [ cmdline pytest_3 ];
  propagatedBuildInputs = [ pytestcov coverage setuptools-git mock pathpy execnet contextlib2 termcolor ];
  nativeBuildInputs = [ pytest_3 ];

  checkPhase = ''
    py.test ${lib.optionalString isPyPy "-k'not (test_run or test_run_integration)'"}
  '';

  meta = with stdenv.lib; {
    description = "A goodie-bag of unix shell and environment tools for py.test";
    homepage = https://github.com/manahl/pytest-plugins;
    maintainers = with maintainers; [ ryansydnor ];
    license = licenses.mit;
  };
}


{stdenv, fetchurl}:

stdenv.mkDerivation {
  name = "sdparm-1.08";

  src = fetchurl {
    url = http://sg.danny.cz/sg/p/sdparm-1.08.tgz;
    sha256 = "0msy8anggdand1yr50vg2azcfgks7sbfpnqk7xzw9adi2jj7hsrp";
  };

  meta = {
    homepage = http://sg.danny.cz/sg/sdparm.html;
    description = "A utility to access SCSI device parameters";
    license = stdenv.lib.licenses.free;
  };
}

Update sdparm 1.08 -> 1.09

{stdenv, fetchurl}:

stdenv.mkDerivation {
  name = "sdparm-1.09";

  src = fetchurl {
    url = http://sg.danny.cz/sg/p/sdparm-1.09.tar.xz;
    sha256 = "0jakqyjwi72zqjzss04bally0xl0lc4710mx8da08vpmir1hfphg";
  };

  meta = with stdenv.lib; {
    homepage = http://sg.danny.cz/sg/sdparm.html;
    description = "A utility to access SCSI device parameters";
    license = with licenses; bsd3;
    maintainers = with maintainers; [ nckx ];
  };
}


{stdenv, fetchurl, libusb, makeWrapper}:

assert stdenv.isLinux;

stdenv.mkDerivation {
  name = "pk2cmd-1.20";
  src = fetchurl {
    url = http://ww1.microchip.com/downloads/en/DeviceDoc/pk2cmdv1.20LinuxMacSource.tar.gz;
    sha256 = "1yjpi2qshnqfpan4w3ggakkr3znfrx5cxkny92ka7v9na3g2fc4h";
  };

  makeFlags = [ "LIBUSB=${libusb}" "linux" ];

  installPhase = ''
    mkdir -p $out/bin $out/share/pk2
    cp pk2cmd $out/bin
    cp PK2DeviceFile.dat $out/share/pk2
    wrapProgram $out/bin/pk2cmd --prefix PATH : $out/share/pk2
  '';

  buildInputs = [ libusb makeWrapper ];

  meta = {
    homepage = http://www.microchip.com/pickit2;
    license = stdenv.lib.licenses.unfree; #MicroChip-PK2
    description = "Microchip PIC programming software for the PICKit2 programmer";
  };
}

Make explicit that 'dev' output of libusb is used

{stdenv, fetchurl, libusb, makeWrapper}:

assert stdenv.isLinux;

stdenv.mkDerivation {
  name = "pk2cmd-1.20";
  src = fetchurl {
    url = http://ww1.microchip.com/downloads/en/DeviceDoc/pk2cmdv1.20LinuxMacSource.tar.gz;
    sha256 = "1yjpi2qshnqfpan4w3ggakkr3znfrx5cxkny92ka7v9na3g2fc4h";
  };

  makeFlags = [ "LIBUSB=${libusb.dev}" "linux" ];

  installPhase = ''
    mkdir -p $out/bin $out/share/pk2
    cp pk2cmd $out/bin
    cp PK2DeviceFile.dat $out/share/pk2
    wrapProgram $out/bin/pk2cmd --prefix PATH : $out/share/pk2
  '';

  buildInputs = [ libusb makeWrapper ];

  meta = {
    homepage = http://www.microchip.com/pickit2;
    license = stdenv.lib.licenses.unfree; #MicroChip-PK2
    description = "Microchip PIC programming software for the PICKit2 programmer";
  };
}


{ stdenv, fetchFromGitHub, qtbase, qttools, qmake, wrapQtAppsHook }:

stdenv.mkDerivation {
  pname = "librepcb";
  version = "0.1.2";

  src = fetchFromGitHub {
    owner = "LibrePCB";
    repo = "LibrePCB";
    fetchSubmodules = true;
    rev = "acdd94d9d2310f79215125b999153e9da88a9376";
    sha256 = "1bbl01rp75sl6k1cmch7x90v00lck578xvqmb856s9fx75bdgnv5";
  };

  enableParallelBuilding = true;

  nativeBuildInputs = [ qmake qttools wrapQtAppsHook ];

  buildInputs = [ qtbase ];

  qmakeFlags = ["-r"];

  postInstall = ''
      mkdir -p $out/share/librepcb/fontobene
      cp share/librepcb/fontobene/newstroke.bene $out/share/librepcb/fontobene/
    '';

  preFixup = ''
    wrapQtApp $out/bin/librepcb
  '';

  meta = with stdenv.lib; {
    description = "A free EDA software to develop printed circuit boards";
    homepage = https://librepcb.org/;
    maintainers = with maintainers; [ luz ];
    license = licenses.gpl3;
    platforms = platforms.linux;
  };
}

Fix platform plugin xcb not found

{ lib, mkDerivation, fetchFromGitHub, qtbase, qttools, qmake, wrapQtAppsHook }:

mkDerivation {
  pname = "librepcb";
  version = "0.1.2";

  src = fetchFromGitHub {
    owner = "LibrePCB";
    repo = "LibrePCB";
    fetchSubmodules = true;
    rev = "acdd94d9d2310f79215125b999153e9da88a9376";
    sha256 = "1bbl01rp75sl6k1cmch7x90v00lck578xvqmb856s9fx75bdgnv5";
  };

  enableParallelBuilding = true;

  nativeBuildInputs = [ qmake qttools wrapQtAppsHook ];

  buildInputs = [ qtbase ];

  qmakeFlags = ["-r"];

  postInstall = ''
      mkdir -p $out/share/librepcb/fontobene
      cp share/librepcb/fontobene/newstroke.bene $out/share/librepcb/fontobene/
    '';

  preFixup = ''
    wrapQtApp $out/bin/librepcb
  '';

  meta = with lib; {
    description = "A free EDA software to develop printed circuit boards";
    homepage = https://librepcb.org/;
    maintainers = with maintainers; [ luz ];
    license = licenses.gpl3;
    platforms = platforms.linux;
  };
}