{ pkgs, ... }:

{
  # fix issue of missing frei0r plugins,
  # see https://github.com/NixOS/nixpkgs/issues/29614#issuecomment-511118058
  nixpkgs.config.packageOverrides = pkgs: {
    kdenlive = pkgs.kdenlive.overrideAttrs (oldAttrs: rec {
        postInstall = ''
         wrapProgram $out/bin/kdenlive --prefix FREI0R_PATH : ${pkgs.frei0r}/lib/frei0r-1
       '';
       nativeBuildInputs = oldAttrs.nativeBuildInputs or [] ++ [ pkgs.makeWrapper ];
    });
  };

  environment.systemPackages = with pkgs; [
    (ffmpeg-full.override {
      nonfreeLicensing = true;
      nvenc = true;
    })
    kdenlive
    breeze-icons # icon set used in kdenlive
    audacity
  ];
}

Remove workaround for missing frei0r plugins in Kdenlive

{ pkgs, ... }:

{
  environment.systemPackages = with pkgs; [
    (ffmpeg-full.override {
      nonfreeLicensing = true;
      nvenc = true;
    })
    kdenlive
    breeze-icons # icon set used in kdenlive
    audacity
  ];
}


{ stdenv, fetchurl }:

# at runtime, need jre or jdk

stdenv.mkDerivation rec {
  name = "scala-2.9.2";

  src = fetchurl {
    url = "http://www.scala-lang.org/downloads/distrib/files/${name}.tgz";
    sha256 = "0s1shpzw2hyz7bwxdqq19rcrzbpq4d7b0kvdvjvhy7h05x496b46";
  };

  installPhase = ''
    mkdir -p $out
    rm "bin/"*.bat
    mv * $out
  '';

  meta = {
    description = "Scala is a general purpose programming language";
    longDescription = ''
      Scala is a general purpose programming language designed to express
      common programming patterns in a concise, elegant, and type-safe way.
      It smoothly integrates features of object-oriented and functional
      languages, enabling Java and other programmers to be more productive.
      Code sizes are typically reduced by a factor of two to three when
      compared to an equivalent Java application.
    '';
    homepage = http://www.scala-lang.org/;
    license = "BSD";
    platforms = stdenv.lib.platforms.all;
  };
}

Remove scalacheck.jar from scala's classpath

{ stdenv, fetchurl }:

# at runtime, need jre or jdk

stdenv.mkDerivation rec {
  name = "scala-2.9.2";

  src = fetchurl {
    url = "http://www.scala-lang.org/downloads/distrib/files/${name}.tgz";
    sha256 = "0s1shpzw2hyz7bwxdqq19rcrzbpq4d7b0kvdvjvhy7h05x496b46";
  };

  installPhase = ''
    mkdir -p $out
    rm bin/*.bat
    rm lib/scalacheck.jar
    mv * $out
  '';

  meta = {
    description = "Scala is a general purpose programming language";
    longDescription = ''
      Scala is a general purpose programming language designed to express
      common programming patterns in a concise, elegant, and type-safe way.
      It smoothly integrates features of object-oriented and functional
      languages, enabling Java and other programmers to be more productive.
      Code sizes are typically reduced by a factor of two to three when
      compared to an equivalent Java application.
    '';
    homepage = http://www.scala-lang.org/;
    license = "BSD";
    platforms = stdenv.lib.platforms.all;
  };
}


{stdenv, fetchgit, kernel, ...}:

stdenv.mkDerivation {
  src = fetchgit {
    url="git://github.com/mkottman/acpi_call.git";
    rev="4f71ce83392bc52b3497";
    sha256="1f20516dc7d42bc7d9d71eaa54f48f38cd56b8683062f81d6f3857990056bdd3";
  };
  name = "acpi-call";

  preBuild = ''
    sed -e 's/break/true/' -i test_off.sh
    sed -e 's@/bin/bash@.bin/sh@' -i test_off.sh
    sed -e "s@/lib/modules@${kernel}/&@" -i Makefile
  '';

  installPhase = ''
    kernelVersion=$(cd ${kernel}/lib/modules && ls)
    ensureDir $out/lib/modules/$kernelVersion/misc
    cp acpi_call.ko $out/lib/modules/$kernelVersion/misc
    ensureDir $out/bin
    cp test_off.sh $out/bin/test_discrete_video_off.sh
  '';

  meta = {
    maintainers = [stdenv.lib.maintainers.raskin];
    platforms = stdenv.lib.platforms.linux;
    description = "A module allowing arbitrary ACPI calls; use case: hybrid video";
  };
}

Fix acpi_call kernel version reference

{stdenv, fetchgit, kernel, ...}:

stdenv.mkDerivation {
  src = fetchgit {
    url="git://github.com/mkottman/acpi_call.git";
    rev="4f71ce83392bc52b3497";
    sha256="1f20516dc7d42bc7d9d71eaa54f48f38cd56b8683062f81d6f3857990056bdd3";
  };
  name = "acpi-call";

  preBuild = ''
    kernelVersion=$(cd ${kernel}/lib/modules && ls)
    sed -e 's/break/true/' -i test_off.sh
    sed -e 's@/bin/bash@.bin/sh@' -i test_off.sh
    sed -e "s@/lib/modules/\$(.*)@${kernel}/lib/modules/$kernelVersion@" -i Makefile
  '';

  installPhase = ''
    kernelVersion=$(cd ${kernel}/lib/modules && ls)
    ensureDir $out/lib/modules/$kernelVersion/misc
    cp acpi_call.ko $out/lib/modules/$kernelVersion/misc
    ensureDir $out/bin
    cp test_off.sh $out/bin/test_discrete_video_off.sh
  '';

  meta = {
    maintainers = [stdenv.lib.maintainers.raskin];
    platforms = stdenv.lib.platforms.linux;
    description = "A module allowing arbitrary ACPI calls; use case: hybrid video";
  };
}


{ config, pkgs, ... }:

{

  # Use config files instead of config.nixpkgs module for nix-env etc.
  nixpkgs.config = import ./nixpkgs-config.nix;
  xdg.configFile."nixpkgs/config.nix".source = ./nixpkgs-config.nix;
  xdg.configFile."nixpkgs/overlays.nix".source = ./nixpkgs-overlays.nix;

  # TODO nix.conf holds substituters and should be writable by e.g. 'cachix use'
  # Possible solution: script to quickly 'swap' ./nix.conf with
  # .config/nix/nix.conf for the occasional use.
  xdg.configFile."nix/nix.conf".source = ./nix.conf;

  # Provide a compatible locale-archive to nix applications using
  # LOCALE_ARCHIVE. This avoids problems where the host's glibc is newer and
  # locales are incompatible.
  home.sessionVariables = {
    LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
  };

  # Locate missing commands using nix-index
  programs.zsh.initExtra = ''
    source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh
  '';

  home.packages = [
    pkgs.cachix # nix cache
    pkgs.nix # the tool
    pkgs.nix-index # locate for nix
    pkgs.nixfmt # format nix
    pkgs.nixpkgs-fmt # format nix the nixpkgs way
  ];
}

Remove the 'nix' command from user profile

{ config, pkgs, ... }:

{

  # Use config files instead of config.nixpkgs module for nix-env etc.
  nixpkgs.config = import ./nixpkgs-config.nix;
  xdg.configFile."nixpkgs/config.nix".source = ./nixpkgs-config.nix;
  xdg.configFile."nixpkgs/overlays.nix".source = ./nixpkgs-overlays.nix;

  # TODO nix.conf holds substituters and should be writable by e.g. 'cachix use'
  # Possible solution: script to quickly 'swap' ./nix.conf with
  # .config/nix/nix.conf for the occasional use.
  xdg.configFile."nix/nix.conf".source = ./nix.conf;

  # Provide a compatible locale-archive to nix applications using
  # LOCALE_ARCHIVE. This avoids problems where the host's glibc is newer and
  # locales are incompatible.
  home.sessionVariables = {
    LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
  };

  # Locate missing commands using nix-index
  programs.zsh.initExtra = ''
    source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh
  '';

  home.packages = [
    pkgs.cachix # nix cache
    pkgs.nix-index # locate for nix
    pkgs.nixfmt # format nix
    pkgs.nixpkgs-fmt # format nix the nixpkgs way
  ];
}


{ buildPythonPackage
, lib
, fetchPypi
}:

buildPythonPackage rec {
  pname = "XStatic-Bootstrap";
  version = "4.1.3.1";

  src = fetchPypi {
    inherit version pname;
    sha256 = "1800e6bb5fc687604d8a893eee8c7882d800a6f3d6721799016f99a47d1dac0f";
  };

  # no tests implemented
  doCheck = false;

  meta = with lib;{
    homepage = http://getbootstrap.com;
    description = "Bootstrap packaged static files for python";
    license = licenses.mit;
    maintainers = with maintainers; [ makefu ];
  };

}

Revert "python: XStatic-Bootstrap: 3.3.7.1 -> 4.1.3.1"

{ buildPythonPackage
, lib
, fetchPypi
}:

buildPythonPackage rec {
  pname = "XStatic-Bootstrap";
  version = "3.3.7.1";

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

  # no tests implemented
  doCheck = false;

  meta = with lib;{
    homepage = http://getbootstrap.com;
    description = "Bootstrap packaged static files for python";
    license = licenses.mit;
    maintainers = with maintainers; [ makefu ];
  };

}


{
  services.xserver.enable = true;
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.desktopManager.gnome3.enable = true;
}

Use new gnome desktop manager option

{
  services.xserver.enable = true;
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.desktopManager.gnome.enable = true;
}


{dysnomia, disnix, disnixos}:
{config, pkgs, ...}:

{
  virtualisation.writableStore = true;
  virtualisation.memorySize = 1024;
  virtualisation.diskSize = 10240;
  virtualisation.pathsInNixDB = [ pkgs.stdenv ];

  ids.gids = { disnix = 200; };
  users.extraGroups = [ { gid = 200; name = "disnix"; } ];

  services.dbus.enable = true;
  services.dbus.packages = [ disnix ];
  services.openssh.enable = true;

  jobs.ssh.restartIfChanged = false;

  jobs.disnix =
    { description = "Disnix server";

      wantedBy = [ "multi-user.target" ];
      after = [ "dbus.service" ];

      path = [ pkgs.nix disnix dysnomia ];

      environment = {
        HOME = "/root";
      };

      exec = "disnix-service";
    };

    environment.systemPackages = [ pkgs.nix dysnomia disnix disnixos pkgs.hello pkgs.zip pkgs.nixops ];
}

Use unstable nixops for the testcases

{dysnomia, disnix, disnixos}:
{config, pkgs, ...}:

{
  virtualisation.writableStore = true;
  virtualisation.memorySize = 1024;
  virtualisation.diskSize = 10240;
  virtualisation.pathsInNixDB = [ pkgs.stdenv ];

  ids.gids = { disnix = 200; };
  users.extraGroups = [ { gid = 200; name = "disnix"; } ];

  services.dbus.enable = true;
  services.dbus.packages = [ disnix ];
  services.openssh.enable = true;

  jobs.ssh.restartIfChanged = false;

  jobs.disnix =
    { description = "Disnix server";

      wantedBy = [ "multi-user.target" ];
      after = [ "dbus.service" ];

      path = [ pkgs.nix disnix dysnomia ];

      environment = {
        HOME = "/root";
      };

      exec = "disnix-service";
    };

    environment.systemPackages = [ pkgs.nix dysnomia disnix disnixos pkgs.hello pkgs.zip pkgs.nixopsUnstable ];
}


{ lib
, pythonOlder
, buildPythonPackage
, fetchFromGitHub
, gmt
, numpy
, netcdf4
, pandas
, packaging
, xarray
}:

buildPythonPackage rec {
  pname = "pygmt";
  version = "0.2.0";

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "GenericMappingTools";
    repo = "pygmt";
    rev = "v${version}";
    sha256 = "1yx1n6mxfmwg69ls5560nm6d3jxyghv27981iplz7m7990bbp468";
  };

  postPatch = ''
    substituteInPlace pygmt/clib/loading.py \
      --replace "env.get(\"GMT_LIBRARY_PATH\", \"\")" "env.get(\"GMT_LIBRARY_PATH\", \"${gmt}/lib\")"
  '';

  propagatedBuildInputs = [ numpy netcdf4 pandas packaging xarray ];

  doCheck = false; # requires network access

  postBuild = "export HOME=$TMP";

  pythonImportsCheck = [ "pygmt" ];

  meta = with lib; {
    description = "A Python interface for the Generic Mapping Tools";
    homepage = "https://github.com/GenericMappingTools/pygmt";
    license = licenses.bsd3;
    maintainers = with maintainers; [ sikmir ];
  };
}

Mark as broken on darwin

{ stdenv
, pythonOlder
, buildPythonPackage
, fetchFromGitHub
, gmt
, numpy
, netcdf4
, pandas
, packaging
, xarray
}:

buildPythonPackage rec {
  pname = "pygmt";
  version = "0.2.0";

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "GenericMappingTools";
    repo = "pygmt";
    rev = "v${version}";
    sha256 = "1yx1n6mxfmwg69ls5560nm6d3jxyghv27981iplz7m7990bbp468";
  };

  postPatch = ''
    substituteInPlace pygmt/clib/loading.py \
      --replace "env.get(\"GMT_LIBRARY_PATH\", \"\")" "env.get(\"GMT_LIBRARY_PATH\", \"${gmt}/lib\")"
  '';

  propagatedBuildInputs = [ numpy netcdf4 pandas packaging xarray ];

  doCheck = false; # requires network access

  postBuild = "export HOME=$TMP";

  pythonImportsCheck = [ "pygmt" ];

  meta = with stdenv.lib; {
    description = "A Python interface for the Generic Mapping Tools";
    homepage = "https://github.com/GenericMappingTools/pygmt";
    license = licenses.bsd3;
    # pygmt.exceptions.GMTCLibNotFoundError: Error loading the GMT shared library '/nix/store/r3xnnqgl89vrnq0kzxx0bmjwzks45mz8-gmt-6.1.1/lib/libgmt.dylib'
    broken = stdenv.isDarwin;
    maintainers = with maintainers; [ sikmir ];
  };
}


{ lib, stdenv
, fetchurl
, meson
, ninja
, pkg-config
, gettext
, itstool
, desktop-file-utils
, gnome
, glib
, gtk3
, libexif
, libtiff
, colord
, colord-gtk
, libcanberra-gtk3
, lcms2
, vte
, exiv2
}:

stdenv.mkDerivation rec {
  pname = "gnome-color-manager";
  version = "3.36.0";

  src = fetchurl {
    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
    sha256 = "nduea2Ry4RmAE4H5CQUzLsHUJYmBchu6gxyiRs6zrTs=";
  };

  nativeBuildInputs = [
    meson
    ninja
    pkg-config
    gettext
    itstool
    desktop-file-utils
  ];

  buildInputs = [
    glib
    gtk3
    libexif
    libtiff
    colord
    colord-gtk
    libcanberra-gtk3
    lcms2
    vte
    exiv2
  ];

  passthru = {
    updateScript = gnome.updateScript {
      packageName = pname;
      attrPath = "gnome.${pname}";
    };
  };

  meta = with lib; {
    description = "A set of graphical utilities for color management to be used in the GNOME desktop";
    license = licenses.gpl2Plus;
    maintainers = teams.gnome.members;
    platforms = platforms.linux;
  };
}

Revert "gnome.gnome-color-manager: 3.32.0 → 3.36.0"

{ lib, stdenv
, fetchurl
, meson
, ninja
, pkg-config
, gettext
, itstool
, desktop-file-utils
, gnome
, glib
, gtk3
, libexif
, libtiff
, colord
, colord-gtk
, libcanberra-gtk3
, lcms2
, vte
, exiv2
}:

stdenv.mkDerivation rec {
  pname = "gnome-color-manager";
  version = "3.32.0";

  src = fetchurl {
    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
    sha256 = "1vpxa2zjz3lkq9ldjg0fl65db9s6b4kcs8nyaqfz3jygma7ifg3w";
  };

  nativeBuildInputs = [
    meson
    ninja
    pkg-config
    gettext
    itstool
    desktop-file-utils
  ];

  buildInputs = [
    glib
    gtk3
    libexif
    libtiff
    colord
    colord-gtk
    libcanberra-gtk3
    lcms2
    vte
    exiv2
  ];

  passthru = {
    updateScript = gnome.updateScript {
      packageName = pname;
      attrPath = "gnome.${pname}";
    };
  };

  meta = with lib; {
    description = "A set of graphical utilities for color management to be used in the GNOME desktop";
    license = licenses.gpl2Plus;
    maintainers = teams.gnome.members;
    platforms = platforms.linux;
  };
}


{ stdenv, fetchurl }:

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

  src = fetchurl {
    url = "https://git.sr.ht/~sircmpwn/scdoc/snapshot/scdoc-${version}.tar.xz";
    sha256 = "1hhvg9cifx1v8b5i91lgq5cjdcskzl3rz7vwmwdq7ad0nqnykz82";
  };

  postPatch = ''
    substituteInPlace Makefile \
      --replace "-static" "" \
      --replace "/usr/local" "$out"
    # It happens from time to time that the version wasn't updated:
    sed -iE 's/VERSION=[0-9]\.[0-9]\.[0-9]/VERSION=${version}/' Makefile
  '';

  doCheck = true;

  meta = with stdenv.lib; {
    description = "A simple man page generator";
    longDescription = ''
      scdoc is a simple man page generator written for POSIX systems written in
      C99.
    '';
    homepage = https://git.sr.ht/~sircmpwn/scdoc/;
    license = licenses.mit;
    platforms = platforms.unix;
    maintainers = with maintainers; [ primeos ];
  };
}

Switch to fetchgit because the archive is unavailable

{ stdenv, fetchgit }:

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

  src = fetchgit {
    url = "https://git.sr.ht/~sircmpwn/scdoc";
    rev = version;
    sha256 = "00a23kw8d36qik6h5kds13pzfnr58krlblfh9n2f0rldf0m9ldk1";
  };

  postPatch = ''
    substituteInPlace Makefile \
      --replace "-static" "" \
      --replace "/usr/local" "$out"
    # It happens from time to time that the version wasn't updated:
    sed -iE 's/VERSION=[0-9]\.[0-9]\.[0-9]/VERSION=${version}/' Makefile
  '';

  doCheck = true;

  meta = with stdenv.lib; {
    description = "A simple man page generator";
    longDescription = ''
      scdoc is a simple man page generator written for POSIX systems written in
      C99.
    '';
    homepage = https://git.sr.ht/~sircmpwn/scdoc/;
    license = licenses.mit;
    platforms = platforms.unix;
    maintainers = with maintainers; [ primeos ];
  };
}


{ sources ? null }:
let
  deps = import ./nix/deps.nix { inherit sources; };
  pkgs = deps.pkgs;
  caBundle = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";

in pkgs.mkShell {
  name = "ekklesia-portal";
  buildInputs = deps.shellInputs;
  # A pure nix shell breaks SSL for git and nix tools which is fixed by setting the path to the certificate bundle.
  shellHook = ''
    export PYTHONPATH=./src:../ekklesia-common/src
    export PATH=${deps.shellPath}
    export NIX_SSL_CERT_FILE=${caBundle}
    export SSL_CERT_FILE=${caBundle}
    export SASS_PATH=${deps.sassPath}
    export JS_PATH=${deps.jsPath}
    export WEBFONTS_PATH=${deps.webfontsPath}
  '';
}

Fix for newer lorri versions

{ sources ? null }:
let
  deps = import ./nix/deps.nix { inherit sources; };
  pkgs = deps.pkgs;
  caBundle = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";

in pkgs.mkShell {
  name = "ekklesia-portal";
  buildInputs = deps.shellInputs;
  # A pure nix shell breaks SSL for git and nix tools which is fixed by setting the path to the certificate bundle.
  shellHook = ''
    export PYTHONPATH=./src:../ekklesia-common/src
    export PATH=${deps.shellPath}:$PATH
    export NIX_SSL_CERT_FILE=${caBundle}
    export SSL_CERT_FILE=${caBundle}
    export SASS_PATH=${deps.sassPath}
    export JS_PATH=${deps.jsPath}
    export WEBFONTS_PATH=${deps.webfontsPath}
  '';
}


{ cairo, fetchzip, glib, gnome3, gobjectIntrospection, pkgconfig, stdenv }:

stdenv.mkDerivation rec {
  name = "osm-gps-map-${version}";
  version = "1.1.0";

  src = fetchzip {
    url = "https://github.com/nzjrs/osm-gps-map/releases/download/${version}/osm-gps-map-${version}.tar.gz";
    sha256 = "0fal3mqcf3yypir4f7njz0dm5wr7lqwpimjx28wz9imh48cqx9n9";
  };

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

  nativeBuildInputs = [ pkgconfig ];

  buildInputs = [
    cairo glib gobjectIntrospection
  ] ++ (with gnome3; [
    gnome-common gtk libsoup
  ]);

  meta = with stdenv.lib; {
    description = "Gtk+ widget for displaying OpenStreetMap tiles";
    homepage = https://nzjrs.github.io/osm-gps-map;
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ hrdinka ];
    platforms = platforms.linux;
  };
}

Add macOS as a supported platform

{ cairo, fetchzip, glib, gnome3, gobjectIntrospection, pkgconfig, stdenv }:

stdenv.mkDerivation rec {
  name = "osm-gps-map-${version}";
  version = "1.1.0";

  src = fetchzip {
    url = "https://github.com/nzjrs/osm-gps-map/releases/download/${version}/osm-gps-map-${version}.tar.gz";
    sha256 = "0fal3mqcf3yypir4f7njz0dm5wr7lqwpimjx28wz9imh48cqx9n9";
  };

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

  nativeBuildInputs = [ pkgconfig ];

  buildInputs = [
    cairo glib gobjectIntrospection
  ] ++ (with gnome3; [
    gnome-common gtk libsoup
  ]);

  meta = with stdenv.lib; {
    description = "Gtk+ widget for displaying OpenStreetMap tiles";
    homepage = https://nzjrs.github.io/osm-gps-map;
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ hrdinka ];
    platforms = platforms.linux ++ platforms.darwin;
  };
}


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

Update beta and dev channels.

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


{ config, pkgs, ... }:
{
  programs.git = {
    enable = true;
    lfs.enable = true;
    userName = "Cyryl Płotnicki";
    userEmail = "cyplo@cyplo.net";
    delta = {
      enable = true;
      options = {
        line-numbers = true;
        syntax-theme = "Solarized (dark)";
      };
    };
    extraConfig = {
      colour.ui = true;
      credential = { helper ="cache"; };
      diff.algorithm = "histogram";
      diff.renameLimit = 2048;
      diff.renames = "copy";
      help.autocorrect = 1;
      mergetool.keepBackup = false;
      pull.ff = "only";
      push.default = "simple";
    };
    aliases =
      {
        tree = "log --show-signature --color --decorate --date=short --all --graph -n 3";
        newbranch = "!git checkout master && git fetch -p && git reset --hard origin/master && git checkout -b $2";
        head = "log HEAD -n1";
        vacuum = "!git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs -r git branch -D && git gc --aggressive --auto";
      };
    };
  }

Set higher rename dection limit in git

{ config, pkgs, ... }:
{
  programs.git = {
    enable = true;
    lfs.enable = true;
    userName = "Cyryl Płotnicki";
    userEmail = "cyplo@cyplo.net";
    delta = {
      enable = true;
      options = {
        line-numbers = true;
        syntax-theme = "Solarized (dark)";
      };
    };
    extraConfig = {
      colour.ui = true;
      credential = { helper ="cache"; };
      diff.algorithm = "histogram";
      diff.renameLimit = 2048;
      diff.renames = "copy";
      help.autocorrect = 1;
      merge.renamelimit = 8192;
      mergetool.keepBackup = false;
      pull.ff = "only";
      push.default = "simple";
    };
    aliases =
      {
        tree = "log --show-signature --color --decorate --date=short --all --graph -n 3";
        newbranch = "!git checkout master && git fetch -p && git reset --hard origin/master && git checkout -b $2";
        head = "log HEAD -n1";
        vacuum = "!git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs -r git branch -D && git gc --aggressive --auto";
      };
    };
  }


{ fetchurl, stdenv, pkgconfig, libao, faad2, libmad, readline, json_c, libgcrypt, gnutls }:

stdenv.mkDerivation rec {
  name = "pianobar-2013.05.19";

  src = fetchurl {
    url = "http://6xq.net/projects/pianobar/${name}.tar.bz2";
    sha256 = "cf88e82663d2b0aa4d73e761506eac4f3e7bc789b57d92377acd994d785e1046";
  };

  buildInputs = [
    pkgconfig libao faad2 libmad json_c libgcrypt gnutls
  ];

  preBuild = "
    makeFlags=\"PREFIX=$out\"
  ";

  CC = "gcc";
  CFLAGS = "-std=c99";

  meta = {
    description = "A console front-end for Pandora.com";
    homepage = "http://6xq.net/projects/pianobar/";
    platforms = stdenv.lib.platforms.linux;
  };
}

Change license and clean up code

{ fetchurl, stdenv, pkgconfig, libao, faad2, libmad, readline, json_c, libgcrypt, gnutls }:

stdenv.mkDerivation rec {
  name = "pianobar-2013.05.19";

  src = fetchurl {
    url = "http://6xq.net/projects/pianobar/${name}.tar.bz2";
    sha256 = "cf88e82663d2b0aa4d73e761506eac4f3e7bc789b57d92377acd994d785e1046";
  };

  buildInputs = [
    pkgconfig libao faad2 libmad json_c libgcrypt gnutls
  ];

  makeFlags="PREFIX=$(out)";

  CC = "gcc";
  CFLAGS = "-std=c99";

  meta = {
    description = "A console front-end for Pandora.com";
    homepage = "http://6xq.net/projects/pianobar/";
    platforms = stdenv.lib.platforms.linux;
    license = stdenv.lib.licenses.unfree;
  };
}


{stdenv, fetchurl, flex}:
let
  s = # Generated upstream information
  rec {
    baseName="gnuchess";
    version="6.1.1";
    name="${baseName}-${version}";
    hash="1jckpg1qi1vjr3pqs0dnip3rmn0mgklx63xflrpqiv3cx2qlz8kn";
    url="http://ftp.gnu.org/gnu/chess/gnuchess-6.1.1.tar.gz";
    sha256="1jckpg1qi1vjr3pqs0dnip3rmn0mgklx63xflrpqiv3cx2qlz8kn";
  };
  buildInputs = [
    flex
  ];
in
stdenv.mkDerivation rec {
  inherit (s) name version;
  src = fetchurl {
    inherit (s) url sha256;
  };
  inherit buildInputs;
  meta = {
    inherit (s) version;
    description = "GNU Chess engine";
    maintainers = [stdenv.lib.maintainers.raskin];
    platforms = stdenv.lib.platforms.linux;
    license = stdenv.lib.licenses.gpl3Plus;
  };
}

Update GNU Chess chess engine

{stdenv, fetchurl, flex}:
let
  s = # Generated upstream information
  rec {
    baseName="gnuchess";
    version="6.1.2";
    name="${baseName}-${version}";
    hash="15k6w9gycp566i0pa7ccajj9v3pw1mz1v62g1ni7czgs3j7i588l";
    url="http://ftp.gnu.org/gnu/chess/gnuchess-6.1.2.tar.gz";
    sha256="15k6w9gycp566i0pa7ccajj9v3pw1mz1v62g1ni7czgs3j7i588l";
  };
  buildInputs = [
    flex
  ];
in
stdenv.mkDerivation rec {
  inherit (s) name version;
  src = fetchurl {
    inherit (s) url sha256;
  };
  inherit buildInputs;
  meta = {
    inherit (s) version;
    description = "GNU Chess engine";
    maintainers = [stdenv.lib.maintainers.raskin];
    platforms = stdenv.lib.platforms.linux;
    license = stdenv.lib.licenses.gpl3Plus;
  };
}


{stdenv}:
expr:

let
  nixToJS = expr:
    if expr == null then "null"
  else
    if builtins.isBool expr then
      if expr then "true" else "false"
    else if builtins.isInt expr then builtins.toString expr
    else if builtins.isString expr then "\"${expr}\""
    else if builtins.isList expr then "[ ${stdenv.lib.concatMapStrings (elem: nixToJS elem + ",\n") expr} ]"
    else if builtins.isAttrs expr then "{ ${stdenv.lib.concatMapStrings (elem: elem + " : ${nixToJS (builtins.getAttr elem expr)},\n") (builtins.attrNames expr)} }"
    else throw "Cannot convert the expression to JavaScript!";
in
nixToJS expr

Fix conversion process a bit, a function is forbidden but the rest is not

{stdenv}:
expr:

let
  nixToJS = expr:
    if expr == null then "null"
  else
    if builtins.isBool expr then
      if expr then "true" else "false"
    else if builtins.isInt expr then builtins.toString expr
    else if builtins.isString expr then "\"${expr}\""
    else if builtins.isList expr then "[ ${stdenv.lib.concatMapStrings (elem: nixToJS elem + ",\n") expr} ]"
    else if builtins.isAttrs expr then "{ ${stdenv.lib.concatMapStrings (elem: elem + " : ${nixToJS (builtins.getAttr elem expr)},\n") (builtins.attrNames expr)} }"
    else if builtins.isFunction expr then throw "Cannot convert a Nix function to a JavaScript function!"
    else "\"${expr}\""; # We assume it's a file
in
nixToJS expr


{ stdenv, lib, bundlerEnv, ruby
, icu, zlib }:

bundlerEnv rec {
  name = "gollum-${version}";
  version = (import gemset).gollum.version;

  inherit ruby;
  gemdir = ./.;
  gemset = ./gemset.nix;

  # FIXME: Add Git as runtime dependency.

  meta = with lib; {
    description = "A simple, Git-powered wiki";
    homepage = "https://github.com/gollum/gollum";
    license = licenses.mit;
    maintainers = with maintainers; [ jgillich primeos ];
    platforms = platforms.unix;
  };
}

Add Git as runtime dependency

{ stdenv, bundlerEnv, ruby, makeWrapper
, git }:

stdenv.mkDerivation rec {
  name = "${pname}-${version}";
  pname = "gollum";
  version = (import ./gemset.nix).gollum.version;

  nativeBuildInputs = [ makeWrapper ];

  env = bundlerEnv {
    name = "${name}-gems";
    inherit pname ruby;
    gemdir = ./.;
  };

  phases = [ "installPhase" ];

  installPhase = ''
    mkdir -p $out/bin
    makeWrapper ${env}/bin/gollum $out/bin/gollum \
      --prefix PATH ":" ${stdenv.lib.makeBinPath [ git ]}
  '';

  meta = with stdenv.lib; {
    description = "A simple, Git-powered wiki";
    homepage = "https://github.com/gollum/gollum";
    license = licenses.mit;
    maintainers = with maintainers; [ jgillich primeos ];
    platforms = platforms.unix;
  };
}


{ stdenv, buildGoPackage, fetchgit, makeWrapper, git, sqliteSupport ? true  }:

buildGoPackage rec {
  name = "gogs-${version}";
  version = "20160728-${stdenv.lib.strings.substring 0 7 rev}";
  rev = "ad7ea88923e371df7558835d8f3e0236cfdf69ba";

  buildInputs = [ makeWrapper ];
  buildFlags = stdenv.lib.optional (sqliteSupport) "-tags sqlite";
  goPackagePath = "github.com/gogits/gogs";

  postInstall = ''
    wrapProgram $bin/bin/gogs \
      --prefix PATH : ${git}/bin \
      --run 'export GOGS_WORK_DIR=''${GOGS_WORK_DIR:-$PWD}' \
      --run 'cd "$GOGS_WORK_DIR"' \
      --run "ln -fs $out/share/go/src/${goPackagePath}/{public,templates} ."
  '';

  src = fetchgit {
    inherit rev;
    url = "https://github.com/gogits/gogs";
    sha256 = "0vgkhpwvj79shpi3bq2sr1nza53fidmnbmh814ic09jnb2dilnrm";
  };

  goDeps = ./deps.json;
}

FIX `public` and `templates` use from `bin`

{ stdenv, buildGoPackage, fetchgit, makeWrapper, git, sqliteSupport ? true  }:

buildGoPackage rec {
  name = "gogs-${version}";
  version = "20160728-${stdenv.lib.strings.substring 0 7 rev}";
  rev = "ad7ea88923e371df7558835d8f3e0236cfdf69ba";

  buildInputs = [ makeWrapper ];
  buildFlags = stdenv.lib.optional (sqliteSupport) "-tags sqlite";
  goPackagePath = "github.com/gogits/gogs";
  outputs = [ "out" "bin" "data" ];

  postInstall = ''
    mkdir $data
    cp -R $src/{public,templates} $data

    wrapProgram $bin/bin/gogs \
      --prefix PATH : ${git}/bin \
      --run 'export GOGS_WORK_DIR=''${GOGS_WORK_DIR:-$PWD}' \
      --run 'cd "$GOGS_WORK_DIR"' \
      --run "ln -fs $data/{public,templates} ."
  '';

  src = fetchgit {
    inherit rev;
    url = "https://github.com/gogits/gogs";
    sha256 = "0vgkhpwvj79shpi3bq2sr1nza53fidmnbmh814ic09jnb2dilnrm";
  };

  goDeps = ./deps.json;
}


{ config, pkgs, modulesPath, ... }:

{
  imports = [ "${modulesPath}/virtualisation/google-compute-image.nix" ];
}

Work around infinite recursion issue in nixops.

{ config, pkgs, ... }:

{
  imports = [ <nixpkgs/nixos/modules/virtualisation/google-compute-image.nix> ];
}


{ stdenv, fetchurl, pythonPackages, pygobject, gst_python
, gst_plugins_good, gst_plugins_base
}:

pythonPackages.buildPythonPackage rec {
  name = "mopidy-${version}";

  version = "0.19.3";

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

  propagatedBuildInputs = with pythonPackages; [
    gst_python pygobject pykka tornado gst_plugins_base gst_plugins_good
  ];

  # There are no tests
  doCheck = false;

  postInstall = ''
    wrapProgram $out/bin/mopidy \
      --prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH"
  '';

  meta = with stdenv.lib; {
    homepage = http://www.mopidy.com/;
    description = ''
      An extensible music server that plays music from local disk, Spotify,
      SoundCloud, Google Play Music, and more.
    '';
    license = licenses.asl20;
    maintainers = [ maintainers.rickynils ];
    hydraPlatforms = [];
  };
}

Update from 0.19.3 to 0.19.4

{ stdenv, fetchurl, pythonPackages, pygobject, gst_python
, gst_plugins_good, gst_plugins_base
}:

pythonPackages.buildPythonPackage rec {
  name = "mopidy-${version}";

  version = "0.19.4";

  src = fetchurl {
    url = "https://github.com/mopidy/mopidy/archive/v${version}.tar.gz";
    sha256 = "13dyn9pgq0jns6915diizviqyn64yfysb08k77xsmxrr4bhm1156";
  };

  propagatedBuildInputs = with pythonPackages; [
    gst_python pygobject pykka tornado gst_plugins_base gst_plugins_good
  ];

  # There are no tests
  doCheck = false;

  postInstall = ''
    wrapProgram $out/bin/mopidy \
      --prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH"
  '';

  meta = with stdenv.lib; {
    homepage = http://www.mopidy.com/;
    description = ''
      An extensible music server that plays music from local disk, Spotify,
      SoundCloud, Google Play Music, and more.
    '';
    license = licenses.asl20;
    maintainers = [ maintainers.rickynils ];
    hydraPlatforms = [];
  };
}


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

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

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

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

  buildInputs = [ ocaml findlib camlp5 ];

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

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

Update HOL Light to svn r244.

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

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

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

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

  buildInputs = [ ocaml findlib camlp5 ];

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

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


{ pkgs, stdenv, fetchFromGitHub, mypy, python3 }:
let self = stdenv.mkDerivation rec {
  name = "nix-pin-${version}";
  version = "0.2.2";
  src = fetchFromGitHub {
    owner = "timbertson";
    repo = "nix-pin";
    rev = "version-0.2.2";
    sha256 = "1kw43kzy4m6lnnif51r2a8i4vcgr7d4vqb1c75p7pk2b9y3jwxsz";
  };
  buildInputs = [ python3 mypy ];
  buildPhase = ''
    mypy bin/*
  '';
  installPhase = ''
    mkdir "$out"
    cp -r bin share "$out"
  '';
  passthru =
    let api = import "${self}/share/nix/api.nix" { inherit pkgs; }; in
    {
      inherit (api) augmentedPkgs pins callPackage;
    };
  meta = with stdenv.lib; {
    homepage = "https://github.com/timbertson/nix-pin";
    description = "nixpkgs development utility";
    license = licenses.mit;
    maintainers = [ maintainers.timbertson ];
    platforms = platforms.all;
  };
}; in self

Revert "nix-pin: 0.1.2 -> 0.2.2"

{ pkgs, stdenv, fetchFromGitHub, mypy, python3 }:
let self = stdenv.mkDerivation rec {
  name = "nix-pin-${version}";
  version = "0.1.2";
  src = fetchFromGitHub {
    owner = "timbertson";
    repo = "nix-pin";
    rev = "version-0.1.2";
    sha256 = "1zwfb5198qzbjwivgiaxbwva9frgrrqaj92nw8vz95yi08pijssh";
  };
  buildInputs = [ python3 mypy ];
  buildPhase = ''
    mypy bin/*
  '';
  installPhase = ''
    mkdir "$out"
    cp -r bin share "$out"
  '';
  passthru = {
    callWithPins = path: args:
      import "${self}/share/nix/call.nix" {
        inherit pkgs path args;
      };
  };
  meta = with stdenv.lib; {
    homepage = "https://github.com/timbertson/nix-pin";
    description = "nixpkgs development utility";
    license = licenses.mit;
    maintainers = [ maintainers.timbertson ];
    platforms = platforms.all;
  };
}; in self


{ stdenv, fetchFromGitHub, audiofile, libtiff, autoreconfHook }:
stdenv.mkDerivation rec {
  version = "3.0.0";
  pname = "spandsp";
  src = fetchFromGitHub {
    owner = "freeswitch";
    repo = pname;
    rev = "6ec23e5a7e411a22d59e5678d12c4d2942c4a4b6"; # upstream does not seem to believe in tags
    sha256 = "03w0s99y3zibi5fnvn8lk92dggfgrr0mz5255745jfbz28b2d5y7";
  };

  outputs = [ "out" "dev" ];

  nativeBuildInputs = [ autoreconfHook ];
  propagatedBuildInputs = [ audiofile libtiff ];

  meta = {
    description = "A portable and modular SIP User-Agent with audio and video support";
    homepage = "https://github.com/freeswitch/spandsp";
    platforms = with stdenv.lib.platforms; linux;
    maintainers = with stdenv.lib.maintainers; [raskin];
    license = stdenv.lib.licenses.gpl2;
  };
}

Revert "spandsp: 0.0.6 -> 3.0.0"

{stdenv, fetchurl, audiofile, libtiff}:
stdenv.mkDerivation rec {
  version = "0.0.6";
  pname = "spandsp";
  src=fetchurl {
    url = "https://www.soft-switch.org/downloads/spandsp/spandsp-${version}.tar.gz";
    sha256 = "0rclrkyspzk575v8fslzjpgp4y2s4x7xk3r55ycvpi4agv33l1fc";
  };

  outputs = [ "out" "dev" ];

  propagatedBuildInputs = [audiofile libtiff];
  meta = {
    description = "A portable and modular SIP User-Agent with audio and video support";
    homepage = "http://www.creytiv.com/baresip.html";
    platforms = with stdenv.lib.platforms; linux;
    maintainers = with stdenv.lib.maintainers; [raskin];
    license = stdenv.lib.licenses.gpl2;
    downloadPage = "http://www.soft-switch.org/downloads/spandsp/";
    inherit version;
    updateWalker = true;
  };
}


{ stdenv
, fetchFromGitHub
, gettext
}:

stdenv.mkDerivation rec {
  pname = "cinnamon-translations";
  version = "4.8.0";

  src = fetchFromGitHub {
    owner = "linuxmint";
    repo = pname;
    rev = version;
    sha256 = "1j3azjwin89z5v6nphx0wsa35p224h2gps50kcq9gwankkfcf3q1";
  };

  nativeBuildInputs = [
    gettext
  ];

  installPhase = ''
    mv usr $out # files get installed like so: msgfmt -o usr/share/locale/$lang/LC_MESSAGES/$dir.mo $file
  '';

  meta = with stdenv.lib; {
    homepage = "https://github.com/linuxmint/cinnamon-translations";
    description = "Translations files for the Cinnamon desktop";
    license = licenses.gpl2;
    platforms = platforms.linux;
    maintainers = teams.cinnamon.members;
  };
}

Revert "cinnamon.cinnamon-translations: 4.6.2 -> 4.8.0"

{ stdenv
, fetchFromGitHub
, gettext
}:

stdenv.mkDerivation rec {
  pname = "cinnamon-translations";
  version = "4.6.2";

  src = fetchFromGitHub {
    owner = "linuxmint";
    repo = pname;
    rev = version;
    sha256 = "0zaghha62ibhg3rir6mrfy1z3v7p7v83b6glhmj9s51nxd86fyv6";
  };

  nativeBuildInputs = [
    gettext
  ];

  installPhase = ''
    mv usr $out # files get installed like so: msgfmt -o usr/share/locale/$lang/LC_MESSAGES/$dir.mo $file
  '';

  meta = with stdenv.lib; {
    homepage = "https://github.com/linuxmint/cinnamon-translations";
    description = "Translations files for the Cinnamon desktop";
    license = licenses.gpl2;
    platforms = platforms.linux;
    maintainers = teams.cinnamon.members;
  };
}


{ pkgs ? (import <nixpkgs> {})
, ocamlPackages ? pkgs.ocamlPackages
}:

with pkgs;

stdenv.mkDerivation rec {

  name = "coq_website";
  src = null;

  buildInputs = [
    dune_2
    lua51Packages.lua
  ] ++ (with ocamlPackages; [
    ocaml
    findlib
    opam-file-format
    yojson
    ppx_deriving_yojson
    merlin
    ocp-indent
    opam
    opam-core
  ]);

}

Remove unneeded dependencies, as they trigger a bug in Dune.

{ pkgs ? (import <nixpkgs> {})
, ocamlPackages ? pkgs.ocamlPackages
}:

with pkgs;

stdenv.mkDerivation rec {

  name = "coq_website";
  src = null;

  buildInputs = [
    dune_2
    lua51Packages.lua
  ] ++ (with ocamlPackages; [
    ocaml
    findlib
    opam-file-format
    yojson
    ppx_deriving_yojson
    opam
    opam-core
  ]);

}


# This file contains all the configuration for ZSH specifically, and not more
# general shell configuration.
{ pkgs, ... }:

{

  programs.zsh = {
    enable = true;
    enableCompletion = true;
    enableAutosuggestions = true;
    autocd = false; # I can't stand when ZSH Decided to change my directory
    defaultKeymap = "viins";
    history = {
      extended = true; # save timestamps
      ignoreDups = false; # log all commands
      save = 10000; # lots of history. Internal history list
      size = 100000; # lots of history. Save to file.
      share = true; # let multiple ZSH session write to the history file
    };
    shellAliases = {
      ":q" = "exit";
      ":e" = "$EDITOR";
      l = "ls";
      lsd = "ls -l $@ | grep '^d'";
      tree = "tree --dirsfirst -ChFQ $@";
      tree1 = "tree -L 1 $@";
      tree2 = "tree -L 2 $@";
      tree3 = "tree -L 3 $@";
      r = "ranger";
    };
    oh-my-zsh = {
      enable = true;
      plugins = [
        "colored-man-pages"
        "docker"
        "gitfast"
        "gpg-agent"
        "pass"
        "pip"
        "rbenv"
        "ssh-agent"
        "sudo"
      ];
      theme = "dieter";
    };
    initExtra = ''
      include () {
        [[ -f "$1" ]] && source "$1"
      }

      include "$HOME/src/bxaws/bxaws"
    '';
  };
}

Cut work script from master branch.

# This file contains all the configuration for ZSH specifically, and not more
# general shell configuration.
{ pkgs, ... }:

{

  programs.zsh = {
    enable = true;
    enableCompletion = true;
    enableAutosuggestions = true;
    autocd = false; # I can't stand when ZSH Decided to change my directory
    defaultKeymap = "viins";
    history = {
      extended = true; # save timestamps
      ignoreDups = false; # log all commands
      save = 10000; # lots of history. Internal history list
      size = 100000; # lots of history. Save to file.
      share = true; # let multiple ZSH session write to the history file
    };
    shellAliases = {
      ":q" = "exit";
      ":e" = "$EDITOR";
      l = "ls";
      lsd = "ls -l $@ | grep '^d'";
      tree = "tree --dirsfirst -ChFQ $@";
      tree1 = "tree -L 1 $@";
      tree2 = "tree -L 2 $@";
      tree3 = "tree -L 3 $@";
      r = "ranger";
    };
    oh-my-zsh = {
      enable = true;
      plugins = [
        "colored-man-pages"
        "docker"
        "gitfast"
        "gpg-agent"
        "pass"
        "pip"
        "rbenv"
        "ssh-agent"
        "sudo"
      ];
      theme = "dieter";
    };
    initExtra = ''
      include () {
        [[ -f "$1" ]] && source "$1"
      }
    '';
  };
}


{ }:
let this = import ./.;
    myEnv = platform: (builtins.getAttr platform this).ghcWithPackages (p: with p; [
      # Add Haskell packages to your environment here
    ]);
in this.nixpkgs.runCommand "shell" {
  buildCommand = ''
    echo "$propagatedBuildInputs $buildInputs $nativeBuildInputs $propagatedNativeBuildInputs" > $out
  '';
  buildInputs = [
    this.nixpkgs.nodejs
  ] ++ builtins.map myEnv this.platforms;
} ""

Add cabal-install to the ghcjs environment

{ }:
let this = import ./.;
    myEnv = platform: (builtins.getAttr platform this).ghcWithPackages (p: with p; [
      # Add Haskell packages to your environment here
    ]);
in this.nixpkgs.runCommand "shell" {
  buildCommand = ''
    echo "$propagatedBuildInputs $buildInputs $nativeBuildInputs $propagatedNativeBuildInputs" > $out
  '';
  buildInputs = [
    this.nixpkgs.nodejs
    this.nixpkgs.haskell-ng.packages.ghc7101.cabal-install
  ] ++ builtins.map myEnv this.platforms;
} ""


defnix: let
  inherit (defnix.build-support) compile-cc;

  inherit (defnix.pkgs) nix boehmgc;

  so = compile-cc [
    "-shared"
    "-fPIC"
    "-I${nix}/include/nix"
    "-I${boehmgc}/include"
    "-lnixformat"
    "-lnixexpr"
    "-lnixutil"
    "-L${nix}/lib"
  ] ./spawn.so.cc;
in defnix.lib.nix-exec.dlopen so "nix_spawn" 2

Fix plugin linking on darwin

defnix: let
  inherit (defnix.build-support) compile-cc;

  inherit (defnix.pkgs) nix boehmgc;

  so = compile-cc [
    "-shared"
    "-fPIC"
    "-I${nix}/include/nix"
    "-I${boehmgc}/include"
    "-undefined" "dynamic_lookup"
  ] ./spawn.so.cc;
in defnix.lib.nix-exec.dlopen so "nix_spawn" 2


{ pkgs, ... }:
{
  imports = [
    ./home-manager.nix
  ];

  home.packages = with pkgs; [
    nixpkgs-fmt
    # standard unix tools
    coreutils
    diffutils
    ed
    findutils
    gawk
    indent
    gnused
    gnutar
    which
    gnutls
    gnugrep
    gzip
    gnupatch
    less
    file
    perl
    rsync
    unzip
  ];

  programs.git = {
    enable = true;
    includes = [
      { path = "~/.gitlocalconfig"; }
    ];
    delta.enable = true;
    ignores = [
      "*.sw[op]"
    ];
    aliases = {
      co = "checkout";
      cob = "checkout -b";
      ap = "add -p";
      cm = "commit";
      cmm = "commit -m";
      cma = "commit --amend";
      cmane = "commit --amend --no-edit";
      d = "diff";
      ds = "diff --staged";
      puo = "!git push -u origin $(git branch --show-current)";
      ri = "rebase --interactive --autosquash";
      lp = "log -p";
      lg = "log --oneline --graph";
      lga = "log --oneline --graph --all";
    };
    extraConfig = {
      pull.ff = "only";
      diff = { tool = "nvimdiff"; };
      merge = { tool = "nvimdiff"; conflictstyle = "diff3"; };
      credential = if pkgs.stdenv.isDarwin then { helper = "osxkeychain"; } else { };
    };
  };
}

Add rp & rsp aliases

{ pkgs, ... }:
{
  imports = [
    ./home-manager.nix
  ];

  home.packages = with pkgs; [
    nixpkgs-fmt
    # standard unix tools
    coreutils
    diffutils
    ed
    findutils
    gawk
    indent
    gnused
    gnutar
    which
    gnutls
    gnugrep
    gzip
    gnupatch
    less
    file
    perl
    rsync
    unzip
  ];

  programs.git = {
    enable = true;
    includes = [
      { path = "~/.gitlocalconfig"; }
    ];
    delta.enable = true;
    ignores = [
      "*.sw[op]"
    ];
    aliases = {
      co = "checkout";
      cob = "checkout -b";
      ap = "add -p";
      cm = "commit";
      cmm = "commit -m";
      cma = "commit --amend";
      cmane = "commit --amend --no-edit";
      d = "diff";
      ds = "diff --staged";
      puo = "!git push -u origin $(git branch --show-current)";
      ri = "rebase --interactive --autosquash";
      lp = "log -p";
      lg = "log --oneline --graph";
      lga = "log --oneline --graph --all";
      rp = "restore -p";
      rsp = "restore --staged -p";
    };
    extraConfig = {
      pull.ff = "only";
      diff = { tool = "nvimdiff"; };
      merge = { tool = "nvimdiff"; conflictstyle = "diff3"; };
      credential = if pkgs.stdenv.isDarwin then { helper = "osxkeychain"; } else { };
    };
  };
}


{ stdenv, fetchurl, fftwSinglePrec, lv2, pkgconfig, wafHook }:

stdenv.mkDerivation rec {
  pname = "mda-lv2";
  version = "1.2.4";

  src = fetchurl {
    url = "https://download.drobilla.net/${pname}-${version}.tar.bz2";
    sha256 = "1a3cv6w5xby9yn11j695rbh3c4ih7rxfxmkca9s1324ljphh06m8";
  };

  nativeBuildInputs = [ pkgconfig wafHook ];
  buildInputs = [ fftwSinglePrec lv2 ];

  meta = with stdenv.lib; {
    homepage = "http://drobilla.net/software/mda-lv2/";
    description = "An LV2 port of the MDA plugins by Paul Kellett";
    license = licenses.gpl2Plus;
    maintainers = [ maintainers.goibhniu ];
    platforms = platforms.linux;
  };
}

Add Python 3 for wafHook

{ stdenv, fetchurl, fftwSinglePrec, lv2, pkgconfig, wafHook, python3 }:

stdenv.mkDerivation rec {
  pname = "mda-lv2";
  version = "1.2.4";

  src = fetchurl {
    url = "https://download.drobilla.net/${pname}-${version}.tar.bz2";
    sha256 = "1a3cv6w5xby9yn11j695rbh3c4ih7rxfxmkca9s1324ljphh06m8";
  };

  nativeBuildInputs = [ pkgconfig wafHook python3 ];
  buildInputs = [ fftwSinglePrec lv2 ];

  meta = with stdenv.lib; {
    homepage = "http://drobilla.net/software/mda-lv2/";
    description = "An LV2 port of the MDA plugins by Paul Kellett";
    license = licenses.gpl2Plus;
    maintainers = [ maintainers.goibhniu ];
    platforms = platforms.linux;
  };
}


{ fetchurl, stdenv, zlib }:

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

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

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

Update to new upstream version 2.5.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/;
  };
}


# This file is autogenerated from update.sh in the same directory.
{
  dev = {
    version = "23.0.1243.2";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-23.0.1243.2.tar.bz2";
    sha256 = "1idsc1k0c392mvh2rhfv0sr50rmzdab18ilh9p90mab5a6fk32rh";
  };
  beta = {
    version = "22.0.1229.14";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-22.0.1229.14.tar.bz2";
    sha256 = "11z5wc1m5443bsassq3np79yqr2bwr06ph672by3saikl2xkadn5";
  };
  stable = {
    version = "21.0.1180.81";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-21.0.1180.81.tar.bz2";
    sha256 = "1b5svzg7xxx46bz9s5ayai2ig9b7s0x4s1yl7r42p9g27qwf0dpl";
  };
}

Update channels to latest versions.

# This file is autogenerated from update.sh in the same directory.
{
  dev = {
    version = "23.0.1255.0";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-23.0.1255.0.tar.bz2";
    sha256 = "12ks55mn6nahdzd5kgiwi9m2cfivb0pwj963g8d4kmdbw5bg017g";
  };
  beta = {
    version = "22.0.1229.39";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-22.0.1229.39.tar.bz2";
    sha256 = "0v0yz9lkr9xdzh6660y9n2z8m1075ls2r3svafcfa80pq18chzfd";
  };
  stable = {
    version = "21.0.1180.89";
    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-21.0.1180.89.tar.bz2";
    sha256 = "1i9mjbjj3aywg03hd59m9j5gq5b5fl8nvw56g47q8s9k1bcsik0n";
  };
}


{ lib, stdenv, fetchFromGitHub, cmake }:

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

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

  nativeBuildInputs = [ cmake ];

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

Revert "aws-checksums: 0.1.3 -> 0.1.5"

{ lib, stdenv, fetchFromGitHub, cmake }:

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

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

  nativeBuildInputs = [ cmake ];

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


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

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

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

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

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

  doCheck = true;

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

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

Revert formatting. Revert to HTTPS

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

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

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

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

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

  doCheck = true;

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

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


{ stdenv, fetchurl, unzip, xulrunner, makeWrapper }:

stdenv.mkDerivation rec {
  name = "chatzilla-0.9.90.1";

  src = fetchurl {
    # Obtained from http://chatzilla.rdmsoft.com/xulrunner/.
    url = "http://chatzilla.rdmsoft.com/xulrunner/download/${name}.en-US.xulapp";
    sha256 = "0z38jig91h10cb14rvs30rpg2pgn3v890nyxyy8lxzbv5ncxmngw";
  };

  buildInputs = [ unzip makeWrapper ];

  buildCommand = ''
    mkdir -p $out/libexec/chatzilla
    unzip $src -d $out/libexec/chatzilla

    makeWrapper ${xulrunner}/bin/xulrunner $out/bin/chatzilla \
      --add-flags $out/libexec/chatzilla/application.ini

    sed -i $out/libexec/chatzilla/application.ini -e 's/.*MaxVersion.*/MaxVersion=99.*/'
  '';

  meta = {
    homepage = http://chatzilla.hacksrus.com/;
    description = "Stand-alone version of Chatzilla, an IRC client";
    maintainers = [ stdenv.lib.maintainers.eelco ];
    platforms = stdenv.lib.platforms.linux;
  };
}

Use firefox instead of xulrunner

{ stdenv, fetchurl, unzip, firefox, makeWrapper }:

stdenv.mkDerivation rec {
  name = "chatzilla-0.9.90.1";

  src = fetchurl {
    # Obtained from http://chatzilla.rdmsoft.com/xulrunner/.
    url = "http://chatzilla.rdmsoft.com/xulrunner/download/${name}.en-US.xulapp";
    sha256 = "0z38jig91h10cb14rvs30rpg2pgn3v890nyxyy8lxzbv5ncxmngw";
  };

  buildInputs = [ unzip makeWrapper ];

  buildCommand = ''
    mkdir -p $out/libexec/chatzilla
    unzip $src -d $out/libexec/chatzilla

    makeWrapper ${firefox}/bin/firefox $out/bin/chatzilla \
      --add-flags "-app $out/libexec/chatzilla/application.ini"

    sed -i $out/libexec/chatzilla/application.ini -e 's/.*MaxVersion.*/MaxVersion=99.*/'
  '';

  meta = {
    homepage = http://chatzilla.hacksrus.com/;
    description = "Stand-alone version of Chatzilla, an IRC client";
    maintainers = [ stdenv.lib.maintainers.eelco ];
    platforms = stdenv.lib.platforms.linux;
  };
}


{ stdenv, fetchurl, openssl, libtool, perl, libxml2 }:

let version = "9.9.5-W1"; in

stdenv.mkDerivation rec {

  name = "bind-${version}";

  src = fetchurl {
    url = "http://ftp.isc.org/isc/bind9/${version}/${name}.tar.gz";
    sha256 = "1b3ycb376b1j2fc0k6w16k8j9vgsfrzy3nlw1vxzzi41fgyqmcd3";
  };

  patchPhase = ''
    sed -i 's/^\t.*run/\t/' Makefile.in
  '';

  buildInputs = [ openssl libtool perl libxml2 ];

  configureFlags = [
    "--localstatedir=/var"
    "--with-libtool"
    "--with-libxml2=${libxml2}"
    "--with-openssl=${openssl}"
    "--without-atf"
    "--without-dlopen"
    "--without-docbook-xsl"
    "--without-gssapi"
    "--without-idn"
    "--without-idnlib"
    "--without-pkcs11"
    "--without-purify"
    "--without-python"
  ];

  meta = {
    homepage = "http://www.isc.org/software/bind";
    description = "ISC BIND: a domain name server";
    license = stdenv.lib.licenses.isc;

    maintainers = with stdenv.lib.maintainers; [viric simons];
    platforms = with stdenv.lib.platforms; linux;
  };
}

Expand to all unix platforms.

{ stdenv, fetchurl, openssl, libtool, perl, libxml2 }:

let version = "9.9.5-W1"; in

stdenv.mkDerivation rec {

  name = "bind-${version}";

  src = fetchurl {
    url = "http://ftp.isc.org/isc/bind9/${version}/${name}.tar.gz";
    sha256 = "1b3ycb376b1j2fc0k6w16k8j9vgsfrzy3nlw1vxzzi41fgyqmcd3";
  };

  patchPhase = ''
    sed -i 's/^\t.*run/\t/' Makefile.in
  '';

  buildInputs = [ openssl libtool perl libxml2 ];

  configureFlags = [
    "--localstatedir=/var"
    "--with-libtool"
    "--with-libxml2=${libxml2}"
    "--with-openssl=${openssl}"
    "--without-atf"
    "--without-dlopen"
    "--without-docbook-xsl"
    "--without-gssapi"
    "--without-idn"
    "--without-idnlib"
    "--without-pkcs11"
    "--without-purify"
    "--without-python"
  ];

  meta = {
    homepage = "http://www.isc.org/software/bind";
    description = "ISC BIND: a domain name server";
    license = stdenv.lib.licenses.isc;

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


{stdenv, fetchurl }:

stdenv.mkDerivation {
  name = "raspberrypi-firmware-20160106";

  src = fetchurl {
    url = "https://github.com/raspberrypi/firmware/archive/4ade27942e.tar.gz";
    sha256 = "0f4p920vr7dcj4hprgil8baqqbnsjx1jykz0pkdx29mqy0n0xanl";
  };

  installPhase = ''
    mkdir -p $out/share/raspberrypi/boot
    cp -R boot/* $out/share/raspberrypi/boot
    cp -R hardfp/opt/vc/* $out
    cp opt/vc/LICENCE $out/share/raspberrypi
  '';

  meta = {
    description = "Firmware for the Raspberry Pi board";
    homepage = https://github.com/raspberrypi;
    license = "non-free";
  };
}

Update to latest version as of 20130826 (rev 3ab17ac25e)

{stdenv, fetchurl }:

let

  rev = "3ab17ac25e";

in stdenv.mkDerivation {
  name = "raspberrypi-firmware-${rev}";

  src = fetchurl {
    url = "https://github.com/raspberrypi/firmware/archive/${rev}.tar.gz";
    sha256 = "080va4zz858bwwgxam8zy58gpwjpxfg7v5h1q5b4cpbzjihsxcx9";
  };

  installPhase = ''
    mkdir -p $out/share/raspberrypi/boot
    cp -R boot/* $out/share/raspberrypi/boot
    cp -R hardfp/opt/vc/* $out
    cp opt/vc/LICENCE $out/share/raspberrypi
  '';

  meta = {
    description = "Firmware for the Raspberry Pi board";
    homepage = https://github.com/raspberrypi;
    license = "non-free";
  };
}


{stdenv, fetchurlBoot, openssl, zlib, windows}:

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

  src = fetchurlBoot {
    url = "${meta.homepage}/download/${name}.tar.gz";
    sha256 = "1m3n8spv79qhjq4yi0wgly5s5rc8783jb1pyra9bkx1md0plxwrr";
  };

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

  buildInputs = [ openssl zlib ];

  crossAttrs = {
    # link against cross-built libraries
    configureFlags = [
      "--with-openssl"
      "--with-libssl-prefix=${openssl.crossDrv}"
      "--with-libz"
      "--with-libz-prefix=${zlib.crossDrv}"
    ];
  } // stdenv.lib.optionalAttrs (stdenv.cross.libc == "msvcrt") {
    # mingw needs import library of ws2_32 to build the shared library
    preConfigure = ''
      export LDFLAGS="-L${windows.mingw_w64}/lib $LDFLAGS"
    '';
  };

  meta = {
    description = "A client-side C library implementing the SSH2 protocol";
    homepage = http://www.libssh2.org;
    platforms = stdenv.lib.platforms.all;
    maintainers = [ stdenv.lib.maintainers.urkud ];
  };
}

Revert "libssh2: 1.7.0 -> 1.8.0"

{stdenv, fetchurlBoot, openssl, zlib, windows}:

stdenv.mkDerivation rec {
  name = "libssh2-1.7.0";

  src = fetchurlBoot {
    url = "${meta.homepage}/download/${name}.tar.gz";
    sha256 = "116mh112w48vv9k3f15ggp5kxw5sj4b88dzb5j69llsh7ba1ymp4";
  };

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

  buildInputs = [ openssl zlib ];

  crossAttrs = {
    # link against cross-built libraries
    configureFlags = [
      "--with-openssl"
      "--with-libssl-prefix=${openssl.crossDrv}"
      "--with-libz"
      "--with-libz-prefix=${zlib.crossDrv}"
    ];
  } // stdenv.lib.optionalAttrs (stdenv.cross.libc == "msvcrt") {
    # mingw needs import library of ws2_32 to build the shared library
    preConfigure = ''
      export LDFLAGS="-L${windows.mingw_w64}/lib $LDFLAGS"
    '';
  };

  meta = {
    description = "A client-side C library implementing the SSH2 protocol";
    homepage = http://www.libssh2.org;
    platforms = stdenv.lib.platforms.all;
    maintainers = [ stdenv.lib.maintainers.urkud ];
  };
}


{stdenv, fetchurl, cmake, boostHeaders}:

stdenv.mkDerivation {
  name = "libyaml-cpp-0.5.1";

  src = fetchurl {
    url = http://yaml-cpp.googlecode.com/files/yaml-cpp-0.5.1.tar.gz;
    sha256 = "01kg0h8ksp162kdhyzn67vnlxpj5zjbks84sh50pv61xni990z1y";
  };

  buildInputs = [ cmake boostHeaders ];

  meta = {
    homepage = http://code.google.com/p/yaml-cpp/;
    description = "A YAML parser and emitter for C++";
    license = stdenv.lib.licenses.mit;
  };
}

Correct meta information and boost

{ stdenv, fetchurl, cmake, boost }:

stdenv.mkDerivation {
  name = "libyaml-cpp-0.5.1";

  src = fetchurl {
    url = http://yaml-cpp.googlecode.com/files/yaml-cpp-0.5.1.tar.gz;
    sha256 = "01kg0h8ksp162kdhyzn67vnlxpj5zjbks84sh50pv61xni990z1y";
  };

  buildInputs = [ cmake boost ];

  meta = with stdenv.lib; {
    homepage = http://code.google.com/p/yaml-cpp/;
    description = "A YAML parser and emitter for C++";
    license = licenses.mit;
    platforms = platforms.unix;
    maintainers = with maintainers; [ wkennington ];
  };
}


{ config, pkgs, ...}:

{
  networking.hostName = "illimani";

  hardware.cpu.intel.updateMicrocode = true;
  boot.loader.efi.canTouchEfiVariables = true;

  boot.loader.timeout = null;
  boot.loader.grub = {
    # required for uefi
    device = "nodev";
    efiSupport = true;

    # winblows entry
    extraEntries = ''
      menuentry "Winblows 10" {
      insmod part_gpt
      insmod search_fs_uuid
      insmod chain
      search --fs-uuid --no-floppy --set=root 4023-cd4e
      chainloader ($root)/EFI/MICROSOFT/BOOT/bootmgfw.efi
      }
    '';
  };

  services.xserver.videoDrivers = [ "nouveau" ];
}

Revert "Switch illimani to nouveau"

{ config, pkgs, ...}:

{
  networking.hostName = "illimani";

  hardware.cpu.intel.updateMicrocode = true;
  boot.loader.efi.canTouchEfiVariables = true;

  boot.loader.timeout = null;
  boot.loader.grub = {
    # required for uefi
    device = "nodev";
    efiSupport = true;

    # winblows entry
    extraEntries = ''
      menuentry "Winblows 10" {
      insmod part_gpt
      insmod search_fs_uuid
      insmod chain
      search --fs-uuid --no-floppy --set=root 4023-cd4e
      chainloader ($root)/EFI/MICROSOFT/BOOT/bootmgfw.efi
      }
    '';
  };

  services.xserver.videoDrivers = [ "nvidia" ];
}


{ pkgs ? (import <nixpkgs> {}) }:

let
  env = with pkgs.rustPlatform; [
    rustc
    cargo
  ];
in

pkgs.stdenv.mkDerivation rec {
    name = "imag";
    src = ./.;
    version = "0.0.0";

    buildInputs = [ env ];

}

Switch to pkgs.rustUnstable, so we do not need to rebuild rustc (wtf?)

{ pkgs ? (import <nixpkgs> {}) }:

let
  env = with pkgs.rustUnstable; [
    rustc
    cargo
  ];
in

pkgs.stdenv.mkDerivation rec {
    name = "imag";
    src = ./.;
    version = "0.0.0";

    buildInputs = [ env ];

}


{ stdenv, fetchgit, pythonPackages }:

pythonPackages.buildPythonPackage rec {
  name = "s3cmd-1.5-pre-81e3842f7a";

  src  = fetchgit {
    url    = "https://github.com/s3tools/s3cmd.git";
    rev    = "81e3842f7afbc8c629f408f4d7dc22058f7bd536";
    sha256 = "13jqw19ws5my8r856j1p7xydwpyp8agnzxkjv6pa7h72wl7rz90i";
  };

  buildInputs = with pythonPackages; [ dateutil ];

  meta = with stdenv.lib;  {
    description = "Command line tool for managing Amazon S3 and CloudFront services";
    homepage    = http://s3tools.org/s3cmd;
    license     = licenses.gpl2;
  };
}

Revert "s3cmd-1.5-pre-81e3842f7a: Use buildInputs, not propagatedBuildInputs."

{ stdenv, fetchgit, pythonPackages }:

pythonPackages.buildPythonPackage rec {
  name = "s3cmd-1.5-pre-81e3842f7a";

  src  = fetchgit {
    url    = "https://github.com/s3tools/s3cmd.git";
    rev    = "81e3842f7afbc8c629f408f4d7dc22058f7bd536";
    sha256 = "13jqw19ws5my8r856j1p7xydwpyp8agnzxkjv6pa7h72wl7rz90i";
  };

  propagatedBuildInputs = with pythonPackages; [ dateutil ];

  meta = with stdenv.lib;  {
    description = "Command line tool for managing Amazon S3 and CloudFront services";
    homepage    = http://s3tools.org/s3cmd;
    license     = licenses.gpl2;
  };
}


{ buildPythonPackage
, numpy
, matplotlib
, pandas
, toolz
, networkx
, pyyaml
, pytestCheckHook
, acoustics
, black
}:

let

  acoustics_ = acoustics.overridePythonAttrs(oldAttrs: {
    doCheck = false;
  });

in buildPythonPackage rec {
  pname = "seapy";
  version = "dev";

  src = fetchGit ./.;

  propagatedBuildInputs = [
    numpy
    matplotlib
    pandas
    toolz
    networkx
    pyyaml
  ];

  checkInputs = [
    pytestCheckHook
    acoustics_
    black
  ];

  passthru.allInputs = propagatedBuildInputs ++ checkInputs;

  dontUseSetuptoolsCheck = true;

  preCheck = ''
    black --check seapy tests setup.py docs/conf.py
  '';
}

Introduce error checking with pylint

{ buildPythonPackage
, numpy
, matplotlib
, pandas
, toolz
, networkx
, pyyaml
, pytestCheckHook
, acoustics
, black
, pylint
}:

let

  acoustics_ = acoustics.overridePythonAttrs(oldAttrs: {
    doCheck = false;
  });

in buildPythonPackage rec {
  pname = "seapy";
  version = "dev";

  src = fetchGit ./.;

  propagatedBuildInputs = [
    numpy
    matplotlib
    pandas
    toolz
    networkx
    pyyaml
  ];

  checkInputs = [
    pytestCheckHook
    acoustics_
    black
    pylint
  ];

  passthru.allInputs = propagatedBuildInputs ++ checkInputs;

  dontUseSetuptoolsCheck = true;

  preCheck = ''
    echo "Checking formatting with black..."
    black --check seapy tests setup.py docs/conf.py
    echo "Static analysis with pylint..."
    pylint -E seapy
  '';
}


{ stdenv, fetchFromGitHub, pidgin, unzip, glib, json_glib, nss, nspr, libgnome_keyring } :

stdenv.mkDerivation rec {
  name = "pidgin-opensteamworks-${version}";
  version = "1.6.1";

  src = fetchFromGitHub {
    owner = "EionRobb";
    repo = "pidgin-opensteamworks";
    rev = "${version}";
    sha256 = "6ab27831e454ad3b440e4f06b52e0b3671a4f8417ba4da3ab6f56c56d82cc29b";
  };

  preConfigure = "cd steam-mobile";
  postInstall = ''
    mkdir -p $out/lib/pidgin/
    mkdir -p $out/share/pixmaps/pidgin/protocols/
    cp libsteam.so $out/lib/pidgin/
    unzip releases/icons.zip -d $out/share/pixmaps/pidgin/protocols/
  '';

  buildInputs = [ pidgin unzip glib json_glib nss nspr libgnome_keyring ];

  meta = with stdenv.lib; {
    homepage = https://code.google.com/p/pidgin-opensteamworks;
    description = "Plugin for Pidgin 2.x which implements Steam Friends/Steam IM compatibility";
    license = licenses.gpl3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ arobyn ];
  };
}

Change install location to work with Finch as well as Pidgin.

{ stdenv, fetchFromGitHub, pidgin, unzip, glib, json_glib, nss, nspr, libgnome_keyring } :

stdenv.mkDerivation rec {
  name = "pidgin-opensteamworks-${version}";
  version = "1.6.1";

  src = fetchFromGitHub {
    owner = "EionRobb";
    repo = "pidgin-opensteamworks";
    rev = "${version}";
    sha256 = "6ab27831e454ad3b440e4f06b52e0b3671a4f8417ba4da3ab6f56c56d82cc29b";
  };

  preConfigure = "cd steam-mobile";
  postInstall = ''
    mkdir -p $out/lib/purple-2
    mkdir -p $out/share/pixmaps/pidgin/protocols/
    cp libsteam.so $out/lib/purple-2/
    unzip releases/icons.zip -d $out/share/pixmaps/pidgin/protocols/
  '';

  buildInputs = [ pidgin unzip glib json_glib nss nspr libgnome_keyring ];

  meta = with stdenv.lib; {
    homepage = https://code.google.com/p/pidgin-opensteamworks;
    description = "Plugin for Pidgin 2.x which implements Steam Friends/Steam IM compatibility";
    license = licenses.gpl3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ arobyn ];
  };
}


{ stdenv, fetchurl, ... } @ args:

import ./generic.nix (args // rec {
  # Reason to add:  RTL8192EE
  version = "3.16-rc1";
  modDirVersion = "3.16.0-rc1";
  extraMeta.branch = "3.16";

  src = fetchurl {
    url = "mirror://kernel/linux/kernel/v3.x/testing/linux-${version}.tar.xz";
    sha256 = "1y2ssifw6db40mr4j6k9c0kjwb4ssrrps74pc38krq4d6yzinhmq";
  };

  features.iwlwifi = true;
  features.efiBootStub = true;
  features.needsCifsUtils = true;
  features.canDisableNetfilterConntrackHelpers = true;
  features.netfilterRPFilter = true;

  # Should the testing kernels ever be built on Hydra?
  extraMeta.hydraPlatforms = [];

} // (args.argsOverride or {}))

Update 3.16-rc to -rc2: -rc1 has problems with mounting BtrFS, will test -rc2

{ stdenv, fetchurl, ... } @ args:

import ./generic.nix (args // rec {
  # Reason to add:  RTL8192EE
  version = "3.16-rc2";
  modDirVersion = "3.16.0-rc2";
  extraMeta.branch = "3.16";

  src = fetchurl {
    url = "mirror://kernel/linux/kernel/v3.x/testing/linux-${version}.tar.xz";
    sha256 = "12bxf62qqsf471ak6rj4gbvvjsybsamgwj9p8bphr98dp14js27w";
  };

  features.iwlwifi = true;
  features.efiBootStub = true;
  features.needsCifsUtils = true;
  features.canDisableNetfilterConntrackHelpers = true;
  features.netfilterRPFilter = true;

  # Should the testing kernels ever be built on Hydra?
  extraMeta.hydraPlatforms = [];

} // (args.argsOverride or {}))


args : with args;
	let localDefs = builderDefs {
		addSbinPath = true;
		src = "";
		buildInputs = [module_init_tools];
		configureFlags = [];
	} null; /* null is a terminator for sumArgs */
	in with localDefs;
let

doCollect = FullDepEntry (''
ensureDir $out/lib/modules
cd $out/
for i in $moduleSources; do
	cp -rfs $i/* .
	chmod -R u+w .
done
rm -rf nix-support
cd lib/modules/
rm */modules.*
MODULE_DIR=$PWD/ depmod -a *
cd $out/
'') [minInit addInputs defEnsureDir];
in
stdenv.mkDerivation rec {
	name = "kernel-modules";
	inherit moduleSources;
	builder = writeScript (name + "-builder")
		(textClosure localDefs [doCollect doForceShare doPropagate]);
	meta = {
		description = "
		A directory to hold all  the modules, including those
		built separately from kernel. Later mentioned directories in
		moduleSources have higher priority.
";
	};
}

Fix enabling switching to kernels not already running (depmod uses uname-r as default to look for modules)

args : with args;
	let localDefs = builderDefs {
		addSbinPath = true;
		src = "";
		buildInputs = [module_init_tools];
		configureFlags = [];
	} null; /* null is a terminator for sumArgs */
	in with localDefs;
let

doCollect = FullDepEntry (''
ensureDir $out/lib/modules
cd $out/
for i in $moduleSources; do
	cp -rfs $i/* .
	chmod -R u+w .
done
rm -rf nix-support
cd lib/modules/
rm */modules.*
#  linux-* will pass the new kernel version to depmod to take rather than `uname -r` (see man page)
MODULE_DIR=$PWD/ depmod -a $(basename lib/modules/2.*)
cd $out/
'') [minInit addInputs defEnsureDir];
in
stdenv.mkDerivation rec {
	name = "kernel-modules";
	inherit moduleSources;
	builder = writeScript (name + "-builder")
		(textClosure localDefs [doCollect doForceShare doPropagate]);
	meta = {
		description = "
		A directory to hold all  the modules, including those
		built separately from kernel. Later mentioned directories in
		moduleSources have higher priority.
";
	};
}


# Common configuration for Xen DomU NixOS virtual machines.

{ config, pkgs, ... }:

{
  # We're being booted using pv-grub, which means that we need to
  # generate a GRUB 1 menu without actually installing GRUB.
  boot.loader.grub.version = 1;
  boot.loader.grub.device = "nodev";
  boot.loader.grub.extraPerEntryConfig = "root (hd0)";

  boot.initrd.kernelModules = [ "xen-blkfront" ];

  # Backgrounds don't work, so don't bother.
  services.ttyBackgrounds.enable = false;

  # Send syslog messages to the Xen console.
  services.syslogd.tty = "hvc0";

  # Start a mingetty on the Xen console (so that you can login using
  # "xm console" in Dom0).
  services.mingetty.ttys = [ "hvc0" "tty1" "tty2" ];

  # Don't run ntpd, since we should get the correct time from Dom0.
  services.ntp.enable = false;
}

Remove obsolete option in Xen domU module

# Common configuration for Xen DomU NixOS virtual machines.

{ config, pkgs, ... }:

{
  # We're being booted using pv-grub, which means that we need to
  # generate a GRUB 1 menu without actually installing GRUB.
  boot.loader.grub.version = 1;
  boot.loader.grub.device = "nodev";
  boot.loader.grub.extraPerEntryConfig = "root (hd0)";

  boot.initrd.kernelModules = [ "xen-blkfront" ];

  # Backgrounds don't work, so don't bother.
  services.ttyBackgrounds.enable = false;

  # Send syslog messages to the Xen console.
  services.syslogd.tty = "hvc0";

  # Don't run ntpd, since we should get the correct time from Dom0.
  services.ntp.enable = false;
}


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

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

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

  preConfigure = ''
    autoreconf -i
  '';

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

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

  doCheck = true;

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

Add libopus and libvpx to buildInputs.

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

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

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

  preConfigure = ''
    autoreconf -i
  '';

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

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

  doCheck = true;

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


{ stdenv, fetchurl, pkgs,
slang, ncurses
}:

let version = "1.0.1"; in

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

  src = fetchurl {
    url = "http://www.jedsoft.org/slrn/download/slrn-1.0.1.tar.gz";
    sha256 = "1rmaprfwvshzkv0c5vi43839cz3laqjpl306b9z0ghwyjdha1d06";
  };

  preConfigure = ''
    sed -i -e "s|-ltermcap|-lncurses|" configure
    sed -i autoconf/Makefile.in src/Makefile.in \
      -e "s|/bin/cp|cp|"  \
      -e "s|/bin/rm|rm|"
  '';

  configureFlags = "--with-slang=${slang}";

  buildInputs = [ slang ncurses ];

  meta = {
    description = "The slrn (S-Lang read news) newsreader";
    homepage = http://slrn.sourceforge.net/index.html;
    license = pkgs.lib.licenses.gpl2;
  };
}

Remove pkgs from slrn. Use stdenv.lib instead

{ stdenv, fetchurl,
slang, ncurses
}:

let version = "1.0.1"; in

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

  src = fetchurl {
    url = "http://www.jedsoft.org/slrn/download/slrn-1.0.1.tar.gz";
    sha256 = "1rmaprfwvshzkv0c5vi43839cz3laqjpl306b9z0ghwyjdha1d06";
  };

  preConfigure = ''
    sed -i -e "s|-ltermcap|-lncurses|" configure
    sed -i autoconf/Makefile.in src/Makefile.in \
      -e "s|/bin/cp|cp|"  \
      -e "s|/bin/rm|rm|"
  '';

  configureFlags = "--with-slang=${slang}";

  buildInputs = [ slang ncurses ];

  meta = {
    description = "The slrn (S-Lang read news) newsreader";
    homepage = http://slrn.sourceforge.net/index.html;
    license = stdenv.lib.licenses.gpl2;
  };
}


{ lib, buildGoModule, fetchFromGitHub }:

buildGoModule rec {
  pname = "skeema";
  version = "1.7.1";

  src = fetchFromGitHub {
    owner = "skeema";
    repo = "skeema";
    rev = "v${version}";
    sha256 = "sha256-DHdc6Le4WhL5QC/hqtbtq7rdBdLiRflDNnXQY2l2aJ8=";
  };

  vendorSha256 = null;

  CGO_ENABLED = 0;

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

  checkFlags = [ "-short" ];

  meta = with lib; {
    description = "Declarative pure-SQL schema management for MySQL and MariaDB";
    homepage = "https://skeema.io/";
    license = licenses.asl20;
    maintainers = with maintainers; [ aaronjheng ];
  };
}

Disable tests requiring network & fix deps

{ lib, buildGoModule, fetchFromGitHub, coreutils }:

buildGoModule rec {
  pname = "skeema";
  version = "1.7.1";

  src = fetchFromGitHub {
    owner = "skeema";
    repo = "skeema";
    rev = "v${version}";
    sha256 = "sha256-DHdc6Le4WhL5QC/hqtbtq7rdBdLiRflDNnXQY2l2aJ8=";
  };

  vendorSha256 = null;

  CGO_ENABLED = 0;

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

  preCheck = ''
    # Disable tests requiring network access to gitlab.com
    buildFlagsArray+=("-run" "[^(Test(ParseDir(Symlinks|))|DirRelPath)]")

    # Fix tests expecting /usr/bin/printf and /bin/echo
    substituteInPlace skeema_cmd_test.go \
      --replace /usr/bin/printf "${coreutils}/bin/printf"

    substituteInPlace internal/fs/dir_test.go \
      --replace /bin/echo "${coreutils}/bin/echo" \
      --replace /usr/bin/printf "${coreutils}/bin/printf"

    substituteInPlace internal/applier/ddlstatement_test.go \
      --replace /bin/echo "${coreutils}/bin/echo"

    substituteInPlace internal/util/shellout_unix_test.go \
      --replace /bin/echo "${coreutils}/bin/echo" \
      --replace /usr/bin/printf "${coreutils}/bin/printf"

    substituteInPlace internal/util/shellout_unix_test.go \
      --replace /bin/echo "${coreutils}/bin/echo"
  '';

  checkFlags = [ "-short" ];

  meta = with lib; {
    description = "Declarative pure-SQL schema management for MySQL and MariaDB";
    homepage = "https://skeema.io/";
    license = licenses.asl20;
    maintainers = with maintainers; [ aaronjheng ];
  };
}


{ cabal, syb }:

cabal.mkDerivation (self: {
  pname = "srcloc";
  version = "0.2.0";
  sha256 = "1p63gachz8ccv61ih3jb995kcg72g7vkihryb2ak7d8bxxxx3irs";
  buildDepends = [ syb ];
  meta = {
    homepage = "http://www.eecs.harvard.edu/~mainland/";
    description = "Data types for managing source code locations";
    license = self.stdenv.lib.licenses.bsd3;
    platforms = self.ghc.meta.platforms;
    maintainers = [ self.stdenv.lib.maintainers.andres ];
  };
})

Revert "haskell-srcloc: update to version 0.2.0"

{ cabal, syb, symbol }:

cabal.mkDerivation (self: {
  pname = "srcloc";
  version = "0.1.2";
  sha256 = "08awipz6al7jk7d974am5v9fkp87i5dy6d457mx1rv7lczlyhws9";
  buildDepends = [ syb symbol ];
  meta = {
    homepage = "http://www.eecs.harvard.edu/~mainland/";
    description = "Data types for managing source code locations";
    license = self.stdenv.lib.licenses.bsd3;
    platforms = self.ghc.meta.platforms;
    maintainers = [ self.stdenv.lib.maintainers.andres ];
  };
})


a :
let
  s = import ./src-for-default.nix;
  buildInputs = with a; [
    openssl zlib pcre libxml2 libxslt
    perl ? null
  ];
in
rec {
  src = a.fetchUrlFromSrcInfo s;

  inherit (s) name;
  inherit buildInputs;
  configureFlags = [
    "--with-http_ssl_module"
    "--with-http_xslt_module"
    "--with-http_sub_module"
    "--with-http_dav_module"
    "--with-http_gzip_static_module"
    "--with-http_secure_link_module"
    # Install destination problems
    # "--with-http_perl_module"
  ];

  preConfigure = a.fullDepEntry ''
    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${a.libxml2}/include/libxml2"
  '' [];

  phaseNames = ["preConfigure" "doConfigure" "doMakeInstall"];

  meta = {
    description = "nginx - 'engine x' - reverse proxy and lightweight webserver";
    maintainers = [
      a.lib.maintainers.raskin
    ];
    platforms = with a.lib.platforms;
      all;
  };
}

Fix remaining perl mention in buildInputs

a :
let
  s = import ./src-for-default.nix;
  buildInputs = with a; [
    openssl zlib pcre libxml2 libxslt
  ];
in
rec {
  src = a.fetchUrlFromSrcInfo s;

  inherit (s) name;
  inherit buildInputs;
  configureFlags = [
    "--with-http_ssl_module"
    "--with-http_xslt_module"
    "--with-http_sub_module"
    "--with-http_dav_module"
    "--with-http_gzip_static_module"
    "--with-http_secure_link_module"
    # Install destination problems
    # "--with-http_perl_module"
  ];

  preConfigure = a.fullDepEntry ''
    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${a.libxml2}/include/libxml2"
  '' [];

  phaseNames = ["preConfigure" "doConfigure" "doMakeInstall"];

  meta = {
    description = "nginx - 'engine x' - reverse proxy and lightweight webserver";
    maintainers = [
      a.lib.maintainers.raskin
    ];
    platforms = with a.lib.platforms;
      all;
  };
}


{ lib, fetchFromGitHub, buildPythonApplication
, colorama, decorator, psutil, pyte, six
, pytest, pytest-mock
}:

buildPythonApplication rec {
  pname = "thefuck";
  version = "3.30";

  src = fetchFromGitHub {
    owner = "nvbn";
    repo = pname;
    rev = version;
    sha256 = "0fnf78956pwhb9cgv1jmgypnkma5xzflkivfrkfiadbgin848yfg";
  };

  propagatedBuildInputs = [ colorama decorator psutil pyte six ];

  checkInputs = [ pytest pytest-mock ];

  checkPhase = ''
    export HOME=$TMPDIR
    export LANG=en_US.UTF-8
    export XDG_CACHE_HOME=$TMPDIR/cache
    export XDG_CONFIG_HOME=$TMPDIR/config
    py.test
  '';

  doCheck = false; # The above is only enough for tests to pass outside the sandbox.

  meta = with lib; {
    homepage = "https://github.com/nvbn/thefuck";
    description = "Magnificent app which corrects your previous console command";
    license = licenses.mit;
    maintainers = with maintainers; [ ma27 ];
  };
}

Fix tests, add SuperSandro2000 as maintainer

{ lib, fetchFromGitHub, buildPythonApplication
, colorama, decorator, psutil, pyte, six
, go, mock, pytestCheckHook, pytest-mock
}:

buildPythonApplication rec {
  pname = "thefuck";
  version = "3.30";

  src = fetchFromGitHub {
    owner = "nvbn";
    repo = pname;
    rev = version;
    sha256 = "0fnf78956pwhb9cgv1jmgypnkma5xzflkivfrkfiadbgin848yfg";
  };

  propagatedBuildInputs = [ colorama decorator psutil pyte six ];

  checkInputs = [ go mock pytestCheckHook pytest-mock ];

  meta = with lib; {
    homepage = "https://github.com/nvbn/thefuck";
    description = "Magnificent app which corrects your previous console command";
    license = licenses.mit;
    maintainers = with maintainers; [ ma27 SuperSandro2000 ];
  };
}


{ stdenv
, lib
, fetchFromSourcehut
, pkg-config
, cmake
, meson
, ninja
, gtk3
, gtk-layer-shell
, json_c
, scdoc
}:

stdenv.mkDerivation rec {
  pname = "gtkgreet";
  version = "0.7";

  src = fetchFromSourcehut {
    owner = "~kennylevinsen";
    repo = pname;
    rev = version;
    sha256 = "ms+2FdtzzNlmlzNxFhu4cpX5H+5H+9ZOtZ0p8uVA3lo=";
  };

  nativeBuildInputs = [
    pkg-config
    meson
    ninja
    cmake
  ];

  buildInputs = [
    gtk3
    gtk-layer-shell
    json_c
    scdoc
  ];

  mesonFlags = [
    "-Dlayershell=enabled"
  ];

  meta = with lib; {
    description = "GTK based greeter for greetd, to be run under cage or similar";
    homepage = "https://git.sr.ht/~kennylevinsen/gtkgreet";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ luc65r ];
    platforms = platforms.linux;
  };
}

Fix build with GLib 2.74

{ stdenv
, lib
, fetchFromSourcehut
, pkg-config
, cmake
, meson
, ninja
, gtk3
, gtk-layer-shell
, json_c
, scdoc
}:

stdenv.mkDerivation rec {
  pname = "gtkgreet";
  version = "0.7";

  src = fetchFromSourcehut {
    owner = "~kennylevinsen";
    repo = pname;
    rev = version;
    sha256 = "ms+2FdtzzNlmlzNxFhu4cpX5H+5H+9ZOtZ0p8uVA3lo=";
  };

  nativeBuildInputs = [
    pkg-config
    meson
    ninja
    cmake
  ];

  buildInputs = [
    gtk3
    gtk-layer-shell
    json_c
    scdoc
  ];

  mesonFlags = [
    "-Dlayershell=enabled"
  ];

  # G_APPLICATION_FLAGS_NONE is deprecated in GLib 2.73.3+.
  NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";

  meta = with lib; {
    description = "GTK based greeter for greetd, to be run under cage or similar";
    homepage = "https://git.sr.ht/~kennylevinsen/gtkgreet";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ luc65r ];
    platforms = platforms.linux;
  };
}


{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "aespipe-${version}";
  version = "v2.4c";

  src = fetchurl {
    url = "mirror://sourceforge/loop-aes/aespipe/${name}.tar.bz2";
    sha256 = "0pl49jnjczjvfxwm9lw576qsjm1lxh8gc4g776l904cixaz90096";
  };

  meta = {
    description = "AES encrypting or decrypting pipe";
    homepage = http://loop-aes.sourceforge.net/aespipe.README;
    license = "GPL";
    #maintainers = stdenv.lib.maintainers.goibniu;
    platforms = stdenv.lib.platforms.linux;
  };
}

Fix typo in maintainer id

{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "aespipe-${version}";
  version = "v2.4c";

  src = fetchurl {
    url = "mirror://sourceforge/loop-aes/aespipe/${name}.tar.bz2";
    sha256 = "0pl49jnjczjvfxwm9lw576qsjm1lxh8gc4g776l904cixaz90096";
  };

  meta = {
    description = "AES encrypting or decrypting pipe";
    homepage = http://loop-aes.sourceforge.net/aespipe.README;
    license = "GPL";
    maintainers = stdenv.lib.maintainers.goibhniu;
    platforms = stdenv.lib.platforms.linux;
  };
}


/**
 * This Nix expression requires the user to download the j2sdk
 * distribution to /tmp. Please obtain j2sdk-1_5_0-beta-linux-i586.bin
 * from java.sun.com by hand and place it in /tmp. Blame Sun, not me.
 *
 * Note that this is not necessary if someone has already pushed a
 * binary.
 *
 * @author Martin Bravenboer <martin@cs.uu.nl>
 */
{stdenv, fetchurl}:

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

derivation {
  name = "j2sdk-1.5.0-beta3";
  filename = "jdk-1_5_0-beta3-b60";
  dirname = "jdk1.5.0";
  system = stdenv.system;
  builder = ./builder.sh;
  pathname = "/tmp/jdk-1_5_0-beta3-bin-b60-linux-i586-28_jul_2004.bin";
  md5 = "c0e25a0776a957a8872382c5b90ef9ca";
  stdenv = stdenv;
}

Update to jdk 1.5.0 release candidate

/**
 * This Nix expression requires the user to download the j2sdk
 * distribution to /tmp. Please obtain j2sdk-1_5_0-beta-linux-i586.bin
 * from java.sun.com by hand and place it in /tmp. Blame Sun, not me.
 *
 * Note that this is not necessary if someone has already pushed a
 * binary.
 *
 * @author Martin Bravenboer <martin@cs.uu.nl>
 */
{stdenv, fetchurl}:

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

derivation {
  name = "j2sdk-1.5.0-rc";
  filename = "jdk-1_5_0-rc";
  dirname = "jdk1.5.0";
  system = stdenv.system;
  builder = ./builder.sh;
  pathname = "/tmp/jdk-1_5_0-rc-linux-i586.bin";
  md5 = "b8c90fb75b270cb32a72766ab8f89dbb";
  stdenv = stdenv;
}


{stdenv, fetchurl, libcap}:

stdenv.mkDerivation rec{
  name = "lxc-0.7.4";

  src = fetchurl {
    url = "mirror://sourceforge/lxc/${name}.tar.gz";
    sha256 = "a8237b2a42a05266a39aa9f9d64d7aa6f12b197cf1982d7764a0b0f9b940eef6";
  };

  patchPhase = ''
    sed -i -e '/ldconfig/d' src/lxc/Makefile.in
  '';

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

  postInstall = ''
    cd "$out/lib"
    lib=liblxc.so.?.*
    ln -s $lib $(echo $lib | sed -re 's/(liblxc[.]so[.].)[.].*/\1/')
  '';

  buildInputs = [ libcap ];

  meta = {
    homepage = http://lxc.sourceforge.net;
    description = "lxc Linux Containers userland tools";
    license = "LGPLv2.1+";
    platforms = stdenv.lib.platforms.linux;
  };
}

Update Linux Containers userspace tools

{stdenv, fetchurl, libcap}:

stdenv.mkDerivation rec{
  name = "lxc-0.7.5";

  src = fetchurl {
    url = "http://lxc.sf.net/download/lxc/${name}.tar.gz";
    sha256 = "019ec63f250c874bf7625b1f1bf555b1a6e3a947937a4fca73100abddf829b1c";
  };

  patchPhase = ''
    sed -i -e '/ldconfig/d' src/lxc/Makefile.in
  '';

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

  postInstall = ''
    cd "$out/lib"
    lib=liblxc.so.?.*
    ln -s $lib $(echo $lib | sed -re 's/(liblxc[.]so[.].)[.].*/\1/')
  '';

  buildInputs = [ libcap ];

  meta = {
    homepage = http://lxc.sourceforge.net;
    description = "lxc Linux Containers userland tools";
    license = "LGPLv2.1+";
    platforms = stdenv.lib.platforms.linux;
  };
}


# ...

{ config, lib, pkgs, ... }:
{
  # Nothing in /tmp should survive a reboot
  boot.cleanTmpDir = true;
  # Use simple bootloader; I prefer the on-demand BIOs boot menu
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  # Just the bear necessities~
  environment.systemPackages = with pkgs; [
    coreutils
    git
    killall
    unzip
    vim
    wget
    # Support for extra filesystems
    sshfs
    exfat
    ntfs3g
    hfsprogs
  ];

  ###
  # My user settings
  my = {
    username = "hlissner";
    env.PATH = [ <my/bin> ];
    user = {
      isNormalUser = true;
      uid = 1000;
      extraGroups = [ "wheel" "video" "networkmanager" ];
      shell = pkgs.zsh;
    };
  };

  # Obey XDG conventions; a tidy $HOME is a tidy mind.
  my.home.xdg.enable = true;
  environment.variables = {
    # These are the defaults, but some applications are buggy when these lack
    # explicit values.
    XDG_CONFIG_HOME = "$HOME/.config";
    XDG_CACHE_HOME = "$HOME/.cache";
    XDG_DATA_HOME = "$HOME/.local/share";
    XDG_BIN_HOME = "$HOME/.local/bin";
  };

  ### Universal defaults
  networking.firewall.enable = true;
}

Switch from boot.cleanTmpDir to a tmpfs on /tmp

# ...

{ config, lib, pkgs, ... }:
{
  # Nothing in /tmp should survive a reboot
  boot.tmpOnTmpfs = true;
  # Use simple bootloader; I prefer the on-demand BIOs boot menu
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  # Just the bear necessities~
  environment.systemPackages = with pkgs; [
    coreutils
    git
    killall
    unzip
    vim
    wget
    # Support for extra filesystems
    sshfs
    exfat
    ntfs3g
    hfsprogs
  ];

  ###
  # My user settings
  my = {
    username = "hlissner";
    env.PATH = [ <my/bin> ];
    user = {
      isNormalUser = true;
      uid = 1000;
      extraGroups = [ "wheel" "video" "networkmanager" ];
      shell = pkgs.zsh;
    };
  };

  # Obey XDG conventions; a tidy $HOME is a tidy mind.
  my.home.xdg.enable = true;
  environment.variables = {
    # These are the defaults, but some applications are buggy when these lack
    # explicit values.
    XDG_CONFIG_HOME = "$HOME/.config";
    XDG_CACHE_HOME = "$HOME/.cache";
    XDG_DATA_HOME = "$HOME/.local/share";
    XDG_BIN_HOME = "$HOME/.local/bin";
  };

  ### Universal defaults
  networking.firewall.enable = true;
}


{stdenv, fetchurl, unzip, autoconf, automake, makeWrapper, pkgconfig
, gnome3, avahi, gtk3, libnotify, pulseaudio, x11}:

stdenv.mkDerivation rec {
  name = "pasystray-0.5.2";

  src = fetchurl {
    url = "https://github.com/christophgysin/pasystray/archive/${name}.zip";
    sha256 = "084jld5zk89h4akll73bwhfav6mpg55zmdd5kvlg396rqi9lqkj4";
  };

  buildInputs = [ unzip autoconf automake makeWrapper pkgconfig
                  gnome3.defaultIconTheme
                  avahi gtk3 libnotify pulseaudio x11 ];

  preConfigure = ''
    aclocal
    autoconf
    autoheader
    automake --add-missing
  '';

  preFixup = ''
    wrapProgram "$out/bin/pasystray" \
      --prefix XDG_DATA_DIRS : "${gnome3.defaultIconTheme}/share:$GSETTINGS_SCHEMAS_PATH"
  '';

  meta = with stdenv.lib; {
    description = "PulseAudio system tray";
    homepage = "https://github.com/christophgysin/pasystray";
    license = licenses.lgpl21Plus;
    maintainers = [ maintainers.exlevan ];
    platfoms = platforms.linux;
  };
}

Use fetchzip to retrieve new pasystray.

{stdenv, fetchzip, autoconf, automake, makeWrapper, pkgconfig
, gnome3, avahi, gtk3, libnotify, pulseaudio, x11}:

stdenv.mkDerivation rec {
  name = "pasystray-0.5.2";

  src = fetchzip {
    url = "https://github.com/christophgysin/pasystray/archive/${name}.zip";
    sha256 = "084jld5zk89h4akll73bwhfav6mpg55zmdd5kvlg396rqi9lqkj4";
  };

  buildInputs = [ autoconf automake makeWrapper pkgconfig
                  gnome3.defaultIconTheme
                  avahi gtk3 libnotify pulseaudio x11 ];

  preConfigure = ''
    aclocal
    autoconf
    autoheader
    automake --add-missing
  '';

  preFixup = ''
    wrapProgram "$out/bin/pasystray" \
      --prefix XDG_DATA_DIRS : "${gnome3.defaultIconTheme}/share:$GSETTINGS_SCHEMAS_PATH"
  '';

  meta = with stdenv.lib; {
    description = "PulseAudio system tray";
    homepage = "https://github.com/christophgysin/pasystray";
    license = licenses.lgpl21Plus;
    maintainers = [ maintainers.exlevan ];
    platfoms = platforms.linux;
  };
}


{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  version = "0.03.11";
  name = "stress-ng-${version}";

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

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

  enableParallelBuilding = true;

  makeFlags = "DESTDIR=$(out)";

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

Update stress-ng 0.03.11 -> 0.03.13

{ stdenv, fetchurl }:

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

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

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

  enableParallelBuilding = true;

  makeFlags = "DESTDIR=$(out)";

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


{ fetchurl, stdenv, gettext }:

stdenv.mkDerivation (rec {
  name = "libelf-0.8.13";

  src = fetchurl {
    url = "http://www.mr511.de/software/${name}.tar.gz";
    sha256 = "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr";
  };

  doCheck = true;

  meta = {
    description = "Libelf, an ELF object file access library";

    homepage = http://www.mr511.de/software/english.html;

    license = "LGPLv2+";

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

//

# Gettext is lacking from `stdenv' on Darwin, but not completely, so NLS
# support is enabled but eventually fails.
# FIXME: Eventually make Gettext a build input on all platforms.
(if stdenv.isDarwin
 then { buildInputs = [ gettext ]; }
 else { }))

Disable native language support on Darwin.

{ fetchurl, stdenv, gettext }:

stdenv.mkDerivation (rec {
  name = "libelf-0.8.13";

  src = fetchurl {
    url = "http://www.mr511.de/software/${name}.tar.gz";
    sha256 = "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr";
  };

  doCheck = true;

  meta = {
    description = "Libelf, an ELF object file access library";

    homepage = http://www.mr511.de/software/english.html;

    license = "LGPLv2+";

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

//

# Libelf's custom NLS macros fail to determine the catalog file extension on
# Darwin, so disable NLS for now.
# FIXME: Eventually make Gettext a build input on all platforms.
(if stdenv.isDarwin
 then { configureFlags = [ "--disable-nls" ]; }
 else { }))