{ stdenv
, lib
, fetchFromGitHub
, autoreconfHook
, pkg-config
, mednafen
, gtk3
, wrapGAppsHook
}:

stdenv.mkDerivation rec {
  pname = "mednaffe";
  version = "0.9.2";

  src = fetchFromGitHub {
    owner = "AmatCoder";
    repo = "mednaffe";
    rev = version;
    sha256 = "sha256-zvSAt6CMcgdoPpTTA5sPlQaWUw9LUMsR2Xg9jM2UaWY=";
  };

  nativeBuildInputs = [ autoreconfHook pkg-config wrapGAppsHook ];
  buildInputs = [ gtk3 mednafen ];

  postInstall = ''
    wrapProgram $out/bin/mednaffe \
      --prefix PATH ':' "${mednafen}/bin"
   '';

  meta = with lib; {
    description = "GTK-based frontend for mednafen emulator";
    homepage = "https://github.com/AmatCoder/mednaffe";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ sheenobu yana AndersonTorres ];
    platforms = platforms.linux;
  };
}

Enable for Darwin, fix wrapping

{ stdenv
, lib
, fetchFromGitHub
, autoreconfHook
, pkg-config
, mednafen
, gtk3
, wrapGAppsHook
}:

stdenv.mkDerivation rec {
  pname = "mednaffe";
  version = "0.9.2";

  src = fetchFromGitHub {
    owner = "AmatCoder";
    repo = "mednaffe";
    rev = version;
    sha256 = "sha256-zvSAt6CMcgdoPpTTA5sPlQaWUw9LUMsR2Xg9jM2UaWY=";
  };

  nativeBuildInputs = [ autoreconfHook pkg-config wrapGAppsHook ];

  buildInputs = [ gtk3 mednafen ];

  enableParallelBuilding = true;

  preFixup = ''
    gappsWrapperArgs+=(
      --prefix PATH ':' "${mednafen}/bin"
    )
   '';

  meta = with lib; {
    description = "GTK-based frontend for mednafen emulator";
    homepage = "https://github.com/AmatCoder/mednaffe";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ sheenobu yana AndersonTorres ];
    platforms = platforms.unix;
  };
}


{stdenv, fetchurl, pkgconfig, libxml2, curl, wirelesstools, glib, openssl}:

stdenv.mkDerivation rec {
  name = "conky-1.9.0";

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

  patches = [ ./stdbool.patch ];

  buildInputs = [ pkgconfig libxml2 curl wirelesstools glib openssl ];
  configureFlags =
    (map (x: "--disable-${x}") [ "x11" "xdamage" "own-window" "xft" "lua" "ncurses" ])
    ++ (map (x: "--enable-${x}") [ "mpd" "double-buffer" "wlan" "rss" ]);

  meta = {
    homepage = http://conky.sourceforge.net/;
    description = "Conky is an advanced, highly configurable system monitor complied without X based on torsmo";
    maintainers = [ stdenv.lib.maintainers.guibert ];
  };
}

Add license attribute to meta.

{stdenv, fetchurl, pkgconfig, libxml2, curl, wirelesstools, glib, openssl}:

stdenv.mkDerivation rec {
  name = "conky-1.9.0";

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

  patches = [ ./stdbool.patch ];

  buildInputs = [ pkgconfig libxml2 curl wirelesstools glib openssl ];
  configureFlags =
    (map (x: "--disable-${x}") [ "x11" "xdamage" "own-window" "xft" "lua" "ncurses" ])
    ++ (map (x: "--enable-${x}") [ "mpd" "double-buffer" "wlan" "rss" ]);

  meta = {
    homepage = http://conky.sourceforge.net/;
    description = "Conky is an advanced, highly configurable system monitor complied without X based on torsmo";
    maintainers = [ stdenv.lib.maintainers.guibert ];
    license = stdenv.lib.licenses.gpl3Plus;
  };
}


# VirtualBox server
{ config, pkgs, ... }:

with pkgs.lib;

let

  cfg = config.services.virtualbox;

in

{

  ###### interface

  options = {

    services.virtualbox = {

      enable = mkOption {
        default = false;
        description = "Whether to enable the VirtualBox service and other guest additions.";
      };

    };

  };

  ###### implementation

  config = mkIf cfg.enable {

    environment.systemPackages = [ ];

    boot.extraModulePackages = [ pkgs.linuxPackages.virtualboxGuestAdditions ];

    jobs.virtualbox =
      { description = "VirtualBox service";

        startOn = "started udev";

        exec = "${pkgs.linuxPackages.virtualboxGuestAdditions}/sbin/VBoxService";
      };

  };

}

Make VirtualBox Guest Additions use the configured kernel.

# VirtualBox server
{ config, pkgs, ... }:

with pkgs.lib;

let

  cfg = config.services.virtualbox;
  kernel = config.boot.kernelPackages;

in

{

  ###### interface

  options = {

    services.virtualbox = {

      enable = mkOption {
        default = false;
        description = "Whether to enable the VirtualBox service and other guest additions.";
      };

    };

  };

  ###### implementation

  config = mkIf cfg.enable {

    environment.systemPackages = [ ];

    boot.extraModulePackages = [ kernel.virtualboxGuestAdditions ];

    jobs.virtualbox =
      { description = "VirtualBox service";

        startOn = "started udev";

        exec = "${kernel.virtualboxGuestAdditions}/sbin/VBoxService";
      };

  };

}


{ fetchurl, stdenv, zlib }:

stdenv.mkDerivation rec {
  name = "protobuf-2.6.0";

  src = fetchurl {
    url = "http://protobuf.googlecode.com/svn-history/r579/rc/protobuf-2.6.0.tar.bz2";
    sha256 = "0krfkxc85vfznqwbh59qlhp7ld81al9ss35av0gfbg74i0rvjids";
  };

  buildInputs = [ zlib ];

  doCheck = true;

  meta = {
    description = "Protocol Buffers - Google's data interchange format";

    longDescription =
      '' Protocol Buffers are a way of encoding structured data in an
         efficient yet extensible format.  Google uses Protocol Buffers for
         almost all of its internal RPC protocols and file formats.
      '';

    license = "mBSD";

    homepage = http://code.google.com/p/protobuf/;
  };
}

Revert "protobuf: Update to 2.6.0"

{ fetchurl, stdenv, zlib }:

stdenv.mkDerivation rec {
  name = "protobuf-2.5.0";

  src = fetchurl {
    url = "http://protobuf.googlecode.com/files/${name}.tar.bz2";
    sha256 = "0xxn9gxhvsgzz2sgmihzf6pf75clr05mqj6218camwrwajpcbgqk";
  };

  buildInputs = [ zlib ];

  doCheck = true;

  meta = {
    description = "Protocol Buffers - Google's data interchange format";

    longDescription =
      '' Protocol Buffers are a way of encoding structured data in an
         efficient yet extensible format.  Google uses Protocol Buffers for
         almost all of its internal RPC protocols and file formats.
      '';

    license = "mBSD";

    homepage = http://code.google.com/p/protobuf/;
  };
}


{ stdenv, fetchurl, openssl, perl }:

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

  src = fetchurl {
    url = "http://chunksync.florz.de/chunksync_${version}.tar.gz";
    sha256 = "e0c27f925c5cf811798466312a56772864b633728c433fb2fcce23c8712b52fc";
  };

  buildInputs = [openssl perl];

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

  preInstall = ''
    mkdir -p $out/bin
    mkdir -p $out/share/man/man1
  '';

  meta = {
    description = "Space-efficient incremental backups of large files or block devices";
    homepage = "http://chunksync.florz.de/";
    license = "GPLv2";
    platforms = with stdenv.lib.platforms; linux;
  };
}

Set chunksync package's NIX_LDFLAGS to "-lgcc_s"

{ stdenv, fetchurl, openssl, perl }:

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

  src = fetchurl {
    url = "http://chunksync.florz.de/chunksync_${version}.tar.gz";
    sha256 = "e0c27f925c5cf811798466312a56772864b633728c433fb2fcce23c8712b52fc";
  };

  buildInputs = [openssl perl];

  NIX_LDFLAGS = "-lgcc_s";

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

  preInstall = ''
    mkdir -p $out/bin
    mkdir -p $out/share/man/man1
  '';

  meta = {
    description = "Space-efficient incremental backups of large files or block devices";
    homepage = "http://chunksync.florz.de/";
    license = "GPLv2";
    platforms = with stdenv.lib.platforms; linux;
  };
}


{pkgs ? import ./nixpkgs.nix {}}:

with pkgs;

mkShell {
  LANG="C.UTF-8";

  buildInputs = [
    less
    git
    nix
    stack
    z3
    which
    glibcLocales
    cacert
  ];

}

Add hostname for nix configuration, which is needed for tests.

{pkgs ? import ./nixpkgs.nix {}}:

with pkgs;

mkShell {
  LANG="C.UTF-8";

  buildInputs = [
    less
    git
    hostname
    nix
    stack
    z3
    which
    glibcLocales
    cacert
  ];

}


{pkgs ? import <nixpkgs> {}, stdenv ? pkgs.stdenv, pinNixDown ? true}:
let
  # Pin nixpkgs version down by default, but allow building with another version
  nixpkgs = if !pinNixDown then pkgs else import (pkgs.fetchFromGitHub {
    owner = "NixOS";
    repo = "nixpkgs";
    rev = "c5aabb0d603e2c1ea05f5a93b3be82437f5ebf31";
    sha256 = "15fwszhn6078sbrb8qk83g8afvh4qnmvff0qbkbvq3cm1fxni2w1";
  }) {};

  drv = nixpkgs.haskellPackages.callPackage ./. {};
in
if pkgs.lib.inNixShell then drv.env else drv

Update nixpkgs pin, compile with GHC 8.8

{pkgs ? import <nixpkgs> {}, stdenv ? pkgs.stdenv, pinNixDown ? true}:
let
  haskellOverlay = final: previous: {
    # Requires latest version to compile with GHC 8.8
    # https://github.com/UU-ComputerScience/uuagc/pull/2
    uuagc-cabal = previous.uuagc-cabal.overrideAttrs (old: rec {
      pname = "uuagc-cabal";
      name = "${pname}-${version}";
      version = "1.2.0.0";
      src = pkgs.fetchurl {
        url = "mirror://hackage/${pname}-${version}.tar.gz";
        inherit sha256;
      };
      sha256 = "1hb567h06zdhrrysb99d0c63ih5p1ii2jl0ng2l304w71m35pk2z";
    });
    # Same as uuagc-cabal
    uuagc = previous.uuagc.overrideAttrs (old: rec {
      pname = "uuagc";
      name = "${pname}-${version}";
      version = "0.9.53.1";
      src = pkgs.fetchurl {
        url = "mirror://hackage/${pname}-${version}.tar.gz";
        inherit sha256;
      };
      sha256 = "0agmvc1ng1dpnl0z8njilc2r51rgl9fh3lmxgprwc0y5dqqrn6zr";
    });
  };
  overlay = final: previous: {
    haskellPackages = previous.haskellPackages.extend haskellOverlay;
  };

  # Pin nixpkgs version down by default, but allow building with another version
  nixpkgs = if !pinNixDown then pkgs else import (pkgs.fetchFromGitHub {
    owner = "NixOS";
    repo = "nixpkgs";
    rev = "38eaa62f28384bc5f6c394e2a99bd6a4913fc71f";
    sha256 = "1pvbhvy6m5zmhhifk66ll07fnwvwnl9rrif03i4yc34s4f48m7ld";
  }) { overlays = [overlay]; };

  drv = nixpkgs.haskellPackages.callPackage ./. {};
in
if pkgs.lib.inNixShell then drv.env else drv


import ./jdk-linux-base.nix {
  productVersion = "7";
  patchVersion = "65";
  downloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html;
  sha256_i686 = "e3032c561deb237c033b485a358cc429ec83b621303bc6b31768855778a9eaa0";
  sha256_x86_64 = "33fac9630ca8c2d374247abc5c010ac8d2875a3384968aa3e74448361808e4b7";
  jceName = "UnlimitedJCEPolicyJDK7.zip";
  jceDownloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html;
  sha256JCE = "7a8d790e7bd9c2f82a83baddfae765797a4a56ea603c9150c87b7cdb7800194d";
}

Update oraclejdk-7 patch version from 65 to 67

import ./jdk-linux-base.nix {
  productVersion = "7";
  patchVersion = "67";
  downloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html;
  sha256_i686 = "0p58pag1x85r911lxhmr4blk687ivjqigflx175vp7rcmmj108xn";
  sha256_x86_64 = "0db36jg08qy8712qy6lgyifdqlqb468rrnjm3aa6937ixl9ixpal";
  jceName = "UnlimitedJCEPolicyJDK7.zip";
  jceDownloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html;
  sha256JCE = "7a8d790e7bd9c2f82a83baddfae765797a4a56ea603c9150c87b7cdb7800194d";
}


{stdenv, fetchurl}:

stdenv.mkDerivation {
  name = "aterm-2.5-r21238";

  src = fetchurl {
    url = http://buildfarm.st.ewi.tudelft.nl/releases/meta-environment/aterm-2.5pre21238-l2q7rg38/aterm-2.5.tar.gz;
    md5 = "33ddcb1a229baf406ad1f603eb1d5995";
  };

  patches = [
    # Fix for http://bugzilla.sen.cwi.nl:8080/show_bug.cgi?id=841
    ./max-long.patch

    # Patch the ATerm header files so that they don't rely on
    # SIZEOF_LONG, SIZEOF_INT and SIZEOF_VOID_P being set.
    ./sizeof.patch
  ];

  doCheck = true;

  dontDisableStatic = true;

  meta = {
    homepage = http://www.cwi.nl/htbin/sen1/twiki/bin/view/SEN1/ATerm;
    license = "LGPL";
    description = "Library for manipulation of term data structures in C";
    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
    maintainers = [ stdenv.lib.maintainers.eelco ];
  };
}

Fix building on Glibc 2.20

{stdenv, fetchurl}:

stdenv.mkDerivation {
  name = "aterm-2.5-r21238";

  src = fetchurl {
    url = http://buildfarm.st.ewi.tudelft.nl/releases/meta-environment/aterm-2.5pre21238-l2q7rg38/aterm-2.5.tar.gz;
    md5 = "33ddcb1a229baf406ad1f603eb1d5995";
  };

  patches = [
    # Fix for http://bugzilla.sen.cwi.nl:8080/show_bug.cgi?id=841
    ./max-long.patch

    # Patch the ATerm header files so that they don't rely on
    # SIZEOF_LONG, SIZEOF_INT and SIZEOF_VOID_P being set.
    ./sizeof.patch
  ];

  doCheck = true;

  dontDisableStatic = true;

  NIX_CFLAGS_COMPILE = "-D__USE_BSD";

  meta = {
    homepage = http://www.cwi.nl/htbin/sen1/twiki/bin/view/SEN1/ATerm;
    license = "LGPL";
    description = "Library for manipulation of term data structures in C";
    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
    maintainers = [ stdenv.lib.maintainers.eelco ];
  };
}


{ callPackage, openssl, python3, enableNpm ? true }:

let
  buildNodejs = callPackage ./nodejs.nix {
    inherit openssl;
    python = python3;
  };
in
  buildNodejs {
    inherit enableNpm;
    version = "16.6.0";
    sha256 = "1ndrqx3k5m62r7nzl5za59m33bx10541n7xbaxxz7088ifh18msw";
  }

Revert "nodejs-16_x: 16.5.0 -> 16.6.0"

{ callPackage, openssl, python3, enableNpm ? true }:

let
  buildNodejs = callPackage ./nodejs.nix {
    inherit openssl;
    python = python3;
  };
in
  buildNodejs {
    inherit enableNpm;
    version = "16.5.0";
    sha256 = "16dapj5pm2y1m3ldrjjlz8rq9axk85nn316iz02nk6qjs66y6drz";
  }


{ nixpkgs ? import <nixpkgs> {}
, ghc ? nixpkgs.haskell.compiler.ghc7103   # Default needed for Docker build.
}:

with nixpkgs;

let
  spark = nixpkgs.spark.override { mesosSupport = false; };
  openjdk = openjdk7;
  jvmlibdir =
    if stdenv.isLinux
    then "${openjdk}/lib/openjdk/jre/lib/amd64/server"
    else "${openjdk}/jre/lib/server";
in
haskell.lib.buildStackProject {
  name = "sparkle";
  buildInputs =
    [ gradle
      openjdk
      spark
      which
      zlib
      zip
    ];
  inherit ghc;
  extraArgs = ["--extra-lib-dirs=${jvmlibdir}"];
  # XXX Workaround https://ghc.haskell.org/trac/ghc/ticket/11042.
  LD_LIBRARY_PATH = [jvmlibdir];
}

Address the true cause of "undefined symbol" errors in GHCi.

{ nixpkgs ? import <nixpkgs> {}
, ghc ? nixpkgs.haskell.compiler.ghc7103   # Default needed for Docker build.
}:

with nixpkgs;

let
  spark = nixpkgs.spark.override { mesosSupport = false; };
  openjdk = openjdk7;
  jvmlibdir =
    if stdenv.isLinux
    then "${openjdk}/lib/openjdk/jre/lib/amd64/server"
    else "${openjdk}/jre/lib/server";
in
haskell.lib.buildStackProject {
  name = "sparkle";
  buildInputs =
    [ gradle
      openjdk
      spark
      which
      zlib
      zip
    ];
  inherit ghc;
  extraArgs = ["--extra-lib-dirs=${jvmlibdir}"];
  # XXX Workaround https://ghc.haskell.org/trac/ghc/ticket/11042.
  LD_LIBRARY_PATH = [jvmlibdir];
  # XXX By default recent Nixpkgs passes hardening flags to the
  # linker. The bindnow hardening flag is problematic, because it
  # makes objects fail to load in GHCi, with strange errors about
  # undefined symbols. See
  # https://ghc.haskell.org/trac/ghc/ticket/12684. As a workaround,
  # disable bindnow for now.
  hardeningDisable = [ "bindnow" ];
}


{ stdenv, fetchFromGitHub, python3 }:

stdenv.mkDerivation rec {
  name = "subdl";

  src = fetchFromGitHub {
    owner = "alexanderwink";
    repo = "subdl";
    rev = "4cf5789b11f0ff3f863b704b336190bf968cd471";
    sha256 = "0kmk5ck1j49q4ww0lvas2767kwnzhkq0vdwkmjypdx5zkxz73fn8";
  };

  meta = {
    homepage = https://github.com/alexanderwink/subdl;
    description = "A command-line tool to download subtitles from opensubtitles.org";
    platforms = stdenv.lib.platforms.all;
    license = stdenv.lib.licenses.gpl3;
    maintainers = [ stdenv.lib.maintainers.exfalso ];
  };

  buildInputs = [ python3 ];

  installPhase = ''
    install -vD subdl $out/bin/subdl
  '';
}

Add a date to name

{ stdenv, fetchFromGitHub, python3 }:

stdenv.mkDerivation rec {
  name = "subdl-0.0pre.2017.11.06";

  src = fetchFromGitHub {
    owner = "alexanderwink";
    repo = "subdl";
    rev = "4cf5789b11f0ff3f863b704b336190bf968cd471";
    sha256 = "0kmk5ck1j49q4ww0lvas2767kwnzhkq0vdwkmjypdx5zkxz73fn8";
  };

  meta = {
    homepage = https://github.com/alexanderwink/subdl;
    description = "A command-line tool to download subtitles from opensubtitles.org";
    platforms = stdenv.lib.platforms.all;
    license = stdenv.lib.licenses.gpl3;
    maintainers = [ stdenv.lib.maintainers.exfalso ];
  };

  buildInputs = [ python3 ];

  installPhase = ''
    install -vD subdl $out/bin/subdl
  '';
}


{ stdenv, fetchgit, cmake, libtsm, SDL2, glew, freetype, dejavu_fonts, pkgconfig, check, vimNox, gprof2dot, oprofile, jansson, fontconfig, expat, doxygen, python27Packages, git, xorg }:

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

  src = ./.;

  buildInputs = [ cmake libtsm SDL2 glew freetype dejavu_fonts pkgconfig check
    jansson fontconfig expat doxygen
    vimNox  /* For the xxd utility */
    python27Packages.sphinx
    git
    xorg.libX11
  ];
}

Remove the ./build directory in nix build

{ stdenv, fetchgit, cmake, libtsm, SDL2, glew, freetype, dejavu_fonts, pkgconfig, check, vimNox, gprof2dot, oprofile, jansson, fontconfig, expat, doxygen, python27Packages, git, xorg }:

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

  src = ./.;

  buildInputs = [ cmake libtsm SDL2 glew freetype dejavu_fonts pkgconfig check
    jansson fontconfig expat doxygen
    vimNox  /* For the xxd utility */
    python27Packages.sphinx
    git
    xorg.libX11
  ];

  preConfigure = ''
    # NOTE: The default nix hooks for cmake also use the ./build
    # directory...  we just remove this directory in advance so the
    # build is not contaminated.
    rm -rf ./build
  '';
}


{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "yap-5.1.1";

  src = fetchurl {
    url = "mirror://sourceforge/yap/Yap-5.1.1.tar.gz";
    sha256 = "0bajxmlla9gay4m4l7y7x6qldxzi0jcq2ykgpjk9liky7g5kbnya";
  };

  meta = {
    description = "Yap Prolog System is a ISO-compatible high-performance Prolog compiler";
    homepage = http://yap.sourceforge.net/;
    license = "artistic";
  };
}

Update YAP to version 6.2.2

{ stdenv, fetchurl, readline }:

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

  src = fetchurl {
    url = "http://www.dcc.fc.up.pt/~vsc/Yap/${name}.tar.gz";
    sha256 = "0l6p0vy667wws64cvwf74ssl6h9gypjzrsl3b2d32hs422186pzi";
  };

  buildInputs = [ readline ];

  meta = {
    description = "Yap Prolog System is a ISO-compatible high-performance Prolog compiler";
    homepage = http://yap.sourceforge.net/;
    license = "artistic";
  };
}


{ lib, stdenv, fetchurl
, withShishi ? !stdenv.isDarwin, shishi ? null
}:

assert withShishi -> shishi != null;

stdenv.mkDerivation rec {
  name = "gss-1.0.3";

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

  buildInputs = lib.optional withShishi shishi;

  configureFlags = [
    "--${if withShishi != null then "enable" else "disable"}-kereberos5"
  ];

  doCheck = true;

  # Fixup .la files
  postInstall = lib.optionalString withShishi ''
    sed -i 's,\(-lshishi\),-L${shishi}/lib \1,' $out/lib/libgss.la
  '';

  meta = with lib; {
    homepage = "https://www.gnu.org/software/gss/";
    description = "Generic Security Service";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ bjg ];
    platforms = platforms.all;
  };
}

Fix typo in enable/disable-kerberos5 flag

{ lib, stdenv, fetchurl
, withShishi ? !stdenv.isDarwin, shishi ? null
}:

assert withShishi -> shishi != null;

stdenv.mkDerivation rec {
  name = "gss-1.0.3";

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

  buildInputs = lib.optional withShishi shishi;

  configureFlags = [
    "--${if withShishi != null then "enable" else "disable"}-kerberos5"
  ];

  doCheck = true;

  # Fixup .la files
  postInstall = lib.optionalString withShishi ''
    sed -i 's,\(-lshishi\),-L${shishi}/lib \1,' $out/lib/libgss.la
  '';

  meta = with lib; {
    homepage = "https://www.gnu.org/software/gss/";
    description = "Generic Security Service";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ bjg ];
    platforms = platforms.all;
  };
}


{ stdenv
, fetchurl

, protobuf-cpp
}:

let
  version = "1.3.0";
in
stdenv.mkDerivation rec {
  name = "protobuf-c-${version}";

  src = fetchurl {
    url = "https://github.com/protobuf-c/protobuf-c/releases/download/v${version}/${name}.tar.gz";
    sha256 = "5dc9ad7a9b889cf7c8ff6bf72215f1874a90260f60ad4f88acf21bb15d2752a1";
  };

  nativeBuildInputs = [
    protobuf-cpp
  ];

  buildInputs = [
    protobuf-cpp
  ];

  meta = with stdenv.lib; {
    maintainers = with maintainers; [
      wkennington
    ];
    platforms = with platforms;
      x86_64-linux;
  };
}

Fix by using older protobuf

{ stdenv
, fetchurl

, protobuf-cpp_legacy
}:

let
  version = "1.3.0";
in
stdenv.mkDerivation rec {
  name = "protobuf-c-${version}";

  src = fetchurl {
    url = "https://github.com/protobuf-c/protobuf-c/releases/download/v${version}/${name}.tar.gz";
    sha256 = "5dc9ad7a9b889cf7c8ff6bf72215f1874a90260f60ad4f88acf21bb15d2752a1";
  };

  nativeBuildInputs = [
    protobuf-cpp_legacy
  ];

  buildInputs = [
    protobuf-cpp_legacy
  ];

  meta = with stdenv.lib; {
    maintainers = with maintainers; [
      wkennington
    ];
    platforms = with platforms;
      x86_64-linux;
  };
}


{ fetchurl, stdenv }:

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

  src = fetchurl {
    url = "mirror://gnu/libsigsegv/${name}.tar.gz";
    sha256 = "063swdvq7mbmc1clv0rnh20grwln1zfc2qnm0sa1hivcxyr2wz6x";
  };

  doCheck = true;

  meta = {
    homepage = http://www.gnu.org/software/libsigsegv/;
    description = "Library to handle page faults in user mode";

    longDescription = ''
      GNU libsigsegv is a library for handling page faults in user mode. A
      page fault occurs when a program tries to access to a region of memory
      that is currently not available. Catching and handling a page fault is
      a useful technique for implementing pageable virtual memory,
      memory-mapped access to persistent databases, generational garbage
      collectors, stack overflow handlers, distributed shared memory, and
      more.
    '';

    license = stdenv.lib.licenses.gpl2Plus;

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

Fix for cross by disabling check

{ stdenv, fetchurl
, buildPlatform, hostPlatform
}:

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

  src = fetchurl {
    url = "mirror://gnu/libsigsegv/${name}.tar.gz";
    sha256 = "063swdvq7mbmc1clv0rnh20grwln1zfc2qnm0sa1hivcxyr2wz6x";
  };

  doCheck = hostPlatform == buildPlatform;

  meta = {
    homepage = http://www.gnu.org/software/libsigsegv/;
    description = "Library to handle page faults in user mode";

    longDescription = ''
      GNU libsigsegv is a library for handling page faults in user mode. A
      page fault occurs when a program tries to access to a region of memory
      that is currently not available. Catching and handling a page fault is
      a useful technique for implementing pageable virtual memory,
      memory-mapped access to persistent databases, generational garbage
      collectors, stack overflow handlers, distributed shared memory, and
      more.
    '';

    license = stdenv.lib.licenses.gpl2Plus;

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


{ stdenv
, buildPythonPackage
, fetchPyPi

, markupsafe
}:

buildPythonPackage rec {
  name = "Jinja2-${version}";
  version = "2.8";

  src = fetchPyPi {
    package = "Jinja2";
    inherit version;
    sha256 = "bc1ff2ff88dbfacefde4ddde471d1417d3b304e8df103a7a9437d47269201bf4";
  };

  propagatedBuildInputs = [
    markupsafe
  ];

  doCheck = true;

  meta = with stdenv.lib; {
    description = "Jinja2 is a template engine written in pure Python";
    homepage = http://jinja.pocoo.org/;
    license = licenses.bsd3;
    maintainers = with maintainers; [
      codyopel
    ];
    platforms = with platforms;
      x86_64-linux;
  };
}

Move version out of derivation

{ stdenv
, buildPythonPackage
, fetchPyPi

, markupsafe
}:

let
  version = "2.8";
in
buildPythonPackage rec {
  name = "Jinja2-${version}";

  src = fetchPyPi {
    package = "Jinja2";
    inherit version;
    sha256 = "bc1ff2ff88dbfacefde4ddde471d1417d3b304e8df103a7a9437d47269201bf4";
  };

  propagatedBuildInputs = [
    markupsafe
  ];

  doCheck = true;

  meta = with stdenv.lib; {
    description = "Jinja2 is a template engine written in pure Python";
    homepage = http://jinja.pocoo.org/;
    license = licenses.bsd3;
    maintainers = with maintainers; [
      codyopel
    ];
    platforms = with platforms;
      x86_64-linux;
  };
}


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

with lib;

let

  cfg = config.services.xserver.windowManager.metacity;
  xorg = config.services.xserver.package;
  gnome = pkgs.gnome;

in

{
  options = {
    services.xserver.windowManager.metacity.enable = mkEnableOption "metacity";
  };

  config = mkIf cfg.enable {

    services.xserver.windowManager.session = singleton
      { name = "metacity";
        start = ''
          env LD_LIBRARY_PATH=${lib.makeLibraryPath [ xorg.libX11 xorg.libXext ]}:/usr/lib/
          # !!! Hack: load the schemas for Metacity.
          GCONF_CONFIG_SOURCE=xml::~/.gconf ${gnome.GConf}/bin/gconftool-2 \
            --makefile-install-rule ${gnome.metacity}/etc/gconf/schemas/*.schemas # */
          ${gnome.metacity}/bin/metacity &
          waitPID=$!
        '';
      };

    environment.systemPackages = [ gnome.metacity ];

  };

}

Fix output references to gnome.GConf

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

with lib;

let

  cfg = config.services.xserver.windowManager.metacity;
  xorg = config.services.xserver.package;
  gnome = pkgs.gnome;

in

{
  options = {
    services.xserver.windowManager.metacity.enable = mkEnableOption "metacity";
  };

  config = mkIf cfg.enable {

    services.xserver.windowManager.session = singleton
      { name = "metacity";
        start = ''
          env LD_LIBRARY_PATH=${lib.makeLibraryPath [ xorg.libX11 xorg.libXext ]}:/usr/lib/
          # !!! Hack: load the schemas for Metacity.
          GCONF_CONFIG_SOURCE=xml::~/.gconf ${gnome.GConf.out}/bin/gconftool-2 \
            --makefile-install-rule ${gnome.metacity}/etc/gconf/schemas/*.schemas # */
          ${gnome.metacity}/bin/metacity &
          waitPID=$!
        '';
      };

    environment.systemPackages = [ gnome.metacity ];

  };

}


{stdenv, fetchurl, zlib, openssl}:

let
  version = "20100703153359";
in

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

  src = fetchurl {
    url = "http://www.fossil-scm.org/download/fossil-src-${version}.tar.gz";
    sha256 = "1n4jl2xcwd8gfp0c897id13myk8z2h0yvs7g7z4s6bywx5wbkx0r";
  };

  buildInputs = [ zlib openssl ];

  installPhase = ''
    ensureDir $out/bin
    INSTALLDIR=$out/bin make install
  '';

  meta = {
    description = "Simple, high-reliability, distributed software configuration management.";
    longDescription = ''
      Fossil is a software configuration management system.  Fossil is
      software that is designed to control and track the development of a
      software project and to record the history of the project. There are
      many such systems in use today. Fossil strives to distinguish itself
      from the others by being extremely simple to setup and operate.
    '';
    homepage = http://www.fossil-scm.org/;
    license = "GPLv2";
    maintainers = [ #Add your name here!
      stdenv.lib.maintainers.z77z
    ];
  };
}

Update fossil to version 2010-08-23 22:24:16

{stdenv, fetchurl, zlib, openssl}:

let
  version = "20100823222416";
in

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

  src = fetchurl {
    url = "http://www.fossil-scm.org/download/fossil-src-${version}.tar.gz";
    sha256 = "16wxg27pyzrv7p5qmaf0gkxpydjxplck5s933aqcwp6xkpx0ys8v";
  };

  buildInputs = [ zlib openssl ];

  installPhase = ''
    ensureDir $out/bin
    INSTALLDIR=$out/bin make install
  '';

  meta = {
    description = "Simple, high-reliability, distributed software configuration management.";
    longDescription = ''
      Fossil is a software configuration management system.  Fossil is
      software that is designed to control and track the development of a
      software project and to record the history of the project. There are
      many such systems in use today. Fossil strives to distinguish itself
      from the others by being extremely simple to setup and operate.
    '';
    homepage = http://www.fossil-scm.org/;
    license = "GPLv2";
    maintainers = [ #Add your name here!
      stdenv.lib.maintainers.z77z
    ];
  };
}


{stdenv, fetchurl, cmake}:

let
  version = "3.3-alpha1";
in
stdenv.mkDerivation {
  name = "eigen-${version}";

  src = fetchurl {
    url = "http://bitbucket.org/eigen/eigen/get/${version}.tar.gz";
    name = "eigen-${version}.tar.gz";
    sha256 = "00vmxz3da76ml3j7s8w8447sdpszx71i3xhnmwivxhpc4smpvz2q";
  };

  nativeBuildInputs = [ cmake ];

  meta = with stdenv.lib; {
    description = "C++ template library for linear algebra: vectors, matrices, and related algorithms";
    license = licenses.lgpl3Plus;
    homepage = http://eigen.tuxfamily.org ;
    platforms = platforms.unix;
    maintainers = with stdenv.lib.maintainers; [ sander urkud raskin ];
    inherit version;
  };
}

Revert "eigen: 3.2.5 -> 3.3-alpha1" to fix freecad

{stdenv, fetchurl, cmake}:

let
  version = "3.2.5";
in
stdenv.mkDerivation {
  name = "eigen-${version}";

  src = fetchurl {
    url = "http://bitbucket.org/eigen/eigen/get/${version}.tar.gz";
    name = "eigen-${version}.tar.gz";
    sha256 = "1vjixip19lwfia2bjpjwm09j7l20ry75493i6mjsk9djszj61agi";
  };

  nativeBuildInputs = [ cmake ];

  meta = with stdenv.lib; {
    description = "C++ template library for linear algebra: vectors, matrices, and related algorithms";
    license = licenses.lgpl3Plus;
    homepage = http://eigen.tuxfamily.org ;
    platforms = platforms.unix;
    maintainers = with stdenv.lib.maintainers; [ sander urkud raskin ];
    inherit version;
  };
}


{ lib, buildGoModule, fetchFromGitHub, pkg-config, libusb1 }:

buildGoModule rec {
  pname = "go-mtpfs";
  version = "1.0.0";

  src = fetchFromGitHub {
    owner = "hanwen";
    repo = "go-mtpfs";
    rev = "v${version}";
    sha256 = "sha256-HVfB8/MImgZZLx4tcrlYOfQjpAdHMHshEaSsd+n758w=";
  };

  vendorSha256 = "sha256-OrAEvD2rF0Y0bvCD9TUv/E429lASsvC3uK3qNvbg734=";

  ldflags = [ "-s" "-w" ];

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

  checkFlags = [ "-short" ];

  meta = with lib; {
    description = "A simple FUSE filesystem for mounting Android devices as a MTP device";
    homepage = "https://github.com/hanwen/go-mtpfs";
    license = licenses.bsd3;
    maintainers = with maintainers; [ aaronjheng ];
  };
}

Disable tests req'ing USB attached devs

{ lib, buildGoModule, fetchFromGitHub, pkg-config, libusb1 }:

buildGoModule rec {
  pname = "go-mtpfs";
  version = "1.0.0";

  src = fetchFromGitHub {
    owner = "hanwen";
    repo = "go-mtpfs";
    rev = "v${version}";
    sha256 = "sha256-HVfB8/MImgZZLx4tcrlYOfQjpAdHMHshEaSsd+n758w=";
  };

  vendorSha256 = "sha256-OrAEvD2rF0Y0bvCD9TUv/E429lASsvC3uK3qNvbg734=";

  ldflags = [ "-s" "-w" ];

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

  preCheck = ''
    # Only run tests under mtp/encoding_test.go
    # Other tests require an Android deviced attached over USB.
    buildFlagsArray+=("-run" "Test(Encode|Decode|Variant).*")
  '';

  meta = with lib; {
    description = "A simple FUSE filesystem for mounting Android devices as a MTP device";
    homepage = "https://github.com/hanwen/go-mtpfs";
    license = licenses.bsd3;
    maintainers = with maintainers; [ aaronjheng ];
  };
}


{ nixpkgs  ? import <nixpkgs> {}
, compiler ? "ghc7102"
}:

let
  pkgs = nixpkgs.pkgs;
  ghc  = pkgs.haskell.packages.${compiler};
  f    = import <pwd>;
  drv  = ghc.callPackage f {};
in
  (pkgs.haskell.lib.addBuildTools drv [
    pkgs.git
    ghc.cabal-install
    ghc.hlint
  ]).env

Add profiling support for nix-hs-build

{ nixpkgs   ? import <nixpkgs> {}
, compiler  ? null
, profiling ? false
}:

let
  pkgs = nixpkgs.pkgs;

  # Use the default Haskell compiler if one isn't specified on the
  # command line.
  baseghc =
    if compiler != null
      then pkgs.haskell.packages.${compiler}
      else pkgs.haskellPackages;

  # Function to optionally enable profiling.
  profilingOverride = super:
    if profiling
      then { mkDerivation = args: super.mkDerivation
               (args // { enableLibraryProfiling = true; }); }
      else { };

  # Haskell compiler with overrides in place.
  ghc = baseghc.override {
    overrides = self: super: profilingOverride super;
  };

  # Load the generated "default.nix" from the specified directory.
  f = import <pwd>;

  # Make the actual derivation to build the Haskell project.
  drv = ghc.callPackage f {};
in
  (pkgs.haskell.lib.addBuildTools drv [
    # Additional tools to make available:
    pkgs.git
    ghc.cabal-install
    ghc.hlint
  ]).env


{ stdenv, fetchurl, pkgconfig, libuuid }:

stdenv.mkDerivation rec {
  name = "e2fsprogs-1.42.13";

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

  buildInputs = [ pkgconfig libuuid ];

  crossAttrs = {
    preConfigure = ''
      export CC=$crossConfig-gcc
    '';
  };

  # libuuid, libblkid, uuidd and fsck are in util-linux-ng (the "libuuid" dependency).
  configureFlags = "--enable-elf-shlibs --disable-libuuid --disable-libblkid --disable-uuidd --disable-fsck --enable-symlink-install";

  enableParallelBuilding = true;

  preInstall = "installFlagsArray=('LN=ln -s')";

  postInstall = "make install-libs";

  meta = {
    homepage = http://e2fsprogs.sourceforge.net/;
    description = "Tools for creating and checking ext2/ext3/ext4 filesystems";
    platforms = stdenv.lib.platforms.linux;
    maintainers = [ stdenv.lib.maintainers.eelco ];
  };
}

Revert "e2fsprogs: Update to 1.42.13"

{ stdenv, fetchurl, pkgconfig, libuuid }:

stdenv.mkDerivation rec {
  name = "e2fsprogs-1.42.12";

  src = fetchurl {
    url = "mirror://sourceforge/e2fsprogs/${name}.tar.gz";
    sha256 = "0v0qcfyls0dlrjy8gx9m3s2wbkp5z3lbsr5hb7x8kp8f3bclcy71";
  };

  buildInputs = [ pkgconfig libuuid ];

  crossAttrs = {
    preConfigure = ''
      export CC=$crossConfig-gcc
    '';
  };

  # libuuid, libblkid, uuidd and fsck are in util-linux-ng (the "libuuid" dependency).
  configureFlags = "--enable-elf-shlibs --disable-libuuid --disable-libblkid --disable-uuidd --disable-fsck --enable-symlink-install";

  enableParallelBuilding = true;

  preInstall = "installFlagsArray=('LN=ln -s')";

  postInstall = "make install-libs";

  meta = {
    homepage = http://e2fsprogs.sourceforge.net/;
    description = "Tools for creating and checking ext2/ext3/ext4 filesystems";
    platforms = stdenv.lib.platforms.linux;
    maintainers = [ stdenv.lib.maintainers.eelco ];
  };
}


{ fetchurl, stdenv }:

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

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

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

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

Update from 0.9.1 -> 0.9.2

{ fetchurl, stdenv }:

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

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

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

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


{ fetchurl, stdenv, gss, libidn }:

stdenv.mkDerivation rec {
  name = "gsasl-1.8.0";

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

  buildInputs = [ libidn ]
    ++ stdenv.lib.optional (!stdenv.isDarwin) gss;

  configureFlags = stdenv.lib.optionalString stdenv.isDarwin "--with-gssapi-impl=mit";

  doCheck = true;

  meta = {
    description = "GNU SASL, Simple Authentication and Security Layer library";

    longDescription =
      '' GNU SASL is a library that implements the IETF Simple
         Authentication and Security Layer (SASL) framework and
         some SASL mechanisms. SASL is used in network servers
         (e.g. IMAP, SMTP, etc.) to authenticate peers.
       '';

    homepage = http://www.gnu.org/software/gsasl/;
    license = stdenv.lib.licenses.gpl3Plus;

    maintainers = with stdenv.lib.maintainers; [ ];
    platforms = stdenv.lib.platforms.all;
  };
}

Bring in krb5 for darwin builds seeing as we use

{ fetchurl, stdenv, gss, libidn, krb5Full }:

stdenv.mkDerivation rec {
  name = "gsasl-1.8.0";

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

  buildInputs = [ libidn ]
    ++ stdenv.lib.optional (!stdenv.isDarwin) gss
    ++ stdenv.lib.optional stdenv.isDarwin krb5Full;

  configureFlags = stdenv.lib.optionalString stdenv.isDarwin "--with-gssapi-impl=mit";

  doCheck = true;

  meta = {
    description = "GNU SASL, Simple Authentication and Security Layer library";

    longDescription =
      '' GNU SASL is a library that implements the IETF Simple
         Authentication and Security Layer (SASL) framework and
         some SASL mechanisms. SASL is used in network servers
         (e.g. IMAP, SMTP, etc.) to authenticate peers.
       '';

    homepage = http://www.gnu.org/software/gsasl/;
    license = stdenv.lib.licenses.gpl3Plus;

    maintainers = with stdenv.lib.maintainers; [ ];
    platforms = stdenv.lib.platforms.all;
  };
}


{stdenv, fetchurl}:
with stdenv; with lib;
mkDerivation rec {
  name = "libb2-${meta.version}";

  meta = {
    version = "0.97";
    description = "The BLAKE2 family of cryptographic hash functions";
    platforms = platforms.all;
    maintainers = with maintainers; [ dfoxfranke ];
    license = licenses.cc0;
  };

  src = fetchurl {
    url = "https://blake2.net/${name}.tar.gz";
    sha256 = "7829c7309347650239c76af7f15d9391af2587b38f0a65c250104a2efef99051";
  };
}

Use "--enable-fat=yes" to avoid build nondeterminism

{stdenv, fetchurl}:
with stdenv; with lib;
mkDerivation rec {
  name = "libb2-${meta.version}";

  src = fetchurl {
    url = "https://blake2.net/${name}.tar.gz";
    sha256 = "7829c7309347650239c76af7f15d9391af2587b38f0a65c250104a2efef99051";
  };

  configureFlags = [ "--enable-fat=yes" ];

  meta = {
    version = "0.97";
    description = "The BLAKE2 family of cryptographic hash functions";
    platforms = platforms.all;
    maintainers = with maintainers; [ dfoxfranke ];
    license = licenses.cc0;
  };
}


{ stdenv, fetchFromGitHub, pkgconfig, autoreconfHook, cppunit, libgcrypt
, c-ares, libxml2, sqlite, zlib }:

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

  src = fetchFromGitHub {
    owner = "tatsuhiro-t";
    repo = "aria2";
    rev = "release-${version}";
    sha256 = "1k4b8jfg4wjsvybb7hysplp6h831allhiqdy9jwsyy0m0zmgk00a";
  };

  buildInputs = [
    pkgconfig autoreconfHook cppunit libgcrypt c-ares libxml2 sqlite zlib
  ];

  configureFlags = [ "--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt" ];

  meta = with stdenv.lib; {
    homepage = https://github.com/tatsuhiro-t/aria2;
    description = "A lightweight, multi-protocol, multi-source, command-line download utility";
    maintainers = with maintainers; [ koral jgeerds ];
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
  };
}

Fix ssl support and switch back to sourceforge

{ stdenv, fetchurl, pkgconfig, autoreconfHook
, openssl, c-ares, libxml2, sqlite, zlib, libssh2
}:

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

  src = fetchurl {
    url = "mirror://sourceforge/aria2/${name}.tar.xz";
    sha256 = "0xm4fmap9gp2pz6z01mnnpmazw6pnhzs8qc58181m5ai4gy5ksp2";
  };

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ openssl c-ares libxml2 sqlite zlib libssh2 ];

  configureFlags = [ "--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt" ];

  meta = with stdenv.lib; {
    homepage = https://github.com/tatsuhiro-t/aria2;
    description = "A lightweight, multi-protocol, multi-source, command-line download utility";
    maintainers = with maintainers; [ koral jgeerds ];
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
  };
}


{ stdenv, fetchurl, pkgconfig, strategoPackages }:

stdenv.mkDerivation rec {
  name = "webdsl-9.7pre4168";

  src = fetchurl {
    url = "http://hydra.nixos.org/build/654196/download/1/${name}.tar.gz";
    sha256 = "08bec3ba02254ec7474ce70206b7be4390fe07456cfc57d927d96a21dd6dcb33";
  };

  buildInputs =
    [ pkgconfig strategoPackages.aterm strategoPackages.sdf
      strategoPackages.strategoxt strategoPackages.javafront
    ];

  meta = {
    homepage = http://webdsl.org/;
    description = "A domain-specific language for developing dynamic web applications with a rich data model";
  };
}

Change which corrected a failing build of webdsl on a 64 bit Linux.

{ stdenv, fetchurl, pkgconfig, strategoPackages }:

stdenv.mkDerivation rec {
  name = "webdsl-9.7pre4168";

  src = fetchurl {
    url = "http://hydra.nixos.org/build/654196/download/1/${name}.tar.gz";
    sha256 = "08bec3ba02254ec7474ce70206b7be4390fe07456cfc57d927d96a21dd6dcb33";
  };

  buildInputs =
    [ pkgconfig strategoPackages.aterm strategoPackages.sdf
      strategoPackages.strategoxt strategoPackages.javafront
    ];

  # This corrected a failing build on at least one 64 bit Linux system.
  # See the comment about this here: http://webdsl.org/selectpage/Download/WebDSLOnLinux
  preBuild = (if stdenv.system == "x86_64-linux" then "ulimit -s unlimited" else "");

  meta = {
    homepage = http://webdsl.org/;
    description = "A domain-specific language for developing dynamic web applications with a rich data model";
  };
}


{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "man-pages-3.54";

  src = fetchurl {
    url = "mirror://kernel/linux/docs/man-pages/${name}.tar.xz";
    sha256 = "0rb75dl9hh4v2s95bcssy12j8qrbd2dmlzry68gphyxk5c7yipbl";
  };

  preBuild =
    ''
      makeFlagsArray=(MANDIR=$out/share/man)
    '';

  meta = {
    description = "Linux development manual pages";
    homepage = http://www.kernel.org/doc/man-pages/;
  };
}

Update from 3.54 -> 3.60.

{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "man-pages-3.60";

  src = fetchurl {
    url = "mirror://kernel/linux/docs/man-pages/${name}.tar.xz";
    sha256 = "0h4wzjcrz1hqbzwn1g0q11byzss7l4f1ynj7vzgbxar7z10gr5b6";
  };

  preBuild =
    ''
      makeFlagsArray=(MANDIR=$out/share/man)
    '';

  meta = {
    description = "Linux development manual pages";
    homepage = http://www.kernel.org/doc/man-pages/;
  };
}


{ lib, stdenv
, fetchFromGitHub
, cmake
}:

stdenv.mkDerivation rec {
  pname = "flatcc";
  version = "0.6.1";

  src = fetchFromGitHub {
    owner = "dvidelabs";
    repo = "flatcc";
    rev = "v${version}";
    sha256 = "sha256-0/IZ7eX6b4PTnlSSdoOH0FsORGK9hrLr1zlr/IHsJFQ=";
  };

  nativeBuildInputs = [ cmake ];

  cmakeFlags = [
    "-DFLATCC_INSTALL=on"
    "-DCMAKE_BUILD_TYPE=Release"
  ];

  NIX_CFLAGS_COMPILE = [
    "-Wno-error=misleading-indentation"
    "-Wno-error=stringop-overflow"
  ];

  meta = {
    description = "FlatBuffers Compiler and Library in C for C ";
    homepage = "https://github.com/dvidelabs/flatcc";
    license = [ lib.licenses.asl20 ];
  };
}

Add myself to maintainers list

{ lib, stdenv
, fetchFromGitHub
, cmake
}:

stdenv.mkDerivation rec {
  pname = "flatcc";
  version = "0.6.1";

  src = fetchFromGitHub {
    owner = "dvidelabs";
    repo = "flatcc";
    rev = "v${version}";
    sha256 = "sha256-0/IZ7eX6b4PTnlSSdoOH0FsORGK9hrLr1zlr/IHsJFQ=";
  };

  nativeBuildInputs = [ cmake ];

  cmakeFlags = [
    "-DFLATCC_INSTALL=on"
    "-DCMAKE_BUILD_TYPE=Release"
  ];

  NIX_CFLAGS_COMPILE = [
    "-Wno-error=misleading-indentation"
    "-Wno-error=stringop-overflow"
  ];

  meta = with lib; {
    description = "FlatBuffers Compiler and Library in C for C ";
    homepage = "https://github.com/dvidelabs/flatcc";
    license = [ licenses.asl20 ];
    maintainers = with maintainers; [ onny ];
  };
}


{ fetchurl, stdenv }:

stdenv.mkDerivation rec {
  name = "talloc-2.0.1";

  src = fetchurl {
    url = "http://samba.org/ftp/talloc/${name}.tar.gz";
    sha256 = "1d694zyi451a5zr03l5yv0n8yccyr3r8pmzga17xaaaz80khb0av";
  };

  configureFlags = "--enable-talloc-compat1 --enable-largefile";

  # https://bugzilla.samba.org/show_bug.cgi?id=7000
  postConfigure = if stdenv.isDarwin then ''
    substituteInPlace "Makefile" --replace "SONAMEFLAG = #" "SONAMEFLAG = -install_name"
  '' else "";

  meta = {
    description = "Hierarchical pool based memory allocator with destructors";
    homepage = http://tdb.samba.org/;
    license = stdenv.lib.licenses.gpl3;
    platforms = stdenv.lib.platforms.all;
  };
}

Fix linker flags on darwin.

{ fetchurl, stdenv }:

stdenv.mkDerivation rec {
  name = "talloc-2.0.1";

  src = fetchurl {
    url = "http://samba.org/ftp/talloc/${name}.tar.gz";
    sha256 = "1d694zyi451a5zr03l5yv0n8yccyr3r8pmzga17xaaaz80khb0av";
  };

  configureFlags = "--enable-talloc-compat1 --enable-largefile";

  # https://bugzilla.samba.org/show_bug.cgi?id=7000
  postConfigure = if stdenv.isDarwin then ''
    substituteInPlace "Makefile" --replace "SONAMEFLAG = #" "SONAMEFLAG = -Wl,-install_name,"
  '' else "";

  meta = {
    description = "Hierarchical pool based memory allocator with destructors";
    homepage = http://tdb.samba.org/;
    license = stdenv.lib.licenses.gpl3;
    platforms = stdenv.lib.platforms.all;
  };
}


{ config, pkgs, ... }:

let
  neopkgs = import (
    pkgs.fetchFromGitHub {
      owner = "NixOS";
      repo = "nixpkgs";
      rev = "8f793ce6bb050252e92a987cc3c5bd48d5423a42";
      sha256 = "0fydxirp79s4svr2gadp3hsx2vrank904n8c5kprqh3jrzid90cg";
    }
  ) {};
in
{
  environment.variables = {
    EDITOR = "nvim";
  };

  environment.systemPackages = [
    # Shells / Terminal
    pkgs.bash
    pkgs.fish
    pkgs.tmux

    # Editor
    neopkgs.neovim

    # Source control
    pkgs.git

    # Web
    pkgs.wget
    pkgs.curl
    pkgs.lynx

    # SSH
    pkgs.mosh

    # Email
    pkgs.isync

    # Interpreters
    pkgs.python

    # Search
    pkgs.silver-searcher

    # Some programs depend on which being available
    pkgs.which
  ];
}

Add psmisc and htop to my tool belt

{ config, pkgs, ... }:

let
  neopkgs = import (
    pkgs.fetchFromGitHub {
      owner = "NixOS";
      repo = "nixpkgs";
      rev = "8f793ce6bb050252e92a987cc3c5bd48d5423a42";
      sha256 = "0fydxirp79s4svr2gadp3hsx2vrank904n8c5kprqh3jrzid90cg";
    }
  ) {};
in
{
  environment.variables = {
    EDITOR = "nvim";
  };

  environment.systemPackages = [
    # Shells / Terminal
    pkgs.bash
    pkgs.fish
    pkgs.tmux

    # Editor
    neopkgs.neovim

    # Source control
    pkgs.git

    # Web
    pkgs.wget
    pkgs.curl
    pkgs.lynx

    # SSH
    pkgs.mosh

    # Email
    pkgs.isync

    # Interpreters
    pkgs.python

    # Search
    pkgs.silver-searcher

    # Some programs depend on which being available
    pkgs.which

    # Performance and monitoring tools
    pkgs.psmisc # includes killall
    pkgs.htop
  ];
}


{ fetchurl, stdenv, writeText, perl, openssh, rsync, logger,
  configFile ? "/etc/rsnapshot.conf" }:

let patch = writeText "rsnapshot-config.patch" ''
--- rsnapshot-program.pl	2013-10-05 20:31:08.715991442 +0200
+++ rsnapshot-program.pl	2013-10-05 20:31:42.496193633 +0200
@@ -383,7 +383,7 @@
 	}

 	# set global variable
-	$config_file = $default_config_file;
+	$config_file = '${configFile}';
 }

 # accepts no args
'';
in
stdenv.mkDerivation rec {
  name = "rsnapshot-1.4.1";

  src = fetchurl {
    url = "http://rsnapshot.org/downloads/${name}.tar.gz";
    sha256 = "1s28wkpqajgmwi88n3xs3qsa4b7yxd6lkl4zfi0mr06klwli2jpv";
  };

  propagatedBuildInputs = [perl openssh rsync logger];

  patchPhase = ''
    substituteInPlace "Makefile.in" --replace \
      "/usr/bin/pod2man" "${perl}/bin/pod2man"
    patch -p0 <${patch}
  '';

  meta = with stdenv.lib; {
    description = "A filesystem snapshot utility for making backups of local and remote systems";
    homepage = http://rsnapshot.org/;
    license = stdenv.lib.licenses.gpl2Plus;
    platforms = platforms.linux;
  };
}

Remove unnecessary argument, refactor one-line patch to flags.

{ fetchurl, stdenv, writeText, perl, openssh, rsync, logger }:

stdenv.mkDerivation rec {
  name = "rsnapshot-1.4.1";

  src = fetchurl {
    url = "http://rsnapshot.org/downloads/${name}.tar.gz";
    sha256 = "1s28wkpqajgmwi88n3xs3qsa4b7yxd6lkl4zfi0mr06klwli2jpv";
  };

  propagatedBuildInputs = [perl openssh rsync logger];

  configureFlags = [ "--sysconfdir=/etc --prefix=/" ];
  makeFlags = [ "DESTDIR=$(out)" ];

  patchPhase = ''
    substituteInPlace "Makefile.in" --replace \
      "/usr/bin/pod2man" "${perl}/bin/pod2man"
  '';

  meta = with stdenv.lib; {
    description = "A filesystem snapshot utility for making backups of local and remote systems";
    homepage = http://rsnapshot.org/;
    license = stdenv.lib.licenses.gpl2Plus;
    platforms = platforms.linux;
  };
}


{ fetchurl, stdenv, glib, pkgconfig, udev, libgudev }:

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

  src = fetchurl {
    url = "mirror://sourceforge/linuxwacom/libwacom/${name}.tar.bz2";
    sha256 = "1vv768870597rvwxdb59v6pjn1pxaxg4r6znbb5j3cl828q35mp7";
  };

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

  meta = with stdenv.lib; {
    platforms = platforms.linux;
    homepage = https://sourceforge.net/projects/linuxwacom/;
    description = "Libraries, configuration, and diagnostic tools for Wacom tablets running under Linux";
  };
}

Revert "libwacom: 0.26 -> 0.28"

{ fetchurl, stdenv, glib, pkgconfig, udev, libgudev }:

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

  src = fetchurl {
    url = "mirror://sourceforge/linuxwacom/libwacom/${name}.tar.bz2";
    sha256 = "0xpvkjvzaj9blcmw8ha46616bzfivj99kwzvr91clxd6iaf11r63";
  };

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

  meta = with stdenv.lib; {
    platforms = platforms.linux;
    homepage = https://sourceforge.net/projects/linuxwacom/;
    description = "Libraries, configuration, and diagnostic tools for Wacom tablets running under Linux";
  };
}


{ stdenv, fetchFromGitHub, inkscape, imagemagick, potrace, svgo, scfbuild }:

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

  src = fetchFromGitHub {
    owner = "eosrei";
    repo = "emojione-color-font";
    rev = "v${version}";
    sha256 = "0hgs661g1j91lkafhrfx5ix7ymarh5bzcx34r2id6jl7dc3j41l3";
  };

  preBuild = ''
    sed -i 's,SCFBUILD :=.*,SCFBUILD := scfbuild,' Makefile
    # Shut up inkscape's warnings
    export HOME="$NIX_BUILD_ROOT"
  '';

  nativeBuildInputs = [ inkscape imagemagick potrace svgo scfbuild ];

  enableParallelBuilding = true;

  installPhase = ''
    install -Dm755 build/EmojiOneColor-SVGinOT.ttf $out/share/fonts/truetype/EmojiOneColor-SVGinOT.ttf
  '';

  meta = with stdenv.lib; {
    description = "Open source emoji set";
    homepage = "http://emojione.com/";
    licenses = licenses.cc-by-40;
    platforms = platforms.all;
    maintainers = with maintainers; [ abbradar ];
  };
}

Fix typo in meta.license attribute name

{ stdenv, fetchFromGitHub, inkscape, imagemagick, potrace, svgo, scfbuild }:

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

  src = fetchFromGitHub {
    owner = "eosrei";
    repo = "emojione-color-font";
    rev = "v${version}";
    sha256 = "0hgs661g1j91lkafhrfx5ix7ymarh5bzcx34r2id6jl7dc3j41l3";
  };

  preBuild = ''
    sed -i 's,SCFBUILD :=.*,SCFBUILD := scfbuild,' Makefile
    # Shut up inkscape's warnings
    export HOME="$NIX_BUILD_ROOT"
  '';

  nativeBuildInputs = [ inkscape imagemagick potrace svgo scfbuild ];

  enableParallelBuilding = true;

  installPhase = ''
    install -Dm755 build/EmojiOneColor-SVGinOT.ttf $out/share/fonts/truetype/EmojiOneColor-SVGinOT.ttf
  '';

  meta = with stdenv.lib; {
    description = "Open source emoji set";
    homepage = "http://emojione.com/";
    license = licenses.cc-by-40;
    platforms = platforms.all;
    maintainers = with maintainers; [ abbradar ];
  };
}


{ lib
, buildPythonPackage
, fetchPypi
, coverage
, pytest
}:

buildPythonPackage rec {
  pname = "pytest-testmon";
  version = "1.0.3";

  src = fetchPypi {
    inherit pname version;
    sha256 = "927a73dd510b90a2e4a48ea4d37e82c4490b56caa745663262024ea0cd278169";
  };

  propagatedBuildInputs = [ coverage ];

  checkInputs = [ pytest ];

  # avoid tests which try to import unittest_mixins
  # unittest_mixins doesn't seem to be very active
  checkPhase = ''
    cd test
    pytest test_{core,process_code,pytest_assumptions}.py
  '';

  meta = with lib; {
    homepage = "https://github.com/tarpas/pytest-testmon/";
    description = "This is a py.test plug-in which automatically selects and re-executes only tests affected by recent changes";
    license = licenses.mit;
    maintainers = [ maintainers.dmvianna ];
  };
}

Revert "python: pytest-testmon: 1.0.2 -> 1.0.3"

{ lib
, buildPythonPackage
, fetchPypi
, coverage
, pytest
}:

buildPythonPackage rec {
  pname = "pytest-testmon";
  version = "1.0.2";

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

  propagatedBuildInputs = [ coverage ];

  checkInputs = [ pytest ];

  # avoid tests which try to import unittest_mixins
  # unittest_mixins doesn't seem to be very active
  checkPhase = ''
    cd test
    pytest test_{core,process_code,pytest_assumptions}.py
  '';

  meta = with lib; {
    homepage = "https://github.com/tarpas/pytest-testmon/";
    description = "This is a py.test plug-in which automatically selects and re-executes only tests affected by recent changes";
    license = licenses.mit;
    maintainers = [ maintainers.dmvianna ];
  };
}


{ stdenv
, buildPythonPackage
, fetchPypi
, sphinx
, readthedocs-sphinx-ext
, pytest
}:

buildPythonPackage rec {
  pname = "sphinx_rtd_theme";
  version = "0.5.0";

  src = fetchPypi {
    inherit pname version;
    sha256 = "22c795ba2832a169ca301cd0a083f7a434e09c538c70beb42782c073651b707d";
  };

  propagatedBuildInputs = [ sphinx ];

  checkInputs = [ readthedocs-sphinx-ext pytest ];

  checkPhase = ''
    py.test
  '';

  meta = with stdenv.lib; {
    description = "ReadTheDocs.org theme for Sphinx";
    homepage = "https://github.com/snide/sphinx_rtd_theme/";
    license = licenses.bsd3;
    platforms = platforms.unix;
  };

}

Revert "python3Packages.sphinx_rtd_theme: 0.4.3 -> 0.5.0"

{ stdenv
, buildPythonPackage
, fetchPypi
, sphinx
, readthedocs-sphinx-ext
, pytest
}:

buildPythonPackage rec {
  pname = "sphinx_rtd_theme";
  version = "0.4.3";

  src = fetchPypi {
    inherit pname version;
    sha256 = "728607e34d60456d736cc7991fd236afb828b21b82f956c5ea75f94c8414040a";
  };

  propagatedBuildInputs = [ sphinx ];

  checkInputs = [ readthedocs-sphinx-ext pytest ];

  checkPhase = ''
    py.test
  '';

  meta = with stdenv.lib; {
    description = "ReadTheDocs.org theme for Sphinx";
    homepage = "https://github.com/snide/sphinx_rtd_theme/";
    license = licenses.bsd3;
    platforms = platforms.unix;
  };

}


{stdenv, fetchurl, emacs}:

let version = "1.3";

in stdenv.mkDerivation {
  name = "writegood-mode-${version}";
  src = fetchurl {
    url = "https://github.com/bnbeckwith/writegood-mode/archive/v${version}.tar.gz";
    sha256 = "0p34rgawnqg94vk4lcw14x99rrvsd23dmbwkxz2vax5kq6l8y5yf";
  };

  buildInputs = [ emacs ];

  buildPhase = ''
    emacs -L . --batch -f batch-byte-compile *.el
  '';

  installPhase = ''
    install -d $out/share/emacs/site-lisp
    install *.el *.elc $out/share/emacs/site-lisp
  '';

  meta = {
    description = "Emacs minor mode that aids in finding common writing problems";
    homepage = https://github.com/bnbeckwith/writegood-mode;
    platforms = stdenv.lib.platforms.all;
    maintainers = [ stdenv.lib.maintainers.pSub ];
    license = "GPL3";
  };
}

Update writegood-mode from 1.3 to 2.0

{stdenv, fetchurl, emacs}:

let version = "2.0";

in stdenv.mkDerivation {
  name = "writegood-mode-${version}";
  src = fetchurl {
    url = "https://github.com/bnbeckwith/writegood-mode/archive/v${version}.tar.gz";
    sha256 = "0wf7bj9d00ggy3xigym885a3njfr98i3aqrrawf8x6lgbfc56dgp";
  };

  buildInputs = [ emacs ];

  buildPhase = ''
    emacs -L . --batch -f batch-byte-compile *.el
  '';

  installPhase = ''
    install -d $out/share/emacs/site-lisp
    install *.el *.elc $out/share/emacs/site-lisp
  '';

  meta = {
    description = "Emacs minor mode that aids in finding common writing problems";
    homepage = https://github.com/bnbeckwith/writegood-mode;
    platforms = stdenv.lib.platforms.all;
    maintainers = [ stdenv.lib.maintainers.pSub ];
    license = "GPL3";
  };
}


{ lib
, buildPythonPackage
, fetchPypi
, webtest
, zope_component
, hupper
, PasteDeploy
, plaster
, plaster-pastedeploy
, repoze_lru
, translationstring
, venusian
, webob
, zope_deprecation
, zope_interface
, isPy35
}:

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

  src = fetchPypi {
    inherit pname version;
    sha256 = "45431b387587ed0fac6213b54d6e9f0936f0cc85238a8f5af7852fc9484c5c77";
  };

  checkInputs = [ webtest zope_component ];

  propagatedBuildInputs = [ hupper PasteDeploy plaster plaster-pastedeploy repoze_lru translationstring venusian webob zope_deprecation zope_interface ];

  # Failing tests
  # https://github.com/Pylons/pyramid/issues/1899
  doCheck = !isPy35;

  pythonImportsCheck = [ "pyramid" ];

  meta = with lib; {
    description = "The Pyramid Web Framework, a Pylons project";
    homepage = "https://trypyramid.com/";
    license = licenses.bsd0;
    maintainers = with maintainers; [ domenkozar ];
  };

}

Revert "python3Packages.pyramid: 1.10.5 -> 2.0"

{ lib
, buildPythonPackage
, fetchPypi
, webtest
, zope_component
, hupper
, PasteDeploy
, plaster
, plaster-pastedeploy
, repoze_lru
, translationstring
, venusian
, webob
, zope_deprecation
, zope_interface
, isPy35
}:

buildPythonPackage rec {
  pname = "pyramid";
  version = "1.10.5";

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

  checkInputs = [ webtest zope_component ];

  propagatedBuildInputs = [ hupper PasteDeploy plaster plaster-pastedeploy repoze_lru translationstring venusian webob zope_deprecation zope_interface ];

  # Failing tests
  # https://github.com/Pylons/pyramid/issues/1899
  doCheck = !isPy35;

  pythonImportsCheck = [ "pyramid" ];

  meta = with lib; {
    description = "The Pyramid Web Framework, a Pylons project";
    homepage = "https://trypyramid.com/";
    license = licenses.bsd0;
    maintainers = with maintainers; [ domenkozar ];
  };

}


{ config, pkgs, ... }:

{

  # List packages installed in system profile. To search by name, run:
  environment.systemPackages =
    [
      pkgs.awscli
      pkgs.bat
      pkgs.clojure
      pkgs.docker
      pkgs.docker-compose
      pkgs.fira-code
      pkgs.fzf
      pkgs.gitAndTools.delta
      pkgs.htop
      pkgs.j
      pkgs.jq
      pkgs.kubectl
      pkgs.mosh
      pkgs.neovim
      pkgs.nodejs
      pkgs.ripgrep
      pkgs.skhd
      pkgs.tmux
      pkgs.vim
      pkgs.watch
      pkgs.wget
      pkgs.yabai
      pkgs.yq
      (pkgs.callPackage ../custom-nix-packages/coder.nix { })
    ];

    nixpkgs.overlays = [
      (import (builtins.fetchTarball {
        url = https://github.com/nix-community/neovim-nightly-overlay/archive/master.tar.gz;
      }))
      (self: super: {
        neovim = super.neovim.override {
          viAlias = true;
          vimAlias = true;
        };
      })
    ];

  # Used for backwards compatibility, please read the changelog before changing.
  # $ darwin-rebuild changelog
  system.stateVersion = 4;

 # Fonts
 fonts = {
   enableFontDir = true;
   fonts = [ pkgs.fira-code ];
 };

  # Shell
  programs.bash.enable = false;
  programs.zsh.enable = true;

  # Enable/Disable services
  services.skhd.enable = true;
  services.yabai = {
    enable = true;
    package = pkgs.yabai;
  };

}

Switch back to neovim master

{ config, pkgs, ... }:

{

  # List packages installed in system profile. To search by name, run:
  environment.systemPackages =
    [
      pkgs.awscli
      pkgs.bat
      pkgs.clojure
      pkgs.docker
      pkgs.docker-compose
      pkgs.fira-code
      pkgs.fzf
      pkgs.gitAndTools.delta
      pkgs.htop
      pkgs.j
      pkgs.jq
      pkgs.kubectl
      pkgs.mosh
      pkgs.neovim
      pkgs.nodejs
      pkgs.ripgrep
      pkgs.skhd
      pkgs.tmux
      pkgs.vim
      pkgs.watch
      pkgs.wget
      pkgs.yabai
      pkgs.yq
      (pkgs.callPackage ../custom-nix-packages/coder.nix { })
    ];

  # Used for backwards compatibility, please read the changelog before changing.
  # $ darwin-rebuild changelog
  system.stateVersion = 4;

 # Fonts
 fonts = {
   enableFontDir = true;
   fonts = [ pkgs.fira-code ];
 };

  # Shell
  programs.bash.enable = false;
  programs.zsh.enable = true;

  # Enable/Disable services
  services.skhd.enable = true;
  services.yabai = {
    enable = true;
    package = pkgs.yabai;
  };

}


{ stdenv, fetchurl, python, pkgconfig, readline, tdb, talloc, tevent
, popt, libxslt, docbook_xsl, docbook_xml_dtd_42
}:

stdenv.mkDerivation rec {
  name = "ldb-1.3.1";

  src = fetchurl {
    url = "mirror://samba/ldb/${name}.tar.gz";
    sha256 = "1b1mkggp8swb67s9aswavhzswlib34hpgsv66zgns009paf2df6d";
  };

  outputs = [ "out" "dev" ];

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [
    python readline tdb talloc tevent popt
    libxslt docbook_xsl docbook_xml_dtd_42
  ];

  preConfigure = ''
    sed -i 's,#!/usr/bin/env python,#!${python}/bin/python,g' buildtools/bin/waf
  '';

  configureFlags = [
    "--bundled-libraries=NONE"
    "--builtin-libraries=replace"
  ];

  stripDebugList = "bin lib modules";

  meta = with stdenv.lib; {
    description = "A LDAP-like embedded database";
    homepage = http://ldb.samba.org/;
    license = licenses.lgpl3Plus;
    maintainers = with maintainers; [ wkennington ];
    platforms = platforms.all;
  };
}

Revert "ldb: 1.1.27 -> 1.3.1"

{ stdenv, fetchurl, python, pkgconfig, readline, tdb, talloc, tevent
, popt, libxslt, docbook_xsl, docbook_xml_dtd_42
}:

stdenv.mkDerivation rec {
  name = "ldb-1.1.27";

  src = fetchurl {
    url = "mirror://samba/ldb/${name}.tar.gz";
    sha256 = "1b1mkl5p8swb67s9aswavhzswlib34hpgsv66zgns009paf2df6d";
  };

  outputs = [ "out" "dev" ];

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [
    python readline tdb talloc tevent popt
    libxslt docbook_xsl docbook_xml_dtd_42
  ];

  preConfigure = ''
    sed -i 's,#!/usr/bin/env python,#!${python}/bin/python,g' buildtools/bin/waf
  '';

  configureFlags = [
    "--bundled-libraries=NONE"
    "--builtin-libraries=replace"
  ];

  stripDebugList = "bin lib modules";

  meta = with stdenv.lib; {
    description = "A LDAP-like embedded database";
    homepage = http://ldb.samba.org/;
    license = licenses.lgpl3Plus;
    maintainers = with maintainers; [ wkennington ];
    platforms = platforms.all;
  };
}


import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/90afb0c10fe6f437fca498298747b2bcb6a77d39.tar.gz") { }

Use fetchFromGitHub to pin nixpkgs

let
  fetchFromGitHub = (import <nixpkgs> {}).fetchFromGitHub;
  pkgs = import (fetchFromGitHub {
                   owner  = "NixOS";
                   repo   = "nixpkgs";
                   rev    = "90afb0c10fe6f437fca498298747b2bcb6a77d39";
                   sha256 = "0mvzdw5aygi1vjnvm0bc8bp7iwb9rypiqg749m6a6km84m7srm0w";
                 }) {};
in pkgs


{ stdenv, fetchurl, cmake, mesa, pkgconfig, libpulseaudio, qt5, debug ? false }:

with stdenv.lib;

let
  v = "4.8.3";
in

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

  src = fetchurl {
    url = "mirror://kde/stable/phonon/${v}/src/phonon-${v}.tar.xz";
    sha256 = "05nshngk03ln90vsjz44dx8al576f4vd5fvhs1l0jmx13jb9q551";
  };

  buildInputs = [ mesa qt5.base qt5.quick1 qt5.tools libpulseaudio ];

  nativeBuildInputs = [ cmake pkgconfig ];

  cmakeFlags = [
    "-DPHONON_BUILD_PHONON4QT5=ON"
    "-DCMAKE_INSTALL_LIBDIR=lib"
  ]
  ++ optional debug "-DCMAKE_BUILD_TYPE=Debug";

  meta = {
    homepage = http://phonon.kde.org/;
    description = "Multimedia API for Qt";
    license = stdenv.lib.licenses.lgpl2;
    platforms = stdenv.lib.platforms.linux;
    maintainers = with stdenv.lib.maintainers; [ ttuegel ];
  };
}

Fix building (on gcc5 maybe)

{ stdenv, fetchurl, cmake, mesa, pkgconfig, libpulseaudio, qt5, debug ? false }:

with stdenv.lib;

let
  v = "4.8.3";
in

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

  src = fetchurl {
    url = "mirror://kde/stable/phonon/${v}/src/phonon-${v}.tar.xz";
    sha256 = "05nshngk03ln90vsjz44dx8al576f4vd5fvhs1l0jmx13jb9q551";
  };

  buildInputs = [ mesa qt5.base qt5.quick1 qt5.tools libpulseaudio ];

  nativeBuildInputs = [ cmake pkgconfig ];

  NIX_CFLAGS_COMPILE = "-fPIC";

  cmakeFlags = [
    "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}"
    "-DPHONON_BUILD_PHONON4QT5=ON"
    "-DCMAKE_INSTALL_LIBDIR=lib"
  ];

  meta = {
    homepage = http://phonon.kde.org/;
    description = "Multimedia API for Qt";
    license = stdenv.lib.licenses.lgpl2;
    platforms = stdenv.lib.platforms.linux;
    maintainers = with stdenv.lib.maintainers; [ ttuegel ];
  };
}


{ lib, rustPlatform, fetchFromGitHub, boost, nix, pkg-config }:

rustPlatform.buildRustPackage rec {
  pname = "nix-doc";
  version = "0.5.1";

  src = fetchFromGitHub {
    rev = "v${version}";
    owner = "lf-";
    repo = "nix-doc";
    sha256 = "0yx5y90shdjwihbjrvv2m3bycgpdalafc9q4acfczfaymag8ggad";
  };

  doCheck = true;
  buildInputs = [ boost nix ];

  nativeBuildInputs = [ pkg-config ];

  cargoSha256 = "11bcn111j4iqwqwpp26w7rnycasbhiixaqb1rq4ry2402hvl90j7";

  meta = with lib; {
    description = "An interactive Nix documentation tool";
    longDescription = "An interactive Nix documentation tool providing a CLI for function search, a Nix plugin for docs in the REPL, and a ctags implementation for Nix script";
    homepage = "https://github.com/lf-/nix-doc";
    license = licenses.lgpl3;
    maintainers = [ maintainers.lf- ];
    platforms = platforms.unix;
  };
}

Fix lint: the license is LGPL3+

{ lib, rustPlatform, fetchFromGitHub, boost, nix, pkg-config }:

rustPlatform.buildRustPackage rec {
  pname = "nix-doc";
  version = "0.5.1";

  src = fetchFromGitHub {
    rev = "v${version}";
    owner = "lf-";
    repo = "nix-doc";
    sha256 = "0yx5y90shdjwihbjrvv2m3bycgpdalafc9q4acfczfaymag8ggad";
  };

  doCheck = true;
  buildInputs = [ boost nix ];

  nativeBuildInputs = [ pkg-config ];

  cargoSha256 = "11bcn111j4iqwqwpp26w7rnycasbhiixaqb1rq4ry2402hvl90j7";

  meta = with lib; {
    description = "An interactive Nix documentation tool";
    longDescription = "An interactive Nix documentation tool providing a CLI for function search, a Nix plugin for docs in the REPL, and a ctags implementation for Nix script";
    homepage = "https://github.com/lf-/nix-doc";
    license = licenses.lgpl3Plus;
    maintainers = [ maintainers.lf- ];
    platforms = platforms.unix;
  };
}


{ fetchurl, stdenv }:

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

  src = fetchurl {
    url = "http://pax.grsecurity.net/${name}.tar.bz2";
    sha256 = "1j6dg6wd1v7na5i4xj8zmbff0mdqdnw6cvqy0rsbz5anra27f1zp";
  };

  preBuild = ''
    sed "s|--owner 0 --group 0||g" -i Makefile
  '';

  makeFlags = [
    "DESTDIR=$(out)"
    "MANDIR=share/man/man1"
  ];

  meta = with stdenv.lib; {
    description = "A tool for controlling PaX flags on a per binary basis";
    homepage    = "https://pax.grsecurity.net";
    license     = licenses.gpl2;
    platforms   = platforms.linux;
    maintainers = with maintainers; [ thoughtpolice wizeman ];
  };
}

Update from 0.7 -> 0.8

{ fetchurl, stdenv }:

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

  src = fetchurl {
    url = "http://pax.grsecurity.net/${name}.tar.gz";
    sha256 = "107gmriq5icsk9yni5q949rnjapjkcs0823pw6zra6h1xml2f0mm";
  };

  preBuild = ''
    sed "s|--owner 0 --group 0||g" -i Makefile
  '';

  makeFlags = [
    "DESTDIR=$(out)"
    "MANDIR=share/man/man1"
  ];

  meta = with stdenv.lib; {
    description = "A tool for controlling PaX flags on a per binary basis";
    homepage    = "https://pax.grsecurity.net";
    license     = licenses.gpl2;
    platforms   = platforms.linux;
    maintainers = with maintainers; [ thoughtpolice wizeman ];
  };
}


{ stdenv, nodejs }:

args @ { src, deps, ... }:

stdenv.mkDerivation ({
  unpackPhase = "true";

  configurePhase = ''
    runHook preConfigure
    mkdir node_modules
    ${stdenv.lib.concatStrings (map (dep: ''
      ln -sv ${dep}/node_modules/${(builtins.parseDrvName dep.name).name} node_modules/
    '') deps)}
    export HOME=$(pwd)
    runHook postConfigure
  '';

  buildPhase = ''
    runHook preBuild
    ${nodejs}/bin/npm --registry http://www.example.com install ${src}
    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall
    mkdir $out
    mv node_modules $out
    if [ -d "$out/node_modules/.bin" ]; then
      ln -sv node_modules/.bin $out/bin
      find -L $out/node_modules/.bin/* -type f -print0 | \
        xargs -0 sed --follow-symlinks -i 's@#!/usr/bin/env node@#!${nodejs}/bin/node@'
    fi
    runHook postInstall
  '';
} // args)

Remove absolute path to source tarball to avoid runtime dependency

{ stdenv, nodejs }:

args @ { src, deps, ... }:

stdenv.mkDerivation ({
  unpackPhase = "true";

  configurePhase = ''
    runHook preConfigure
    mkdir node_modules
    ${stdenv.lib.concatStrings (map (dep: ''
      ln -sv ${dep}/node_modules/${(builtins.parseDrvName dep.name).name} node_modules/
    '') deps)}
    export HOME=$(pwd)
    runHook postConfigure
  '';

  buildPhase = ''
    runHook preBuild
    ${nodejs}/bin/npm --registry http://www.example.com install ${src}
    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall
    mkdir $out
    mv node_modules $out
    if [ -d "$out/node_modules/.bin" ]; then
      ln -sv node_modules/.bin $out/bin
      find -L $out/node_modules/.bin/* -type f -print0 | \
        xargs -0 sed --follow-symlinks -i 's@#!/usr/bin/env node@#!${nodejs}/bin/node@'
    fi
    runHook postInstall
  '';

  preFixup = ''
    find $out -type f -print0 | xargs -0 sed -i 's|${src}|${src.name}|g'
  '';
} // args)


{ config, pkgs, ... }:

with pkgs.lib;

{
  options = {

    time = {

      timeZone = mkOption {
        default = "CET";
        type = with types; uniq string;
        example = "America/New_York";
        description = "The time zone used when displaying times and dates.";
      };

      hardwareClockInLocalTime = mkOption {
        default = false;
        description = "If set, keep the hardware clock in local time instead of UTC.";
      };

    };
  };

  config = {

    environment.shellInit =
      ''
        export TZDIR=${pkgs.tzdata}/share/zoneinfo
      '';

    environment.etc = singleton
      { source = "${pkgs.tzdata}/share/zoneinfo/${config.time.timeZone}";
        target = "localtime";
      };

  };

}

Create a /etc/zoneinfo symlink and use it in $TZDIR

{ config, pkgs, ... }:

with pkgs.lib;

{
  options = {

    time = {

      timeZone = mkOption {
        default = "CET";
        type = with types; uniq string;
        example = "America/New_York";
        description = "The time zone used when displaying times and dates.";
      };

      hardwareClockInLocalTime = mkOption {
        default = false;
        description = "If set, keep the hardware clock in local time instead of UTC.";
      };

    };
  };

  config = {

    environment.shellInit =
      ''
        export TZDIR=/etc/zoneinfo
      '';

    environment.etc.localtime.source = "${pkgs.tzdata}/share/zoneinfo/${config.time.timeZone}";

    environment.etc.zoneinfo.source = "${pkgs.tzdata}/share/zoneinfo";

  };

}


{ pkgs, nixpkgs, config, lib, ... }:
{
  nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
    "skypeforlinux"
    "slack"
    "spotify"
    "spotify-unwrapped"
    "vscode"
    "vscode-with-extensions"
    "zoom"
  ];

  environment.systemPackages = with pkgs;
    [
      ( python38.withPackages (ps: with ps; [ pip flake8 black pynvim ipython python-language-server.override { pylint = null; } ]) )
      httpie
      ffmpeg
      gnupg
      openssl
      yarn
      coreutils
      htop
      httpie
      ripgrep
      fzf
      irssi
      tig
      tree
      wget
      fswatch
      sqlite
      nodejs
      docker
      reattach-to-user-namespace
      alacritty
      ghc
      cabal-install
      syncthing
    ];

  fonts = {
    enableFontDir = true;
    fonts = with pkgs; [ fira-code iosevka];
  };

  programs.zsh.enable = true;

  system.stateVersion = 4;
  users = {
    users.sebastian = {
      home = /Users/sebastian;
    };
  };
}

Enable flakes in macbook flake and use pkgs.nixUnstable

{ pkgs, nix, nixpkgs, config, lib, ... }:
{
  nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
    "skypeforlinux"
    "slack"
    "spotify"
    "spotify-unwrapped"
    "vscode"
    "vscode-with-extensions"
    "zoom"
  ];

  environment.systemPackages = with pkgs;
    [
      ( python38.withPackages (ps: with ps; [ pip flake8 black pynvim ipython python-language-server.override { pylint = null; } ]) )
      httpie
      ffmpeg
      gnupg
      openssl
      yarn
      coreutils
      htop
      httpie
      ripgrep
      fzf
      irssi
      tig
      tree
      wget
      fswatch
      sqlite
      nodejs
      docker
      reattach-to-user-namespace
      alacritty
      ghc
      cabal-install
      syncthing
    ];

  fonts = {
    enableFontDir = true;
    fonts = with pkgs; [ fira-code iosevka];
  };

  programs.zsh.enable = true;

  system.stateVersion = 4;
  users = {
    users.sebastian = {
      home = /Users/sebastian;
    };
  };

  nix = {
    package = pkgs.nixUnstable;
    extraOptions = ''
      experimental-features = nix-command flakes
    '';
  };
}


{ stdenv, fetchurl, autoconf, libtool, automake, libsodium, ncurses
, libtoxcore, openal, libvpx, freealut, libconfig, pkgconfig }:

let
  version = "0.5.1";
in stdenv.mkDerivation rec {
  name = "toxic-${version}";

  src = fetchurl {
    url = "https://github.com/Tox/toxic/archive/v${version}.tar.gz";
    sha256 = "0zzfgwm17a4xcy9l0ll2pksp45mz6f4s3isdrgjpw1xibv9xnzcm";
  };

  makeFlags = [ "-Cbuild" "VERSION=${version}" "PREFIX=$(out)" ];
  installFlags = [ "PREFIX=$(out)" ];

  buildInputs = [
    autoconf libtool automake libtoxcore libsodium ncurses
    libconfig pkgconfig
  ] ++ stdenv.lib.optionals (!stdenv.isArm) [
    openal libvpx freealut
  ];

  meta = {
    description = "Reference CLI for Tox";
    license = stdenv.lib.licenses.gpl3Plus;
    maintainers = with stdenv.lib.maintainers; [ viric ];
    platforms = stdenv.lib.platforms.all;
  };
}

Update to the newest dev version

{ stdenv, fetchFromGitHub, autoconf, libtool, automake, libsodium, ncurses
, libtoxcore, openal, libvpx, freealut, libconfig, pkgconfig }:

stdenv.mkDerivation rec {
  name = "toxic-dev-20141130";

  src = fetchFromGitHub {
    owner = "Tox";
    repo = "toxic";
    rev = "4acfe84171";
    sha256 = "1yqglh9fm75zph4fzf3z4gwmamngypwpvb7shpqgakdg8ybq0a8s";
  };

  makeFlags = [ "-Cbuild" "PREFIX=$(out)" ];
  installFlags = [ "PREFIX=$(out)" ];

  buildInputs = [
    autoconf libtool automake libtoxcore libsodium ncurses
    libconfig pkgconfig
  ] ++ stdenv.lib.optionals (!stdenv.isArm) [
    openal libvpx freealut
  ];

  meta = with stdenv.lib; {
    description = "Reference CLI for Tox";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ viric jgeerds ];
    platforms = platforms.all;
  };
}


{ stdenv
, buildPythonPackage
, fetchPypi
, dulwich
, isPy3k
}:

buildPythonPackage rec {
  pname = "hg-git";
  version = "0.8.11";
  disabled = isPy3k;

  src = fetchPypi {
    inherit pname version;
    sha256 = "08kw1sj3sq1q1571hwkc51w20ks9ysmlg93pcnmd6gr66bz02dyn";
  };

  propagatedBuildInputs = [ dulwich ];

  meta = with stdenv.lib; {
    description = "Push and pull from a Git server using Mercurial";
    homepage = http://hg-git.github.com/;
    maintainers = with maintainers; [ koral ];
    license = stdenv.lib.licenses.gpl2;
  };

}

Update to 0.8.12 and unbreak.

{ stdenv
, buildPythonPackage
, fetchPypi
, dulwich
, isPy3k
, fetchpatch
}:

buildPythonPackage rec {
  pname = "hg-git";
  version = "0.8.12";
  disabled = isPy3k;

  src = fetchPypi {
    inherit pname version;
    sha256 = "13hbm0ki6s88r6p65ibvrbxnskinzdz0m9gsshb8s571p91ymfjn";
  };

  propagatedBuildInputs = [ dulwich ];

  # Needs patch to work with Mercurial 4.8
  # https://bitbucket.org/durin42/hg-git/issues/264/unexpected-keyword-argument-createopts-hg
  patches =
    fetchpatch {
      url = "https://bitbucket.org/rsalmaso/hg-git/commits/a778506fd4be0bf1afa75755f6ee9260fa234a0f/raw";
      sha256 = "12r4qzbc5xcqwv0kvf8g4wjji7n45421zkbf6i75vyi4nl6n4j15";
    };

  meta = with stdenv.lib; {
    description = "Push and pull from a Git server using Mercurial";
    homepage = http://hg-git.github.com/;
    maintainers = with maintainers; [ koral ];
    license = stdenv.lib.licenses.gpl2;
  };

}


{ stdenv, buildPythonPackage, fetchPypi, six }:

buildPythonPackage rec {
  pname = "whisper";
  version = "1.1.4";

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

  propagatedBuildInputs = [ six ];

  meta = with stdenv.lib; {
    homepage = http://graphite.wikidot.com/;
    description = "Fixed size round-robin style database";
    maintainers = with maintainers; [ rickynils offline basvandijk ];
    license = licenses.asl20;
  };
}

Add mock to the list of whisper's test inputs.

{ stdenv, buildPythonPackage, fetchPypi, mock, six }:

buildPythonPackage rec {
  pname = "whisper";
  version = "1.1.4";

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

  propagatedBuildInputs = [ six ];
  checkInputs           = [ mock ];

  meta = with stdenv.lib; {
    homepage = http://graphite.wikidot.com/;
    description = "Fixed size round-robin style database";
    maintainers = with maintainers; [ rickynils offline basvandijk ];
    license = licenses.asl20;
  };
}


{ nixpkgs  ? import <nixpkgs> {}
, compiler ? "ghc7101"
}:

let
  pkgs = nixpkgs.pkgs;
  ghc  = pkgs.haskell.packages.${compiler};
  f    = import <pwd>;
  drv  = ghc.callPackage f {};
in
  (pkgs.haskell.lib.addBuildTools drv [
    pkgs.git
    ghc.cabal-install
    ghc.hlint
  ]).env

Bump GHC version to 7.10.2

{ nixpkgs  ? import <nixpkgs> {}
, compiler ? "ghc7102"
}:

let
  pkgs = nixpkgs.pkgs;
  ghc  = pkgs.haskell.packages.${compiler};
  f    = import <pwd>;
  drv  = ghc.callPackage f {};
in
  (pkgs.haskell.lib.addBuildTools drv [
    pkgs.git
    ghc.cabal-install
    ghc.hlint
  ]).env


{fetchurl, stdenv, flex, bison, db4}:

stdenv.mkDerivation rec {
  name = "iproute2-2.6.29-1";

  src = fetchurl {
    url = "http://devresources.linux-foundation.org/dev/iproute2/download/${name}.tar.bz2";
    sha256 = "16zvhdzv7yqyvmwxyqa6shzsld6r0wpnk37dig69sk20wpzv1zqk";
  };

  preConfigure =
    ''
      patchShebangs ./configure
    '';

  makeFlags = "DESTDIR= LIBDIR=$(out)/lib SBINDIR=$(out)/sbin CONFDIR=$(out)/etc DOCDIR=$(out)/share/doc MANDIR=$(out)/share/man";

  buildInputs = [bison flex db4];

  meta = {
    homepage =
      http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2;
  };
}

Upgrade iproute, add meta info

{fetchurl, stdenv, flex, bison, db4, iptables}:

stdenv.mkDerivation rec {
  name = "iproute2-2.6.35";

  src = fetchurl {
    url = "http://devresources.linux-foundation.org/dev/iproute2/download/${name}.tar.bz2";
    sha256 = "18why1wy0v859axgrlfxn80zmskss0410hh9rf5gn9cr29zg9cla";
  };

  preConfigure =
    ''
      patchShebangs ./configure
      sed -e '/ARPDDIR/d' -i Makefile
    '';
  postConfigure = "cat Config";

  makeFlags = "DESTDIR= LIBDIR=$(out)/lib SBINDIR=$(out)/sbin"
   + " CONFDIR=$(out)/etc DOCDIR=$(out)/share/doc/${name}"
  + " MANDIR=$(out)/share/man";

  buildInputs = [bison flex db4 iptables];

  meta = {
    homepage =
      http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2;
    description = "A collection of utilities for controlling TCP / IP"
      + " networking and traffic control in Linux";
    platforms = stdenv.lib.platforms.linux;
  };
}


{ fetchurl, lib, stdenv, zlib, openssl, libuuid, pkg-config }:

stdenv.mkDerivation rec {
  version = "20201230";
  pname = "libewf";

  src = fetchurl {
    url = "https://github.com/libyal/libewf/releases/download/${version}/libewf-experimental-${version}.tar.gz";
    sha256 = "sha256-10r4jPzsA30nHQzjdg/VkwTG1PwOskwv8Bra34ZPMgc=";
  };

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

  meta = {
    description = "Library for support of the Expert Witness Compression Format";
    homepage = "https://sourceforge.net/projects/libewf/";
    license = lib.licenses.lgpl3;
    maintainers = [ lib.maintainers.raskin ] ;
    platforms = lib.platforms.unix;
  };
}

Add bzip2 dependency for darwin

{ fetchurl, lib, stdenv, zlib, openssl, libuuid, pkg-config, bzip2 }:

stdenv.mkDerivation rec {
  version = "20201230";
  pname = "libewf";

  src = fetchurl {
    url = "https://github.com/libyal/libewf/releases/download/${version}/libewf-experimental-${version}.tar.gz";
    sha256 = "sha256-10r4jPzsA30nHQzjdg/VkwTG1PwOskwv8Bra34ZPMgc=";
  };

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [ zlib openssl libuuid ]
    ++ lib.optionals stdenv.isDarwin [ bzip2 ];

  meta = {
    description = "Library for support of the Expert Witness Compression Format";
    homepage = "https://sourceforge.net/projects/libewf/";
    license = lib.licenses.lgpl3;
    maintainers = [ lib.maintainers.raskin ] ;
    platforms = lib.platforms.unix;
  };
}


{ stdenv
, buildPythonPackage
, fetchFromGitHub

, daemonize
, funcsigs
, pathlib2
, pbr
, pyasn1
, pynacl
, service-identity
, setuptools-trial
, signedjson
, six
, twisted
, unpaddedbase64
}:

buildPythonPackage {
  name = "sydent-2016-06-03";

  src = fetchFromGitHub {
    owner = "matrix-org";
    repo = "sydent";
    rev = "93a49497f8cad02ad0553911b60cfa0c5253ddb3";
    sha256 = "0e10a3ef8528f636041f5838440553155b0f6584f0f33311c8faef0d7980c4a4";
  };

  propagatedBuildInputs = [
    daemonize
    funcsigs
    pathlib2
    pbr
    pyasn1
    pynacl
    service-identity
    setuptools-trial
    signedjson
    six
    twisted
    unpaddedbase64
  ];

  meta = with stdenv.lib; {
    maintainers = with maintainers; [
      wkennington
    ];
    platforms = with platforms;
      x86_64-linux;
  };
}

Build a script for running

{ stdenv
, buildPythonPackage
, fetchFromGitHub

, daemonize
, funcsigs
, pathlib2
, pbr
, pyasn1
, pynacl
, service-identity
, setuptools-trial
, signedjson
, six
, twisted
, unpaddedbase64
}:

buildPythonPackage {
  name = "sydent-2016-06-03";

  src = fetchFromGitHub {
    owner = "matrix-org";
    repo = "sydent";
    rev = "93a49497f8cad02ad0553911b60cfa0c5253ddb3";
    sha256 = "0e10a3ef8528f636041f5838440553155b0f6584f0f33311c8faef0d7980c4a4";
  };

  propagatedBuildInputs = [
    daemonize
    funcsigs
    pathlib2
    pbr
    pyasn1
    pynacl
    service-identity
    setuptools-trial
    signedjson
    six
    twisted
    unpaddedbase64
  ];

  postInstall = ''
    mkdir -p $out/bin
    echo '#!/bin/sh' >> "$out/bin/sydent"
    echo "export PYTHONPATH='$PYTHONPATH'" >> "$out/bin/sydent"
    echo "$(command -v python) -m sydent.sydent \"\$@\"" >> "$out/bin/sydent"
    chmod +x "$out/bin/sydent"
  '';

  meta = with stdenv.lib; {
    maintainers = with maintainers; [
      wkennington
    ];
    platforms = with platforms;
      x86_64-linux;
  };
}


{ stdenv
, buildPythonPackage
, fetchPypi
, pyparsing
, graphviz
}:

buildPythonPackage rec {
  name = "${pname}-${version}";
  pname = "pydotplus";
  version = "2.0.2";

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

  propagatedBuildInputs = [
    pyparsing
    graphviz
  ];

  meta = {
    homepage = https://code.google.com/p/pydot/;
    description = "An improved version of the old pydot project that provides a Python Interface to Graphviz’s Dot language";
  };
}

Update homepage, add license and maintainers.

{ stdenv
, buildPythonPackage
, fetchPypi
, pyparsing
, graphviz
}:

buildPythonPackage rec {
  name = "${pname}-${version}";
  pname = "pydotplus";
  version = "2.0.2";

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

  propagatedBuildInputs = [
    pyparsing
    graphviz
  ];

  meta = with stdenv.lib; {
    homepage = https://github.com/erocarrera/pydot;
    description = "An improved version of the old pydot project that provides a Python Interface to Graphviz’s Dot language";
    license = licenses.mit;
    maintainers = with maintainers; [ ashgillman ];
  };
}


{stdenv, fetchurl, ncurses, tcl, openssl, pam, pkgconfig, gettext, kerberos
, openldap
}:
let
  s =
  rec {
    version = "2.00";
    url = "ftp://ftp.cac.washington.edu/alpine/alpine-${version}.tar.bz2";
    sha256 = "19m2w21dqn55rhxbh5lr9qarc2fqa9wmpj204jx7a0zrb90bhpf8";
    baseName = "alpine";
    name = "${baseName}-${version}";
  };
  buildInputs = [
    ncurses tcl openssl pam kerberos openldap
  ];
in
stdenv.mkDerivation {
  inherit (s) name version;
  inherit buildInputs;
  src = fetchurl {
    inherit (s) url sha256;
  };
  configureFlags = [
    "--with-ssl-include-dir=${openssl}/include/openssl"
    "--with-tcl-lib=tcl8.5"
    ];
  meta = {
    inherit (s) version;
    description = ''Console mail reader'';
    license = stdenv.lib.licenses.asl20;
    maintainers = [stdenv.lib.maintainers.raskin];
    platforms = stdenv.lib.platforms.linux;
    homepage = "https://www.washington.edu/alpine/";
  };
}

Fix the libgcc_s problem in alpine

{stdenv, fetchurl, ncurses, tcl, openssl, pam, pkgconfig, gettext, kerberos
, openldap
}:
let
  s =
  rec {
    version = "2.00";
    url = "ftp://ftp.cac.washington.edu/alpine/alpine-${version}.tar.bz2";
    sha256 = "19m2w21dqn55rhxbh5lr9qarc2fqa9wmpj204jx7a0zrb90bhpf8";
    baseName = "alpine";
    name = "${baseName}-${version}";
  };
  buildInputs = [
    ncurses tcl openssl pam kerberos openldap
  ];
in
stdenv.mkDerivation {
  inherit (s) name version;
  inherit buildInputs;
  src = fetchurl {
    inherit (s) url sha256;
  };
  configureFlags = [
    "--with-ssl-include-dir=${openssl}/include/openssl"
    "--with-tcl-lib=tcl8.5"
    ];
  preConfigure = ''
    export NIX_LDFLAGS="$NIX_LDFLAGS -lgcc_s"
  '';
  meta = {
    inherit (s) version;
    description = ''Console mail reader'';
    license = stdenv.lib.licenses.asl20;
    maintainers = [stdenv.lib.maintainers.raskin];
    platforms = stdenv.lib.platforms.linux;
    homepage = "https://www.washington.edu/alpine/";
  };
}


{ stdenv, fetchurl }:

stdenv.mkDerivation {
  name = "keychain-2.7.1";

  src = fetchurl {
    url = mirror://gentoo/distfiles/keychain-2.7.1.tar.bz2;
    sha256 = "14ai6wjwnj09xnl81ar2dlr5kwb8y1k5ck6nc549shpng0zzw1qi";
  };

  phases = "unpackPhase buildPhase";

  buildPhase =
    ''
      mkdir -p $out/bin
      cp keychain $out/bin
    '';

  meta = {
    description = "Keychain management tool";
    homepage = "http://www.gentoo.org/proj/en/keychain/";
    license = "GPL2";
  };
}

Add missing binaries to PATH

{ stdenv, fetchurl, makeWrapper, coreutils, openssh, gnupg
, procps, gnugrep, gawk, findutils, gnused }:

stdenv.mkDerivation {
  name = "keychain-2.7.1";

  src = fetchurl {
    url = mirror://gentoo/distfiles/keychain-2.7.1.tar.bz2;
    sha256 = "14ai6wjwnj09xnl81ar2dlr5kwb8y1k5ck6nc549shpng0zzw1qi";
  };

  phases = [ "unpackPhase" "buildPhase" ];

  buildInputs = [ makeWrapper ];

  buildPhase = ''
    mkdir -p $out/bin
    cp keychain $out/bin
    wrapProgram $out/bin/keychain \
      --prefix PATH ":" "${coreutils}/bin" \
      --prefix PATH ":" "${openssh}/bin" \
      --prefix PATH ":" "${gnupg}/bin" \
      --prefix PATH ":" "${gnugrep}/bin" \
      --prefix PATH ":" "${gnused}/bin" \
      --prefix PATH ":" "${findutils}/bin" \
      --prefix PATH ":" "${gawk}/bin" \
      --prefix PATH ":" "${procps}/bin"
  '';

  meta = {
    description = "Keychain management tool";
    homepage = "http://www.gentoo.org/proj/en/keychain/";
    license = "GPL2";
  };
}


{stdenv, fetchurl, openssl, pkgconfig
, withPerl ? false, perl
, withPython ? false, python3
, withTcl ? false, tcl
, withCyrus ? true, cyrus_sasl
}:

with stdenv.lib;
stdenv.mkDerivation rec {
  name = "znc-1.0";
  src = fetchurl {
    url = "http://znc.in/releases/${name}.tar.gz";
    sha256 = "0ah6890ngvj97kah3x7fd8yzi6dpdgrxw1b2skj2cyv98bd3jmd8";
  };

  buildInputs = [ openssl pkgconfig ]
    ++ optional withPerl perl
    ++ optional withPython python3
    ++ optional withTcl tcl
    ++ optional withCyrus cyrus_sasl;

  configureFlags = optionalString withPerl "--enable-perl "
    + optionalString withPython "--enable-python "
    + optionalString withTcl "--enable-tcl --with-tcl=${tcl}/lib "
    + optionalString withCyrus "--enable-cyrus ";

  meta = {
    description = "Advanced IRC bouncer";
    homepage = http://wiki.znc.in/ZNC;
    maintainers = [ stdenv.lib.maintainers.viric ];
    license = "ASL2.0";
    platforms = stdenv.lib.platforms.unix;
  };
}

Update from 1.0 -> 1.2

{ stdenv, fetchurl, openssl, pkgconfig
, withPerl ? false, perl
, withPython ? false, python3
, withTcl ? false, tcl
, withCyrus ? true, cyrus_sasl
}:

with stdenv.lib;
stdenv.mkDerivation rec {
  name = "znc-1.2";

  src = fetchurl {
    url = "http://znc.in/releases/${name}.tar.gz";
    sha256 = "07bh306wl5494sqsgz4a526wvyrylkc8vpnbr5pkxwjg90mcv8nr";
  };

  buildInputs = [ openssl pkgconfig ]
    ++ optional withPerl perl
    ++ optional withPython python3
    ++ optional withTcl tcl
    ++ optional withCyrus cyrus_sasl;

  configureFlags = optionalString withPerl "--enable-perl "
    + optionalString withPython "--enable-python "
    + optionalString withTcl "--enable-tcl --with-tcl=${tcl}/lib "
    + optionalString withCyrus "--enable-cyrus ";

  meta = with stdenv.lib; {
    description = "Advanced IRC bouncer";
    homepage = http://wiki.znc.in/ZNC;
    maintainers = with maintainers; [ viric ];
    license = licenses.asl20;
    platforms = platforms.unix;
  };
}


{ stdenv, fetchurl }:
stdenv.mkDerivation rec {
  name = "matio-1.5.17";
  src = fetchurl {
    url = "mirror://sourceforge/matio/${name}.tar.gz";
    sha256 = "00644612zhn53j25vj50q73kmjcrsns2lnmy99y2kavhsckmaiay";
  };

  meta = with stdenv.lib; {
    description = "A C library for reading and writing Matlab MAT files";
    license = licenses.bsd2;
    platforms = platforms.all;
    maintainers = [ maintainers.vbgl ];
    homepage = "http://matio.sourceforge.net/";
  };
}

Update matio: 1.5.17 -> 1.5.18

{ stdenv, fetchurl }:
stdenv.mkDerivation rec {
  name = "matio-1.5.18";
  src = fetchurl {
    url = "mirror://sourceforge/matio/${name}.tar.gz";
    sha256 = "09gy507zm1gxxyxf5qapzgars51pm16wis7lqqf84kc57ak73baz";
  };

  meta = with stdenv.lib; {
    description = "A C library for reading and writing Matlab MAT files";
    license = licenses.bsd2;
    platforms = platforms.all;
    maintainers = [ maintainers.vbgl ];
    homepage = "http://matio.sourceforge.net/";
  };
}


{ stdenv, fetchurl, gmp }:

stdenv.mkDerivation rec {
  name = "mpfr-3.1.3";

  src = fetchurl {
    url = "mirror://gnu/mpfr/${name}.tar.bz2";
    sha256 = "1z8akfw9wbmq91vrx04bw86mmnxw2sw5qm5cr8ix5b3w2mcv8fzn";
  };

  patches = [ ./upstream.patch ];

  # mpfr.h requires gmp.h
  propagatedBuildInputs = [ gmp ];

  configureFlags =
    stdenv.lib.optional stdenv.is64bit "--with-pic";

  doCheck = true;

  enableParallelBuilding = true;

  meta = {
    homepage = http://www.mpfr.org/;
    description = "Library for multiple-precision floating-point arithmetic";

    longDescription = ''
      The GNU MPFR library is a C library for multiple-precision
      floating-point computations with correct rounding.  MPFR is
      based on the GMP multiple-precision library.

      The main goal of MPFR is to provide a library for
      multiple-precision floating-point computation which is both
      efficient and has a well-defined semantics.  It copies the good
      ideas from the ANSI/IEEE-754 standard for double-precision
      floating-point arithmetic (53-bit mantissa).
    '';

    license = stdenv.lib.licenses.lgpl2Plus;

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

Fix MPFR build again on SmartOS.

{ stdenv, fetchurl, gmp }:

stdenv.mkDerivation rec {
  name = "mpfr-3.1.3";

  src = fetchurl {
    url = "mirror://gnu/mpfr/${name}.tar.bz2";
    sha256 = "1z8akfw9wbmq91vrx04bw86mmnxw2sw5qm5cr8ix5b3w2mcv8fzn";
  };

  patches = [ ./upstream.patch ];

  # mpfr.h requires gmp.h
  propagatedBuildInputs = [ gmp ];

  configureFlags =
    stdenv.lib.optional stdenv.isSunOS "--disable-thread-safe" ++
    stdenv.lib.optional stdenv.is64bit "--with-pic";

  doCheck = true;

  enableParallelBuilding = true;

  meta = {
    homepage = http://www.mpfr.org/;
    description = "Library for multiple-precision floating-point arithmetic";

    longDescription = ''
      The GNU MPFR library is a C library for multiple-precision
      floating-point computations with correct rounding.  MPFR is
      based on the GMP multiple-precision library.

      The main goal of MPFR is to provide a library for
      multiple-precision floating-point computation which is both
      efficient and has a well-defined semantics.  It copies the good
      ideas from the ANSI/IEEE-754 standard for double-precision
      floating-point arithmetic (53-bit mantissa).
    '';

    license = stdenv.lib.licenses.lgpl2Plus;

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


{ pkgs, ident ? "oogabooga" }:
{
  # `dockerTools.pullImage` will pull the image outside of docker and
  # save it as a `.tar.gz` which we can `docker load`. The `ident`
  # could be used to refer to an image's ID, but for now it is just
  # the example string `exampleid`.

  # When referring to the collins-container package later, it will
  # look like this:
  # ```
  # pkgs.collins-container = {
  #   img = /nix/store/....tumblr-collins-exampleid.tar.gz;
  #   ident = "exampleid";
  # };
  # ```
  img = pkgs.dockerTools.pullImage {
    imageName = "tumblr/collins";
    sha256 = "0x22q0a9r885xjzc0ffl4xs9g5w66sqgxid822r874h46rpzzkzx";
    inherit ident;
  };
  inherit ident;
}

Update the hash for the collins container

{ pkgs, ident ? "oogabooga" }:
{
  # `dockerTools.pullImage` will pull the image outside of docker and
  # save it as a `.tar.gz` which we can `docker load`. The `ident`
  # could be used to refer to an image's ID, but for now it is just
  # the example string `exampleid`.

  # When referring to the collins-container package later, it will
  # look like this:
  # ```
  # pkgs.collins-container = {
  #   img = /nix/store/....tumblr-collins-exampleid.tar.gz;
  #   ident = "exampleid";
  # };
  # ```
  img = pkgs.dockerTools.pullImage {
    imageName = "tumblr/collins";
    sha256 = "1k9gcv9xmzawbr4dnh9pcl2akbp65h4kda9ay6k1500ag9jmjkmn";
    inherit ident;
  };
  inherit ident;
}


{ stdenv, fetchurl, devicemapper, libgcrypt, libuuid, pkgconfig, popt }:

stdenv.mkDerivation rec {
  name = "cryptsetup-1.5.1";

  src = fetchurl {
    url = "http://cryptsetup.googlecode.com/files/${name}.tar.bz2";
    sha256 = "0dib3nw6ifd7d7hr9k4iyaha3hz0pkzairqa38l3fndkr9w3zlhn";
  };

  configureFlags = "--enable-cryptsetup-reencrypt";

  buildInputs = [ devicemapper libgcrypt libuuid pkgconfig popt ];

  meta = {
    homepage = http://code.google.com/p/cryptsetup/;
    description = "LUKS for dm-crypt";
    license = "GPLv2";
    maintainers = with stdenv.lib.maintainers; [ viric chaoflow ];
    platforms = with stdenv.lib.platforms; linux;
  };
}

Allow to build with Python support.

{ stdenv, fetchurl, devicemapper, libgcrypt, libuuid, pkgconfig, popt
, enablePython ? false, python ? null
}:

assert enablePython -> python != null;

stdenv.mkDerivation rec {
  name = "cryptsetup-1.5.1";

  src = fetchurl {
    url = "http://cryptsetup.googlecode.com/files/${name}.tar.bz2";
    sha256 = "0dib3nw6ifd7d7hr9k4iyaha3hz0pkzairqa38l3fndkr9w3zlhn";
  };

  configureFlags = [ "--enable-cryptsetup-reencrypt" ]
                ++ stdenv.lib.optional enablePython "--enable-python";

  buildInputs = [ devicemapper libgcrypt libuuid pkgconfig popt ]
             ++ stdenv.lib.optional enablePython python;

  meta = {
    homepage = http://code.google.com/p/cryptsetup/;
    description = "LUKS for dm-crypt";
    license = "GPLv2";
    maintainers = with stdenv.lib.maintainers; [ viric chaoflow ];
    platforms = with stdenv.lib.platforms; linux;
  };
}