about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/misc')
-rw-r--r--nixpkgs/pkgs/applications/misc/1password/default.nix44
-rw-r--r--nixpkgs/pkgs/applications/misc/abook/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/adobe-reader/builder.sh42
-rw-r--r--nixpkgs/pkgs/applications/misc/adobe-reader/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/airtame/default.nix80
-rw-r--r--nixpkgs/pkgs/applications/misc/alacritty/default.nix125
-rw-r--r--nixpkgs/pkgs/applications/misc/albert/default.nix52
-rw-r--r--nixpkgs/pkgs/applications/misc/almanah/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/aminal/default.nix75
-rw-r--r--nixpkgs/pkgs/applications/misc/antfs-cli/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/misc/ape/apeclex.nix8
-rw-r--r--nixpkgs/pkgs/applications/misc/ape/clex.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/ape/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/misc/appeditor/default.nix56
-rw-r--r--nixpkgs/pkgs/applications/misc/apvlv/default.nix74
-rw-r--r--nixpkgs/pkgs/applications/misc/apvlv/fix-build-with-poppler-0.73.0.patch13
-rw-r--r--nixpkgs/pkgs/applications/misc/archiver/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/misc/artha/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/misc/artha/gio-underlink.patch13
-rw-r--r--nixpkgs/pkgs/applications/misc/asciiquarium/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/audio/sox/default.nix50
-rw-r--r--nixpkgs/pkgs/applications/misc/audio/soxr/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/misc/audio/wavesurfer/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/audio/wavrsocvt/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/autospotting/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/autospotting/deps.nix75
-rw-r--r--nixpkgs/pkgs/applications/misc/avrdudess/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/misc/barrier/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/misc/bashSnippets/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/misc/batti/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/misc/bb/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/bemenu/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/misc/bibletime/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/misc/bicon/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/bitcoinarmory/default.nix91
-rw-r--r--nixpkgs/pkgs/applications/misc/bleachbit/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/misc/blender/default.nix102
-rw-r--r--nixpkgs/pkgs/applications/misc/blender/fix-include.patch12
-rw-r--r--nixpkgs/pkgs/applications/misc/buku/default.nix76
-rw-r--r--nixpkgs/pkgs/applications/misc/calcurse/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/misc/calibre/default.nix178
-rw-r--r--nixpkgs/pkgs/applications/misc/calibre/disable_plugins.patch17
-rw-r--r--nixpkgs/pkgs/applications/misc/calibre/dont_build_unrar_plugin.patch12
-rw-r--r--nixpkgs/pkgs/applications/misc/calibre/no_updates_dialog.patch15
-rw-r--r--nixpkgs/pkgs/applications/misc/candle/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/cardpeek/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/cataract/build.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/cataract/default.nix8
-rw-r--r--nixpkgs/pkgs/applications/misc/cataract/unstable.nix8
-rw-r--r--nixpkgs/pkgs/applications/misc/catclock/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/cbatticon/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/cdrtools/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/misc/cdrtools/fix-paths.patch32
-rw-r--r--nixpkgs/pkgs/applications/misc/cgminer/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/misc/cheat/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/misc/cherrytree/default.nix50
-rw-r--r--nixpkgs/pkgs/applications/misc/cherrytree/subprocess.patch14
-rw-r--r--nixpkgs/pkgs/applications/misc/cli-visualizer/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/clipit/default.nix21
-rw-r--r--nixpkgs/pkgs/applications/misc/clipmenu/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/cmatrix/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/cointop/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/colort/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/misc/confclerk/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/cool-retro-term/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/misc/copyq/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/coursera-dl/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/misc/cpp-ethereum/default.nix85
-rw-r--r--nixpkgs/pkgs/applications/misc/crumbs/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/ctodo/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/cum/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/cura/default.nix57
-rw-r--r--nixpkgs/pkgs/applications/misc/cura/lulzbot.nix58
-rw-r--r--nixpkgs/pkgs/applications/misc/cura/numpy-cast.patch12
-rw-r--r--nixpkgs/pkgs/applications/misc/cura/plugins.nix34
-rw-r--r--nixpkgs/pkgs/applications/misc/cura/stable.nix73
-rw-r--r--nixpkgs/pkgs/applications/misc/curabydagoma/default.nix76
-rw-r--r--nixpkgs/pkgs/applications/misc/curaengine/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/misc/curaengine/stable.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/dbeaver/default.nix70
-rw-r--r--nixpkgs/pkgs/applications/misc/dbvisualizer/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/ddgr/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/misc/deco/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/devilspie2/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/misc/dfilemanager/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/misc/diff-pdf/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/diffpdf/default.nix60
-rw-r--r--nixpkgs/pkgs/applications/misc/diffpdf/fix_path_poppler_qt5.patch16
-rw-r--r--nixpkgs/pkgs/applications/misc/digitalbitbox/default.nix142
-rw-r--r--nixpkgs/pkgs/applications/misc/ding/default.nix55
-rw-r--r--nixpkgs/pkgs/applications/misc/ding/dict.patch26
-rw-r--r--nixpkgs/pkgs/applications/misc/direwolf/default.nix44
-rw-r--r--nixpkgs/pkgs/applications/misc/djvulibre/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/misc/dmensamenu/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/misc/dmensamenu/dmenu-path.patch13
-rw-r--r--nixpkgs/pkgs/applications/misc/dmenu/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/dmenu2/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/dockbarx/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/doing/Gemfile2
-rw-r--r--nixpkgs/pkgs/applications/misc/doing/Gemfile.lock25
-rw-r--r--nixpkgs/pkgs/applications/misc/doing/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/doing/gemset.nix60
-rw-r--r--nixpkgs/pkgs/applications/misc/doomseeker/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/doomseeker/fix_paths.patch40
-rw-r--r--nixpkgs/pkgs/applications/misc/doomseeker/qt_build_fix.patch47
-rw-r--r--nixpkgs/pkgs/applications/misc/dotfiles/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/misc/dozenal/default.nix61
-rw-r--r--nixpkgs/pkgs/applications/misc/dozenal/lua-header.patch16
-rw-r--r--nixpkgs/pkgs/applications/misc/dunst/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/misc/eaglemode/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/misc/electron-cash/default.nix81
-rw-r--r--nixpkgs/pkgs/applications/misc/electrum/dash.nix46
-rw-r--r--nixpkgs/pkgs/applications/misc/electrum/default.nix128
-rw-r--r--nixpkgs/pkgs/applications/misc/electrum/ltc.nix57
-rw-r--r--nixpkgs/pkgs/applications/misc/electrum/update.nix59
-rw-r--r--nixpkgs/pkgs/applications/misc/emem/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/epdfview/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/misc/et/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/eterm/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/misc/eureka-editor/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/evilvte/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/evtest/default.nix21
-rw-r--r--nixpkgs/pkgs/applications/misc/exercism/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/misc/exercism/deps.nix201
-rw-r--r--nixpkgs/pkgs/applications/misc/extract_url/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/misc/far2l/default.nix85
-rw-r--r--nixpkgs/pkgs/applications/misc/fbreader/default.nix75
-rw-r--r--nixpkgs/pkgs/applications/misc/fbreader/typecheck.patch11
-rw-r--r--nixpkgs/pkgs/applications/misc/fehlstart/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/fehlstart/use-nix-profiles.patch21
-rw-r--r--nixpkgs/pkgs/applications/misc/fetchmail/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/misc/fff/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/filet/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/misc/flamerobin/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/fme/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/misc/font-manager/default.nix67
-rw-r--r--nixpkgs/pkgs/applications/misc/freemind/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/misc/fsv/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/misc/gImageReader/default.nix70
-rw-r--r--nixpkgs/pkgs/applications/misc/galculator/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/gallery-dl/default.nix21
-rw-r--r--nixpkgs/pkgs/applications/misc/gammu/bashcomp-dir.patch11
-rw-r--r--nixpkgs/pkgs/applications/misc/gammu/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/misc/gammu/systemd.patch30
-rw-r--r--nixpkgs/pkgs/applications/misc/ganttproject-bin/default.nix60
-rw-r--r--nixpkgs/pkgs/applications/misc/garmin-plugin/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/misc/gcal/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/gcalcli/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/get_iplayer/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/getxbook/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/misc/girara/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/misc/gkrellm/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/misc/gksu/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/misc/gksu/gksu-2.0.2-glib-2.31.patch29
-rw-r--r--nixpkgs/pkgs/applications/misc/glava/default.nix84
-rw-r--r--nixpkgs/pkgs/applications/misc/glom/default.nix132
-rw-r--r--nixpkgs/pkgs/applications/misc/gmrun/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/misc/gmrun/find-config-file-in-system-etc-dir.patch18
-rw-r--r--nixpkgs/pkgs/applications/misc/gmrun/gcc43.patch51
-rw-r--r--nixpkgs/pkgs/applications/misc/gmrun/gmrun-0.9.2-xdg.patch58
-rw-r--r--nixpkgs/pkgs/applications/misc/gmtp/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/gnome-recipes/default.nix79
-rw-r--r--nixpkgs/pkgs/applications/misc/gnome-usage/default.nix63
-rw-r--r--nixpkgs/pkgs/applications/misc/gnome15/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/go-jira/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/misc/golden-cheetah/default.nix59
-rw-r--r--nixpkgs/pkgs/applications/misc/goldendict/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/gollum/Gemfile2
-rw-r--r--nixpkgs/pkgs/applications/misc/gollum/Gemfile.lock68
-rw-r--r--nixpkgs/pkgs/applications/misc/gollum/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/gollum/gemset.nix284
-rw-r--r--nixpkgs/pkgs/applications/misc/googleearth/default.nix106
-rw-r--r--nixpkgs/pkgs/applications/misc/googler/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/gosmore/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/misc/gosmore/pointer_int_comparison.patch11
-rw-r--r--nixpkgs/pkgs/applications/misc/gpa/default.nix20
-rw-r--r--nixpkgs/pkgs/applications/misc/gpg-mdp/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/misc/gphoto2/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/gphoto2/gphotofs.nix23
-rw-r--r--nixpkgs/pkgs/applications/misc/gpsbabel/default.nix77
-rw-r--r--nixpkgs/pkgs/applications/misc/gpscorrelate/default.nix63
-rw-r--r--nixpkgs/pkgs/applications/misc/gpsprune/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/misc/gpx-viewer/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/gpx/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/misc/gpxsee/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/gramps/default.nix65
-rw-r--r--nixpkgs/pkgs/applications/misc/green-pdfviewer/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/green-pdfviewer/gdk-libs.patch55
-rw-r--r--nixpkgs/pkgs/applications/misc/gremlin-console/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/grip/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/misc/grsync/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/gsimplecal/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/gtk2fontsel/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/guake/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/misc/gummi/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/misc/gv/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/misc/gxmessage/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/misc/gxneur/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/misc/hamster-time-tracker/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/misc/haxor-news/default.nix44
-rw-r--r--nixpkgs/pkgs/applications/misc/hdate/default.nix16
-rw-r--r--nixpkgs/pkgs/applications/misc/hello-unfree/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/misc/hello/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/misc/hivemind/default.nix21
-rw-r--r--nixpkgs/pkgs/applications/misc/houdini/default.nix14
-rw-r--r--nixpkgs/pkgs/applications/misc/houdini/runtime.nix86
-rw-r--r--nixpkgs/pkgs/applications/misc/hovercraft/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/misc/hr/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/hstr/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/misc/hubstaff/default.nix65
-rw-r--r--nixpkgs/pkgs/applications/misc/hubstaff/revision.json5
-rwxr-xr-xnixpkgs/pkgs/applications/misc/hubstaff/update.sh18
-rw-r--r--nixpkgs/pkgs/applications/misc/hugo/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/hyper/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/misc/icesl/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/ikiwiki/default.nix88
-rw-r--r--nixpkgs/pkgs/applications/misc/img2pdf/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/misc/ipmicfg/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/misc/ipmiview/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/iterm2/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/iterm2/disable_updates.patch11
-rw-r--r--nixpkgs/pkgs/applications/misc/j4-dmenu-desktop/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/jbidwatcher/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/misc/jekyll/basic/Gemfile10
-rw-r--r--nixpkgs/pkgs/applications/misc/jekyll/basic/Gemfile.lock99
-rw-r--r--nixpkgs/pkgs/applications/misc/jekyll/basic/gemset.nix402
-rw-r--r--nixpkgs/pkgs/applications/misc/jekyll/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/misc/jekyll/full/Gemfile30
-rw-r--r--nixpkgs/pkgs/applications/misc/jekyll/full/Gemfile.lock155
-rw-r--r--nixpkgs/pkgs/applications/misc/jekyll/full/gemset.nix772
-rwxr-xr-xnixpkgs/pkgs/applications/misc/jekyll/update.sh15
-rw-r--r--nixpkgs/pkgs/applications/misc/jgmenu/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/misc/jigdo/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/jigdo/sizewidth.patch40
-rw-r--r--nixpkgs/pkgs/applications/misc/joplin-desktop/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/misc/josm/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/misc/jp2a/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/jrnl/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/k2pdfopt/default.nix132
-rw-r--r--nixpkgs/pkgs/applications/misc/k2pdfopt/k2pdfopt.patch99
-rw-r--r--nixpkgs/pkgs/applications/misc/k2pdfopt/leptonica-CVE-2018-3836.patch95
-rw-r--r--nixpkgs/pkgs/applications/misc/k2pdfopt/tesseract.patch13
-rw-r--r--nixpkgs/pkgs/applications/misc/kanboard/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/misc/kdbplus/default.nix75
-rw-r--r--nixpkgs/pkgs/applications/misc/kdeconnect/default.nix50
-rw-r--r--nixpkgs/pkgs/applications/misc/keepass-plugins/keeagent/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/keepass-plugins/keepasshttp/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/keepass-plugins/keepassrpc/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/misc/keepass/default.nix115
-rwxr-xr-xnixpkgs/pkgs/applications/misc/keepass/extractWinRscIconsToStdFreeDesktopDir.sh61
-rw-r--r--nixpkgs/pkgs/applications/misc/keepass/fix-paths.patch87
-rw-r--r--nixpkgs/pkgs/applications/misc/keepass/keepass-plugins-load.patch1
-rw-r--r--nixpkgs/pkgs/applications/misc/keepass/keepass-plugins.patch13
-rw-r--r--nixpkgs/pkgs/applications/misc/keepassx/2.0.nix21
-rw-r--r--nixpkgs/pkgs/applications/misc/keepassx/community.nix119
-rw-r--r--nixpkgs/pkgs/applications/misc/keepassx/darwin.patch53
-rw-r--r--nixpkgs/pkgs/applications/misc/keepassx/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/keepassx/random.patch13
-rw-r--r--nixpkgs/pkgs/applications/misc/khal/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/misc/khard/default.nix55
-rw-r--r--nixpkgs/pkgs/applications/misc/kitty/default.nix122
-rw-r--r--nixpkgs/pkgs/applications/misc/kitty/fix-paths.patch27
-rw-r--r--nixpkgs/pkgs/applications/misc/kitty/no-lto.patch12
-rw-r--r--nixpkgs/pkgs/applications/misc/kitty/no-werror.patch11
-rw-r--r--nixpkgs/pkgs/applications/misc/kitty/png2icns.patch19
-rw-r--r--nixpkgs/pkgs/applications/misc/kiwix/default.nix110
-rw-r--r--nixpkgs/pkgs/applications/misc/krename/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/krusader/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/misc/kupfer/default.nix57
-rw-r--r--nixpkgs/pkgs/applications/misc/latte-dock/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/lenmus/default.nix52
-rw-r--r--nixpkgs/pkgs/applications/misc/libosmocore/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/misc/librecad/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/misc/lifelines/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/lighthouse/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/misc/lilyterm/default.nix57
-rw-r--r--nixpkgs/pkgs/applications/misc/llpp/default.nix57
-rw-r--r--nixpkgs/pkgs/applications/misc/llpp/fix-build-bash.patch88
-rw-r--r--nixpkgs/pkgs/applications/misc/loxodo/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/misc/ltwheelconf/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/lutris/default.nix178
-rw-r--r--nixpkgs/pkgs/applications/misc/lxterminal/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/misc/lxterminal/respect-xml-catalog-files-var.patch15
-rw-r--r--nixpkgs/pkgs/applications/misc/lyx/default.nix53
-rw-r--r--nixpkgs/pkgs/applications/misc/madonctl/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/madonctl/deps.nix228
-rw-r--r--nixpkgs/pkgs/applications/misc/makeself/Use-rm-from-PATH.patch43
-rw-r--r--nixpkgs/pkgs/applications/misc/makeself/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/mako/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/masterpdfeditor/default.nix53
-rw-r--r--nixpkgs/pkgs/applications/misc/mdp/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/mediainfo-gui/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/mediainfo/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/megasync/default.nix125
-rw-r--r--nixpkgs/pkgs/applications/misc/megasync/install-megasync.patch21
-rw-r--r--nixpkgs/pkgs/applications/misc/megasync/noinstall-distro-version.patch13
-rw-r--r--nixpkgs/pkgs/applications/misc/memo/default.nix52
-rw-r--r--nixpkgs/pkgs/applications/misc/mencal/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/menumaker/default.nix21
-rw-r--r--nixpkgs/pkgs/applications/misc/merkaartor/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/metamorphose2/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/misc/metar/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/milu/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/misc/minergate-cli/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/minergate/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/mlterm/default.nix94
-rw-r--r--nixpkgs/pkgs/applications/misc/moonlight-embedded/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/misc/mop/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/mop/deps.nix11
-rw-r--r--nixpkgs/pkgs/applications/misc/mpvc/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/mqtt-bench/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/mqtt-bench/deps.nix21
-rw-r--r--nixpkgs/pkgs/applications/misc/mrxvt/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/misc/mucommander/default.nix84
-rw-r--r--nixpkgs/pkgs/applications/misc/multibootusb/default.nix59
-rw-r--r--nixpkgs/pkgs/applications/misc/mupdf/darwin.patch30
-rw-r--r--nixpkgs/pkgs/applications/misc/mupdf/default.nix97
-rw-r--r--nixpkgs/pkgs/applications/misc/mupdf/default.upstream7
-rw-r--r--nixpkgs/pkgs/applications/misc/mupdf/mupdf-1.14-shared_libs.patch39
-rw-r--r--nixpkgs/pkgs/applications/misc/mwic/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/mysql-workbench/default.nix109
-rw-r--r--nixpkgs/pkgs/applications/misc/mysql-workbench/fix-gdal-includes.patch47
-rw-r--r--nixpkgs/pkgs/applications/misc/mysql-workbench/hardcode-paths.patch187
-rw-r--r--nixpkgs/pkgs/applications/misc/mystem/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/misc/nanoblogger/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/navipowm/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/navit/CMakeLists.txt.patch13
-rw-r--r--nixpkgs/pkgs/applications/misc/navit/default.nix90
-rw-r--r--nixpkgs/pkgs/applications/misc/neap/default.nix44
-rw-r--r--nixpkgs/pkgs/applications/misc/netsurf/browser/default.nix76
-rw-r--r--nixpkgs/pkgs/applications/misc/netsurf/buildsystem/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/misc/netsurf/libcss/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/netsurf/libdom/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/netsurf/libhubbub/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/misc/netsurf/libnsbmp/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/netsurf/libnsfb/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/netsurf/libnsgif/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/netsurf/libnsutils/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/netsurf/libparserutils/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/netsurf/libutf8proc/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/netsurf/libwapcaplet/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/netsurf/nsgenbind/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/nix-tour/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/nixnote2/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/misc/nnn/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/noice/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/notable/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/notejot/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/misc/notify-osd-customizable/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/misc/notify-osd/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/nrsc5/default.nix52
-rw-r--r--nixpkgs/pkgs/applications/misc/nut/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/misc/ocropus/default.nix59
-rw-r--r--nixpkgs/pkgs/applications/misc/octoprint/default.nix101
-rw-r--r--nixpkgs/pkgs/applications/misc/octoprint/m33-fio-one-library.patch175
-rw-r--r--nixpkgs/pkgs/applications/misc/octoprint/plugins.nix196
-rw-r--r--nixpkgs/pkgs/applications/misc/ola/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/omegat.nix40
-rw-r--r--nixpkgs/pkgs/applications/misc/onboard/default.nix164
-rw-r--r--nixpkgs/pkgs/applications/misc/onboard/fix-paths.patch11
-rw-r--r--nixpkgs/pkgs/applications/misc/onboard/hunspell-use-xdg-datadirs.patch20
-rw-r--r--nixpkgs/pkgs/applications/misc/oneko/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/openbox-menu/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/openbox-menu/with-svg.patch11
-rw-r--r--nixpkgs/pkgs/applications/misc/openbrf/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/misc/opencpn/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/openjump/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/opentx/default.nix62
-rw-r--r--nixpkgs/pkgs/applications/misc/orca/default.nix75
-rw-r--r--nixpkgs/pkgs/applications/misc/orca/fix-paths.patch78
-rw-r--r--nixpkgs/pkgs/applications/misc/orpie/default.nix21
-rw-r--r--nixpkgs/pkgs/applications/misc/osm2xmap/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/misc/osmctools/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/misc/osmium-tool/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/misc/overmind/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/misc/pbpst/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/misc/pcmanfm/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/pcmanx-gtk2/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/pdf-quench/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/misc/pdfdiff/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/misc/pdfmod/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/misc/pdfpc/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/pell/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/misc/perkeep/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/pgadmin/default.nix58
-rw-r--r--nixpkgs/pkgs/applications/misc/pgmanage/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/phwmon/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/misc/pinfo/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/misc/plank/default.nix64
-rw-r--r--nixpkgs/pkgs/applications/misc/plank/hide-in-pantheon.patch9
-rw-r--r--nixpkgs/pkgs/applications/misc/plasma-applet-volumewin7mixer/cmake.patch20
-rw-r--r--nixpkgs/pkgs/applications/misc/plasma-applet-volumewin7mixer/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/misc/playonlinux/default.nix110
-rw-r--r--nixpkgs/pkgs/applications/misc/plover/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/misc/pmenu/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/polar-bookshelf/default.nix91
-rw-r--r--nixpkgs/pkgs/applications/misc/polybar/default.nix83
-rw-r--r--nixpkgs/pkgs/applications/misc/posterazor/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/printrun/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/misc/procmail/CVE-2014-3618.patch18
-rw-r--r--nixpkgs/pkgs/applications/misc/procmail/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/projectlibre/default.nix44
-rw-r--r--nixpkgs/pkgs/applications/misc/prusa-slicer/default.nix89
-rw-r--r--nixpkgs/pkgs/applications/misc/pstree/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/pt/.bundle/config2
-rw-r--r--nixpkgs/pkgs/applications/misc/pt/Gemfile3
-rw-r--r--nixpkgs/pkgs/applications/misc/pt/Gemfile.lock69
-rw-r--r--nixpkgs/pkgs/applications/misc/pt/default.nix15
-rw-r--r--nixpkgs/pkgs/applications/misc/pt/gemset.nix273
-rw-r--r--nixpkgs/pkgs/applications/misc/ptask/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/ptask/json_c_is_error.patch13
-rw-r--r--nixpkgs/pkgs/applications/misc/ptask/tw-version.patch11
-rw-r--r--nixpkgs/pkgs/applications/misc/pwsafe/default.nix68
-rw-r--r--nixpkgs/pkgs/applications/misc/pydf/default.nix18
-rw-r--r--nixpkgs/pkgs/applications/misc/pytrainer/default.nix64
-rw-r--r--nixpkgs/pkgs/applications/misc/pytrainer/fix-test-tz.patch45
-rw-r--r--nixpkgs/pkgs/applications/misc/pytrainer/pytrainer-webkit.patch14
-rw-r--r--nixpkgs/pkgs/applications/misc/qMasterPassword/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/misc/qdirstat/default.nix55
-rw-r--r--nixpkgs/pkgs/applications/misc/qlcplus/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/misc/qmapshack/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/misc/qmetro/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/qolibri/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/qpdfview/default.nix44
-rw-r--r--nixpkgs/pkgs/applications/misc/qsyncthingtray/default.nix74
-rw-r--r--nixpkgs/pkgs/applications/misc/qsyncthingtray/qsyncthingtray-0.5.8-qt-5.6.3.patch13
-rw-r--r--nixpkgs/pkgs/applications/misc/qtbitcointrader/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/misc/qtpass/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/quicksynergy/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/misc/ranger/default.nix64
-rw-r--r--nixpkgs/pkgs/applications/misc/redis-desktop-manager/default.nix80
-rw-r--r--nixpkgs/pkgs/applications/misc/redshift-plasma-applet/default.nix44
-rw-r--r--nixpkgs/pkgs/applications/misc/redshift/575.patch51
-rw-r--r--nixpkgs/pkgs/applications/misc/redshift/default.nix93
-rw-r--r--nixpkgs/pkgs/applications/misc/regextester/default.nix58
-rw-r--r--nixpkgs/pkgs/applications/misc/rescuetime/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/misc/robo3t/default.nix78
-rw-r--r--nixpkgs/pkgs/applications/misc/robomongo/default.nix77
-rw-r--r--nixpkgs/pkgs/applications/misc/rofi-menugen/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/rofi/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/rofi/wrapper.nix24
-rw-r--r--nixpkgs/pkgs/applications/misc/roxterm/default.nix61
-rw-r--r--nixpkgs/pkgs/applications/misc/rsibreak/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/rtv/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/misc/rxvt/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-autocomplete-all-the-things/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-font-size/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-perl/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-perls/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-tabbedex/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-theme-switch/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-vtwheel.nix27
-rw-r--r--nixpkgs/pkgs/applications/misc/rxvt_unicode/default.nix72
-rw-r--r--nixpkgs/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-256-color-resources.patch255
-rw-r--r--nixpkgs/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-9.06-font-width.patch21
-rw-r--r--nixpkgs/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-makefile-phony.patch10
-rw-r--r--nixpkgs/pkgs/applications/misc/rxvt_unicode/wrapper.nix23
-rw-r--r--nixpkgs/pkgs/applications/misc/safeeyes/default.nix71
-rw-r--r--nixpkgs/pkgs/applications/misc/sakura/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/sbagen/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/sc-im/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/misc/sdcv/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/sent/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/sequeler/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/misc/sequelpro/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/sigal/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/misc/simplenote/default.nix64
-rw-r--r--nixpkgs/pkgs/applications/misc/slade/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/misc/slade/git.nix26
-rw-r--r--nixpkgs/pkgs/applications/misc/sleepyhead/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/misc/slic3r/default.nix85
-rw-r--r--nixpkgs/pkgs/applications/misc/slmenu/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/slstatus/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/solaar/default.nix50
-rw-r--r--nixpkgs/pkgs/applications/misc/spacefm/default.nix53
-rw-r--r--nixpkgs/pkgs/applications/misc/speedread/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/sqliteman/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/ssocr/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/misc/st/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/st/xst.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/stag/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/stog/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/stog/install.patch18
-rw-r--r--nixpkgs/pkgs/applications/misc/stretchly/default.nix139
-rw-r--r--nixpkgs/pkgs/applications/misc/stupidterm/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/styx/default.nix71
-rw-r--r--nixpkgs/pkgs/applications/misc/subsurface/default.nix111
-rw-r--r--nixpkgs/pkgs/applications/misc/super_user_spark/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/sweethome3d/default.nix100
-rw-r--r--nixpkgs/pkgs/applications/misc/sweethome3d/editors.nix96
-rw-r--r--nixpkgs/pkgs/applications/misc/synapse/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/misc/syncthing-tray/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/syncthing-tray/deps.nix93
-rw-r--r--nixpkgs/pkgs/applications/misc/synergy/default.nix87
-rw-r--r--nixpkgs/pkgs/applications/misc/synergy/openssl-1.1.patch18
-rw-r--r--nixpkgs/pkgs/applications/misc/synergy/respect_macos_arch.patch61
-rw-r--r--nixpkgs/pkgs/applications/misc/synergy/update_gtest_gmock.patch158
-rw-r--r--nixpkgs/pkgs/applications/misc/tabula/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/tangogps/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/misc/taskell/default.nix65
-rw-r--r--nixpkgs/pkgs/applications/misc/taskjuggler/2.x/default.nix76
-rw-r--r--nixpkgs/pkgs/applications/misc/taskjuggler/2.x/timezone-glibc.patch48
-rw-r--r--nixpkgs/pkgs/applications/misc/taskjuggler/3.x/Gemfile2
-rw-r--r--nixpkgs/pkgs/applications/misc/taskjuggler/3.x/Gemfile.lock21
-rw-r--r--nixpkgs/pkgs/applications/misc/taskjuggler/3.x/default.nix15
-rw-r--r--nixpkgs/pkgs/applications/misc/taskjuggler/3.x/gemset.nix47
-rw-r--r--nixpkgs/pkgs/applications/misc/taskjuggler/Gemfile2
-rw-r--r--nixpkgs/pkgs/applications/misc/taskjuggler/Gemfile.lock21
-rw-r--r--nixpkgs/pkgs/applications/misc/taskjuggler/default.nix19
-rw-r--r--nixpkgs/pkgs/applications/misc/taskjuggler/gemset.nix55
-rw-r--r--nixpkgs/pkgs/applications/misc/tasknc/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/misc/taskopen/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/misc/tasksh/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/misc/taskwarrior/0001-bash-completion-quote-pattern-argument-to-grep.patch28
-rw-r--r--nixpkgs/pkgs/applications/misc/taskwarrior/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/tdrop/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/termdown/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/misc/terminal-notifier/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/misc/terminal-parrot/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/misc/terminator/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/misc/terminus/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/misc/termite/add_errno_header.patch24
-rw-r--r--nixpkgs/pkgs/applications/misc/termite/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/misc/termite/remove_ldflags_macos.patch25
-rw-r--r--nixpkgs/pkgs/applications/misc/termite/url_regexp_trailing.patch27
-rw-r--r--nixpkgs/pkgs/applications/misc/termite/wrapper.nix15
-rw-r--r--nixpkgs/pkgs/applications/misc/termonad/default.nix19
-rw-r--r--nixpkgs/pkgs/applications/misc/teseq/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/misc/thinking-rock/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/misc/tilda/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/tilix/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/misc/timewarrior/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/misc/tint2/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/misc/tmatrix/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/misc/tnef/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/todiff/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/todoist/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/misc/todolist/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/misc/toggldesktop/TogglDesktop.pro19
-rw-r--r--nixpkgs/pkgs/applications/misc/toggldesktop/default.nix148
-rw-r--r--nixpkgs/pkgs/applications/misc/toggldesktop/libtoggl.pro20
-rw-r--r--nixpkgs/pkgs/applications/misc/tomboy/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/misc/toot/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/tootle/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/misc/topydo/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/misc/tpmmanager/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/misc/translate-shell/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/tthsum/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/misc/tvbrowser/bin.nix56
-rw-r--r--nixpkgs/pkgs/applications/misc/twmn/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/tzupdate/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/misc/udevil/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/udevil/device-info-sys-stat.patch14
-rw-r--r--nixpkgs/pkgs/applications/misc/udiskie/default.nix63
-rw-r--r--nixpkgs/pkgs/applications/misc/ulauncher/default.nix105
-rw-r--r--nixpkgs/pkgs/applications/misc/ulauncher/fix-path.patch13
-rw-r--r--nixpkgs/pkgs/applications/misc/urlscan/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/misc/urlview/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/misc/usync/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/misc/valentina/default.nix66
-rw-r--r--nixpkgs/pkgs/applications/misc/vcal/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/misc/veracrypt/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/verbiste/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/misc/vifm/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/viking/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/misc/visidata/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/vit/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/misc/volnoti/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/vp/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/misc/vue/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/misc/vym/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/misc/waybar/default.nix53
-rw-r--r--nixpkgs/pkgs/applications/misc/wcalc/default.nix20
-rw-r--r--nixpkgs/pkgs/applications/misc/weather/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/misc/wego/default.nix21
-rw-r--r--nixpkgs/pkgs/applications/misc/wego/deps.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/wikicurses/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/with-shell/default.nix20
-rw-r--r--nixpkgs/pkgs/applications/misc/wmname/default.nix21
-rw-r--r--nixpkgs/pkgs/applications/misc/wordnet/default.nix52
-rw-r--r--nixpkgs/pkgs/applications/misc/worker/default.nix20
-rw-r--r--nixpkgs/pkgs/applications/misc/workrave/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/misc/wtf/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/xastir/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/xautoclick/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/xca/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/misc/xchm/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/misc/xcruiser/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/misc/xdgmenumaker/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/xfe/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/xfontsel/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/xiphos/default.nix55
-rw-r--r--nixpkgs/pkgs/applications/misc/xkbd/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/misc/xkblayout-state/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/misc/xkbmon/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/xmind/default.nix90
-rw-r--r--nixpkgs/pkgs/applications/misc/xmind/java-env-config-fixes.patch40
-rw-r--r--nixpkgs/pkgs/applications/misc/xmr-stak/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/misc/xmrig/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/xmrig/proxy.nix38
-rw-r--r--nixpkgs/pkgs/applications/misc/xneur/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/misc/xpad/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/xpdf/cmake_version.patch15
-rw-r--r--nixpkgs/pkgs/applications/misc/xpdf/default.nix63
-rw-r--r--nixpkgs/pkgs/applications/misc/xpdf/libxpdf.nix52
-rw-r--r--nixpkgs/pkgs/applications/misc/xpdf/libxpdf.patch45
-rw-r--r--nixpkgs/pkgs/applications/misc/xpdf/xpdf-3.02-protection.patch74
-rw-r--r--nixpkgs/pkgs/applications/misc/xrandr-invert-colors/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/misc/xrq/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/misc/xscope/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/misc/xsuspender/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/xsw/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/misc/xsw/parse.patch21
-rw-r--r--nixpkgs/pkgs/applications/misc/xteddy/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/misc/xterm/default.nix71
-rw-r--r--nixpkgs/pkgs/applications/misc/xterm/sixel-256.support.patch11
-rw-r--r--nixpkgs/pkgs/applications/misc/xtermcontrol/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/xxkb/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/misc/yaft/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/misc/yakuake/default.nix70
-rw-r--r--nixpkgs/pkgs/applications/misc/yarssr/default.nix64
-rw-r--r--nixpkgs/pkgs/applications/misc/yate/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/misc/yokadi/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/misc/yubioath-desktop/default.nix57
-rw-r--r--nixpkgs/pkgs/applications/misc/zathura/cb/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/zathura/core/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/misc/zathura/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/misc/zathura/djvu/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/zathura/pdf-mupdf/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/misc/zathura/pdf-poppler/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/zathura/ps/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/zathura/wrapper.nix32
-rw-r--r--nixpkgs/pkgs/applications/misc/zk-shell/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/misc/zola/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/misc/zscroll/default.nix27
635 files changed, 28990 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/misc/1password/default.nix b/nixpkgs/pkgs/applications/misc/1password/default.nix
new file mode 100644
index 000000000000..79c3a6d7302f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/1password/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchzip }:
+
+stdenv.mkDerivation rec {
+  pname = "1password";
+  version = "0.5.7";
+  src =
+    if stdenv.hostPlatform.system == "i686-linux" then
+      fetchzip {
+        url = "https://cache.agilebits.com/dist/1P/op/pkg/v${version}/op_linux_386_v${version}.zip";
+        sha256 = "1193lq6cvqkv2cy07l6wzb25gb5vb3s3pxm534q3izhzrrz6lisz";
+        stripRoot = false;
+      }
+    else if stdenv.hostPlatform.system == "x86_64-linux" then
+      fetchzip {
+        url = "https://cache.agilebits.com/dist/1P/op/pkg/v${version}/op_linux_amd64_v${version}.zip";
+        sha256 = "0hlw1jasxzg31293d2n3ydzj62q7ji7nig7aaighcvzi3c9j7v51";
+        stripRoot = false;
+      }
+    else if stdenv.hostPlatform.system == "x86_64-darwin" then
+      fetchzip {
+        url = "https://cache.agilebits.com/dist/1P/op/pkg/v${version}/op_darwin_amd64_v${version}.zip";
+        sha256 = "05z5k63fza6v0vhydyiq4sh9xhxnd9rcfxyym7jihv6b3fv3fnx3";
+        stripRoot = false;
+      }
+    else throw "Architecture not supported";
+
+  installPhase = ''
+    install -D op $out/bin/op
+  '';
+  postFixup = stdenv.lib.optionalString stdenv.isLinux ''
+    patchelf \
+      --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
+      $out/bin/op
+  '';
+
+  meta = with stdenv.lib; {
+    description  = "1Password command-line tool";
+    homepage     = https://support.1password.com/command-line/;
+    downloadPage = https://app-updates.agilebits.com/product_history/CLI;
+    maintainers  = with maintainers; [ joelburget ];
+    license      = licenses.unfree;
+    platforms    = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/abook/default.nix b/nixpkgs/pkgs/applications/misc/abook/default.nix
new file mode 100644
index 000000000000..f87bd4c11ec4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/abook/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, fetchpatch, pkgconfig, ncurses, readline, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  name = "abook-0.6.1";
+
+  src = fetchurl {
+    url = "http://abook.sourceforge.net/devel/${name}.tar.gz";
+    sha256 = "1yf0ifyjhq2r003pnpn92mn0924bn9yxjifxxj2ldcsgd7w0vagh";
+  };
+
+  patches = [
+    (fetchpatch {
+       url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/gcc5.patch?h=packages/abook";
+       name = "gcc5.patch";
+       sha256 = "13n3qd6yy45i5n8ppjn9hj6y63ymjrq96280683xk7f7rjavw5nn";
+     })
+  ];
+
+  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  buildInputs = [ ncurses readline ];
+
+  meta = {
+    homepage = http://abook.sourceforge.net/;
+    description = "Text-based addressbook program designed to use with mutt mail client";
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [ stdenv.lib.maintainers.edwtjo ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/adobe-reader/builder.sh b/nixpkgs/pkgs/applications/misc/adobe-reader/builder.sh
new file mode 100644
index 000000000000..41281385c990
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/adobe-reader/builder.sh
@@ -0,0 +1,42 @@
+source $stdenv/setup
+
+echo "unpacking $src..."
+tar xvfa $src
+
+echo "unpacking reader..."
+p=$out/libexec/adobe-reader
+mkdir -p $out/libexec
+tar xvf AdobeReader/COMMON.TAR -C $out
+tar xvf AdobeReader/ILINXR.TAR -C $out
+mv $out/Adobe/Reader9 $p
+rmdir $out/Adobe
+
+# Disable this plugin for now (it needs LDAP, and I'm too lazy to add it).
+rm $p/Reader/intellinux/plug_ins/PPKLite.api
+
+# More pointless files.
+rm $p/bin/UNINSTALL
+
+patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+    --set-rpath $libPath \
+    $p/Reader/intellinux/bin/acroread
+
+# The "xargs -r" is to shut up a warning when Mozilla can't be found.
+substituteInPlace $p/bin/acroread \
+    --replace /bin/pwd $(type -P pwd) \
+    --replace /bin/ls $(type -P ls) \
+    --replace xargs "xargs -r"
+
+mkdir -p $out/bin
+ln -s $p/bin/acroread $out/bin/acroread
+
+mkdir -p $out/share/applications
+mv $p/Resource/Support/AdobeReader.desktop $out/share/applications/
+icon=$p/Resource/Icons/128x128/AdobeReader9.png
+[ -e $icon ]
+sed -i $out/share/applications/AdobeReader.desktop \
+    -e "s|Icon=.*|Icon=$icon|"
+
+# Not sure if this works.
+mkdir -p $out/share/mimelnk/application
+mv $p/Resource/Support/vnd*.desktop $out/share/mimelnk/application
diff --git a/nixpkgs/pkgs/applications/misc/adobe-reader/default.nix b/nixpkgs/pkgs/applications/misc/adobe-reader/default.nix
new file mode 100644
index 000000000000..0ca12a0096ed
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/adobe-reader/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, libX11, cups, zlib, libxml2, pango, atk, gtk2, glib
+, gdk_pixbuf }:
+
+assert stdenv.hostPlatform.system == "i686-linux";
+
+let version = "9.5.5"; in
+
+stdenv.mkDerivation {
+  name = "adobe-reader-${version}-1";
+
+  builder = ./builder.sh;
+
+  src = fetchurl {
+    url = "http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/${version}/enu/AdbeRdr${version}-1_i486linux_enu.tar.bz2";
+    sha256 = "0h35misxrqkl5zlmmvray1bqf4ywczkm89n9qw7d9arqbg3aj3pf";
+  };
+
+  # !!! Adobe Reader contains copies of OpenSSL, libcurl, and libicu.
+  # We should probably remove those and use the regular Nixpkgs
+  # versions.
+
+  libPath = stdenv.lib.makeLibraryPath
+    [ stdenv.cc.cc libX11 zlib libxml2 cups pango atk gtk2 glib gdk_pixbuf ];
+
+  passthru.mozillaPlugin = "/libexec/adobe-reader/Browser/intellinux";
+
+  meta = {
+    description = "Adobe Reader, a viewer for PDF documents";
+    homepage = http://www.adobe.com/products/reader;
+    license = stdenv.lib.licenses.unfree;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/airtame/default.nix b/nixpkgs/pkgs/applications/misc/airtame/default.nix
new file mode 100644
index 000000000000..3e5bf8df4a7b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/airtame/default.nix
@@ -0,0 +1,80 @@
+{ stdenv, lib, fetchurl, makeDesktopItem, makeWrapper
+, alsaLib, atk, cairo, cups, curl, dbus, expat, ffmpeg, fontconfig, freetype
+, gdk_pixbuf, glib, glibc, gnome2, gtk2, libX11, libXScrnSaver, libXcomposite
+, libXcursor, libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender
+, libXtst, libopus, libpulseaudio, libxcb, nspr, nss, pango, udev, x264
+}:
+
+let libPath = lib.makeLibraryPath [
+  alsaLib atk cairo cups curl dbus expat ffmpeg fontconfig freetype gdk_pixbuf
+  glib glibc gnome2.GConf gtk2 libopus nspr nss pango stdenv.cc.cc udev x264
+  libX11 libXScrnSaver libXcomposite libXcursor libXdamage libXext libXfixes
+  libXi libXrandr libXrender libXtst libpulseaudio libxcb
+];
+in stdenv.mkDerivation rec {
+  pname = "airtame";
+  version = "3.3.0";
+  name = "${pname}-${version}";
+  longName = "${pname}-application";
+
+  src = fetchurl {
+    url = "https://downloads.airtame.com/application/ga/lin_x64/releases/${longName}-${version}.tar.gz";
+    sha256 = "16ca1vcxpka26jcrfbxpq74kcizgrm138j94bby6kzqp2swhrl76";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  desktopItem = makeDesktopItem rec {
+    name = "airtame";
+    exec = longName;
+    comment = "Airtame Streaming Client";
+    desktopName = "Airtame";
+    icon = name;
+    genericName = comment;
+    categories = "Application;Network;";
+  };
+
+  installPhase = ''
+    opt="$out/opt/airtame"
+    mkdir -p "$opt"
+    cp -R . "$opt"
+    mkdir -p "$out/bin"
+    ln -s "$opt/${longName}" "$out/bin/"
+    mkdir -p "$out/share"
+    cp -r "${desktopItem}/share/applications" "$out/share/"
+    mkdir -p "$out/share/icons"
+    ln -s "$opt/icon.png" "$out/share/icons/airtame.png"
+
+    # Flags and rpath are copied from launch-airtame.sh.
+    vendorlib="\
+    $opt/resources/app.asar.unpacked/modules/streamer/dist/deps/airtame-modules:\
+    $opt/resources/app.asar.unpacked/encryption/out/lib:\
+    $opt/resources/deps/airtame-core/lib:\
+    $opt/resources/deps/airtame-encryption/lib"
+
+    echo $vendorlib
+
+    rpath="${libPath}:$opt:$vendorlib"
+
+    find "$opt" \( -type f -executable -o -name "*.so" -o -name "*.so.*" \) \
+      -exec patchelf --set-rpath "$rpath" {} \;
+
+    # The main binary also needs libudev which was removed by --shrink-rpath.
+    interp="$(< $NIX_CC/nix-support/dynamic-linker)"
+    patchelf --set-interpreter "$interp" $opt/${longName}
+
+    wrapProgram $opt/${longName} \
+      --prefix LD_LIBRARY_PATH=$rpath \
+      --add-flags "--disable-gpu --enable-transparent-visuals"
+  '';
+
+  dontPatchELF = true;
+
+  meta = with stdenv.lib; {
+    homepage = https://airtame.com/download;
+    description = "Wireless streaming client for Airtame devices";
+    license = licenses.unfree;
+    maintainers = with maintainers; [ thanegill ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/alacritty/default.nix b/nixpkgs/pkgs/applications/misc/alacritty/default.nix
new file mode 100644
index 000000000000..490c83bed078
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/alacritty/default.nix
@@ -0,0 +1,125 @@
+{ stdenv,
+  lib,
+  fetchFromGitHub,
+  rustPlatform,
+
+  cmake,
+  gzip,
+  makeWrapper,
+  ncurses,
+  pkgconfig,
+  python3,
+
+  expat,
+  fontconfig,
+  freetype,
+  libGL,
+  libX11,
+  libXcursor,
+  libXi,
+  libXrandr,
+  libXxf86vm,
+  libxcb,
+  libxkbcommon,
+  wayland,
+
+  # Darwin Frameworks
+  cf-private,
+  AppKit,
+  CoreFoundation,
+  CoreGraphics,
+  CoreServices,
+  CoreText,
+  Foundation,
+  OpenGL }:
+
+with rustPlatform;
+
+let
+  rpathLibs = [
+    expat
+    fontconfig
+    freetype
+    libGL
+    libX11
+    libXcursor
+    libXi
+    libXrandr
+    libXxf86vm
+    libxcb
+  ] ++ lib.optionals stdenv.isLinux [
+    libxkbcommon
+    wayland
+  ];
+in buildRustPackage rec {
+  pname = "alacritty";
+  version = "0.3.3";
+
+  src = fetchFromGitHub {
+    owner = "jwilm";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1h9zid7bi19qga3a8a2d4x3ma9wf1njmj74s4xnw7nzqqf3dh750";
+  };
+
+  cargoSha256 = "1rxb5ljgvn881jkxm8772kf815mmp08ci7sqmn2x1jwdcrphhxr1";
+
+  nativeBuildInputs = [
+    cmake
+    gzip
+    makeWrapper
+    ncurses
+    pkgconfig
+    python3
+  ];
+
+  buildInputs = rpathLibs
+    ++ lib.optionals stdenv.isDarwin [
+      AppKit CoreFoundation CoreGraphics CoreServices CoreText Foundation OpenGL
+      # Needed for CFURLResourceIsReachable symbols.
+      cf-private
+    ];
+
+  outputs = [ "out" "terminfo" ];
+
+  postBuild = lib.optionalString stdenv.isDarwin "make app";
+
+  installPhase = ''
+    runHook preInstall
+
+    install -D target/release/alacritty $out/bin/alacritty
+
+  '' + (if stdenv.isDarwin then ''
+    mkdir $out/Applications
+    cp -r target/release/osx/Alacritty.app $out/Applications/Alacritty.app
+  '' else ''
+    install -D extra/linux/alacritty.desktop -t $out/share/applications/
+    install -D extra/logo/alacritty-term.svg $out/share/icons/hicolor/scalable/apps/Alacritty.svg
+    patchelf --set-rpath "${stdenv.lib.makeLibraryPath rpathLibs}" $out/bin/alacritty
+  '') + ''
+
+    install -D extra/completions/_alacritty -t "$out/share/zsh/site-functions/"
+    install -D extra/completions/alacritty.bash -t "$out/etc/bash_completion.d/"
+    install -D extra/completions/alacritty.fish -t "$out/share/fish/vendor_completions.d/"
+
+    install -dm 755 "$out/share/man/man1"
+    gzip -c extra/alacritty.man > "$out/share/man/man1/alacritty.1.gz"
+
+    install -dm 755 "$terminfo/share/terminfo/a/"
+    tic -x -o "$terminfo/share/terminfo" extra/alacritty.info
+    mkdir -p $out/nix-support
+    echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
+
+    runHook postInstall
+  '';
+
+  dontPatchELF = true;
+
+  meta = with stdenv.lib; {
+    description = "GPU-accelerated terminal emulator";
+    homepage = https://github.com/jwilm/alacritty;
+    license = with licenses; [ asl20 ];
+    maintainers = with maintainers; [ mic92 ];
+    platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/albert/default.nix b/nixpkgs/pkgs/applications/misc/albert/default.nix
new file mode 100644
index 000000000000..2dda615081c0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/albert/default.nix
@@ -0,0 +1,52 @@
+{ mkDerivation, lib, fetchFromGitHub, makeWrapper, qtbase,
+  qtdeclarative, qtsvg, qtx11extras, muparser, cmake, python3,
+  qtcharts }:
+
+mkDerivation rec {
+  pname = "albert";
+  version = "0.16.1";
+
+  src = fetchFromGitHub {
+    owner  = "albertlauncher";
+    repo   = "albert";
+    rev    = "v${version}";
+    sha256 = "04sr35fqz66i24lv7r2p9qfqxs55i8xpj7aam0v9yakcr33lf55a";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ cmake makeWrapper ];
+
+  buildInputs = [ qtbase qtdeclarative qtsvg qtx11extras muparser python3 qtcharts ];
+
+  enableParallelBuilding = true;
+
+  # We don't have virtualbox sdk so disable plugin
+  cmakeFlags = [ "-DBUILD_VIRTUALBOX=OFF" "-DCMAKE_INSTALL_LIBDIR=libs" ];
+
+  postPatch = ''
+    sed -i "/QStringList dirs = {/a    \"$out/libs\"," \
+      src/app/main.cpp
+  '';
+
+  preBuild = ''
+    mkdir -p "$out/"
+    ln -s "$PWD/lib" "$out/lib"
+  '';
+
+  postBuild = ''
+    rm "$out/lib"
+  '';
+
+  postInstall = ''
+    wrapProgram $out/bin/albert \
+      --prefix XDG_DATA_DIRS : $out/share
+  '';
+
+  meta = with lib; {
+    homepage    = https://albertlauncher.github.io/;
+    description = "Desktop agnostic launcher";
+    license     = licenses.gpl3Plus;
+    maintainers = with maintainers; [ ericsagnes synthetica ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/almanah/default.nix b/nixpkgs/pkgs/applications/misc/almanah/default.nix
new file mode 100644
index 000000000000..4997a9c7f2ac
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/almanah/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, pkgconfig, intltool
+, libxml2, desktop-file-utils, wrapGAppsHook, evolution-data-server, gtkspell3, gpgme, libcryptui
+, glib, gtk3, gtksourceview3, sqlite, cairo, atk, gcr, gnome3 }:
+
+stdenv.mkDerivation rec {
+  pname = "almanah";
+  version = "0.11.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1g0fyykq8bs3x1xqc0l0bk9zazcrxja784m68myymv1zfqqnp9h0";
+  };
+
+  nativeBuildInputs = [ pkgconfig intltool libxml2 desktop-file-utils wrapGAppsHook ];
+
+  buildInputs = [ glib gtk3 gtksourceview3 sqlite cairo atk gcr gtkspell3 evolution-data-server gnome3.evolution gpgme libcryptui ];
+
+  passthru = {
+    updateScript = gnome3.updateScript {
+      packageName = pname;
+      versionPolicy = "none"; # it is quite odd
+    };
+  };
+
+  meta = with stdenv.lib; {
+    description = "Small GTK application to allow to keep a diary of your life";
+    homepage = https://wiki.gnome.org/Apps/Almanah_Diary;
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+    maintainers = gnome3.maintainers;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/aminal/default.nix b/nixpkgs/pkgs/applications/misc/aminal/default.nix
new file mode 100644
index 000000000000..1c769e58705a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/aminal/default.nix
@@ -0,0 +1,75 @@
+{ buildGoPackage
+, Carbon
+, Cocoa
+, Kernel
+, cf-private
+, fetchFromGitHub
+, lib
+, mesa_glu
+, stdenv
+, xorg
+}:
+
+buildGoPackage rec {
+  name = "aminal-${version}";
+  version = "0.8.6";
+
+  goPackagePath = "github.com/liamg/aminal";
+
+  buildInputs =
+    lib.optionals stdenv.isLinux [
+      mesa_glu
+      xorg.libX11
+      xorg.libXcursor
+      xorg.libXi
+      xorg.libXinerama
+      xorg.libXrandr
+      xorg.libXxf86vm
+    ] ++ lib.optionals stdenv.isDarwin [
+      Carbon
+      Cocoa
+      Kernel
+      cf-private  /* Needed for NSDefaultRunLoopMode */
+    ];
+
+  src = fetchFromGitHub {
+    owner = "liamg";
+    repo = "aminal";
+    rev = "v${version}";
+    sha256 = "0qhjdckj2kr0vza6qssd9z8dfrsif1qxb1mal1d4wgdsy12lrmwl";
+  };
+
+  preBuild = ''
+    buildFlagsArray=("-ldflags=-X ${goPackagePath}/version.Version=${version}")
+  '';
+
+  meta = with lib; {
+    description = "Golang terminal emulator from scratch";
+    longDescription = ''
+      Aminal is a modern terminal emulator for Mac/Linux implemented in Golang
+      and utilising OpenGL.
+
+      The project is experimental at the moment, so you probably won't want to
+      rely on Aminal as your main terminal for a while.
+
+      Features:
+      - Unicode support
+      - OpenGL rendering
+      - Customisation options
+      - True colour support
+      - Support for common ANSI escape sequences a la xterm
+      - Scrollback buffer
+      - Clipboard access
+      - Clickable URLs
+      - Multi platform support (Windows coming soon...)
+      - Sixel support
+      - Hints/overlays
+      - Built-in patched fonts for powerline
+      - Retina display support
+    '';
+    homepage = https://github.com/liamg/aminal;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ kalbasit ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/antfs-cli/default.nix b/nixpkgs/pkgs/applications/misc/antfs-cli/default.nix
new file mode 100644
index 000000000000..f21438dfcec5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/antfs-cli/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchFromGitHub, python3Packages }:
+
+python3Packages.buildPythonApplication rec {
+  pname = "antfs-cli";
+  version = "unstable-2017-02-11";
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/Tigge/antfs-cli;
+    description = "Extracts FIT files from ANT-FS based sport watches";
+    license = licenses.mit;
+    platforms = platforms.linux;
+  };
+
+  src = fetchFromGitHub {
+    owner = "Tigge";
+    repo = "antfs-cli";
+    rev = "85a6cc6fe6fc0ec38399f5aa30fb39177c565b52";
+    sha256 = "0v8y64kldfbs809j1g9d75dd1vxq7mfxnp4b45pz8anpxhjf64fy";
+  };
+
+  propagatedBuildInputs = [ python3Packages.openant ];
+}
diff --git a/nixpkgs/pkgs/applications/misc/ape/apeclex.nix b/nixpkgs/pkgs/applications/misc/ape/apeclex.nix
new file mode 100644
index 000000000000..710ddfec9942
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ape/apeclex.nix
@@ -0,0 +1,8 @@
+{ stdenv, attemptoClex, callPackage }:
+
+callPackage ./. {
+  pname = "ape-clex";
+  lexicon = "${attemptoClex}/clex_lexicon.pl";
+  description = "Parser for Attempto Controlled English (ACE) with a large lexicon (~100,000 entries)";
+  license = with stdenv.lib; [ licenses.lgpl3 licenses.gpl3 ];
+}
diff --git a/nixpkgs/pkgs/applications/misc/ape/clex.nix b/nixpkgs/pkgs/applications/misc/ape/clex.nix
new file mode 100644
index 000000000000..37d140e19ba3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ape/clex.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  name = "attempto-clex-${version}";
+  version = "5133afe";
+
+  src = fetchFromGitHub {
+     owner = "Attempto";
+     repo = "Clex";
+     rev = version;
+     sha256 = "0p9s64g1jic213bwm6347jqckszgnni9szrrz31qjgaf32kf7nkp";
+  };
+
+  installPhase = ''
+    mkdir -p $out
+    cp clex_lexicon.pl $out
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Large lexicon for APE (~100,000 entries)";
+    license = licenses.gpl3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ yrashk ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/ape/default.nix b/nixpkgs/pkgs/applications/misc/ape/default.nix
new file mode 100644
index 000000000000..e78ba2df9993
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ape/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, swiProlog, makeWrapper,
+  fetchFromGitHub,
+  lexicon ? "lexicon/clex_lexicon.pl",
+  pname ? "ape",
+  description ? "Parser for Attempto Controlled English (ACE)",
+  license ? with stdenv.lib; licenses.lgpl3
+  }:
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  version = "6.7-131003";
+
+  buildInputs = [ swiProlog makeWrapper ];
+
+  src = fetchFromGitHub {
+     owner = "Attempto";
+     repo = "APE";
+     rev = version;
+     sha256 = "0cw47qjg4896kw3vps6rfs02asvscsqvcfdiwgfmqb3hvykb1sdx";
+  };
+
+  patchPhase = ''
+    # We move the file first to avoid "same file" error in the default case
+    cp ${lexicon} new_lexicon.pl
+    rm lexicon/clex_lexicon.pl
+    cp new_lexicon.pl lexicon/clex_lexicon.pl
+  '';
+
+  buildPhase = ''
+    make build
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp ape.exe $out
+    makeWrapper $out/ape.exe $out/bin/ape --add-flags ace
+  '';
+
+  meta = with stdenv.lib; {
+    description = description;
+    license = license;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ yrashk ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/appeditor/default.nix b/nixpkgs/pkgs/applications/misc/appeditor/default.nix
new file mode 100644
index 000000000000..0530ec9c1b80
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/appeditor/default.nix
@@ -0,0 +1,56 @@
+{ stdenv
+, fetchFromGitHub
+, meson
+, ninja
+, pkgconfig
+, pantheon
+, python3
+, gettext
+, glib
+, gtk3
+, hicolor-icon-theme
+, libgee
+, wrapGAppsHook }:
+
+stdenv.mkDerivation rec {
+  pname = "appeditor";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "donadigo";
+    repo = "appeditor";
+    rev = version;
+    sha256 = "04x2f4x4dp5ca2y3qllqjgirbyl6383pfl4bi9bkcqlg8b5081rg";
+  };
+
+  nativeBuildInputs = [
+    gettext
+    meson
+    ninja
+    pantheon.vala
+    pkgconfig
+    python3
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    glib
+    gtk3
+    hicolor-icon-theme
+    pantheon.granite
+    libgee
+  ];
+
+  postPatch = ''
+    chmod +x meson/post_install.py
+    patchShebangs meson/post_install.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Edit the Pantheon desktop application menu";
+    homepage = https://github.com/donadigo/appeditor;
+    maintainers = with maintainers; [ kjuvi ] ++ pantheon.maintainers;
+    platforms = platforms.linux;
+    license = licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/apvlv/default.nix b/nixpkgs/pkgs/applications/misc/apvlv/default.nix
new file mode 100644
index 000000000000..2da0de9ead8c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/apvlv/default.nix
@@ -0,0 +1,74 @@
+{ stdenv, fetchFromGitHub, fetchpatch, cmake, pkgconfig, pcre, libxkbcommon, epoxy
+, gtk3, poppler, freetype, libpthreadstubs, libXdmcp, libxshmfence, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  version = "0.1.5";
+  name = "apvlv-${version}";
+
+  src = fetchFromGitHub {
+    owner = "naihe2010";
+    repo = "apvlv";
+    rev = "v${version}";
+    sha256 = "1n4xiic8lqnv3mqi7wpdv866gyyakax71gffv3n9427rmcld465i";
+  };
+
+  NIX_CFLAGS_COMPILE = "-I${poppler.dev}/include/poppler";
+
+  nativeBuildInputs = [
+    pkgconfig
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    cmake
+    poppler pcre libxkbcommon epoxy
+    freetype gtk3
+    libpthreadstubs libXdmcp libxshmfence # otherwise warnings in compilation
+  ];
+
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/naihe2010/apvlv/commit/d432635b9c5ea6c052a2ae1fb71aedec5c4ad57a.patch";
+      sha256 = "1am8dgv2kkpqmm2vaysa61czx8ppdx94zb3c59sx88np50jpy70w";
+    })
+    (fetchpatch {
+      url = "https://github.com/naihe2010/apvlv/commit/4c7a583e8431964def482e5471f02e6de8e62a7b.patch";
+      sha256 = "1dszm120lwm90hcg5zmd4vr6pjyaxc84qmb7k0fr59mmb3qif62j";
+    })
+    # fix build with gcc7
+    (fetchpatch {
+      url = "https://github.com/naihe2010/apvlv/commit/a3a895772a27d76dab0c37643f0f4c73f9970e62.patch";
+      sha256 = "1fpc7wr1ajilvwi5gjsy5g9jcx4bl03gp5dmajg90ljqbhwz2bfi";
+    })
+    ./fix-build-with-poppler-0.73.0.patch
+  ];
+
+  installPhase = ''
+    # binary
+    mkdir -p $out/bin
+    cp src/apvlv $out/bin/apvlv
+
+    # displays pdfStartup.pdf as default pdf entry
+    mkdir -p $out/share/doc/apvlv/
+    cp ../Startup.pdf $out/share/doc/apvlv/Startup.pdf
+    cp ../main_menubar.glade $out/share/doc/apvlv/main_menubar.glade
+  ''
+  + stdenv.lib.optionalString (!stdenv.isDarwin) ''
+    install -D ../apvlv.desktop $out/share/applications/apvlv.desktop
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://naihe2010.github.io/apvlv/;
+    description = "PDF viewer with Vim-like behaviour";
+    longDescription = ''
+      apvlv is a PDF/DJVU/UMD/TXT Viewer Under Linux/WIN32
+      with Vim-like behaviour.
+    '';
+
+    license = licenses.lgpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.ardumont ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/apvlv/fix-build-with-poppler-0.73.0.patch b/nixpkgs/pkgs/applications/misc/apvlv/fix-build-with-poppler-0.73.0.patch
new file mode 100644
index 000000000000..d2a7831dca63
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/apvlv/fix-build-with-poppler-0.73.0.patch
@@ -0,0 +1,13 @@
+diff --git a/src/ApvlvPdf.cc b/src/ApvlvPdf.cc
+index 765b112..83d133f 100644
+--- a/src/ApvlvPdf.cc
++++ b/src/ApvlvPdf.cc
+@@ -29,7 +29,7 @@
+ #include "ApvlvPdf.h"
+
+ #ifndef POPPLER_WITH_GDK
+-#include <goo/gtypes.h>
++#include <goo/gfile.h>
+
+ static void
+ copy_cairo_surface_to_pixbuf (cairo_surface_t *surface,
diff --git a/nixpkgs/pkgs/applications/misc/archiver/default.nix b/nixpkgs/pkgs/applications/misc/archiver/default.nix
new file mode 100644
index 000000000000..03f534e1a4da
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/archiver/default.nix
@@ -0,0 +1,26 @@
+{ buildGoModule
+, fetchFromGitHub
+, lib
+}:
+
+buildGoModule rec {
+  pname = "archiver";
+  version = "3.2.0";
+
+  src = fetchFromGitHub {
+    owner = "mholt";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1kq2cyhbniwdabk426j493cs8d4nj35vmznm9031rrdd9ln5h9gl";
+  };
+
+  modSha256 = "13vwgqpw7ypq6mrvwmnl8n38x0h89ymryrrzkf7ya478fp00vclj";
+
+  meta = with lib; {
+    description = "Easily create & extract archives, and compress & decompress files of various formats";
+    homepage = "https://github.com/mholt/archiver";
+    license = licenses.mit;
+    maintainers = with maintainers; [ kalbasit ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/artha/default.nix b/nixpkgs/pkgs/applications/misc/artha/default.nix
new file mode 100644
index 000000000000..202c1669f858
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/artha/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, autoreconfHook, fetchurl, dbus-glib, gtk2, pkgconfig, wordnet }:
+
+stdenv.mkDerivation rec {
+  name = "artha-${version}";
+  version = "1.0.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/artha/1.0.3/artha-1.0.3.tar.bz2";
+    sha256 = "0qr4ihl7ma3cq82xi1fpzvf74mm9vsg0j035xvmcp3r6rmw2fycx";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  buildInputs = [ dbus-glib gtk2 wordnet ];
+
+  patches = [
+    ./gio-underlink.patch
+  ];
+
+  meta = with stdenv.lib; {
+    description = "An offline thesaurus based on WordNet";
+    homepage = http://artha.sourceforge.net;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/artha/gio-underlink.patch b/nixpkgs/pkgs/applications/misc/artha/gio-underlink.patch
new file mode 100644
index 000000000000..08d9c4787369
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/artha/gio-underlink.patch
@@ -0,0 +1,13 @@
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 0236d72..bcc1182 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -38,7 +38,7 @@ artha_LDADD = libwni.a $(WORDNET_LIB)
+ 
+ if POSIX
+ AM_CFLAGS += @libdbus_CFLAGS@
+-artha_LDADD += -lX11 -ldbus-1 -ldbus-glib-1 -lgtk-x11-2.0 \
++artha_LDADD += -lX11 -ldbus-1 -ldbus-glib-1 -lgio-2.0 -lgtk-x11-2.0 \
+ 		-lgdk-x11-2.0 -lgmodule-2.0 -lgobject-2.0 -lglib-2.0
+ else
+ artha_LDADD += @GTK_LIBS@
diff --git a/nixpkgs/pkgs/applications/misc/asciiquarium/default.nix b/nixpkgs/pkgs/applications/misc/asciiquarium/default.nix
new file mode 100644
index 000000000000..3c18d70d6c26
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/asciiquarium/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, makeWrapper, perlPackages }:
+
+let version = "1.1";
+in stdenv.mkDerivation {
+  name = "asciiquarium-${version}";
+  src = fetchurl {
+    url = "https://robobunny.com/projects/asciiquarium/asciiquarium_${version}.tar.gz";
+    sha256 = "0qfkr5b7sxzi973nh0h84blz2crvmf28jkkgaj3mxrr56mhwc20v";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ perlPackages.perl ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp asciiquarium $out/bin
+    chmod +x $out/bin/asciiquarium
+    wrapProgram $out/bin/asciiquarium \
+      --set PERL5LIB ${perlPackages.makeFullPerlPath [ perlPackages.TermAnimation ] }
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Enjoy the mysteries of the sea from the safety of your own terminal!";
+    homepage = https://robobunny.com/projects/asciiquarium/html/;
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.utdemir ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/audio/sox/default.nix b/nixpkgs/pkgs/applications/misc/audio/sox/default.nix
new file mode 100644
index 000000000000..622e7169faec
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/audio/sox/default.nix
@@ -0,0 +1,50 @@
+{ config, lib, stdenv, fetchurl, pkgconfig, CoreAudio
+, enableAlsa ? true, alsaLib ? null
+, enableLibao ? true, libao ? null
+, enableLame ? config.sox.enableLame or false, lame ? null
+, enableLibmad ? true, libmad ? null
+, enableLibogg ? true, libogg ? null, libvorbis ? null
+, enableOpusfile ? true, opusfile ? null
+, enableFLAC ? true, flac ? null
+, enablePNG ? true, libpng ? null
+, enableLibsndfile ? true, libsndfile ? null
+# amrnb and amrwb are unfree, disabled by default
+, enableAMR ? false, amrnb ? null, amrwb ? null
+, enableLibpulseaudio ? true, libpulseaudio ? null
+}:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "sox-14.4.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/sox/${name}.tar.gz";
+    sha256 = "0v2znlxkxxcd3f48hf3dx9pq7i6fdhb62kgj7wv8xggz8f35jpxl";
+  };
+
+  # configure.ac uses pkg-config only to locate libopusfile
+  nativeBuildInputs = optional enableOpusfile pkgconfig;
+
+  buildInputs =
+    optional (enableAlsa && stdenv.isLinux) alsaLib ++
+    optional enableLibao libao ++
+    optional enableLame lame ++
+    optional enableLibmad libmad ++
+    optionals enableLibogg [ libogg libvorbis ] ++
+    optional enableOpusfile opusfile ++
+    optional enableFLAC flac ++
+    optional enablePNG libpng ++
+    optional enableLibsndfile libsndfile ++
+    optionals enableAMR [ amrnb amrwb ] ++
+    optional enableLibpulseaudio libpulseaudio ++
+    optional (stdenv.isDarwin) CoreAudio;
+
+  meta = {
+    description = "Sample Rate Converter for audio";
+    homepage = http://sox.sourceforge.net/;
+    maintainers = [ lib.maintainers.marcweber ];
+    license = if enableAMR then lib.licenses.unfree else lib.licenses.gpl2Plus;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/audio/soxr/default.nix b/nixpkgs/pkgs/applications/misc/audio/soxr/default.nix
new file mode 100644
index 000000000000..7c4e6ff8c3d7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/audio/soxr/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  name = "soxr-0.1.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/soxr/${name}-Source.tar.xz";
+    sha256 = "12aql6svkplxq5fjycar18863hcq84c5kx8g6f4rj0lcvigw24di";
+  };
+
+  outputs = [ "out" "doc" ]; # headers are just two and very small
+
+  preConfigure = if stdenv.isDarwin then ''
+    export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:"`pwd`/build/src
+  '' else ''
+    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:"`pwd`/build/src
+  '';
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = {
+    description = "An audio resampling library";
+    homepage = http://soxr.sourceforge.net;
+    license = stdenv.lib.licenses.lgpl21Plus;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/audio/wavesurfer/default.nix b/nixpkgs/pkgs/applications/misc/audio/wavesurfer/default.nix
new file mode 100644
index 000000000000..0add5ed78cc5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/audio/wavesurfer/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, snack, tcl, tk, makeWrapper }:
+
+stdenv.mkDerivation {
+  name = "wavesurfer-1.8.5";
+
+  src = fetchurl {
+    url = https://www.speech.kth.se/wavesurfer/wavesurfer-1.8.5.tar.gz;
+    sha256 = "1yx9s1j47cq0v40cwq2gn7bdizpw46l95ba4zl9z4gg31mfvm807";
+  };
+
+  buildInputs = [ snack tcl tk makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out/{bin,nix-support,share/wavesurfer/}
+    mv doc $out/share/wavesurfer
+    mv * $out/nix-support
+    ln -s $out/{nix-support,bin}/wavesurfer.tcl
+    wrapProgram "$out/nix-support/wavesurfer.tcl"  \
+                 --set TCLLIBPATH "${snack}/lib" \
+                 --prefix PATH : "${stdenv.lib.makeBinPath [ tcl tk ]}"
+  '';
+
+  meta = { 
+    description = "Tool for recording, playing, editing, viewing and labeling of audio";
+    homepage = http://www.speech.kth.se/wavesurfer/;
+    license = "BSD";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/audio/wavrsocvt/default.nix b/nixpkgs/pkgs/applications/misc/audio/wavrsocvt/default.nix
new file mode 100644
index 000000000000..09b75e27d46a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/audio/wavrsocvt/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "wavrsocvt-1.0.2.0";
+
+  src = fetchurl {
+    url = "http://bricxcc.sourceforge.net/wavrsocvt.tgz";
+    sha256 = "15qlvdfwbiclljj7075ycm78yzqahzrgl4ky8pymix5179acm05h";
+  };
+
+  phases = [ "unpackPhase" "installPhase" ];
+
+  unpackPhase = ''
+    tar -zxf $src 
+    '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp wavrsocvt $out/bin
+    '';
+
+  meta = with stdenv.lib; {
+    description = "Convert .wav files into sound files for Lego NXT brick";
+    longDescription = ''
+    wavrsocvt is a command-line utility which can be used from a
+    terminal window or script to convert .wav files into sound
+    files for the NXT brick (.rso files). It can also convert the
+    other direction (i.e., .rso -> .wav). It can produce RSO files
+    with a sample rate between 2000 and 16000 (the min/max range of
+    supported sample rates in the standard NXT firmware).
+    You can then upload these with e.g. nxt-python.
+    '';
+    homepage = http://bricxcc.sourceforge.net/;
+    license = licenses.mpl11;
+    maintainers = with maintainers; [ leenaars ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/autospotting/default.nix b/nixpkgs/pkgs/applications/misc/autospotting/default.nix
new file mode 100644
index 000000000000..2dd151c1a6c1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/autospotting/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, buildGoPackage, fetchFromGitHub }:
+
+buildGoPackage rec {
+  name = "autospotting-${version}";
+  version = "unstable-2018-11-17";
+  goPackagePath = "github.com/AutoSpotting/AutoSpotting";
+
+  src = fetchFromGitHub {
+    owner = "AutoSpotting";
+    repo = "AutoSpotting";
+    rev = "122ab8f292a2f718dd85e79ec22acd455122907e";
+    sha256 = "0p48lgig9kblxvgq1kggczkn4qdbx6ciq9c8x0179i80vl4jf7v6";
+  };
+
+  goDeps = ./deps.nix;
+
+  # patching path where repository used to exist
+  postPatch = ''
+    sed -i "s+github.com/cristim/autospotting/core+github.com/AutoSpotting/AutoSpotting/core+" autospotting.go
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/AutoSpotting/AutoSpotting;
+    description = "Automatically convert your existing AutoScaling groups to up to 90% cheaper spot instances with minimal configuration changes";
+    license = licenses.free;
+    maintainers = [ maintainers.costrouc ];
+    platforms = platforms.unix;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/autospotting/deps.nix b/nixpkgs/pkgs/applications/misc/autospotting/deps.nix
new file mode 100644
index 000000000000..ea744ed6648f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/autospotting/deps.nix
@@ -0,0 +1,75 @@
+# file generated from Gopkg.lock using dep2nix (https://github.com/nixcloud/dep2nix)
+[
+  {
+    goPackagePath  = "github.com/aws/aws-lambda-go";
+    fetch = {
+      type = "git";
+      url = "https://github.com/aws/aws-lambda-go";
+      rev =  "2d482ef09017ae953b1e8d5a6ddac5b696663a3c";
+      sha256 = "06v2yfvn4sn116lds0526a8mfrsng4vafrdjf1dhpalqarrbdvmz";
+    };
+  }
+  {
+    goPackagePath  = "github.com/aws/aws-sdk-go";
+    fetch = {
+      type = "git";
+      url = "https://github.com/aws/aws-sdk-go";
+      rev =  "9333060a8d957db41bff1c80603a802aa674fad8";
+      sha256 = "0fnypw6zm6k70fzhm5a8g69ag64rxbrrpdk7l3rkfqd99slyg5kz";
+    };
+  }
+  {
+    goPackagePath  = "github.com/cristim/ec2-instances-info";
+    fetch = {
+      type = "git";
+      url = "https://github.com/cristim/ec2-instances-info";
+      rev =  "73c042a5558cd6d8b61fb82502d6f7aec334e9ed";
+      sha256 = "1xajrkxqqz5wlbi9w2wdhnk115rbmqxyga29f8v9psq8hzwgi0rg";
+    };
+  }
+  {
+    goPackagePath  = "github.com/davecgh/go-spew";
+    fetch = {
+      type = "git";
+      url = "https://github.com/davecgh/go-spew";
+      rev =  "d8f796af33cc11cb798c1aaeb27a4ebc5099927d";
+      sha256 = "19z27f306fpsrjdvkzd61w1bdazcdbczjyjck177g33iklinhpvx";
+    };
+  }
+  {
+    goPackagePath  = "github.com/go-ini/ini";
+    fetch = {
+      type = "git";
+      url = "https://github.com/go-ini/ini";
+      rev =  "5cf292cae48347c2490ac1a58fe36735fb78df7e";
+      sha256 = "0xbnw1nd22q6k863n5gs0nxld15w0p8qxbhfky85akcb5rk1vwi9";
+    };
+  }
+  {
+    goPackagePath  = "github.com/jmespath/go-jmespath";
+    fetch = {
+      type = "git";
+      url = "https://github.com/jmespath/go-jmespath";
+      rev =  "0b12d6b5";
+      sha256 = "1vv6hph8j6xgv7gwl9vvhlsaaqsm22sxxqmgmldi4v11783pc1ld";
+    };
+  }
+  {
+    goPackagePath  = "github.com/namsral/flag";
+    fetch = {
+      type = "git";
+      url = "https://github.com/namsral/flag";
+      rev =  "67f268f20922975c067ed799e4be6bacf152208c";
+      sha256 = "1lmxq3z276zrsggpfq9b7yklzzxdyib49zr8sznb1lcqlvxqsr47";
+    };
+  }
+  {
+    goPackagePath  = "github.com/pkg/errors";
+    fetch = {
+      type = "git";
+      url = "https://github.com/pkg/errors";
+      rev =  "645ef00459ed84a119197bfb8d8205042c6df63d";
+      sha256 = "001i6n71ghp2l6kdl3qq1v2vmghcz3kicv9a5wgcihrzigm75pp5";
+    };
+  }
+]
\ No newline at end of file
diff --git a/nixpkgs/pkgs/applications/misc/avrdudess/default.nix b/nixpkgs/pkgs/applications/misc/avrdudess/default.nix
new file mode 100644
index 000000000000..4227b4155acf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/avrdudess/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, runtimeShell, fetchurl, unzip, mono, avrdude, gtk2, xdg_utils }:
+
+stdenv.mkDerivation rec {
+  name = "avrdudess-2.2.20140102";
+
+  src = fetchurl {
+    url = "http://blog.zakkemble.co.uk/download/avrdudess_20140102.zip";
+    sha256 = "18llpvjsfhypzijrvfbzmcg3g141f307mzsrg11wcdxh9syxqak6";
+  };
+
+  buildInputs = [ unzip ];
+
+  phases = [ "buildPhase" ];
+
+  buildPhase = ''
+    mkdir -p "$out/avrdudess"
+    mkdir -p "$out/bin"
+
+    unzip "$src" -d "$out/avrdudess"
+
+    cat >> "$out/bin/avrdudess" << __EOF__
+    #!${runtimeShell}
+    export LD_LIBRARY_PATH="${stdenv.lib.makeLibraryPath [gtk2 mono]}"
+    # We need PATH from user env for xdg-open to find its tools, which
+    # typically depend on the currently running desktop environment.
+    export PATH="${stdenv.lib.makeBinPath [ avrdude xdg_utils ]}:\$PATH"
+
+    # avrdudess must have its resource files in its current working directory
+    cd $out/avrdudess && exec ${mono}/bin/mono "$out/avrdudess/avrdudess.exe" "\$@"
+    __EOF__
+
+    chmod a+x "$out/bin/"*
+  '';
+
+  meta = with stdenv.lib; {
+    description = "GUI for AVRDUDE (AVR microcontroller programmer)";
+    homepage = https://github.com/zkemble/AVRDUDESS;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/barrier/default.nix b/nixpkgs/pkgs/applications/misc/barrier/default.nix
new file mode 100644
index 000000000000..6151b3d55ab7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/barrier/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchpatch, fetchurl, cmake, curl, xorg, avahi, qt5,
+  avahiWithLibdnssdCompat ? avahi.override { withLibdnssdCompat = true; }
+}:
+
+stdenv.mkDerivation rec {
+  name = "barrier-${version}";
+  version = "2.1.1";
+  src = fetchurl {
+    url = "https://github.com/debauchee/barrier/archive/v${version}.tar.gz";
+    sha256 = "0x17as5ikfx2r5hawr368a9risvcavyc8zv5g724s709nr6m0pbp";
+  };
+
+  buildInputs = [ cmake curl xorg.libX11 xorg.libXext xorg.libXtst avahiWithLibdnssdCompat ];
+  propagatedBuildInputs = with qt5; [ qtbase ];
+
+  patches = [
+    # Fix compilation on Qt 5.11
+    # Patch should be removed on next version bump from 2.1.1!
+    (fetchpatch {
+      url = "https://github.com/debauchee/barrier/commit/a956cad0da23f544b874888c6c3540dc7f8f22cf.patch";
+      sha256 = "0x5045bdks1f9casp0v7svx9ml1gxhkhw5sqc7xk36h184m24a21";
+    })
+  ];
+
+  postFixup = ''
+    substituteInPlace "$out/share/applications/barrier.desktop" --replace "Exec=barrier" "Exec=$out/bin/barrier"
+  '';
+
+  meta = {
+    description = "Open-source KVM software";
+    longDescription = ''
+      Barrier is KVM software forked from Symless's synergy 1.9 codebase.
+      Synergy was a commercialized reimplementation of the original
+      CosmoSynergy written by Chris Schoeneman.
+    '';
+    homepage = https://github.com/debauchee/barrier;
+    downloadPage = https://github.com/debauchee/barrier/releases;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [ stdenv.lib.maintainers.phryneas ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/bashSnippets/default.nix b/nixpkgs/pkgs/applications/misc/bashSnippets/default.nix
new file mode 100644
index 000000000000..fc5fa4d03006
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/bashSnippets/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, lib, fetchFromGitHub, makeWrapper
+, curl, python, bind, iproute, bc, gitMinimal }:
+let
+  version = "1.17.3";
+  deps = lib.makeBinPath [
+    curl
+    python
+    bind.dnsutils
+    iproute
+    bc
+    gitMinimal
+  ];
+in
+stdenv.mkDerivation {
+  name = "bashSnippets-${version}";
+
+  src = fetchFromGitHub {
+    owner = "alexanderepstein";
+    repo = "Bash-Snippets";
+    rev = "v${version}";
+    sha256 = "1xdjk8bjh7l6h7gdqrra1dh4wdq89wmd0jsirsvqa3bmcsb2wz1r";
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  patchPhase = ''
+    patchShebangs install.sh
+    substituteInPlace install.sh --replace /usr/local "$out"
+  '';
+
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir -p "$out"/bin "$out"/share/man/man1
+    ./install.sh all
+    for file in "$out"/bin/*; do
+      wrapProgram "$file" --prefix PATH : "${deps}"
+    done
+  '';
+
+  meta = with lib; {
+    description = "A collection of small bash scripts for heavy terminal users";
+    homepage = https://github.com/alexanderepstein/Bash-Snippets;
+    license = licenses.mit;
+    maintainers = with maintainers; [ infinisil ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/batti/default.nix b/nixpkgs/pkgs/applications/misc/batti/default.nix
new file mode 100644
index 000000000000..9322aefb2d69
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/batti/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchurl
+, pkgconfig, gettext, pythonPackages
+, gtk2, gdk_pixbuf, upower
+, makeWrapper }:
+
+let
+  inherit (pythonPackages) dbus-python pygtk python;
+in stdenv.mkDerivation rec {
+
+  name = "batti-${version}";
+  version = "0.3.8";
+
+  src = fetchurl {
+    url = "https://batti-gtk.googlecode.com/files/${name}.tar.gz";
+    sha256 = "072d92gpsiiin631589nj77i2w1425p6db0qxyml7myscfy9jgx6";
+  };
+
+  buildInputs = with stdenv.lib;
+  [ pkgconfig gettext python gtk2 pygtk dbus-python gdk_pixbuf upower makeWrapper ];
+
+  dontConfigure = true;
+
+  buildPhase = ''
+    python setup.py build
+  '';
+
+  installPhase = ''
+    python setup.py install --prefix $out
+    wrapProgram "$out/bin/batti" \
+      --set PYTHONPATH "$PYTHONPATH:$(toPythonPath $out)" \
+      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
+      --prefix XDG_DATA_DIRS : "$out/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH"
+  '';
+
+
+  meta = with stdenv.lib; {
+    description = "An {UPower,GTK}-based battery monitor for the system tray";
+    longDescription = ''
+      Batti is a simple battery monitor for the system tray. Batti
+      uses UPower, and if that is missing DeviceKit.Power, for it's
+      power information.
+    '';
+    homepage = http://batti-gtk.googlecode.com/;
+    license = licenses.lgpl2Plus;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.linux;
+    broken = true;  # see https://github.com/NixOS/nixpkgs/pull/4031#issuecomment-56283520
+  };
+}
+
+# TODO: fix the "icon not found" problems...
diff --git a/nixpkgs/pkgs/applications/misc/bb/default.nix b/nixpkgs/pkgs/applications/misc/bb/default.nix
new file mode 100644
index 000000000000..f085e4bd7dd5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/bb/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, fetchurl, darwin, aalib, ncurses, xorg, libmikmod }:
+
+stdenv.mkDerivation rec {
+  name    = "bb-${version}";
+  version = "1.3rc1";
+
+  src = fetchurl {
+    url    = "mirror://sourceforge/aa-project/bb/${version}/${name}.tar.gz";
+    sha256 = "1i411glxh7g4pfg4gw826lpwngi89yrbmxac8jmnsfvrfb48hgbr";
+  };
+
+  buildInputs = [
+    aalib ncurses libmikmod
+    xorg.libXau xorg.libXdmcp xorg.libX11
+  ] ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.CoreAudio;
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    sed -i -e '/^#include <malloc.h>$/d' *.c
+  '';
+
+  meta = with lib; {
+    homepage    = http://aa-project.sourceforge.net/bb;
+    description = "AA-lib demo";
+    license     = licenses.gpl2;
+    maintainers = [ maintainers.rnhmjoj ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/bemenu/default.nix b/nixpkgs/pkgs/applications/misc/bemenu/default.nix
new file mode 100644
index 000000000000..89c32668be9c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/bemenu/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchFromGitHub, cairo, cmake, libxkbcommon
+, pango, fribidi, harfbuzz, pcre, pkgconfig
+, ncursesSupport ? true, ncurses ? null
+, waylandSupport ? true, wayland ? null
+, x11Support ? true, xlibs ? null, xorg ? null
+}:
+
+assert ncursesSupport -> ncurses != null;
+assert waylandSupport -> wayland != null;
+assert x11Support -> xlibs != null && xorg != null;
+
+stdenv.mkDerivation rec {
+  pname = "bemenu";
+  version = "0.1.0";
+
+  src = fetchFromGitHub {
+    owner = "Cloudef";
+    repo = "bemenu";
+    rev = "33e540a2b04ce78f5c7ab4a60b899c67f586cc32";
+    sha256 = "11h55m9dx6ai12pqij52ydjm36dvrcc856pa834njihrp626pl4w";
+  };
+
+  nativeBuildInputs = [ cmake pkgconfig pcre ];
+
+  buildInputs = with stdenv.lib; [
+    cairo
+    fribidi
+    harfbuzz
+    libxkbcommon
+    pango
+  ] ++ optionals ncursesSupport [ ncurses ]
+    ++ optionals waylandSupport [ wayland ]
+    ++ optionals x11Support [
+      xlibs.libX11 xlibs.libXinerama xlibs.libXft
+      xorg.libXdmcp xorg.libpthreadstubs xorg.libxcb
+    ];
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/Cloudef/bemenu";
+    description = "Dynamic menu library and client program inspired by dmenu";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ thiagokokada ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/bibletime/default.nix b/nixpkgs/pkgs/applications/misc/bibletime/default.nix
new file mode 100644
index 000000000000..41184d6e9492
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/bibletime/default.nix
@@ -0,0 +1,34 @@
+{stdenv, fetchurl, cmake, sword, qt4, boost, clucene_core}:
+
+stdenv.mkDerivation rec {
+
+  version = "2.10.1";
+
+  name = "bibletime-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/bibletime/${name}.tar.xz";
+    sha256 = "14fayy5h1ffjxin669q56fflxn4ij1irgn60cygwx2y02cwxbll6";
+  };
+
+  prePatch = ''
+    patchShebangs .;
+  '';
+
+  preConfigure =  ''
+    export CLUCENE_HOME=${clucene_core};
+    export SWORD_HOME=${sword};
+  '';
+
+  buildInputs = [ cmake sword qt4 boost clucene_core ];
+
+  cmakeFlags = "-DUSE_QT_WEBKIT=ON -DCMAKE_BUILD_TYPE=Debug";
+
+  meta = {
+    description = "A Qt4 Bible study tool";
+    homepage = http://www.bibletime.info/;
+    platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [ stdenv.lib.maintainers.piotr ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/bicon/default.nix b/nixpkgs/pkgs/applications/misc/bicon/default.nix
new file mode 100644
index 000000000000..22eb3e3d8594
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/bicon/default.nix
@@ -0,0 +1,36 @@
+{ stdenv
+  , fetchFromGitHub
+  , autoreconfHook
+  , pkg-config
+  , perl
+  , fribidi
+  , kbd
+  , xkbutils
+}:
+
+stdenv.mkDerivation rec {
+  pname = "bicon";
+  version = "unstable-2018-09-10";
+
+  src = fetchFromGitHub {
+    owner = "behdad";
+    repo = pname;
+    rev = "38725c062a83ab19c4e4b4bc20eb9535561aa76c";
+    sha256 = "0hdslrci8pq300f3rrjsvl5psfrxdwyxf9g2m5g789sr049dksnq";
+  };
+
+  buildInputs = [ fribidi kbd xkbutils perl ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  preConfigure = ''
+    patchShebangs .
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A bidirectional console";
+    homepage =  https://github.com/behdad/bicon;
+    license = [ licenses.lgpl21 licenses.psfl licenses.bsd0 ];
+    maintainers = [ maintainers.linarcx ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/bitcoinarmory/default.nix b/nixpkgs/pkgs/applications/misc/bitcoinarmory/default.nix
new file mode 100644
index 000000000000..9c99dcee2b3c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/bitcoinarmory/default.nix
@@ -0,0 +1,91 @@
+{ stdenv, fetchFromGitHub, pythonPackages
+, pkgconfig, autoreconfHook, rsync
+, swig, qt48Full, fcgi
+, bitcoin, procps, utillinux
+}:
+let
+
+  version = "0.96.1";
+  inherit (pythonPackages) buildPythonApplication pyqt4 psutil twisted;
+
+in buildPythonApplication {
+
+  name = "bitcoinarmory-${version}";
+
+  src = fetchFromGitHub {
+    owner = "goatpig";
+    repo = "BitcoinArmory";
+    rev = "v${version}";
+    sha256 = "0pjk5qx16n3kvs9py62666qkwp2awkgd87by4karbj7vk6p1l14h"; fetchSubmodules = true;
+  };
+
+  format = "other";
+
+  # FIXME bitcoind doesn't die on shutdown. Need some sort of patch to fix that.
+  #patches = [ ./shutdown-fix.patch ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkgconfig
+    swig
+    pyqt4
+    qt48Full
+    rsync # used by silly install script (TODO patch upstream)
+  ];
+  buildInputs = [
+    qt48Full
+    fcgi
+  ];
+
+  propagatedBuildInputs = [
+    pyqt4
+    psutil
+    twisted
+  ];
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  makeWrapperArgs = [
+    "--prefix            PATH : ${bitcoin}/bin"   # for `bitcoind`
+    "--prefix            PATH : ${procps}/bin"    # for `free`
+    "--prefix            PATH : ${utillinux}/bin" # for `whereis`
+    "--suffix LD_LIBRARY_PATH : $out/lib"         # for python bindings built as .so files
+    "--run    cd\\ $out/lib/armory"               # so that GUI resources can be loaded
+  ];
+
+  # auditTmpdir runs during fixupPhase, so patchelf before that
+  preFixup = ''
+    newRpath=$(patchelf --print-rpath $out/bin/ArmoryDB | sed -r 's|(.*)(/tmp/nix-build-.*libfcgi/.libs:?)(.*)|\1\3|')
+    patchelf --set-rpath $out/lib:$newRpath $out/bin/ArmoryDB
+  '';
+
+  # fixupPhase of mkPythonDerivation wraps $out/bin/*, so this needs to come after
+  postFixup = ''
+    wrapPythonProgramsIn $out/lib/armory "$out $pythonPath"
+    ln -sf $out/lib/armory/ArmoryQt.py $out/bin/armory
+  '';
+
+  meta = {
+    description = "Bitcoin wallet with cold storage and multi-signature support";
+    longDescription = ''
+      Armory is the most secure and full featured solution available for users
+      and institutions to generate and store Bitcoin private keys. This means
+      users never have to trust the Armory team and can use it with the Glacier
+      Protocol. Satoshi would be proud!
+
+      Users are empowered with multiple encrypted Bitcoin wallets and permanent
+      one-time ‘paper backups’. Armory pioneered cold storage and distributed
+      multi-signature. Bitcoin cold storage is a system for securely storing
+      Bitcoins on a completely air-gapped offline computer.
+
+      Maintainer's note: The original authors at https://bitcoinarmory.com/
+      discontinued development. I elected instead to package GitHub user
+      @goatpig's fork, as it's the most active, at time of this writing.
+    '';
+    homepage = https://github.com/goatpig/BitcoinArmory;
+    license = stdenv.lib.licenses.agpl3Plus;
+    maintainers = with stdenv.lib.maintainers; [ elitak ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/bleachbit/default.nix b/nixpkgs/pkgs/applications/misc/bleachbit/default.nix
new file mode 100644
index 000000000000..3f13972de9bb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/bleachbit/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, pythonPackages, fetchurl, gettext }:
+pythonPackages.buildPythonApplication rec {
+  pname = "bleachbit";
+  version = "2.2";
+
+  format = "other";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.bz2";
+    sha256 = "1yj9bc3k6s1aib7znb79h5rybfv691zz4szxkwf9fm9nr0dws603";
+  };
+
+  nativeBuildInputs = [ gettext ];
+
+  # Patch the many hardcoded uses of /usr/share/ and /usr/bin
+  postPatch = ''
+    find -type f -exec sed -i -e 's@/usr/share@${placeholder "out"}/share@g' {} \;
+    find -type f -exec sed -i -e 's@/usr/bin@${placeholder "out"}/bin@g' {} \;
+  '';
+
+  dontBuild = true;
+
+  installFlags = [ "prefix=${placeholder "out"}" ];
+
+  propagatedBuildInputs = with pythonPackages; [ pygtk ];
+
+  meta = {
+    homepage = http://bleachbit.sourceforge.net;
+    description = "A program to clean your computer";
+    longDescription = "BleachBit helps you easily clean your computer to free space and maintain privacy.";
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = with stdenv.lib.maintainers; [ leonardoce ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/blender/default.nix b/nixpkgs/pkgs/applications/misc/blender/default.nix
new file mode 100644
index 000000000000..5445c7efb59b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/blender/default.nix
@@ -0,0 +1,102 @@
+{ config, stdenv, lib, fetchurl, boost, cmake, ffmpeg, gettext, glew
+, ilmbase, libXi, libX11, libXext, libXrender
+, libjpeg, libpng, libsamplerate, libsndfile
+, libtiff, libGLU_combined, openal, opencolorio, openexr, openimageio, openjpeg_1, pythonPackages
+, zlib, fftw, opensubdiv, freetype, jemalloc, ocl-icd, addOpenGLRunpath
+, jackaudioSupport ? false, libjack2
+, cudaSupport ? config.cudaSupport or false, cudatoolkit
+, colladaSupport ? true, opencollada
+, enableNumpy ? false, makeWrapper
+}:
+
+with lib;
+
+let python = pythonPackages.python; in
+
+stdenv.mkDerivation rec {
+  name = "blender-2.79b";
+
+  src = fetchurl {
+    url = "https://download.blender.org/source/${name}.tar.gz";
+    sha256 = "1g4kcdqmf67srzhi3hkdnr4z1ph4h9sza1pahz38mrj998q4r52c";
+  };
+
+  nativeBuildInputs = [ cmake ] ++ optional cudaSupport addOpenGLRunpath;
+  buildInputs =
+    [ boost ffmpeg gettext glew ilmbase
+      libXi libX11 libXext libXrender
+      freetype libjpeg libpng libsamplerate libsndfile libtiff libGLU_combined openal
+      opencolorio openexr openimageio openjpeg_1 python zlib fftw jemalloc
+      (opensubdiv.override { inherit cudaSupport; })
+      makeWrapper
+    ]
+    ++ optional jackaudioSupport libjack2
+    ++ optional cudaSupport cudatoolkit
+    ++ optional colladaSupport opencollada;
+
+  postPatch =
+    ''
+      substituteInPlace doc/manpage/blender.1.py --replace /usr/bin/python ${python}/bin/python3
+      substituteInPlace extern/clew/src/clew.c --replace '"libOpenCL.so"' '"${ocl-icd}/lib/libOpenCL.so"'
+    '';
+
+  cmakeFlags =
+    [ "-DWITH_MOD_OCEANSIM=ON"
+      "-DWITH_CODEC_FFMPEG=ON"
+      "-DWITH_CODEC_SNDFILE=ON"
+      "-DWITH_INSTALL_PORTABLE=OFF"
+      "-DWITH_FFTW3=ON"
+      #"-DWITH_SDL=ON"
+      "-DWITH_GAMEENGINE=ON"
+      "-DWITH_OPENCOLORIO=ON"
+      "-DWITH_SYSTEM_OPENJPEG=ON"
+      "-DWITH_PLAYER=ON"
+      "-DWITH_OPENSUBDIV=ON"
+      "-DPYTHON_LIBRARY=${python.libPrefix}m"
+      "-DPYTHON_LIBPATH=${python}/lib"
+      "-DPYTHON_INCLUDE_DIR=${python}/include/${python.libPrefix}m"
+      "-DPYTHON_VERSION=${python.pythonVersion}"
+      "-DWITH_PYTHON_INSTALL=OFF"
+      "-DWITH_PYTHON_INSTALL_NUMPY=OFF"
+    ]
+    ++ optional jackaudioSupport "-DWITH_JACK=ON"
+    ++ optionals cudaSupport
+      [ "-DWITH_CYCLES_CUDA_BINARIES=ON"
+        # Disable architectures before sm_30 to support new CUDA toolkits.
+        "-DCYCLES_CUDA_BINARIES_ARCH=sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61"
+      ]
+    ++ optional colladaSupport "-DWITH_OPENCOLLADA=ON";
+
+  NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}";
+
+  # Since some dependencies are built with gcc 6, we need gcc 6's
+  # libstdc++ in our RPATH. Sigh.
+  NIX_LDFLAGS = optionalString cudaSupport "-rpath ${stdenv.cc.cc.lib}/lib";
+
+  enableParallelBuilding = true;
+
+  postInstall = optionalString enableNumpy
+    ''
+      wrapProgram $out/bin/blender \
+        --prefix PYTHONPATH : ${pythonPackages.numpy}/${python.sitePackages}
+    '';
+
+  # Set RUNPATH so that libcuda and libnvrtc in /run/opengl-driver(-32)/lib can be
+  # found. See the explanation in libglvnd.
+  postFixup = optionalString cudaSupport ''
+    for program in $out/bin/blender $out/bin/.blender-wrapped; do
+      isELF "$program" || continue
+      addOpenGLRunpath "$program"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "3D Creation/Animation/Publishing System";
+    homepage = https://www.blender.org;
+    # They comment two licenses: GPLv2 and Blender License, but they
+    # say: "We've decided to cancel the BL offering for an indefinite period."
+    license = licenses.gpl2Plus;
+    platforms = [ "x86_64-linux" ];
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/blender/fix-include.patch b/nixpkgs/pkgs/applications/misc/blender/fix-include.patch
new file mode 100644
index 000000000000..44e2147d073c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/blender/fix-include.patch
@@ -0,0 +1,12 @@
+diff --git a/intern/smoke/intern/WAVELET_NOISE.h b/intern/smoke/intern/WAVELET_NOISE.h
+index fce901b..1f73c5e 100644
+--- a/intern/smoke/intern/WAVELET_NOISE.h
++++ b/intern/smoke/intern/WAVELET_NOISE.h
+@@ -43,6 +43,7 @@
+ #ifndef WAVELET_NOISE_H
+ #define WAVELET_NOISE_H
+ 
++#include <string.h>
+ #include <MERSENNETWISTER.h>
+ 
+ #ifdef WIN32
diff --git a/nixpkgs/pkgs/applications/misc/buku/default.nix b/nixpkgs/pkgs/applications/misc/buku/default.nix
new file mode 100644
index 000000000000..60ade661cffd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/buku/default.nix
@@ -0,0 +1,76 @@
+{ stdenv, python3, fetchFromGitHub }:
+
+with python3.pkgs; buildPythonApplication rec {
+  version = "4.2.2";
+  pname = "buku";
+
+  src = fetchFromGitHub {
+    owner = "jarun";
+    repo = "buku";
+    rev = "v${version}";
+    sha256 = "1wy5i1av1s98yr56ybiq66kv0vg48zci3fp91zfgj04nh2966w1w";
+  };
+
+  checkInputs = [
+    pytestcov
+    hypothesis
+    pytest
+    pylint
+    flake8
+    pyyaml
+    mypy_extensions
+  ];
+
+  propagatedBuildInputs = [
+    cryptography
+    beautifulsoup4
+    requests
+    urllib3
+    flask
+    flask-api
+    flask-bootstrap
+    flask-paginate
+    flask_wtf
+    arrow
+    werkzeug
+    click
+    html5lib
+    vcrpy
+  ];
+
+  postPatch = ''
+    # Jailbreak problematic dependencies
+    sed -i \
+      -e "s,'PyYAML.*','PyYAML',g" \
+      setup.py
+  '';
+
+  preCheck = ''
+    # Fixes two tests for wrong encoding
+    export PYTHONIOENCODING=utf-8
+
+    # Disables a test which requires internet
+    substituteInPlace tests/test_bukuDb.py \
+      --replace "@pytest.mark.slowtest" "@unittest.skip('skipping')" \
+      --replace "self.assertEqual(shorturl, 'http://tny.im/yt')" "" \
+      --replace "self.assertEqual(url, 'https://www.google.com')" ""
+  '';
+
+  postInstall = ''
+    make install PREFIX=$out
+
+    mkdir -p $out/share/zsh/site-functions $out/share/bash-completion/completions $out/share/fish/vendor_completions.d
+    cp auto-completion/zsh/* $out/share/zsh/site-functions
+    cp auto-completion/bash/* $out/share/bash-completion/completions
+    cp auto-completion/fish/* $out/share/fish/vendor_completions.d
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Private cmdline bookmark manager";
+    homepage = https://github.com/jarun/Buku;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ matthiasbeyer infinisil ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/calcurse/default.nix b/nixpkgs/pkgs/applications/misc/calcurse/default.nix
new file mode 100644
index 000000000000..a15814082014
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/calcurse/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, ncurses, gettext, python3, python3Packages, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "calcurse-${version}";
+  version = "4.5.0";
+
+  src = fetchurl {
+    url = "https://calcurse.org/files/${name}.tar.gz";
+    sha256 = "1vjwcmp51h7dsvwn0qx93w9chp3wp970v7d9mjhk7jyamcbfywn3";
+  };
+
+  buildInputs = [ ncurses gettext python3 python3Packages.wrapPython ];
+  nativeBuildInputs = [ makeWrapper ];
+
+  postInstall = ''
+    patchShebangs .
+    buildPythonPath ${python3Packages.httplib2}
+    patchPythonScript $out/bin/calcurse-caldav
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A calendar and scheduling application for the command line";
+    longDescription = ''
+      calcurse is a calendar and scheduling application for the command line. It helps
+      keep track of events, appointments and everyday tasks. A configurable notification
+      system reminds users of upcoming deadlines, the curses based interface can be
+      customized to suit user needs and a very powerful set of command line options can
+      be used to filter and format appointments, making it suitable for use in scripts.
+    '';
+    homepage = http://calcurse.org/;
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/calibre/default.nix b/nixpkgs/pkgs/applications/misc/calibre/default.nix
new file mode 100644
index 000000000000..c05b98a07283
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/calibre/default.nix
@@ -0,0 +1,178 @@
+{ stdenv, fetchurl, poppler_utils, pkgconfig, libpng
+, imagemagick, libjpeg, fontconfig, podofo, qtbase, qmake, icu, sqlite
+, makeWrapper, unrarSupport ? false, chmlib, python2Packages, libusb1, libmtp
+, xdg_utils, makeDesktopItem, wrapGAppsHook, removeReferencesTo
+}:
+
+stdenv.mkDerivation rec {
+  version = "3.44.0";
+  name = "calibre-${version}";
+
+  src = fetchurl {
+    url = "https://download.calibre-ebook.com/${version}/${name}.tar.xz";
+    sha256 = "13d3cbn8qbjd8a19qprra6gmib1d818c3zgf3q70kx6b2fq58lzi";
+  };
+
+  patches = [
+    # Patches from Debian that:
+    # - disable plugin installation (very insecure)
+    ./disable_plugins.patch
+    # - switches the version update from enabled to disabled by default
+    ./no_updates_dialog.patch
+    # the unrar patch is not from debian
+  ] ++ stdenv.lib.optional (!unrarSupport) ./dont_build_unrar_plugin.patch;
+
+  prePatch = ''
+    sed -i "/pyqt_sip_dir/ s:=.*:= '${python2Packages.pyqt5_with_qtwebkit}/share/sip/PyQt5':"  \
+      setup/build_environment.py
+
+    # Remove unneeded files and libs
+    rm -rf resources/calibre-portable.* \
+           src/odf
+  '';
+
+  dontUseQmakeConfigure = true;
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ makeWrapper pkgconfig qmake removeReferencesTo ];
+
+  buildInputs = [
+    poppler_utils libpng imagemagick libjpeg
+    fontconfig podofo qtbase chmlib icu sqlite libusb1 libmtp xdg_utils wrapGAppsHook
+  ] ++ (with python2Packages; [
+    apsw cssselect css-parser dateutil dnspython html5-parser lxml mechanize netifaces pillow
+    python pyqt5_with_qtwebkit sip
+    regex msgpack beautifulsoup4
+    # the following are distributed with calibre, but we use upstream instead
+    odfpy
+  ]);
+
+  installPhase = ''
+    runHook preInstall
+
+    export HOME=$TMPDIR/fakehome
+    export POPPLER_INC_DIR=${poppler_utils.dev}/include/poppler
+    export POPPLER_LIB_DIR=${poppler_utils.out}/lib
+    export MAGICK_INC=${imagemagick.dev}/include/ImageMagick
+    export MAGICK_LIB=${imagemagick.out}/lib
+    export FC_INC_DIR=${fontconfig.dev}/include/fontconfig
+    export FC_LIB_DIR=${fontconfig.lib}/lib
+    export PODOFO_INC_DIR=${podofo.dev}/include/podofo
+    export PODOFO_LIB_DIR=${podofo.lib}/lib
+    export SIP_BIN=${python2Packages.sip}/bin/sip
+    ${python2Packages.python.interpreter} setup.py install --prefix=$out
+
+    PYFILES="$out/bin/* $out/lib/calibre/calibre/web/feeds/*.py
+      $out/lib/calibre/calibre/ebooks/metadata/*.py
+      $out/lib/calibre/calibre/ebooks/rtf2xml/*.py"
+
+    sed -i "s/env python[0-9.]*/python/" $PYFILES
+    sed -i "2i import sys; sys.argv[0] = 'calibre'" $out/bin/calibre
+
+    for a in $out/bin/*; do
+      wrapProgram $a --prefix PYTHONPATH : $PYTHONPATH \
+                     --prefix PATH : ${poppler_utils.out}/bin
+    done
+
+    # Replace @out@ by the output path.
+    mkdir -p $out/share/applications/
+    cp {$calibreDesktopItem,$ebookEditDesktopItem,$ebookViewerDesktopItem}/share/applications/* $out/share/applications/
+    for entry in $out/share/applications/*.desktop; do
+      substituteAllInPlace $entry
+    done
+
+    mkdir -p $out/share
+    cp -a man-pages $out/share/man
+
+    runHook postInstall
+  '';
+
+  # Remove some references to shrink the closure size. This reference (as of
+  # 2018-11-06) was a single string like the following:
+  #   /nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-podofo-0.9.6-dev/include/podofo/base/PdfVariant.h
+  preFixup = ''
+    remove-references-to -t ${podofo.dev} $out/lib/calibre/calibre/plugins/podofo.so
+  '';
+
+  disallowedReferences = [ podofo.dev ];
+
+  calibreDesktopItem = makeDesktopItem {
+    name = "calibre";
+    desktopName = "calibre";
+    exec = "@out@/bin/calibre --detach %F";
+    genericName = "E-book library management";
+    icon = "@out@/share/calibre/images/library.png";
+    comment = "Manage, convert, edit, and read e-books";
+    mimeType = stdenv.lib.concatStringsSep ";" [
+      "application/x-mobipocket-subscription"
+      "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
+      "text/html"
+      "application/x-cbc"
+      "application/ereader"
+      "application/oebps-package+xml"
+      "image/vnd.djvu"
+      "application/x-sony-bbeb"
+      "application/vnd.ms-word.document.macroenabled.12"
+      "text/rtf"
+      "text/x-markdown"
+      "application/pdf"
+      "application/x-cbz"
+      "application/x-mobipocket-ebook"
+      "application/x-cbr"
+      "application/x-mobi8-ebook"
+      "text/fb2+xml"
+      "application/vnd.oasis.opendocument.text"
+      "application/epub+zip"
+      "text/plain"
+      "application/xhtml+xml"
+    ];
+    categories = "Office";
+    extraEntries = ''
+      Actions=Edit;Viewer;
+
+      [Desktop Action Edit]
+      Name=Edit E-book
+      Icon=@out@/share/calibre/images/tweak.png
+      Exec=@out@/bin/ebook-edit --detach %F
+
+      [Desktop Action Viewer]
+      Name=E-book Viewer
+      Icon=@out@/share/calibre/images/viewer.png
+      Exec=@out@/bin/ebook-viewer --detach %F
+    '';
+  };
+
+  ebookEditDesktopItem = makeDesktopItem {
+    name = "calibre-edit-ebook";
+    desktopName = "Edit E-book";
+    genericName = "E-book Editor";
+    comment = "Edit e-books";
+    icon = "@out@/share/calibre/images/tweak.png";
+    exec = "@out@/bin/ebook-edit --detach %F";
+    categories = "Office;Publishing";
+    mimeType = "application/epub+zip";
+    extraEntries = "NoDisplay=true";
+  };
+
+  ebookViewerDesktopItem = makeDesktopItem {
+    name = "calibre-ebook-viewer";
+    desktopName = "E-book Viewer";
+    genericName = "E-book Viewer";
+    comment = "Read e-books in all the major formats";
+    icon = "@out@/share/calibre/images/viewer.png";
+    exec = "@out@/bin/ebook-viewer --detach %F";
+    categories = "Office;Viewer";
+    mimeType = "application/epub+zip";
+    extraEntries = "NoDisplay=true";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Comprehensive e-book software";
+    homepage = https://calibre-ebook.com;
+    license = with licenses; if unrarSupport then unfreeRedistributable else gpl3;
+    maintainers = with maintainers; [ domenkozar pSub AndersonTorres ];
+    platforms = platforms.linux;
+    inherit version;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/calibre/disable_plugins.patch b/nixpkgs/pkgs/applications/misc/calibre/disable_plugins.patch
new file mode 100644
index 000000000000..9ef1dd04251d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/calibre/disable_plugins.patch
@@ -0,0 +1,17 @@
+Description: Disable plugin dialog. It uses a totally non-authenticated and non-trusted way of installing arbitrary code.
+Author: Martin Pitt <mpitt@debian.org>
+Bug-Debian: http://bugs.debian.org/640026
+
+Index: calibre-0.8.29+dfsg/src/calibre/gui2/actions/preferences.py
+===================================================================
+--- calibre-0.8.29+dfsg.orig/src/calibre/gui2/actions/preferences.py	2011-12-16 05:49:14.000000000 +0100
++++ calibre-0.8.29+dfsg/src/calibre/gui2/actions/preferences.py	2011-12-20 19:29:04.798468930 +0100
+@@ -28,8 +28,6 @@
+             pm.addAction(QIcon(I('config.png')), _('Preferences'), self.do_config)
+         cm('welcome wizard', _('Run welcome wizard'),
+                 icon='wizard.png', triggered=self.gui.run_wizard)
+-        cm('plugin updater', _('Get plugins to enhance calibre'),
+-                icon='plugins/plugin_updater.png', triggered=self.get_plugins)
+         if not DEBUG:
+             pm.addSeparator()
+             cm('restart', _('Restart in debug mode'), icon='debug.png',
diff --git a/nixpkgs/pkgs/applications/misc/calibre/dont_build_unrar_plugin.patch b/nixpkgs/pkgs/applications/misc/calibre/dont_build_unrar_plugin.patch
new file mode 100644
index 000000000000..5164b80a0bee
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/calibre/dont_build_unrar_plugin.patch
@@ -0,0 +1,12 @@
+diff --git a/src/calibre/ebooks/metadata/archive.py b/src/calibre/ebooks/metadata/archive.py
+index 938ab24..1e095f8 100644
+--- a/src/calibre/ebooks/metadata/archive.py
++++ b/src/calibre/ebooks/metadata/archive.py
+@@ -44,7 +44,7 @@
+     description = _('Extract common e-book formats from archive files '
+         '(ZIP/RAR). Also try to autodetect if they are actually '
+         'CBZ/CBR files.')
+-    file_types = {'zip', 'rar'}
++    file_types = {'zip'}
+     supported_platforms = ['windows', 'osx', 'linux']
+     on_import = True
diff --git a/nixpkgs/pkgs/applications/misc/calibre/no_updates_dialog.patch b/nixpkgs/pkgs/applications/misc/calibre/no_updates_dialog.patch
new file mode 100644
index 000000000000..faaaf2c19949
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/calibre/no_updates_dialog.patch
@@ -0,0 +1,15 @@
+diff -burN calibre-2.9.0.orig/src/calibre/gui2/main.py calibre-2.9.0/src/calibre/gui2/main.py
+--- calibre-2.9.0.orig/src/calibre/gui2/main.py	2014-11-09 20:09:54.081231882 +0800
++++ calibre-2.9.0/src/calibre/gui2/main.py	2014-11-09 20:15:48.193033844 +0800
+@@ -37,8 +37,9 @@
+                       help=_('Start minimized to system tray.'))
+     parser.add_option('-v', '--verbose', default=0, action='count',
+                       help=_('Ignored, do not use. Present only for legacy reasons'))
+-    parser.add_option('--no-update-check', default=False, action='store_true',
+-            help=_('Do not check for updates'))
++    parser.add_option('--update-check', dest='no_update_check', default=True,
++            action='store_false',
++            help=_('Check for updates'))
+     parser.add_option('--ignore-plugins', default=False, action='store_true',
+             help=_('Ignore custom plugins, useful if you installed a plugin'
+                 ' that is preventing calibre from starting'))
diff --git a/nixpkgs/pkgs/applications/misc/candle/default.nix b/nixpkgs/pkgs/applications/misc/candle/default.nix
new file mode 100644
index 000000000000..35aa681df4ba
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/candle/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, qtbase, qtserialport, qmake }:
+
+stdenv.mkDerivation rec {
+  name = "candle-${version}";
+  version = "1.1";
+
+  src = fetchFromGitHub {
+    owner  = "Denvi";
+    repo   = "Candle";
+    rev    = "v${version}";
+    sha256 = "1gpx08gdz8awbsj6lsczwgffp19z3q0r2fvm72a73qd9az29pmm0";
+  };
+
+  nativeBuildInputs = [ qmake ];
+  
+  sourceRoot = "source/src";
+
+  installPhase = ''
+    runHook preInstall
+    install -Dm755 Candle $out/bin/candle
+    runHook postInstall
+  '';
+
+  buildInputs = [ qtbase qtserialport ];
+
+  meta = with stdenv.lib; {
+    description = "GRBL controller application with G-Code visualizer written in Qt";
+    homepage = https://github.com/Denvi/Candle;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ matti-kariluoma ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/cardpeek/default.nix b/nixpkgs/pkgs/applications/misc/cardpeek/default.nix
new file mode 100644
index 000000000000..a0e5c8149968
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cardpeek/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchFromGitHub, pkgconfig, autoreconfHook,
+  glib, gtk3, pcsclite, lua5_2, curl, readline }:
+let
+  version = "0.8.4";
+in
+  stdenv.mkDerivation {
+    name = "cardpeek-${version}";
+
+    src = fetchFromGitHub {
+      owner = "L1L1";
+      repo = "cardpeek";
+      rev = "cardpeek-${version}";
+      sha256 = "1ighpl7nvcvwnsd6r5h5n9p95kclwrq99hq7bry7s53yr57l6588";
+    };
+
+    nativeBuildInputs = [ pkgconfig autoreconfHook ];
+    buildInputs = [ glib gtk3 pcsclite lua5_2 curl readline ];
+
+    enableParallelBuilding = true;
+
+    meta = with stdenv.lib; {
+      homepage = https://github.com/L1L1/cardpeek;
+      description = "A tool to read the contents of ISO7816 smart cards";
+      license = licenses.gpl3Plus;
+      platforms = with platforms; linux ++ darwin;
+      maintainers = with maintainers; [ embr ];
+    };
+  }
diff --git a/nixpkgs/pkgs/applications/misc/cataract/build.nix b/nixpkgs/pkgs/applications/misc/cataract/build.nix
new file mode 100644
index 000000000000..e48b32a783d7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cataract/build.nix
@@ -0,0 +1,39 @@
+{ stdenv
+, fetchgit
+, autoreconfHook
+, glib
+, pkgconfig
+, libxml2
+, exiv2
+, imagemagick
+, version
+, sha256
+, rev }:
+
+stdenv.mkDerivation rec {
+  inherit version;
+  name = "cataract-${version}";
+
+  src = fetchgit {
+    url = "git://git.bzatek.net/cataract";
+    inherit sha256 rev;
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  buildInputs = [ glib libxml2 exiv2 imagemagick ];
+
+  installPhase = ''
+    mkdir $out/{bin,share} -p
+    cp src/cgg{,-dirgen} $out/bin/
+  '';
+
+  meta = {
+    homepage = http://cgg.bzatek.net/;
+    description = "a simple static web photo gallery, designed to be clean and easily usable";
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [ stdenv.lib.maintainers.matthiasbeyer ];
+    platforms = with stdenv.lib.platforms; linux ++ darwin;
+  };
+}
+
+
diff --git a/nixpkgs/pkgs/applications/misc/cataract/default.nix b/nixpkgs/pkgs/applications/misc/cataract/default.nix
new file mode 100644
index 000000000000..3a9f20289227
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cataract/default.nix
@@ -0,0 +1,8 @@
+{ callPackage }:
+
+callPackage ./build.nix {
+  version = "1.1.0";
+  rev = "675e647dc8ae918d29f520a29be9201ae85a94dd";
+  sha256 = "13b9rvcy9k2ay8w36j28kc7f4lnxp4jc0494ck3xsmwgqsawmzdj";
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/cataract/unstable.nix b/nixpkgs/pkgs/applications/misc/cataract/unstable.nix
new file mode 100644
index 000000000000..397aed355a95
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cataract/unstable.nix
@@ -0,0 +1,8 @@
+{ callPackage }:
+
+callPackage ./build.nix {
+  version = "unstable-2016-10-18";
+  rev = "db3d992febbe703931840e9bdad95c43081694a5";
+  sha256 = "04f85piy675lq36w1mw6mw66n8911mmn4ifj8h9x47z8z806h3rf";
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/catclock/default.nix b/nixpkgs/pkgs/applications/misc/catclock/default.nix
new file mode 100644
index 000000000000..75f5ab406fe0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/catclock/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub, xlibsWrapper, motif }:
+
+stdenv.mkDerivation rec {
+  name = "catclock-2015-10-04";
+
+  src = fetchFromGitHub {
+    owner = "BarkyTheDog";
+    repo = "catclock";
+    rev = "d20b8825b38477a144e8a2a4bbd4779adb3620ac";
+    sha256 = "0fiv9rj8p8mifv24cxljdrrmh357q70zmzdci9bpbxnhs1gdpr63";
+  };
+
+  preInstall = ''
+    mkdir -p $out/bin
+    mkdir -p $out/share/man/man1
+    cp xclock.man $out/share/man/man1/xclock.1
+  '';
+
+  makeFlags = [
+    "DESTINATION=$(out)/bin/"
+  ];
+
+  buildInputs = [ xlibsWrapper motif ];
+
+  meta = with stdenv.lib; {
+    homepage = http://codefromabove.com/2014/05/catclock/;
+    license = with licenses; mit;
+    maintainers = with maintainers; [ ramkromberg ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/cbatticon/default.nix b/nixpkgs/pkgs/applications/misc/cbatticon/default.nix
new file mode 100644
index 000000000000..44612644359c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cbatticon/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub, pkgconfig, gettext, glib, gtk3, libnotify }:
+
+stdenv.mkDerivation rec {
+  pname = "cbatticon";
+  version = "1.6.9";
+
+  src = fetchFromGitHub {
+    owner = "valr";
+    repo = pname;
+    rev = version;
+    sha256 = "0kw09d678sd3m18fmi4380sl4a2m5lkfmq0kps16cdmq7z80rvaf";
+  };
+
+  nativeBuildInputs = [ pkgconfig gettext ];
+
+  buildInputs =  [ glib gtk3 libnotify ];
+
+  patchPhase = ''
+    sed -i -e 's/ -Wno-format//g' Makefile
+  '';
+
+  makeFlags = "PREFIX=${placeholder "out"}";
+
+  meta = with stdenv.lib; {
+    description = "Lightweight and fast battery icon that sits in the system tray";
+    homepage = https://github.com/valr/cbatticon;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.domenkozar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/cdrtools/default.nix b/nixpkgs/pkgs/applications/misc/cdrtools/default.nix
new file mode 100644
index 000000000000..3738fb83c705
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cdrtools/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchurl, acl, libcap }:
+
+stdenv.mkDerivation rec {
+  name = "cdrtools-${version}";
+  version = "3.02a06";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/cdrtools/${name}.tar.bz2";
+    sha256 = "1cayhfbhj5g2vgmkmq5scr23k0ka5fsn0dhn0n9yllj386csnygd";
+  };
+
+  patches = [ ./fix-paths.patch ];
+
+  buildInputs = [ acl libcap ];
+
+  postPatch = ''
+    sed "/\.mk3/d" -i libschily/Targets.man
+    substituteInPlace man/Makefile --replace "man4" ""
+  '';
+
+  dontConfigure = true;
+
+  GMAKE_NOWARN = true;
+
+  makeFlags = [ "INS_BASE=/" "INS_RBASE=/" "DESTDIR=$(out)" ];
+
+  meta = with stdenv.lib; {
+    homepage = https://sourceforge.net/projects/cdrtools/;
+    description = "Highly portable CD/DVD/BluRay command line recording software";
+    license = with licenses; [ gpl2 lgpl2 cddl ];
+    platforms = platforms.linux;
+    # Licensing issues: This package contains code licensed under CDDL, GPL2
+    # and LGPL2. There is a debate regarding the legality of distributing this
+    # package in binary form.
+    hydraPlatforms = [];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/cdrtools/fix-paths.patch b/nixpkgs/pkgs/applications/misc/cdrtools/fix-paths.patch
new file mode 100644
index 000000000000..f4a541210880
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cdrtools/fix-paths.patch
@@ -0,0 +1,32 @@
+diff -ru3 cdrtools-3.01-old/DEFAULTS/Defaults.linux cdrtools-3.01/DEFAULTS/Defaults.linux
+--- cdrtools-3.01-old/DEFAULTS/Defaults.linux	2015-12-11 17:37:21.505848835 +0300
++++ cdrtools-3.01/DEFAULTS/Defaults.linux	2015-12-11 17:37:32.155828925 +0300
+@@ -57,7 +57,8 @@
+ # Installation config stuff
+ #
+ ###########################################################################
+-INS_BASE=	/opt/schily
++#INS_BASE=	/opt/schily
++INS_BASE=	$(out)
+ INS_KBASE=	/
+ INS_RBASE=	/
+ #
+Only in cdrtools-3.01/DEFAULTS: Defaults.linux.orig
+diff -ru3 cdrtools-3.01-old/RULES/rules.prg cdrtools-3.01/RULES/rules.prg
+--- cdrtools-3.01-old/RULES/rules.prg	2015-12-11 17:37:21.500848844 +0300
++++ cdrtools-3.01/RULES/rules.prg	2015-12-11 17:38:29.890720987 +0300
+@@ -43,10 +43,10 @@
+ #
+ #SHELL=		/bin/sh
+ 
+-LN=		/bin/ln
+-SYMLINK=	/bin/ln -s
+-RM=		/bin/rm
+-MV=		/bin/mv
++LN=		ln
++SYMLINK=	ln -s
++RM=		rm
++MV=		mv
+ LORDER=		lorder
+ TSORT=		tsort
+ CTAGS=		vctags
diff --git a/nixpkgs/pkgs/applications/misc/cgminer/default.nix b/nixpkgs/pkgs/applications/misc/cgminer/default.nix
new file mode 100644
index 000000000000..9d63b5aedcb7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cgminer/default.nix
@@ -0,0 +1,45 @@
+{ fetchgit, stdenv, pkgconfig, libtool, autoconf, automake
+, curl, ncurses, ocl-icd, opencl-headers, xorg, jansson }:
+
+stdenv.mkDerivation rec {
+  version = "3.7.2";
+  name = "cgminer-${version}";
+
+  src = fetchgit {
+    url = "https://github.com/ckolivas/cgminer.git";
+    rev = "refs/tags/v3.7.2";
+    sha256  = "1xfzx91dpwjj1vmhas3v9ybs0p2i74lrhinijmpav15acfggm9fq";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    autoconf automake libtool curl ncurses ocl-icd opencl-headers
+    xorg.libX11 xorg.libXext xorg.libXinerama jansson
+  ];
+  configureScript = "./autogen.sh";
+  configureFlags = [ "--enable-scrypt" "--enable-opencl" ];
+  NIX_LDFLAGS = "-lgcc_s -lX11 -lXext -lXinerama";
+
+  postBuild = ''
+    gcc api-example.c -o cgminer-api
+  '';
+
+  postInstall = ''
+    cp cgminer-api $out/bin/
+    chmod 444 $out/bin/*.cl
+  '';
+
+  meta = with stdenv.lib; {
+    description = "CPU/GPU miner in c for bitcoin";
+    longDescription= ''
+      This is a multi-threaded multi-pool GPU, FPGA and ASIC miner with ATI GPU
+      monitoring, (over)clocking and fanspeed support for bitcoin and derivative
+      coins. Do not use on multiple block chains at the same time!
+    '';
+    homepage = https://github.com/ckolivas/cgminer;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.offline ];
+    platforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = [];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/cheat/default.nix b/nixpkgs/pkgs/applications/misc/cheat/default.nix
new file mode 100644
index 000000000000..41660bc7f2b0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cheat/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, python3, fetchFromGitHub }:
+
+with python3.pkgs;
+buildPythonApplication rec {
+  name = "${pname}-${version}";
+  pname = "cheat";
+  version = "2.5.1";
+
+  propagatedBuildInputs = [ docopt pygments termcolor ];
+
+  src = fetchFromGitHub {
+    owner = "chrisallenlane";
+    repo = "cheat";
+    rev = version;
+    sha256 = "1i543hvg1yizamfd83bawflfcb500hvc72i59ikck8j1hjk50hsl";
+  };
+  # no tests available
+  doCheck = false;
+
+  postInstall = ''
+    install -D man1/cheat.1.gz $out/share/man/man1/cheat.1.gz
+    mv $out/${python3.sitePackages}/etc $out/
+    mv $out/${python3.sitePackages}/usr/share/* $out/share/
+    rm -r $out/${python3.sitePackages}/usr
+  '';
+
+  makeWrapperArgs = [
+    "--suffix" "CHEAT_PATH" ":" "$out/share/cheat"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "cheat allows you to create and view interactive cheatsheets on the command-line";
+    maintainers = with maintainers; [ mic92 ];
+    license = with licenses; [ gpl3 mit ];
+    homepage = https://github.com/chrisallenlane/cheat;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/cherrytree/default.nix b/nixpkgs/pkgs/applications/misc/cherrytree/default.nix
new file mode 100644
index 000000000000..0578393dfca0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cherrytree/default.nix
@@ -0,0 +1,50 @@
+{ stdenv, fetchurl, pythonPackages, gettext }:
+
+with stdenv.lib;
+stdenv.mkDerivation rec {
+
+  name = "cherrytree-${version}";
+  version = "0.38.8";
+
+  src = fetchurl {
+    url = "https://www.giuspen.com/software/${name}.tar.xz";
+    sha256 = "1ns87xl2sgrf3nha4xkhp0xcxlycqszlp6xdrn95lg6vzm0fa8dg";
+  };
+
+  buildInputs = with pythonPackages;
+  [ python gettext wrapPython pygtk dbus-python pygtksourceview ];
+
+  pythonPath = with pythonPackages;
+  [ pygtk dbus-python pygtksourceview ];
+
+  patches = [ ./subprocess.patch ];
+
+  installPhase = ''
+    python setup.py install --prefix="$out"
+
+    for file in "$out"/bin/*; do
+        wrapProgram "$file" \
+            --prefix PYTHONPATH : "$(toPythonPath $out):$PYTHONPATH"
+    done
+  '';
+
+  doCheck = false;
+
+  meta = {
+    description = "An hierarchical note taking application";
+    longDescription = ''
+      Cherrytree is an hierarchical note taking application,
+      featuring rich text, syntax highlighting and powerful search
+      capabilities. It organizes all information in units called
+      "nodes", as in a tree, and can be very useful to store any piece
+      of information, from tables and links to pictures and even entire
+      documents. All those little bits of information you have scattered
+      around your hard drive can be conveniently placed into a
+      Cherrytree document where you can easily find it.
+    '';
+    homepage = http://www.giuspen.com/cherrytree;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.AndersonTorres ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/cherrytree/subprocess.patch b/nixpkgs/pkgs/applications/misc/cherrytree/subprocess.patch
new file mode 100644
index 000000000000..1f80cde03b75
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cherrytree/subprocess.patch
@@ -0,0 +1,14 @@
+diff -Naur cherrytree-0.37.1-orig/setup.py cherrytree-0.37.1/setup.py
+--- cherrytree-0.37.1-orig/setup.py	2016-01-08 20:50:50.000000000 +0100
++++ cherrytree-0.37.1/setup.py	2016-07-05 20:30:27.768178682 +0200
+@@ -205,4 +205,9 @@
+           },
+        distclass=CherryTreeDist
+     )
+-    subprocess.call("update-desktop-database")
++    try:
++        subprocess.check_call(['update-desktop-database'])
++    except subprocess.CalledProcessError:
++        pass # handle errors in the called executable
++    except OSError:
++        pass # executable not found
diff --git a/nixpkgs/pkgs/applications/misc/cli-visualizer/default.nix b/nixpkgs/pkgs/applications/misc/cli-visualizer/default.nix
new file mode 100644
index 000000000000..6602adb2f2ab
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cli-visualizer/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, fftw, ncurses5, libpulseaudio, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  version = "1.8";
+  name = "cli-visualizer-${version}";
+
+  src = fetchFromGitHub {
+    owner = "dpayne";
+    repo = "cli-visualizer";
+    rev = "v${version}";
+    sha256 = "003mbbwsz43mg3d7llphpypqa9g7rs1p1cdbqi1mbc2bfrc1gcq2";
+  };
+
+  postPatch = ''
+    sed '1i#include <cmath>' -i src/Transformer/SpectrumCircleTransformer.cpp
+  '';
+
+  buildInputs = [ fftw ncurses5 libpulseaudio makeWrapper ];
+
+  buildFlags = [ "ENABLE_PULSE=1" ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp build/vis $out/bin/vis
+    # See https://github.com/dpayne/cli-visualizer/issues/62#issuecomment-330738075
+    wrapProgram $out/bin/vis --set TERM rxvt-256color
+  '';
+
+  meta = {
+    homepage = https://github.com/dpayne/cli-visualizer;
+    description = "CLI based audio visualizer";
+    license = stdenv.lib.licenses.mit;
+    maintainers = [ stdenv.lib.maintainers.matthiasbeyer ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/clipit/default.nix b/nixpkgs/pkgs/applications/misc/clipit/default.nix
new file mode 100644
index 000000000000..4477cbbcc06a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/clipit/default.nix
@@ -0,0 +1,21 @@
+{ fetchurl, stdenv, intltool, pkgconfig, gtk2, xdotool, hicolor-icon-theme }:
+
+stdenv.mkDerivation rec {
+  name = "clipit-${version}";
+  version = "1.4.2";
+
+  src = fetchurl {
+    url = "https://github.com/downloads/shantzu/ClipIt/${name}.tar.gz";
+    sha256 = "0jrwn8qfgb15rwspdp1p8hb1nc0ngmpvgr87d4k3lhlvqg2cfqva";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ intltool gtk2 xdotool hicolor-icon-theme ];
+
+  meta = with stdenv.lib; {
+    description = "Lightweight GTK+ Clipboard Manager";
+    homepage    = "http://clipit.rspwn.com";
+    license     = licenses.gpl3;
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/clipmenu/default.nix b/nixpkgs/pkgs/applications/misc/clipmenu/default.nix
new file mode 100644
index 000000000000..7a47a0e3bc0b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/clipmenu/default.nix
@@ -0,0 +1,33 @@
+{ clipnotify, makeWrapper, xsel, dmenu2, utillinux, gawk, stdenv, fetchFromGitHub, lib }:
+let
+  runtimePath = lib.makeBinPath [ clipnotify xsel dmenu2 utillinux gawk ];
+in
+stdenv.mkDerivation rec {
+  name = "clipmenu-${version}";
+  version = "5.6.0";
+
+  src = fetchFromGitHub {
+    owner  = "cdown";
+    repo   = "clipmenu";
+    rev    = version;
+    sha256 = "13hyarzazh6j33d808h3s5yk320wqzivc0ni9xm8kalvn4k3a0bq";
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp clipdel clipmenu clipmenud $out/bin
+
+    for bin in $out/bin/*; do
+      wrapProgram "$bin" --prefix PATH : "${runtimePath}"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Clipboard management using dmenu";
+    inherit (src.meta) homepage;
+    maintainers = with maintainers; [ jb55 ];
+    license = licenses.publicDomain;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/cmatrix/default.nix b/nixpkgs/pkgs/applications/misc/cmatrix/default.nix
new file mode 100644
index 000000000000..28f14cc1435f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cmatrix/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, pkgconfig, ncurses }:
+
+let
+  version = "1.2a";
+in with stdenv.lib;
+stdenv.mkDerivation rec {
+
+  name = "cmatrix-${version}";
+
+  src = fetchurl{
+    url = "http://www.asty.org/cmatrix/dist/${name}.tar.gz";
+    sha256 = "0k06fw2n8nzp1pcdynhajp5prba03gfgsbj91bknyjr5xb5fd9hz";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ ncurses ];
+
+  meta = {
+    description = "Simulates the falling characters theme from The Matrix movie";
+    longDescription = ''
+      CMatrix simulates the display from "The Matrix" and is based
+      on the screensaver from the movie's website.  
+    '';
+    homepage = http://www.asty.org/cmatrix/;
+    platforms = ncurses.meta.platforms;
+    maintainers = [ maintainers.AndersonTorres ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/cointop/default.nix b/nixpkgs/pkgs/applications/misc/cointop/default.nix
new file mode 100644
index 000000000000..b973c73c0dd8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cointop/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "cointop";
+  version = "1.2.0";
+
+  src = fetchFromGitHub {
+    owner = "miguelmota";
+    repo = pname;
+    rev = version;
+    sha256 = "1vhsbk55rrsmnh9b3cxjiv1pzdiip54cyj31j4aj33vlr4hkampn";
+  };
+
+  modSha256 = "0vvypp97b3bjwxb96hajpjzr52sb5lc4r3zdkrdgg3vjwwacjwsn";
+
+  meta = with lib; {
+    description = "The fastest and most interactive terminal based UI application for tracking cryptocurrencies";
+    longDescription = ''
+      cointop is a fast and lightweight interactive terminal based UI
+      application for tracking and monitoring cryptocurrency coin stats in
+      real-time.
+
+      The interface is inspired by htop and shortcut keys are inspired by vim.
+    '';
+    homepage = "https://cointop.sh";
+    maintainers = [ maintainers.marsam ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/colort/default.nix b/nixpkgs/pkgs/applications/misc/colort/default.nix
new file mode 100644
index 000000000000..554c7d8c78bb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/colort/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation {
+  name = "colort-unstable-2017-03-12";
+
+  src = fetchFromGitHub {
+    owner = "neeasade";
+    repo = "colort";
+    rev = "8470190706f358dc807b4c26ec3453db7f0306b6";
+    sha256 = "10n8rbr2h6hz86hcx73f86pjbbfiaw2rvxsk0yfajnma7bpxgdxw";
+  };
+
+  makeFlags = ["PREFIX=$(out)"];
+
+  meta = with stdenv.lib; {
+    description = "A program for 'tinting' color values";
+    homepage = https://github.com/neeasade/colort;
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = [ maintainers.neeasade ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/confclerk/default.nix b/nixpkgs/pkgs/applications/misc/confclerk/default.nix
new file mode 100644
index 000000000000..3851730c4596
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/confclerk/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, qt4, qmake4Hook }:
+
+let version = "0.6.4"; in
+stdenv.mkDerivation {
+  name = "confclerk-${version}";
+
+  src = fetchurl {
+    url = "https://www.toastfreeware.priv.at/tarballs/confclerk/confclerk-${version}.tar.gz";
+    sha256 = "10rhg44px4nvbkd3p341cmp2ds43jn8r4rvgladda9v8zmsgr2b3";
+  };
+
+  buildInputs = [ qt4 ];
+
+  nativeBuildInputs = [ qmake4Hook ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp src/bin/confclerk $out/bin
+  '';
+
+  meta = {
+    description = "Offline conference schedule viewer";
+    homepage = http://www.toastfreeware.priv.at/confclerk;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = with stdenv.lib.maintainers; [ ehmry ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/cool-retro-term/default.nix b/nixpkgs/pkgs/applications/misc/cool-retro-term/default.nix
new file mode 100644
index 000000000000..f2372aa51e68
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cool-retro-term/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchFromGitHub, qtbase, qtquick1, qmltermwidget
+, qtquickcontrols, qtgraphicaleffects, qmake }:
+
+stdenv.mkDerivation rec {
+  version = "1.1.1";
+  name = "cool-retro-term-${version}";
+
+  src = fetchFromGitHub {
+    owner = "Swordfish90";
+    repo = "cool-retro-term";
+    rev = version;
+    sha256 = "0mird4k88ml6y61hky2jynrjmnxl849fvhsr5jfdlnv0i7r5vwi5";
+  };
+
+  patchPhase = ''
+    sed -i -e '/qmltermwidget/d' cool-retro-term.pro
+  '';
+
+  buildInputs = [ qtbase qtquick1 qmltermwidget qtquickcontrols qtgraphicaleffects ];
+  nativeBuildInputs = [ qmake ];
+
+  installFlags = [ "INSTALL_ROOT=$(out)" ];
+
+  preFixup = ''
+    mv $out/usr/share $out/share
+    mv $out/usr/bin $out/bin
+    rmdir $out/usr
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    ln -s $out/bin/cool-retro-term.app/Contents/MacOS/cool-retro-term $out/bin/cool-retro-term
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Terminal emulator which mimics the old cathode display";
+    longDescription = ''
+      cool-retro-term is a terminal emulator which tries to mimic the look and
+      feel of the old cathode tube screens. It has been designed to be
+      eye-candy, customizable, and reasonably lightweight.
+    '';
+    homepage = https://github.com/Swordfish90/cool-retro-term;
+    license = stdenv.lib.licenses.gpl3Plus;
+    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    maintainers = with stdenv.lib.maintainers; [ skeidel ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/copyq/default.nix b/nixpkgs/pkgs/applications/misc/copyq/default.nix
new file mode 100644
index 000000000000..3ee357ce151b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/copyq/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, cmake, qtbase, qtscript, qtwebkit, libXfixes, libXtst
+, qtx11extras, git
+, webkitSupport ? true
+}:
+
+stdenv.mkDerivation rec {
+  name = "CopyQ-${version}";
+  version = "3.9.0";
+
+  src  = fetchFromGitHub {
+    owner = "hluk";
+    repo = "CopyQ";
+    rev = "v${version}";
+    sha256 = "1l9f0hg2ggy944sjlyiyglln5mjm9fvgmvwp3pnvmmc6mfbmslq3";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [
+    git qtbase qtscript libXfixes libXtst qtx11extras
+  ] ++ stdenv.lib.optional webkitSupport qtwebkit;
+
+  meta = with stdenv.lib; {
+    homepage    = https://hluk.github.io/CopyQ;
+    description = "Clipboard Manager with Advanced Features";
+    license     = licenses.gpl3;
+    maintainers = [ maintainers.willtim ];
+    # NOTE: CopyQ supports windows and osx, but I cannot test these.
+    # OSX build requires QT5.
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/coursera-dl/default.nix b/nixpkgs/pkgs/applications/misc/coursera-dl/default.nix
new file mode 100644
index 000000000000..0601514546f2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/coursera-dl/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchFromGitHub, glibcLocales, pandoc, python3 }:
+
+let
+  pythonPackages = python3.pkgs;
+
+in pythonPackages.buildPythonApplication rec {
+  pname = "coursera-dl";
+  version = "0.11.4";
+
+  src = fetchFromGitHub {
+    owner = "coursera-dl";
+    repo = "coursera-dl";
+    rev = version;
+    sha256 = "0dn7a6s98dwba62r0dyabq8pryzga4b2wpx88i9bmp7ja1b1f92f";
+  };
+
+  nativeBuildInputs = with pythonPackages; [ pandoc ];
+
+  buildInputs = with pythonPackages; [ glibcLocales ];
+
+  propagatedBuildInputs = with pythonPackages; [ attrs beautifulsoup4 ConfigArgParse keyring pyasn1 requests six urllib3 ];
+
+  checkInputs = with pythonPackages; [ pytest mock ];
+
+  postPatch = ''
+    substituteInPlace requirements.txt \
+      --replace '==' '>='
+  '';
+
+  preConfigure = ''
+    export LC_ALL=en_US.utf-8
+  '';
+
+  checkPhase = ''
+    # requires dbus service
+    py.test -k 'not test_get_credentials_with_keyring' .
+  '';
+
+  meta = with stdenv.lib; {
+    description = "CLI for downloading Coursera.org videos and naming them";
+    homepage = https://github.com/coursera-dl/coursera-dl;
+    license = licenses.lgpl3Plus;
+    maintainers = with maintainers; [ alexfmpe ];
+    platforms = platforms.darwin ++ platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/cpp-ethereum/default.nix b/nixpkgs/pkgs/applications/misc/cpp-ethereum/default.nix
new file mode 100644
index 000000000000..4d9975192461
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cpp-ethereum/default.nix
@@ -0,0 +1,85 @@
+{ stdenv
+, fetchFromGitHub
+, cmake
+, jsoncpp
+, libjson-rpc-cpp
+, curl
+, boost
+, leveldb
+, cryptopp
+, libcpuid
+, opencl-headers
+, ocl-icd
+, miniupnpc
+, libmicrohttpd
+, gmp
+, libGLU_combined
+, extraCmakeFlags ? []
+}:
+stdenv.mkDerivation rec {
+  name = "cpp-ethereum-${version}";
+  version = "1.3.0";
+
+  src = fetchFromGitHub {
+    owner = "ethereum";
+    repo = "cpp-ethereum";
+    rev = "62ab9522e58df9f28d2168ea27999a214b16ea96";
+    sha256 = "1fxgpqhmjhpv0zzs1m3yf9h8mh25dqpa7pmcfy7f9qiqpfdr4zq9";
+  };
+
+  cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" extraCmakeFlags ];
+
+  configurePhase = ''
+    export BOOST_INCLUDEDIR=${boost.dev}/include
+    export BOOST_LIBRARYDIR=${boost.out}/lib
+
+    mkdir -p Build/Install
+    pushd Build
+
+    cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/Install $cmakeFlags
+  '';
+
+  enableParallelBuilding = true;
+
+  runPath = with stdenv.lib; makeLibraryPath ([ stdenv.cc.cc ] ++ buildInputs);
+
+  installPhase = ''
+    make install
+
+    mkdir -p $out
+
+    for f in Install/lib/*.so* $(find Install/bin -executable -type f); do
+      patchelf --set-rpath $runPath:$out/lib $f
+    done
+
+    cp -r Install/* $out
+  '';
+
+  buildInputs = [
+    cmake
+    jsoncpp
+    libjson-rpc-cpp
+    curl
+    boost
+    leveldb
+    cryptopp
+    libcpuid
+    opencl-headers
+    ocl-icd
+    miniupnpc
+    libmicrohttpd
+    gmp
+    libGLU_combined
+  ];
+
+  dontStrip = true;
+
+  meta = with stdenv.lib; {
+    description = "Ethereum C++ client";
+    homepage = https://github.com/ethereum/cpp-ethereum;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ artuuge ];
+    platforms = platforms.linux;
+    broken = true; # 2018-04-10
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/crumbs/default.nix b/nixpkgs/pkgs/applications/misc/crumbs/default.nix
new file mode 100644
index 000000000000..2d612c16fef3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/crumbs/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "crumbs";
+  version = "0.0.3";
+
+  src = fetchFromGitHub
+    { owner = "fasseg";
+      repo = "crumbs";
+      rev = version;
+      sha256 = "0jjvydn4i4n9xv8vsal2jxpa95mk2lw6myv0gx9wih242k9vy0l7";
+    };
+
+  prePatch = ''
+    sed -i 's|gfind|find|' crumbs-completion.fish
+  '';
+
+  postInstall = ''
+    mkdir -p $out/share/bash-completion/completions
+    mkdir -p $out/share/fish/vendor_completions.d
+
+    cp crumbs-completion.bash $out/share/bash-completion/completions/crumbs
+    cp crumbs-completion.fish $out/share/fish/vendor_completions.d/crumbs.fish
+  '';
+
+  meta = with stdenv.lib;
+    { description = "Bookmarks for the command line";
+      homepage    = https://github.com/fasseg/crumbs;
+      license     = licenses.wtfpl;
+      platforms   = platforms.all;
+      maintainers = with maintainers; [ thesola10 ];
+    };
+}
diff --git a/nixpkgs/pkgs/applications/misc/ctodo/default.nix b/nixpkgs/pkgs/applications/misc/ctodo/default.nix
new file mode 100644
index 000000000000..0123e0c38d74
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ctodo/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, cmake, fetchurl, ncurses, readline }:
+
+stdenv.mkDerivation rec {
+  name = "ctodo-${version}";
+  version = "1.3";
+
+  src = fetchurl {
+    url = "https://github.com/Acolarh/ctodo/archive/v${version}.tar.gz";
+    sha256 = "1k3raigcgpwa0h8zkv5x9rycnn2iqkb9qim4q9ydqy9wbv3m32jb";
+  };
+
+  buildInputs = [ stdenv cmake ncurses readline ];
+
+  configurePhase = ''
+    cmake -DCMAKE_INSTALL_PREFIX=$out .
+  '';
+
+  meta = {
+    homepage = http://ctodo.apakoh.dk/;
+    description = "A simple ncurses-based task list manager";
+    license = stdenv.lib.licenses.mit;
+    maintainers = [ stdenv.lib.maintainers.matthiasbeyer ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/cum/default.nix b/nixpkgs/pkgs/applications/misc/cum/default.nix
new file mode 100644
index 000000000000..2675a5f4fc5d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cum/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, python3Packages }:
+
+with python3Packages;
+
+buildPythonApplication rec {
+  pname = "cum";
+  version = "0.9.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "15qc6agka2g3kcnpnz0hbjic1s3260cr9bda0rlcyninxs1vndq0";
+  };
+
+  propagatedBuildInputs = [
+    alembic beautifulsoup4 click natsort requests sqlalchemy
+  ];
+
+  # tests seem to fail for `config` not being defined,
+  # but it works once installed
+  doCheck = false;
+
+  # remove the top-level `tests` and `LICENSE` file
+  # they should not be installed, and there can be issues if another package
+  # has a collision (especially with the license file)
+  postInstall = ''
+    rm -rf $out/tests $out/LICENSE
+  '';
+
+  meta = with stdenv.lib; {
+    description = "comic updater, mangafied";
+    homepage = "https://github.com/Hamuko/cum";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ tadeokondrak ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/cura/default.nix b/nixpkgs/pkgs/applications/misc/cura/default.nix
new file mode 100644
index 000000000000..290801ea5781
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cura/default.nix
@@ -0,0 +1,57 @@
+{ mkDerivation, lib, fetchFromGitHub, cmake, python3, qtbase, qtquickcontrols2, qtgraphicaleffects, curaengine, plugins ? [] }:
+
+mkDerivation rec {
+  name = "cura-${version}";
+  version = "4.1.0";
+
+  src = fetchFromGitHub {
+    owner = "Ultimaker";
+    repo = "Cura";
+    rev = version;
+    sha256 = "1mfpnjrh3splpkadgml3v71k939g56zb9hbmzghwfjwlrf8valmz";
+  };
+
+  materials = fetchFromGitHub {
+    owner = "Ultimaker";
+    repo = "fdm_materials";
+    rev = version;
+    sha256 = "0yp2162msxfwpixzvassn23p7r3swjpwk4nhsjka5w6fm8pv0wpl";
+  };
+
+  buildInputs = [ qtbase qtquickcontrols2 qtgraphicaleffects ];
+  propagatedBuildInputs = with python3.pkgs; [
+    libsavitar numpy-stl pyserial requests uranium zeroconf
+  ] ++ plugins;
+  nativeBuildInputs = [ cmake python3.pkgs.wrapPython ];
+
+  cmakeFlags = [
+    "-DURANIUM_DIR=${python3.pkgs.uranium.src}"
+    "-DCURA_VERSION=${version}"
+  ];
+
+  postPatch = ''
+    sed -i 's,/python''${PYTHON_VERSION_MAJOR}/dist-packages,/python''${PYTHON_VERSION_MAJOR}.''${PYTHON_VERSION_MINOR}/site-packages,g' CMakeLists.txt
+    sed -i 's, executable_name = .*, executable_name = "${curaengine}/bin/CuraEngine",' plugins/CuraEngineBackend/CuraEngineBackend.py
+  '';
+
+  postInstall = ''
+    mkdir -p $out/share/cura/resources/materials
+    cp ${materials}/*.fdm_material $out/share/cura/resources/materials/
+    mkdir -p $out/lib/cura/plugins
+    for plugin in ${toString plugins}; do
+      ln -s $plugin/lib/cura/plugins/* $out/lib/cura/plugins
+    done
+  '';
+
+  postFixup = ''
+    wrapPythonPrograms
+  '';
+
+  meta = with lib; {
+    description = "3D printer / slicing GUI built on top of the Uranium framework";
+    homepage = https://github.com/Ultimaker/Cura;
+    license = licenses.lgpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/cura/lulzbot.nix b/nixpkgs/pkgs/applications/misc/cura/lulzbot.nix
new file mode 100644
index 000000000000..f3f1972f6e6e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cura/lulzbot.nix
@@ -0,0 +1,58 @@
+{ stdenv, fetchurl, dpkg, bash, python27Packages }:
+
+let
+  py = python27Packages;
+in
+stdenv.mkDerivation rec {
+  name = "cura-lulzbot-${version}";
+  version = "15.02.1-1.03-5064";
+
+  src =
+    if stdenv.hostPlatform.system == "x86_64-linux" then
+      fetchurl {
+        url = "https://download.alephobjects.com/ao/aodeb/dists/jessie/main/binary-amd64/cura_${version}_amd64.deb";
+        sha256 = "1gsfidg3gim5pjbl82vkh0cw4ya253m4p7nirm8nr6yjrsirkzxg";
+      }
+    else if stdenv.hostPlatform.system == "i686-linux" then
+      fetchurl {
+        url = "http://download.alephobjects.com/ao/aodeb/dists/jessie/main/binary-i386/cura_${version}_i386.deb";
+        sha256 = "0xd3df6bxq4rijgvsqvps454jkc1nzhxbdzzj6j2w317ppsbhyc1";
+      }
+    else throw "${name} is not supported on ${stdenv.hostPlatform.system}";
+
+  python_deps = with py; [ pyopengl pyserial numpy wxPython30 power setuptools ];
+  pythonPath = python_deps;
+  propagatedBuildInputs = python_deps;
+  buildInputs = [ dpkg bash py.wrapPython ];
+
+  phases = [ "unpackPhase" "installPhase" ];
+  unpackPhase = "dpkg-deb -x ${src} ./";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -r usr/share $out/share
+    find $out/share -type f -exec sed -i 's|/usr/share/cura|$out/share/cura|g' "{}" \;
+
+    cat <<EOT > $out/bin/cura
+    #!${bash}/bin/bash
+    PYTHONPATH=$PYTHONPATH:$out/share/cura ${py.python}/bin/python $out/share/cura/cura.py "\$@"
+    EOT
+
+    chmod 555 $out/bin/cura
+  '';
+
+  meta = with stdenv.lib; {
+    description = "3D printing host software for the Lulzbot";
+
+     longDescription = ''
+       Cura LulzBot Edition is a fork of the 3D printing/slicing
+       software from Ultimaker, with changes to support 3D printers
+       from Aleph Objects.
+     '';
+
+    homepage = https://www.lulzbot.com/cura/;
+    license = licenses.agpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ pjones ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/cura/numpy-cast.patch b/nixpkgs/pkgs/applications/misc/cura/numpy-cast.patch
new file mode 100644
index 000000000000..efb14182b3e6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cura/numpy-cast.patch
@@ -0,0 +1,12 @@
+diff -urN Cura-15.04.old/Cura/util/sliceEngine.py Cura-15.04/Cura/util/sliceEngine.py
+--- Cura-15.04.old/Cura/util/sliceEngine.py	2016-05-07 20:34:17.305020334 +0200
++++ Cura-15.04/Cura/util/sliceEngine.py	2016-05-07 20:40:02.993286467 +0200
+@@ -343,7 +343,7 @@
+ 						objMax[1] = max(oMax[1], objMax[1])
+ 			if objMin is None:
+ 				return
+-			pos += (objMin + objMax) / 2.0 * 1000
++			pos = numpy.add( pos, (objMin + objMax) / 2.0 * 1000, out=pos, casting='unsafe')
+ 			commandList += ['-s', 'posx=%d' % int(pos[0]), '-s', 'posy=%d' % int(pos[1])]
+ 
+ 			vertexTotal = [0] * 4
diff --git a/nixpkgs/pkgs/applications/misc/cura/plugins.nix b/nixpkgs/pkgs/applications/misc/cura/plugins.nix
new file mode 100644
index 000000000000..a5a196a78100
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cura/plugins.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchFromGitHub, cmake, python3Packages }:
+
+let
+
+  self = {
+
+    octoprint = stdenv.mkDerivation rec {
+      pname = "Cura-OctoPrintPlugin";
+      version = "3.5.5";
+
+      src = fetchFromGitHub {
+        owner = "fieldOfView";
+        repo = pname;
+        rev = "d05a9a4c1a01c584d5cec4f4b7d170077235467a";
+        sha256 = "0ik69g3kbn7rz2wh0cfq9ww8x222kagd8jvsd4xlqgq4yrf0jk7x";
+      };
+
+      nativeBuildInputs = [ cmake ];
+
+      propagatedBuildInputs = with python3Packages; [
+        netifaces
+      ];
+
+      meta = with stdenv.lib; {
+        description = "Enables printing directly to OctoPrint and monitoring the process";
+        homepage = "https://github.com/fieldOfView/Cura-OctoPrintPlugin";
+        license = licenses.agpl3;
+        maintainers = with maintainers; [ gebner ];
+      };
+    };
+
+  };
+
+in self
diff --git a/nixpkgs/pkgs/applications/misc/cura/stable.nix b/nixpkgs/pkgs/applications/misc/cura/stable.nix
new file mode 100644
index 000000000000..a53b001b0e98
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/cura/stable.nix
@@ -0,0 +1,73 @@
+{ stdenv, python27Packages, curaengine, makeDesktopItem, fetchurl }:
+let
+  py = python27Packages;
+  version = "15.04";
+in
+stdenv.mkDerivation rec {
+  name = "cura-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/daid/Cura/archive/${version}.tar.gz";
+    sha256 = "0xbjvzhp8wzq9lnpmcg1fjf7j5h39bj5463sd5c8jzdjl96izizl";
+  };
+
+  desktopItem = makeDesktopItem {
+    name = "Cura";
+    exec = "cura";
+    icon = "cura";
+    comment = "Cura";
+    desktopName = "Cura";
+    genericName = "3D printing host software";
+    categories = "GNOME;GTK;Utility;";
+  };
+
+  python_deps = with py; [ pyopengl pyserial numpy wxPython30 power setuptools ];
+
+  pythonPath = python_deps;
+
+  propagatedBuildInputs = python_deps;
+
+  buildInputs = [ curaengine py.wrapPython ];
+
+  configurePhase = "";
+  buildPhase = "";
+  
+  patches = [ ./numpy-cast.patch ];
+
+  installPhase = ''
+    # Install Python code.
+    site_packages=$out/lib/python2.7/site-packages
+    mkdir -p $site_packages
+    cp -r Cura $site_packages/
+
+    # Install resources.
+    resources=$out/share/cura
+    mkdir -p $resources
+    cp -r resources/* $resources/
+    sed -i 's|os.path.join(os.path.dirname(__file__), "../../resources")|"'$resources'"|g' $site_packages/Cura/util/resources.py
+
+    # Install executable.
+    mkdir -p $out/bin
+    cp Cura/cura.py $out/bin/cura
+    chmod +x $out/bin/cura
+    sed -i 's|#!/usr/bin/python|#!/usr/bin/env python|' $out/bin/cura
+    wrapPythonPrograms
+
+    # Make it find CuraEngine.
+    echo "def getEngineFilename(): return '${curaengine}/bin/CuraEngine'" >> $site_packages/Cura/util/sliceEngine.py
+
+    # Install desktop item.
+    mkdir -p "$out"/share/applications
+    cp "$desktopItem"/share/applications/* "$out"/share/applications/
+    mkdir -p "$out"/share/icons
+    ln -s "$resources/images/c.png" "$out"/share/icons/cura.png
+  '';
+
+  meta = with stdenv.lib; {
+    description = "3D printing host software";
+    homepage = https://github.com/daid/Cura;
+    license = licenses.agpl3;
+    platforms = platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ the-kenny ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/curabydagoma/default.nix b/nixpkgs/pkgs/applications/misc/curabydagoma/default.nix
new file mode 100644
index 000000000000..4e620425d5c3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/curabydagoma/default.nix
@@ -0,0 +1,76 @@
+{ stdenv, runtimeShell, lib, fetchurl, python, pythonPackages, unzip }:
+
+# This package uses a precompiled "binary" distribution of CuraByDagoma,
+# distributed by the editor.
+#
+# To update the package, follow the links on https://dist.dagoma.fr/:
+# * Cura By Dagoma
+# * Linux
+# * 64 bits
+# * Genric archive
+#
+# I made the arbitrary choice to compile this package only for x86_64.
+# I guess people owning a 3D printer generally don't use i686.
+# If, however, someone needs it, we certainly can find a solution.
+
+stdenv.mkDerivation rec {
+  name = "curabydagoma-${version}";
+  # Version is the date, UNIX format
+  version = "1520506579";
+  # Hash of the user's choice: os, arch, package type...
+  hash = "58228cce5bbdcf764b7116850956f1e5";
+
+  src = fetchurl {
+    url = "https://dist.dagoma.fr/get/zip/CuraByDagoma/${version}/${hash}";
+    sha256 = "16wfipdyjkf6dq8awjzs4zgkmqk6230277mf3iz8swday9hns8pq";
+  };
+  unpackCmd = "unzip $curSrc && tar zxf CuraByDagoma_amd64.tar.gz";
+  nativeBuildInputs = [ unzip ];
+  buildInputs = [ python pythonPackages.pyopengl pythonPackages.wxPython pythonPackages.pyserial pythonPackages.numpy ];
+
+  # Compile all pyc files because the included pyc files may be older than the
+  # py files. However, Python doesn't realize that because the packages
+  # have all dates set to epoch.
+  buildPhase = ''
+    python -m compileall -f curabydago
+  '';
+
+  # * Simply copy the stuff there
+  # * Create an executable with the correct path etc
+  # * Create a .desktop file to have a launcher in the desktop environments
+  installPhase = ''
+    mkdir $out
+    cp -r * $out/
+
+    mkdir $out/bin
+    cat > $out/bin/curabydago <<EOF
+    #!${runtimeShell}
+    export PYTHONPATH=$PYTHONPATH
+    ${python.out}/bin/python $out/curabydago/cura.py
+    EOF
+    chmod a+x $out/bin/curabydago
+
+    mkdir -p $out/share/applications
+    cat > $out/share/applications/curabydago.desktop <<EOF
+    [Desktop Entry]
+    Type=Application
+    Name=Cura-by-dagoma
+    Comment=CuraByDagoma is a fork of Legacy Cura made by Dagoma for its own printers.
+    Icon=$out/curabydago/resources/images/cura.ico
+    Exec=$out/bin/curabydago
+    Path=$out/
+    StartupNotify=true
+    Terminal=false
+    Categories=GNOME;GTK;Utility;
+    EOF
+
+  '';
+
+  meta = with lib; {
+    description = "Slicer for 3D printers built by Dagoma";
+    homepage = https://dagoma.fr/cura-by-dagoma.html;
+    license = licenses.agpl3;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ tiramiseb ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/curaengine/default.nix b/nixpkgs/pkgs/applications/misc/curaengine/default.nix
new file mode 100644
index 000000000000..a7339acddee2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/curaengine/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchFromGitHub, cmake, libarcus, stb, protobuf }:
+
+stdenv.mkDerivation rec {
+  name = "curaengine-${version}";
+  version = "4.1.0";
+
+  src = fetchFromGitHub {
+    owner = "Ultimaker";
+    repo = "CuraEngine";
+    rev = version;
+    sha256 = "14zy9ir46vndsi4l8kapm6byw02fimm7ava2rfi0kvcckf5yq9w8";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libarcus stb protobuf ];
+
+  cmakeFlags = [ "-DCURA_ENGINE_VERSION=${version}" ];
+
+  meta = with stdenv.lib; {
+    description = "A powerful, fast and robust engine for processing 3D models into 3D printing instruction";
+    homepage = https://github.com/Ultimaker/CuraEngine;
+    license = licenses.agpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/curaengine/stable.nix b/nixpkgs/pkgs/applications/misc/curaengine/stable.nix
new file mode 100644
index 000000000000..ce743a008798
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/curaengine/stable.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl }:
+let
+  version = "15.04.6";
+in
+stdenv.mkDerivation {
+  name = "curaengine-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/Ultimaker/CuraEngine/archive/${version}.tar.gz";
+    sha256 = "1cd4dikzvqyj5g80rqwymvh4nwm76vsf78clb37kj6q0fig3qbjg";
+  };
+
+  postPatch = ''
+    sed -i 's,--static,,g' Makefile
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp build/CuraEngine $out/bin/
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Engine for processing 3D models into 3D printing instructions";
+    homepage = https://github.com/Ultimaker/CuraEngine;
+    license = licenses.agpl3;
+    platforms = platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ the-kenny ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/dbeaver/default.nix b/nixpkgs/pkgs/applications/misc/dbeaver/default.nix
new file mode 100644
index 000000000000..77a25f2755f0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/dbeaver/default.nix
@@ -0,0 +1,70 @@
+{ stdenv, fetchurl, makeDesktopItem, makeWrapper
+, fontconfig, freetype, glib, gtk3
+, jdk, libX11, libXrender, libXtst, zlib }:
+
+# The build process is almost like eclipse's.
+# See `pkgs/applications/editors/eclipse/*.nix`
+
+stdenv.mkDerivation rec {
+  name = "dbeaver-ce-${version}";
+  version = "6.1.0";
+
+  desktopItem = makeDesktopItem {
+    name = "dbeaver";
+    exec = "dbeaver";
+    icon = "dbeaver";
+    desktopName = "dbeaver";
+    comment = "SQL Integrated Development Environment";
+    genericName = "SQL Integrated Development Environment";
+    categories = "Application;Development;";
+  };
+
+  buildInputs = [
+    fontconfig freetype glib gtk3
+    jdk libX11 libXrender libXtst zlib
+  ];
+
+  nativeBuildInputs = [
+    makeWrapper
+  ];
+
+  src = fetchurl {
+    url = "https://dbeaver.io/files/${version}/dbeaver-ce-${version}-linux.gtk.x86_64.tar.gz";
+    sha256 = "0ngfv5pcj8hs7zcddwk0jw0l7hnm768wp76yrfyk38wkijk9f412";
+  };
+
+  installPhase = ''
+    mkdir -p $out/
+    cp -r . $out/dbeaver
+
+    # Patch binaries.
+    interpreter=$(cat $NIX_CC/nix-support/dynamic-linker)
+    patchelf --set-interpreter $interpreter $out/dbeaver/dbeaver
+
+    makeWrapper $out/dbeaver/dbeaver $out/bin/dbeaver \
+      --prefix PATH : ${jdk}/bin \
+      --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath ([ glib gtk3 libXtst ])} \
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
+
+    # Create desktop item.
+    mkdir -p $out/share/applications
+    cp ${desktopItem}/share/applications/* $out/share/applications
+
+    mkdir -p $out/share/pixmaps
+    ln -s $out/dbeaver/icon.xpm $out/share/pixmaps/dbeaver.xpm
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://dbeaver.io/;
+    description = "Universal SQL Client for developers, DBA and analysts. Supports MySQL, PostgreSQL, MariaDB, SQLite, and more";
+    longDescription = ''
+      Free multi-platform database tool for developers, SQL programmers, database
+      administrators and analysts. Supports all popular databases: MySQL,
+      PostgreSQL, MariaDB, SQLite, Oracle, DB2, SQL Server, Sybase, MS Access,
+      Teradata, Firebird, Derby, etc.
+    '';
+    license = licenses.asl20;
+    platforms = [ "x86_64-linux" ];
+    maintainers = [ maintainers.samueldr ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/dbvisualizer/default.nix b/nixpkgs/pkgs/applications/misc/dbvisualizer/default.nix
new file mode 100644
index 000000000000..fbeb965df380
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/dbvisualizer/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, jre, makeWrapper }:
+
+stdenv.mkDerivation {
+  name = "dbvisualizer-9.5.7";
+
+  src = fetchurl {
+    url = https://www.dbvis.com/product_download/dbvis-9.5.7/media/dbvis_unix_9_5_7.tar.gz;
+    sha256 = "1xv4fw7cji2ffvv7z8vjl5lap512pj60s2ynihirrqld7pmklnyr";
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -a . $out
+    ln -sf $out/dbvis $out/bin
+    wrapProgram $out/bin/dbvis --set INSTALL4J_JAVA_HOME ${jre}
+  '';
+
+  meta = {
+    description = "The universal database tool";
+    homepage = https://www.dbvis.com/;
+    license = stdenv.lib.licenses.unfree;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/ddgr/default.nix b/nixpkgs/pkgs/applications/misc/ddgr/default.nix
new file mode 100644
index 000000000000..b010e5401b80
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ddgr/default.nix
@@ -0,0 +1,34 @@
+{stdenv, fetchFromGitHub, python3}:
+
+stdenv.mkDerivation rec {
+  version = "1.6";
+  name = "ddgr-${version}";
+
+  src = fetchFromGitHub {
+    owner = "jarun";
+    repo = "ddgr";
+    rev = "v${version}";
+    sha256 = "04ybbjsf9hpn2p5cjjm15cwvv0mwrmdi19iifrym6ps3rmll0p3c";
+  };
+
+  buildInputs = [ python3 ];
+
+  makeFlags = "PREFIX=$(out)";
+
+  postInstall = ''
+    mkdir -p "$out/share/bash-completion/completions/"
+    cp "auto-completion/bash/ddgr-completion.bash" "$out/share/bash-completion/completions/"
+    mkdir -p "$out/share/fish/vendor_completions.d/"
+    cp "auto-completion/fish/ddgr.fish" "$out/share/fish/vendor_completions.d/"
+    mkdir -p "$out/share/zsh/site-functions/"
+    cp "auto-completion/zsh/_ddgr" "$out/share/zsh/site-functions/"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/jarun/ddgr;
+    description = "Search DuckDuckGo from the terminal";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ ceedubs markus1189 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/deco/default.nix b/nixpkgs/pkgs/applications/misc/deco/default.nix
new file mode 100644
index 000000000000..7f4629100d5d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/deco/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, scsh, feh, xorg }:
+
+stdenv.mkDerivation rec {
+  pname = "deco";
+  version = "0.0.2";
+  name = "${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "ebzzry";
+    repo = pname;
+    rev = "49cded5ad123b0169f47cd0dc0f5420f4b581837";
+    sha256 = "19rvqhw0blwga8ck86yy8hj7j1l9hriphlld6yrfd3yip4jprjzz";
+  };
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp ${pname} $out/bin
+    chmod +x $out/bin/${pname}
+  '';
+
+  postFixup = ''
+    substituteInPlace $out/bin/deco --replace "/usr/bin/env scsh" "${scsh}/bin/scsh"
+    substituteInPlace $out/bin/deco --replace "feh" "${feh}/bin/feh"
+    substituteInPlace $out/bin/deco --replace "xdpyinfo" "${xorg.xdpyinfo}/bin/xdpyinfo"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/ebzzry/deco;
+    description = "A simple root image setter";
+    license = licenses.mit;
+    maintainers = [ maintainers.ebzzry ];
+    platforms = platforms.unix;
+  };
+
+  dontBuild = true;
+}
diff --git a/nixpkgs/pkgs/applications/misc/devilspie2/default.nix b/nixpkgs/pkgs/applications/misc/devilspie2/default.nix
new file mode 100644
index 000000000000..4fb9ca5fa713
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/devilspie2/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, intltool, pkgconfig, glib, gtk, lua, libwnck3 }:
+
+stdenv.mkDerivation rec {
+  name = "devilspie2-${version}";
+  version = "0.43";
+
+  src = fetchurl {
+    url = "https://download.savannah.gnu.org/releases/devilspie2/devilspie2_${version}-src.tar.gz";
+    sha256 = "0a7qjl2qd4099kkkbwa1y2fk48s21jlr409lf9mij7mlc9yc3zzc";
+  };
+
+  nativeBuildInputs = [ intltool pkgconfig ];
+  buildInputs = [ glib gtk lua libwnck3 ];
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/man/man1
+    cp bin/devilspie2 $out/bin
+    cp devilspie2.1 $out/share/man/man1
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A window matching utility";
+    longDescription = ''
+      Devilspie2 is a window matching utility, allowing the user to
+      perform scripted actions on windows as they are created. For
+      example you can script a terminal program to always be
+      positioned at a specific screen position, or position a window
+      on a specific workspace.
+    '';
+    homepage = http://www.gusnan.se/devilspie2/;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.ebzzry ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/dfilemanager/default.nix b/nixpkgs/pkgs/applications/misc/dfilemanager/default.nix
new file mode 100644
index 000000000000..eeb7a8ccf526
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/dfilemanager/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchgit, cmake, file, qtbase, qttools, solid }:
+
+let
+  version = "git-2016-01-10";
+in
+stdenv.mkDerivation {
+  name = "dfilemanager-${version}";
+  src = fetchgit {
+    url = "git://git.code.sf.net/p/dfilemanager/code";
+    rev = "2c5078b05e0ad74c037366be1ab3e6a03492bde4";
+    sha256 = "1qwhnlcc2j8sr1f3v63sxs3m7q7w1xy6c2jqsnznjgm23b5h3hxd";
+  };
+
+  buildInputs = [ cmake qtbase qttools file solid ];
+
+  cmakeFlags = "-DQT5BUILD=true";
+
+  meta = {
+    homepage = http://dfilemanager.sourceforge.net/;
+    description = "File manager written in Qt/C++";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/diff-pdf/default.nix b/nixpkgs/pkgs/applications/misc/diff-pdf/default.nix
new file mode 100644
index 000000000000..467c2b3c2d59
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/diff-pdf/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, autoconf, automake, pkgconfig, cairo, poppler, wxGTK ? null, wxmac ? null, darwin ? null }:
+
+let
+  wxInputs =
+    if stdenv.isDarwin then
+      [ wxmac darwin.apple_sdk.frameworks.Cocoa ]
+    else
+      [ wxGTK ];
+in
+stdenv.mkDerivation rec {
+  name = "diff-pdf-${version}";
+  version = "2017-12-30";
+
+  src = fetchFromGitHub {
+    owner = "vslavik";
+    repo = "diff-pdf";
+    rev = "c4d67226ec4c29b30a7399e75f80636ff8a6f9fc";
+    sha256 = "1c3ig7ckrg37p5vzvgjnsfdzdad328wwsx0r31lbs1d8pkjkgq3m";
+  };
+
+  nativeBuildInputs = [ autoconf automake pkgconfig ];
+  buildInputs = [ cairo poppler ] ++ wxInputs;
+
+  preConfigure = "./bootstrap";
+
+  meta = with stdenv.lib; {
+    homepage = http://vslavik.github.io/diff-pdf;
+    description = "Simple tool for visually comparing two PDF files";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/diffpdf/default.nix b/nixpkgs/pkgs/applications/misc/diffpdf/default.nix
new file mode 100644
index 000000000000..daea20835c8a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/diffpdf/default.nix
@@ -0,0 +1,60 @@
+{ stdenv, fetchurl, fetchpatch, qmake, qttools, qtbase, poppler }:
+
+stdenv.mkDerivation rec {
+  version = "2.1.3";
+  name = "diffpdf-${version}";
+
+  src = fetchurl {
+    url = "http://www.qtrac.eu/${name}.tar.gz";
+    sha256 = "0cr468fi0d512jjj23r5flfzx957vibc9c25gwwhi0d773h2w566";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = https://raw.githubusercontent.com/gentoo/gentoo/9b971631588ff46e7c2d501bc35cd0d9ce2d98e2/app-text/diffpdf/files/diffpdf-2.1.3-qt5.patch;
+      sha256 = "0sax8gcqcmzf74hmdr3rarqs4nsxmml9qmh6pqyjmgl3lypxhafg";
+    })
+    ./fix_path_poppler_qt5.patch
+  ];
+
+  nativeBuildInputs = [ qmake qttools ];
+  buildInputs = [ qtbase poppler ];
+
+  preConfigure = ''
+    substituteInPlace diffpdf.pro --replace @@NIX_POPPLER_QT5@@ ${poppler.dev}
+    lrelease diffpdf.pro
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/man/man1
+
+    install -Dpm755 -D diffpdf $out/bin/diffpdf
+    install -Dpm644 -D diffpdf.1 $out/share/man/man1/diffpdf.1
+
+    install -dpm755 $out/share/doc/${name} $out/share/licenses/${name} $out/share/icons $out/share/pixmaps $out/share/applications
+    install -Dpm644 CHANGES README help.html $out/share/doc/${name}/
+    install -Dpm644 gpl-2.0.txt $out/share/licenses/${name}/
+    install -Dpm644 images/icon.png $out/share/icons/diffpdf.png
+    install -Dpm644 images/icon.png $out/share/pixmaps/diffpdf.png
+
+    cat > $out/share/applications/diffpdf.desktop <<EOF
+    [Desktop Entry]
+    Type=Application
+    Version=1.0
+    Name=diffpdf
+    Icon=diffpdf
+    Comment=PDF diffing tool
+    Exec=$out/bin/diffpdf
+    Terminal=false
+    EOF
+    '';
+
+  meta = {
+    homepage = http://www.qtrac.eu/diffpdfc.html;
+    description = "Tool for diffing pdf files visually or textually";
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = with stdenv.lib.maintainers; [ tstrobel ];
+    platforms = with stdenv.lib.platforms; linux;
+    inherit version;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/diffpdf/fix_path_poppler_qt5.patch b/nixpkgs/pkgs/applications/misc/diffpdf/fix_path_poppler_qt5.patch
new file mode 100644
index 000000000000..9535ea2c6b0d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/diffpdf/fix_path_poppler_qt5.patch
@@ -0,0 +1,16 @@
+diff -uNr diffpdf-2.1.3/diffpdf.pro diffpdf-2.1.3-new/diffpdf.pro
+--- diffpdf-2.1.3/diffpdf.pro	2013-10-15 09:01:22.000000000 +0200
++++ diffpdf-2.1.3-new/diffpdf.pro	2015-07-07 23:13:36.445572148 +0200
+@@ -47,9 +47,9 @@
+ 	INCLUDEPATH += /c/poppler_lib/include/poppler/qt5
+ 	LIBS += -Wl,-rpath -Wl,/c/poppler_lib/bin -Wl,-L/c/poppler_lib/bin
+     } else {
+-	exists(/usr/include/poppler/qt5) {
+-	    INCLUDEPATH += /usr/include/poppler/cpp
+-	    INCLUDEPATH += /usr/include/poppler/qt5
++	exists(@@NIX_POPPLER_QT5@@/include/poppler/qt5) {
++	    INCLUDEPATH += @@NIX_POPPLER_QT5@@/include/poppler/cpp
++	    INCLUDEPATH += @@NIX_POPPLER_QT5@@/include/poppler/qt5
+ 	} else {
+ 	    INCLUDEPATH += /usr/local/include/poppler/cpp
+ 	    INCLUDEPATH += /usr/local/include/poppler/qt5
diff --git a/nixpkgs/pkgs/applications/misc/digitalbitbox/default.nix b/nixpkgs/pkgs/applications/misc/digitalbitbox/default.nix
new file mode 100644
index 000000000000..58bc483d43f3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/digitalbitbox/default.nix
@@ -0,0 +1,142 @@
+{ stdenv
+, autoreconfHook
+, curl
+, fetchFromGitHub
+, git
+, libevent
+, libtool
+, qrencode
+, udev
+, libusb
+, makeWrapper
+, pkgconfig
+, qtbase
+, qttools
+, qtwebsockets
+, qtmultimedia
+, udevRule51 ? ''
+,   SUBSYSTEM=="usb", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="dbb%n", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2402"
+, ''
+, udevRule52 ? ''
+,   KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2402", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="dbbf%n"
+, ''
+, writeText
+}:
+
+# Enabling the digitalbitbox program
+#
+#     programs.digitalbitbox.enable = true;
+#
+# will install the digitalbitbox package and enable the corresponding hardware
+# module and is by far the easiest way to get started with the Digital Bitbox on
+# NixOS.
+
+# In case you install the package only, please be aware that you may need to
+# apply some udev rules to allow the application to identify and access your
+# wallet. In a nixos-configuration, one may accomplish this by enabling the
+# digitalbitbox hardware module
+#
+#     hardware.digitalbitbox.enable = true;
+#
+# or by adding the digitalbitbox package to system.udev.packages
+#
+#     system.udev.packages = [ pkgs.digitalbitbox ];
+
+# See https://digitalbitbox.com/start_linux for more information.
+let
+  copyUdevRuleToOutput = name: rule:
+    "cp ${writeText name rule} $out/etc/udev/rules.d/${name}";
+in stdenv.mkDerivation rec {
+  name = "digitalbitbox-${version}";
+  version = "2.2.2";
+
+  src = fetchFromGitHub {
+    owner = "digitalbitbox";
+    repo = "dbb-app";
+    rev = "v${version}";
+    sha256 = "1r77fvqrlaryzij5dfbnigzhvg1d12g96qb2gp8dy3xph1j0k3s1";
+  };
+
+  nativeBuildInputs = with stdenv.lib; [
+    autoreconfHook
+    curl
+    git
+    makeWrapper
+    pkgconfig
+    qttools
+  ];
+
+  buildInputs = [
+    libevent
+    libtool
+    udev
+    libusb
+    qrencode
+
+    qtbase
+    qtwebsockets
+    qtmultimedia
+  ];
+
+  LUPDATE="${qttools.dev}/bin/lupdate";
+  LRELEASE="${qttools.dev}/bin/lrelease";
+  MOC="${qtbase.dev}/bin/moc";
+  QTDIR="${qtbase.dev}";
+  RCC="${qtbase.dev}/bin/rcc";
+  UIC="${qtbase.dev}/bin/uic";
+
+  configureFlags = [
+    "--enable-libusb"
+  ];
+
+  hardeningDisable = [
+    "format"
+  ];
+
+  postInstall = ''
+    mkdir -p "$out/lib"
+    cp src/libbtc/.libs/*.so* $out/lib
+    cp src/libbtc/src/secp256k1/.libs/*.so* $out/lib
+    cp src/hidapi/libusb/.libs/*.so* $out/lib
+    cp src/univalue/.libs/*.so* $out/lib
+
+    # [RPATH][patchelf] Avoid forbidden reference error
+    rm -rf $PWD
+
+    wrapProgram "$out/bin/dbb-cli" --prefix LD_LIBRARY_PATH : "$out/lib"
+    wrapProgram "$out/bin/dbb-app" --prefix LD_LIBRARY_PATH : "$out/lib"
+
+    # Provide udev rules as documented in https://digitalbitbox.com/start_linux
+    mkdir -p "$out/etc/udev/rules.d"
+    ${copyUdevRuleToOutput "51-hid-digitalbox.rules" udevRule51}
+    ${copyUdevRuleToOutput "52-hid-digitalbox.rules" udevRule52}
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A QT based application for the Digital Bitbox hardware wallet";
+    longDescription = ''
+      Digital Bitbox provides dbb-app, a GUI tool, and dbb-cli, a CLI tool, to manage Digital Bitbox devices.
+
+      This package will only install the dbb-app and dbb-cli, however; in order for these applications to identify and access Digital Bitbox devices, one may want to enable the digitalbitbox hardware module by adding
+
+          hardware.digitalbitbox.enable = true;
+
+      to the configuration which is equivalent to adding this package to the udev.packages list.
+
+
+      The easiest way to use the digitalbitbox package in NixOS is by adding
+
+          programs.digitalbitbox.enable = true;
+
+      to the configuration which installs the package and enables the hardware module.
+    '';
+    homepage = "https://digitalbitbox.com/";
+    license = licenses.mit;
+    maintainers = with maintainers; [
+      vidbina
+    ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/ding/default.nix b/nixpkgs/pkgs/applications/misc/ding/default.nix
new file mode 100644
index 000000000000..e76f95b6a50d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ding/default.nix
@@ -0,0 +1,55 @@
+{ aspell, aspellDicts_de, aspellDicts_en, buildEnv, fetchurl, fortune, gnugrep, makeWrapper, stdenv, tk, tre }:
+let
+  aspellEnv = buildEnv {
+    name = "env-ding-aspell";
+    paths = [
+      aspell
+      aspellDicts_de
+      aspellDicts_en
+    ];
+  };
+in
+stdenv.mkDerivation rec {
+  name = "ding-1.8.1";
+
+  src = fetchurl {
+    url = "http://ftp.tu-chemnitz.de/pub/Local/urz/ding/${name}.tar.gz";
+    sha256 = "0chjqs3z9zs1w3l7b5lsaj682rgnkf9kibcbzhggqqcn1pbvl5sq";
+  };
+
+  buildInputs = [ aspellEnv fortune gnugrep makeWrapper tk tre ];
+
+  patches = [ ./dict.patch ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mkdir -p $out/share/dict
+    mkdir -p $out/share/man/man1
+    mkdir -p $out/share/applications
+    mkdir -p $out/share/pixmaps
+
+    for f in ding ding.1; do
+      sed -i "s@/usr/share@$out/share@g" "$f"
+    done
+
+    sed -i "s@/usr/bin/fortune@fortune@g" ding
+
+    sed -i "s@/usr/bin/ding@$out/bin/ding@g" ding.desktop
+
+    cp -v ding $out/bin/
+    cp -v de-en.txt $out/share/dict/
+    cp -v ding.1 $out/share/man/man1/
+    cp -v ding.png $out/share/pixmaps/
+    cp -v ding.desktop $out/share/applications/
+
+    wrapProgram $out/bin/ding --prefix PATH : ${stdenv.lib.makeBinPath [ gnugrep aspellEnv tk fortune ]} --prefix ASPELL_CONF : "\"prefix ${aspellEnv};\""
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Simple and fast dictionary lookup tool";
+    homepage = https://www-user.tu-chemnitz.de/~fri/ding/;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux; # homepage says: unix-like except darwin
+    maintainers = [ maintainers.exi ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/ding/dict.patch b/nixpkgs/pkgs/applications/misc/ding/dict.patch
new file mode 100644
index 000000000000..70ecea10550e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ding/dict.patch
@@ -0,0 +1,26 @@
+Ding persists its settings to $HOME/.dingrc on startup, this sadly includes the path to the dictionary.
+On all other distributions, that would be /usr/share/dict/de-en.txt and would hardly ever change.
+On nixos, this will indeed change on ever update and would break it for all users.
+This just comments out the dictionary path in the .dingrc so the user can still set it if she wants to, but it will not affect normal operations.
+--- a/ding
++++ b/ding
+@@ -899,7 +899,9 @@ if { ! [info exists ding_version]} {
+         }
+ 
+         # Change path of default ger-eng.txt when upgrading from version 1.1
+-        if {$searchmeth($i,dictfile) == {/usr/dict/ger-eng.txt} &&
++        if {! [info exists searchmeth($i,dictfile)]} {
++            set searchmeth($i,dictfile) $default_searchmeth(0,dictfile)
++        } elseif {$searchmeth($i,dictfile) == {/usr/dict/ger-eng.txt} &&
+             $ding_version == {1.1}} {
+             set searchmeth($i,dictfile) $default_searchmeth(0,dictfile)
+             debug 2 "New path and name of ger-eng.txt configured: $default_searchmeth(0,dictfile)"
+@@ -5065,7 +5067,7 @@ proc saveOptions {} {
+     foreach i $searchmpos {
+         puts $fd "set searchmeth($n,name) {$searchmeth($i,name)}"
+         puts $fd "set searchmeth($n,type) {$searchmeth($i,type)}"
+-        puts $fd "set searchmeth($n,dictfile) {$searchmeth($i,dictfile)}"
++        puts $fd "#set searchmeth($n,dictfile) {$searchmeth($i,dictfile)}"
+         puts $fd "set searchmeth($n,separator) {$searchmeth($i,separator)}"
+         puts $fd "set searchmeth($n,language1) {$searchmeth($i,language1)}"
+         puts $fd "set searchmeth($n,language2) {$searchmeth($i,language2)}"
diff --git a/nixpkgs/pkgs/applications/misc/direwolf/default.nix b/nixpkgs/pkgs/applications/misc/direwolf/default.nix
new file mode 100644
index 000000000000..f1e33ea53571
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/direwolf/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchFromGitHub
+, espeak, alsaLib, perl
+, python }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "direwolf-${version}";
+  version = "1.4";
+
+  src = fetchFromGitHub {
+    owner = "wb2osz";
+    repo = "direwolf";
+    rev = version;
+    sha256 = "033sffjs2dz48077hc58jr4lxxs8md1fyfh4lig6ib7pyigiv1y0";
+  };
+
+  buildInputs = [
+    espeak perl python
+  ] ++ (optional stdenv.isLinux alsaLib);
+
+  postPatch = ''
+    for i in Makefile.*; do
+      substituteInPlace "$i" \
+        --replace /usr/share $out/share
+    done
+
+    substituteInPlace dwespeak.sh \
+      --replace espeak ${espeak}/bin/espeak
+  '';
+
+  preInstall = ''
+    mkdir -p $out/bin
+  '';
+  installFlags = [ "INSTALLDIR=$(out)" ];
+
+  meta = {
+    description = "A Soundcard Packet TNC, APRS Digipeater, IGate, APRStt gateway";
+    homepage = https://github.com/wb2osz/direwolf/;
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.the-kenny ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/djvulibre/default.nix b/nixpkgs/pkgs/applications/misc/djvulibre/default.nix
new file mode 100644
index 000000000000..0b685e04a6fc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/djvulibre/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, libjpeg, libtiff, librsvg, libiconv }:
+
+stdenv.mkDerivation rec {
+  name = "djvulibre-3.5.27";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/djvu/${name}.tar.gz";
+    sha256 = "0psh3zl9dj4n4r3lx25390nx34xz0bg0ql48zdskhq354ljni5p6";
+  };
+
+  outputs = [ "bin" "dev" "out" ];
+
+  buildInputs = [ libjpeg libtiff librsvg libiconv ];
+
+  meta = with stdenv.lib; {
+    description = "A library and viewer for the DJVU file format for scanned images";
+    homepage = http://djvu.sourceforge.net;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/dmensamenu/default.nix b/nixpkgs/pkgs/applications/misc/dmensamenu/default.nix
new file mode 100644
index 000000000000..1c3b41338674
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/dmensamenu/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, buildPythonApplication, fetchFromGitHub, substituteAll, requests, dmenu }:
+
+buildPythonApplication rec {
+  pname = "dmensamenu";
+  version = "1.2.1";
+
+  src = fetchFromGitHub {
+    owner = "dotlambda";
+    repo = "dmensamenu";
+    rev = version;
+    sha256 = "15c8g2vdban3dw3g979icypgpx52irpvv39indgk19adicgnzzqp";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./dmenu-path.patch;
+      inherit dmenu;
+    })
+  ];
+
+  propagatedBuildInputs = [
+    requests
+  ];
+
+  # No tests implemented
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/dotlambda/dmensamenu;
+    description = "Print German canteen menus using dmenu and OpenMensa";
+    license = licenses.mit;
+    maintainers = with maintainers; [ dotlambda ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/dmensamenu/dmenu-path.patch b/nixpkgs/pkgs/applications/misc/dmensamenu/dmenu-path.patch
new file mode 100644
index 000000000000..1508e5142d29
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/dmensamenu/dmenu-path.patch
@@ -0,0 +1,13 @@
+diff --git a/dmensamenu/dmensamenu.py b/dmensamenu/dmensamenu.py
+index 7df49f2..052ef1b 100644
+--- a/dmensamenu/dmensamenu.py
++++ b/dmensamenu/dmensamenu.py
+@@ -99,7 +99,7 @@ def main():
+     parser.add_argument('--city',
+                         help='When searching for a canteen, only show the ones from the city specified'
+                             +' (case-insensitive).')
+-    parser.add_argument('--dmenu', metavar='CMD', default='dmenu -i -l "$lines" -p "$date"',
++    parser.add_argument('--dmenu', metavar='CMD', default='@dmenu@/bin/dmenu -i -l "$lines" -p "$date"',
+                         help='Command to execute. '
+                              'Can be used to pass custom parameters to dmenu. '
+                              'The shell variable $lines will be set to the number of items on the menu '
diff --git a/nixpkgs/pkgs/applications/misc/dmenu/default.nix b/nixpkgs/pkgs/applications/misc/dmenu/default.nix
new file mode 100644
index 000000000000..e6b62817b907
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/dmenu/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, libX11, libXinerama, libXft, zlib, patches ? null }:
+
+stdenv.mkDerivation rec {
+  name = "dmenu-4.9";
+
+  src = fetchurl {
+    url = "https://dl.suckless.org/tools/${name}.tar.gz";
+    sha256 = "0ia9nqr83bv6x247q30bal0v42chcj9qcjgv59xs6xj46m7iz5xk";
+  };
+
+  buildInputs = [ libX11 libXinerama zlib libXft ];
+
+  inherit patches;
+
+  postPatch = ''
+    sed -ri -e 's!\<(dmenu|dmenu_path|stest)\>!'"$out/bin"'/&!g' dmenu_run
+    sed -ri -e 's!\<stest\>!'"$out/bin"'/&!g' dmenu_path
+  '';
+
+  preConfigure = ''
+    sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk
+  '';
+
+  makeFlags = [ "CC:=$(CC)" ];
+
+  meta = with stdenv.lib; {
+      description = "A generic, highly customizable, and efficient menu for the X Window System";
+      homepage = https://tools.suckless.org/dmenu;
+      license = licenses.mit;
+      maintainers = with maintainers; [ pSub ];
+      platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/dmenu2/default.nix b/nixpkgs/pkgs/applications/misc/dmenu2/default.nix
new file mode 100644
index 000000000000..3d5676033593
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/dmenu2/default.nix
@@ -0,0 +1,29 @@
+{stdenv, fetchhg, libX11, libXinerama, libXft, zlib}:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "dmenu2-0.3pre-2014-07-08";
+
+  src = fetchhg {
+    url = "https://bitbucket.org/melek/dmenu2";
+    rev = "36cb94a16edf928bdaaa636123392517ed469be0";
+    sha256 = "1b17z5ypg6ij7zz3ncp3irc87raccna10y4w490c872a99lp23lv";
+  };
+
+  buildInputs = [ libX11 libXinerama zlib libXft ];
+
+  postPatch = ''
+    sed -ri -e 's!\<(dmenu|stest)\>!'"$out/bin"'/&!g' dmenu_run
+  '';
+
+  preConfigure = [ ''sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk'' ];
+
+  meta = {
+      description = "A patched fork of the original dmenu - an efficient dynamic menu for X";
+      homepage = https://bitbucket.org/melek/dmenu2;
+      license = licenses.mit;
+      maintainers = [ maintainers.cstrahan ];
+      platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/dockbarx/default.nix b/nixpkgs/pkgs/applications/misc/dockbarx/default.nix
new file mode 100644
index 000000000000..3888c4ce0a0d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/dockbarx/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, pythonPackages, gnome2, keybinder }:
+
+pythonPackages.buildPythonApplication rec {
+  ver = "0.93";
+  name = "dockbarx-${ver}";
+
+  src = fetchFromGitHub {
+    owner = "M7S";
+    repo = "dockbarx";
+    rev = ver;
+    sha256 = "1h1g2vag5vnx87sa1f0qi8rq7wlr2ymvkrdr08kk7cma4wk0x6hg";
+  };
+
+  postPatch = ''
+    substituteInPlace setup.py                                --replace /usr/                   ""
+    substituteInPlace setup.py                                --replace '"/", "usr", "share",'  '"share",'
+    substituteInPlace dockbarx/applets.py                     --replace /usr/share/             $out/share/
+    substituteInPlace dockbarx/dockbar.py                     --replace /usr/share/             $out/share/
+    substituteInPlace dockbarx/iconfactory.py                 --replace /usr/share/             $out/share/
+    substituteInPlace dockbarx/theme.py                       --replace /usr/share/             $out/share/
+    substituteInPlace dockx_applets/battery_status.py         --replace /usr/share/             $out/share/
+    substituteInPlace dockx_applets/namebar.py                --replace /usr/share/             $out/share/
+    substituteInPlace dockx_applets/namebar_window_buttons.py --replace /usr/share/             $out/share/
+    substituteInPlace dockx_applets/volume-control.py         --replace /usr/share/             $out/share/
+  '';
+
+  propagatedBuildInputs = (with pythonPackages; [ pygtk pyxdg dbus-python pillow xlib ])
+    ++ (with gnome2; [ gnome_python gnome_python_desktop ])
+    ++ [ keybinder ];
+
+  meta = with stdenv.lib; {
+    homepage = https://launchpad.net/dockbar/;
+    description = "DockBarX is a lightweight taskbar / panel replacement for Linux which works as a stand-alone dock";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.volth ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/doing/Gemfile b/nixpkgs/pkgs/applications/misc/doing/Gemfile
new file mode 100644
index 000000000000..2706a85e9d89
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/doing/Gemfile
@@ -0,0 +1,2 @@
+source 'https://rubygems.org'
+gem 'doing', '1.0.10pre'
diff --git a/nixpkgs/pkgs/applications/misc/doing/Gemfile.lock b/nixpkgs/pkgs/applications/misc/doing/Gemfile.lock
new file mode 100644
index 000000000000..4d266827415f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/doing/Gemfile.lock
@@ -0,0 +1,25 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    chronic (0.10.2)
+    deep_merge (1.2.1)
+    doing (1.0.10pre)
+      chronic (~> 0.10, >= 0.10.2)
+      deep_merge
+      gli (~> 2.17.1)
+      haml (= 4.0.3)
+      json (~> 1.8.1)
+    gli (2.17.1)
+    haml (4.0.3)
+      tilt
+    json (1.8.6)
+    tilt (2.0.8)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  doing (= 1.0.10pre)
+
+BUNDLED WITH
+   1.14.6
diff --git a/nixpkgs/pkgs/applications/misc/doing/default.nix b/nixpkgs/pkgs/applications/misc/doing/default.nix
new file mode 100644
index 000000000000..9ae2ea41d831
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/doing/default.nix
@@ -0,0 +1,25 @@
+{ lib, bundlerEnv, ruby
+}:
+
+# Bundix:
+# nix-shell -p bundix zlib
+bundlerEnv rec {
+  pname = "doing";
+  version = (import ./gemset.nix).doing.version;
+
+  inherit ruby;
+  gemdir = ./.;
+
+  meta = with lib; {
+    description = "A command line tool for keeping track of what you’re doing and tracking what you’ve done.";
+    longDescription = ''
+      doing is a basic CLI for adding and listing "what was I doing" reminders
+      in a TaskPaper-formatted text file. It allows for multiple
+      sections/categories and flexible output formatting.
+    '';
+    homepage    = https://brettterpstra.com/projects/doing/;
+    license     = licenses.mit;
+    maintainers = with maintainers; [ ktf ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/doing/gemset.nix b/nixpkgs/pkgs/applications/misc/doing/gemset.nix
new file mode 100644
index 000000000000..b30a124bb58b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/doing/gemset.nix
@@ -0,0 +1,60 @@
+{
+  chronic = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1hrdkn4g8x7dlzxwb1rfgr8kw3bp4ywg5l4y4i9c2g5cwv62yvvn";
+      type = "gem";
+    };
+    version = "0.10.2";
+  };
+  deep_merge = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1q3picw7zx1xdkybmrnhmk2hycxzaa0jv4gqrby1s90dy5n7fmsb";
+      type = "gem";
+    };
+    version = "1.2.1";
+  };
+  doing = {
+    dependencies = ["chronic" "deep_merge" "gli" "haml" "json"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1y42yc7h45sz9hqj3g1dd77ipx58l7v64i7mrsj3is2f5rszd1rv";
+      type = "gem";
+    };
+    version = "1.0.10pre";
+  };
+  gli = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0g7g3lxhh2b4h4im58zywj9vcfixfgndfsvp84cr3x67b5zm4kaq";
+      type = "gem";
+    };
+    version = "2.17.1";
+  };
+  haml = {
+    dependencies = ["tilt"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1l9zhfdk9z7xjfdp108r9fw4xa55hflin7hh3lpafbf9bdz96knr";
+      type = "gem";
+    };
+    version = "4.0.3";
+  };
+  json = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0qmj7fypgb9vag723w1a49qihxrcf5shzars106ynw2zk352gbv5";
+      type = "gem";
+    };
+    version = "1.8.6";
+  };
+  tilt = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0020mrgdf11q23hm1ddd6fv691l51vi10af00f137ilcdb2ycfra";
+      type = "gem";
+    };
+    version = "2.0.8";
+  };
+}
\ No newline at end of file
diff --git a/nixpkgs/pkgs/applications/misc/doomseeker/default.nix b/nixpkgs/pkgs/applications/misc/doomseeker/default.nix
new file mode 100644
index 000000000000..fd08ed9c3916
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/doomseeker/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, cmake, fetchFromBitbucket, pkgconfig, qtbase, qttools, qtmultimedia, zlib, bzip2, xxd }:
+
+stdenv.mkDerivation rec {
+  name = "doomseeker-${version}";
+  version = "2018-03-05";
+
+  src = fetchFromBitbucket {
+    owner = "Doomseeker";
+    repo = "doomseeker";
+    rev = "c2c7f37b1afb";
+    sha256 = "17fna3a604miqsvply3klnmypps4ifz8axgd3pj96z46ybxs8akw";
+  };
+
+  patches = [ ./fix_paths.patch ./qt_build_fix.patch ];
+
+  buildInputs = [ qtbase qtmultimedia zlib bzip2 ];
+
+  nativeBuildInputs = [ cmake qttools pkgconfig xxd ];
+
+  enableParallelBuilding = true;
+
+  NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.cc.isClang "-Wno-error=format-security";
+
+  meta = with stdenv.lib; {
+    homepage = http://doomseeker.drdteam.org/;
+    description = "Multiplayer server browser for many Doom source ports";
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.MP2E ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/doomseeker/fix_paths.patch b/nixpkgs/pkgs/applications/misc/doomseeker/fix_paths.patch
new file mode 100644
index 000000000000..08654c2384cb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/doomseeker/fix_paths.patch
@@ -0,0 +1,40 @@
+diff -ru3 source-old/src/core/datapaths.cpp source-new/src/core/datapaths.cpp
+--- source-old/src/core/datapaths.cpp	1970-01-01 03:00:01.000000000 +0300
++++ source-new/src/core/datapaths.cpp	2018-03-04 00:10:25.247262567 +0300
+@@ -335,7 +335,7 @@
+ 	paths.append(workingDirectory());
+ 	paths.append("./");
+ #ifndef Q_OS_WIN32
+-	paths.append(INSTALL_PREFIX "/" INSTALL_LIBDIR "/doomseeker/");
++	paths.append(INSTALL_PREFIX "/lib/doomseeker/");
+ #endif
+ 	paths = uniquePaths(paths);
+ 	return Strings::combineManyPaths(paths, "engines/");
+diff -ru3 source-old/src/core/pathfinder/pathfinder.cpp source-new/src/core/pathfinder/pathfinder.cpp
+--- source-old/src/core/pathfinder/pathfinder.cpp	1970-01-01 03:00:01.000000000 +0300
++++ source-new/src/core/pathfinder/pathfinder.cpp	2018-03-04 00:09:34.862556976 +0300
+@@ -128,9 +128,7 @@
+ 		<< DataPaths::programFilesDirectory(DataPaths::x64)
+ 		<< DataPaths::programFilesDirectory(DataPaths::x86);
+ #else
+-	paths << "/usr/bin" << "/usr/local/bin" << "/usr/share/bin"
+-		<< "/usr/games/" << "/usr/local/games/"
+-		<< "/usr/share/games/" << gDefaultDataPaths->workingDirectory() << ".";
++	paths << gDefaultDataPaths->workingDirectory() << ".";
+ #endif
+ 	QStringList pathsCopy(paths);
+ 	foreach (const QString &path, pathsCopy)
+diff -ru3 source-old/src/core/pathfinder/wadpathfinder.cpp source-new/src/core/pathfinder/wadpathfinder.cpp
+--- source-old/src/core/pathfinder/wadpathfinder.cpp	1970-01-01 03:00:01.000000000 +0300
++++ source-new/src/core/pathfinder/wadpathfinder.cpp	2018-03-04 00:09:56.822865339 +0300
+@@ -84,10 +84,6 @@
+ 		QStringList defaultPaths()

+ 		{

+ 			QStringList paths;

+-			#ifdef Q_OS_UNIX

+-			paths << "/usr/local/share/games/doom/"

+-				<< "/usr/share/games/doom/";

+-			#endif

+ 			return paths;

+ 		}

+ };

diff --git a/nixpkgs/pkgs/applications/misc/doomseeker/qt_build_fix.patch b/nixpkgs/pkgs/applications/misc/doomseeker/qt_build_fix.patch
new file mode 100644
index 000000000000..e21b53b3cc53
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/doomseeker/qt_build_fix.patch
@@ -0,0 +1,47 @@
+diff -r c2c7f37b1afb src/core/gui/irc/ircdock.cpp
+--- a/src/core/gui/irc/ircdock.cpp	Tue Mar 06 00:14:23 2018 +0100
++++ b/src/core/gui/irc/ircdock.cpp	Sat Jul 28 16:53:04 2018 -0700
+@@ -32,6 +32,7 @@
+ #include <QInputDialog>
+ #include <QMessageBox>
+ #include <QToolBar>
++#include <QTabBar>
+ 
+ DClass<IRCDock> : public Ui::IRCDock
+ {
+diff -r c2c7f37b1afb src/core/gui/logdock.cpp
+--- a/src/core/gui/logdock.cpp	Tue Mar 06 00:14:23 2018 +0100
++++ b/src/core/gui/logdock.cpp	Sat Jul 28 16:53:04 2018 -0700
+@@ -21,6 +21,8 @@
+ // Copyright (C) 2009 "Zalewa" <zalewapl@gmail.com>
+ //------------------------------------------------------------------------------
+ 
++#include <QAction>
++
+ #include "clipboard.h"
+ #include "logdock.h"
+ #include "log.h"
+diff -r c2c7f37b1afb src/core/gui/serverdetailsdock.cpp
+--- a/src/core/gui/serverdetailsdock.cpp	Tue Mar 06 00:14:23 2018 +0100
++++ b/src/core/gui/serverdetailsdock.cpp	Sat Jul 28 16:53:04 2018 -0700
+@@ -21,6 +21,7 @@
+ // Copyright (C) 2014 Braden "Blzut3" Obrzut <admin@maniacsvault.net>
+ //------------------------------------------------------------------------------
+ 
++#include <QAction>
+ #include <QBoxLayout>
+ 
+ #include "serverdetailsdock.h"
+diff -r c2c7f37b1afb src/core/gui/serverfilterdock.cpp
+--- a/src/core/gui/serverfilterdock.cpp	Tue Mar 06 00:14:23 2018 +0100
++++ b/src/core/gui/serverfilterdock.cpp	Sat Jul 28 16:53:04 2018 -0700
+@@ -20,6 +20,9 @@
+ //------------------------------------------------------------------------------
+ // Copyright (C) 2011 "Zalewa" <zalewapl@gmail.com>
+ //------------------------------------------------------------------------------
++
++#include <QAction>
++
+ #include "serverfilterdock.h"
+ #include "ui_serverfilterdock.h"
+ 
diff --git a/nixpkgs/pkgs/applications/misc/dotfiles/default.nix b/nixpkgs/pkgs/applications/misc/dotfiles/default.nix
new file mode 100644
index 000000000000..1d3c405b7038
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/dotfiles/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, pythonPackages }:
+
+pythonPackages.buildPythonApplication rec {
+  pname = "dotfiles";
+  name = "${pname}-${version}";
+  version = "0.6.4";
+
+  src = pythonPackages.fetchPypi {
+    inherit version pname;
+    sha256 = "03qis6m9r2qh00sqbgwsm883s4bj1ibwpgk86yh4l235mdw8jywv";
+  };
+
+  # No tests in archive
+  doCheck = false;
+
+  checkInputs = with pythonPackages; [ pytest ];
+  propagatedBuildInputs = with pythonPackages; [ click ];
+
+  meta = with stdenv.lib; {
+    description = "Easily manage your dotfiles";
+    homepage = https://github.com/jbernard/dotfiles;
+    license = licenses.isc;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/dozenal/default.nix b/nixpkgs/pkgs/applications/misc/dozenal/default.nix
new file mode 100644
index 000000000000..b5ae9fb567ca
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/dozenal/default.nix
@@ -0,0 +1,61 @@
+{ stdenv, fetchFromGitHub, ncurses, hdate, lua5_2 }:
+
+stdenv.mkDerivation rec {
+  version = "12010904";
+  name = "dozenal-${version}";
+  src = fetchFromGitHub {
+    owner = "dgoodmaniii";
+    repo = "dozenal";
+    rev = "v${version}";
+    sha256 = "1ic63gpdda762x6ks3al71dwgmsy2isicqyr2935bd245jx8s209";
+  };
+  makeFlags = [
+              # author do not use configure and prefix directly using $prefix
+              "prefix=$(out)"
+              # graphical version of dozdc requires xforms, which is not i nixpkgs so I turned it down
+              "XFORMS_FLAGS=-UXFORMS"
+              "LUALIB=-llua"
+              "bindir=$(prefix)/bin/"
+            ];
+  # some include hardcodes the lua libraries path. This is a patch for that
+  patches = [ ./lua-header.patch ];
+  preBuild = "cd dozenal";
+  buildInputs = [ ncurses hdate lua5_2 ];
+  # I remove gdozdc, as I didn't figure all it's dependency yet.
+  postInstall = "rm $out/bin/gdozdc";
+
+  meta = {
+    description = "A complete suite of dozenal (base twelve) programs";
+    longDescription = ''
+      Programs
+
+      doz --- a converter; converts decimal numbers into dozenal. Accepts
+         input in standard or exponential notation (i.e., "1492.2" or "1.4922e3").
+      dec --- a converter; converts dozenal numbers into decimal. Accepts input
+         in standard or exponential notation (i.e., "X44;4" or "X;444e2").
+      dozword --- converts a dozenal number (integers only) into words,
+         according to the Pendlebury system.
+      dozdc --- a full-featured scientific calculator which works in the
+         dozenal base. RPN command line.
+      tgmconv --- a converter for all standard measurements; converts to and
+         from TGM, Imperial, customary, and SI metric.
+      dozpret --- a pretty-printer for dozenal numbers; inserts spacing (or
+         other characters) as desired, and can also transform transdecimal digits
+         from 'X' to 'E' into any character or sequence of characters desired.
+      dozdate --- a more-or-less drop-in replacement for GNU and BSD date, it
+         outputs the date and time in dozenal, as well as containing some TGM
+         extensions.
+      dozstring --- a simple byte converter; absorbs a string either from
+         standard input or a command line argument, leaving it identical but
+         for the numbers, which it converts into dozenal. Options for padding
+         and for not converting specific numbers.
+      doman --- a converter which takes a dozenal integer and
+         emits its equivalent in a non-place-value system, such as
+         Roman numerals.  Arbitrary ranks and symbols may be used.
+         Defaults to dozenal Roman numerals.
+    '';
+    homepage = https://github.com/dgoodmaniii/dozenal/;
+    maintainers = with stdenv.lib.maintainers; [ CharlesHD ];
+    license = stdenv.lib.licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/dozenal/lua-header.patch b/nixpkgs/pkgs/applications/misc/dozenal/lua-header.patch
new file mode 100644
index 000000000000..45b76e159a11
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/dozenal/lua-header.patch
@@ -0,0 +1,16 @@
+diff -ruN dozenal-12010904/dozenal/dozcal/call_lua.c dozenal-patched/dozenal/dozcal/call_lua.c
+--- dozenal-12010904/dozenal/dozcal/call_lua.c	2017-09-04 19:25:01.000000000 +0200
++++ dozenal-patched/dozenal/dozcal/call_lua.c	2018-06-13 10:19:57.821950327 +0200
+@@ -38,9 +38,9 @@
+ #include"utility.h"
+ #include"conv.h"
+ #include"proc_date.h"
+-#include<lua5.2/lua.h>
+-#include<lua5.2/lauxlib.h>
+-#include<lua5.2/lualib.h>
++#include<lua.h>
++#include<lauxlib.h>
++#include<lualib.h>
+ 
+ void bail(lua_State *L, int err_code, char *filename);
+ int file_prefix(char **s, char *t);
diff --git a/nixpkgs/pkgs/applications/misc/dunst/default.nix b/nixpkgs/pkgs/applications/misc/dunst/default.nix
new file mode 100644
index 000000000000..35073db2ae14
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/dunst/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, lib, fetchFromGitHub, makeWrapper
+, pkgconfig, which, perl, libXrandr
+, cairo, dbus, systemd, gdk_pixbuf, glib, libX11, libXScrnSaver
+, libXinerama, libnotify, pango, xorgproto, librsvg, dunstify ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dunst";
+  version = "1.4.1";
+
+  src = fetchFromGitHub {
+    owner = "dunst-project";
+    repo = "dunst";
+    rev = "v${version}";
+    sha256 = "0xjj1f2jr1ja5grj6wrx5jjz1sx5fpqnvkw7nqi4452j3nc4p4l2";
+  };
+
+  nativeBuildInputs = [ perl pkgconfig which systemd makeWrapper ];
+
+  buildInputs = [
+    cairo dbus gdk_pixbuf glib libX11 libXScrnSaver
+    libXinerama libnotify pango xorgproto librsvg libXrandr
+  ];
+
+  outputs = [ "out" "man" ];
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "VERSION=$(version)"
+    "SERVICEDIR_DBUS=$(out)/share/dbus-1/services"
+    "SERVICEDIR_SYSTEMD=$(out)/lib/systemd/user"
+  ];
+
+  buildFlags = if dunstify then [ "dunstify" ] else [];
+
+  postInstall = lib.optionalString dunstify ''
+    install -Dm755 dunstify $out/bin
+  '' + ''
+    wrapProgram $out/bin/dunst \
+      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
+  '';
+
+  meta = with lib; {
+    description = "Lightweight and customizable notification daemon";
+    homepage = "https://dunst-project.org/";
+    license = licenses.bsd3;
+    # NOTE: 'unix' or even 'all' COULD work too, I'm not sure
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ domenkozar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/eaglemode/default.nix b/nixpkgs/pkgs/applications/misc/eaglemode/default.nix
new file mode 100644
index 000000000000..6c802e683ce9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/eaglemode/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchurl, perl, libX11, libXinerama, libjpeg, libpng, libtiff, pkgconfig,
+librsvg, glib, gtk2, libXext, libXxf86vm, poppler, xineLib, ghostscript, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "eaglemode-${version}";
+  version = "0.94.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/eaglemode/${name}.tar.bz2";
+    sha256 = "0mpnk0fzy02jxbafipkdkj48m6k38h42j599gw4sdnag7ymlms89";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ perl libX11 libXinerama libjpeg libpng libtiff
+    librsvg glib gtk2 libXxf86vm libXext poppler xineLib ghostscript makeWrapper ];
+
+  # The program tries to dlopen Xxf86vm, Xext and Xinerama, so we use the
+  # trick on NIX_LDFLAGS and dontPatchELF to make it find them.
+  # I use 'yes y' to skip a build error linking with xineLib,
+  # because xine stopped exporting "_x_vo_new_port"
+  #  https://sourceforge.net/projects/eaglemode/forums/forum/808824/topic/5115261
+  buildPhase = ''
+    export NIX_LDFLAGS="$NIX_LDFLAGS -lXxf86vm -lXext -lXinerama"
+    perl make.pl build
+  '';
+
+  dontPatchELF = true;
+  # eaglemode expects doc to be in the root directory
+  forceShare = [ "man" "info" ];
+
+  installPhase = ''
+    perl make.pl install dir=$out
+    wrapProgram $out/bin/eaglemode --set EM_DIR "$out" --prefix LD_LIBRARY_PATH : "$out/lib" --prefix PATH : "${ghostscript}/bin"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://eaglemode.sourceforge.net;
+    description = "Zoomable User Interface";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/electron-cash/default.nix b/nixpkgs/pkgs/applications/misc/electron-cash/default.nix
new file mode 100644
index 000000000000..cc7b9cf27c2a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/electron-cash/default.nix
@@ -0,0 +1,81 @@
+{ lib, fetchurl, python3Packages, qtbase, makeWrapper }:
+
+python3Packages.buildPythonApplication rec {
+  pname = "electron-cash";
+  version = "4.0.7";
+
+  src = fetchurl {
+    url = "https://electroncash.org/downloads/${version}/win-linux/Electron-Cash-${version}.tar.gz";
+    # Verified using official SHA-1 and signature from
+    # https://github.com/fyookball/keys-n-hashes
+    sha256 = "d63ef2d52cff0b821b745067d752fd0c7f2902fa23eaf8e9392c54864cae5c77";
+  };
+
+  propagatedBuildInputs = with python3Packages; [
+    dnspython
+    ecdsa
+    jsonrpclib-pelix
+    matplotlib
+    pbkdf2
+    pyaes
+    pycrypto
+    pyqt5
+    pysocks
+    qrcode
+    requests
+    tlslite-ng
+    qdarkstyle
+
+    # plugins
+    keepkey
+    trezor
+    btchip
+  ];
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postPatch = ''
+    substituteInPlace contrib/requirements/requirements.txt \
+      --replace "qdarkstyle<2.6" "qdarkstyle<3"
+
+    substituteInPlace setup.py \
+      --replace "(share_dir" "(\"share\""
+  '';
+
+  checkInputs = with python3Packages; [
+    pytest
+  ];
+
+  checkPhase = ''
+    unset HOME
+    pytest lib/tests
+  '';
+
+  postInstall = ''
+    substituteInPlace $out/share/applications/electron-cash.desktop \
+      --replace "Exec=electron-cash" "Exec=$out/bin/electron-cash"
+
+    # Please remove this when #44047 is fixed
+    wrapProgram $out/bin/electron-cash \
+      --prefix QT_PLUGIN_PATH : ${qtbase}/lib/qt-5.${lib.versions.minor qtbase.version}/plugins
+  '';
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    $out/bin/electron-cash help >/dev/null
+  '';
+
+  meta = with lib; {
+    description = "A Bitcoin Cash SPV Wallet";
+    longDescription = ''
+      An easy-to-use Bitcoin Cash client featuring wallets generated from
+      mnemonic seeds (in addition to other, more advanced, wallet options)
+      and the ability to perform transactions without downloading a copy
+      of the blockchain.
+    '';
+    homepage = https://www.electroncash.org/;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ lassulus nyanloutre ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/electrum/dash.nix b/nixpkgs/pkgs/applications/misc/electrum/dash.nix
new file mode 100644
index 000000000000..98ed10b0c7cc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/electrum/dash.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl, python2Packages }:
+
+python2Packages.buildPythonApplication rec {
+  version = "2.9.3.1";
+  name = "electrum-dash-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/akhavr/electrum-dash/releases/download/${version}/Electrum-DASH-${version}.tar.gz";
+    #"https://github.com/dashpay/electrum-dash/releases/download/v${version}/Electrum-DASH-${version}.tar.gz";
+    sha256 = "9b7ac205f63fd4bfb15d77a34a4451ef82caecf096f31048a7603bd276dfc33e";
+  };
+
+  propagatedBuildInputs = with python2Packages; [
+    dnspython
+    ecdsa
+    pbkdf2
+    protobuf
+    pyasn1
+    pyasn1-modules
+    pycrypto
+    pyqt4
+    qrcode
+    requests
+    pyaes
+    tlslite-ng
+    x11_hash
+    mnemonic
+    jsonrpclib
+
+    # plugins
+    trezor
+  ];
+
+  preInstall = ''
+    mkdir -p $out/share
+    sed -i 's@usr_share = .*@usr_share = os.getenv("out")+"/share"@' setup.py
+    pyrcc4 icons.qrc -o gui/qt/icons_rc.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Electrum DASH";
+    homepage = https://github.com/dashpay/electrum-dash;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ np ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/electrum/default.nix b/nixpkgs/pkgs/applications/misc/electrum/default.nix
new file mode 100644
index 000000000000..0de055df5698
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/electrum/default.nix
@@ -0,0 +1,128 @@
+{ stdenv, fetchurl, fetchFromGitHub, python3, python3Packages, zbar, secp256k1
+
+
+# for updater.nix
+, writeScript
+, common-updater-scripts
+, bash
+, coreutils
+, curl
+, gnugrep
+, gnupg
+, gnused
+, nix
+}:
+
+let
+  version = "3.3.7";
+
+  # Not provided in official source releases, which are what upstream signs.
+  tests = fetchFromGitHub {
+    owner = "spesmilo";
+    repo = "electrum";
+    rev = version;
+    sha256 = "1g2kbbsi6k105q6s0la20h12gz8dzka5kdcjbdhs12jqsjfx3lr0";
+
+    extraPostFetch = ''
+      mv $out ./all
+      mv ./all/electrum/tests $out
+    '';
+  };
+in
+
+python3Packages.buildPythonApplication rec {
+  pname = "electrum";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://download.electrum.org/${version}/Electrum-${version}.tar.gz";
+    sha256 = "13ahc4zqpgzmck2r663sqqgz86xsd83r5qqi26mh2vazy1i6pykz";
+  };
+
+  postUnpack = ''
+    # can't symlink, tests get confused
+    cp -ar ${tests} $sourceRoot/electrum/tests
+  '';
+
+  propagatedBuildInputs = with python3Packages; [
+    aiorpcx
+    aiohttp
+    aiohttp-socks
+    dnspython
+    ecdsa
+    jsonrpclib-pelix
+    matplotlib
+    pbkdf2
+    protobuf
+    pyaes
+    pycryptodomex
+    pyqt5
+    pysocks
+    qdarkstyle
+    qrcode
+    requests
+    tlslite-ng
+
+    # plugins
+    keepkey
+    trezor
+    btchip
+
+    # TODO plugins
+    # amodem
+  ];
+
+  preBuild = ''
+    sed -i 's,usr_share = .*,usr_share = "'$out'/share",g' setup.py
+    sed -i "s|name = 'libzbar.*'|name='${zbar}/lib/libzbar.so'|" electrum/qrscanner.py
+    substituteInPlace ./electrum/ecc_fast.py --replace libsecp256k1.so.0 ${secp256k1}/lib/libsecp256k1.so.0
+  '';
+
+  postInstall = ''
+    # Despite setting usr_share above, these files are installed under
+    # $out/nix ...
+    mv $out/${python3.sitePackages}/nix/store"/"*/share $out
+    rm -rf $out/${python3.sitePackages}/nix
+
+    substituteInPlace $out/share/applications/electrum.desktop \
+      --replace 'Exec=sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; electrum %u"' \
+                "Exec=$out/bin/electrum %u" \
+      --replace 'Exec=sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; electrum --testnet %u"' \
+                "Exec=$out/bin/electrum --testnet %u"
+  '';
+
+  checkInputs = with python3Packages; [ pytest ];
+
+  checkPhase = ''
+    py.test electrum/tests
+    $out/bin/electrum help >/dev/null
+  '';
+
+  passthru.updateScript = import ./update.nix {
+    inherit (stdenv) lib;
+    inherit
+      writeScript
+      common-updater-scripts
+      bash
+      coreutils
+      curl
+      gnupg
+      gnugrep
+      gnused
+      nix
+    ;
+  };
+
+  meta = with stdenv.lib; {
+    description = "A lightweight Bitcoin wallet";
+    longDescription = ''
+      An easy-to-use Bitcoin client featuring wallets generated from
+      mnemonic seeds (in addition to other, more advanced, wallet options)
+      and the ability to perform transactions without downloading a copy
+      of the blockchain.
+    '';
+    homepage = https://electrum.org/;
+    license = licenses.mit;
+    maintainers = with maintainers; [ ehmry joachifm np ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/electrum/ltc.nix b/nixpkgs/pkgs/applications/misc/electrum/ltc.nix
new file mode 100644
index 000000000000..a5e4bd74a6eb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/electrum/ltc.nix
@@ -0,0 +1,57 @@
+{ stdenv
+, fetchurl
+, python3Packages
+}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "electrum-ltc";
+  version = "3.1.3.1";
+
+  src = fetchurl {
+    url = "https://electrum-ltc.org/download/Electrum-LTC-${version}.tar.gz";
+    sha256 = "0kxcx1xf6h9z8x0k483d6ykpnmfr30n6z3r6lgqxvbl42pq75li7";
+  };
+
+  nativeBuildInputs = with python3Packages; [ pyqt5 ];
+
+  propagatedBuildInputs = with python3Packages; [
+    pyaes
+    ecdsa
+    pbkdf2
+    requests
+    qrcode
+    py_scrypt
+    pyqt5
+    protobuf
+    dnspython
+    jsonrpclib-pelix
+    pysocks
+  ];
+
+  preBuild = ''
+    sed -i 's,usr_share = .*,usr_share = "'$out'/share",g' setup.py
+    pyrcc5 icons.qrc -o gui/qt/icons_rc.py
+    # Recording the creation timestamps introduces indeterminism to the build
+    sed -i '/Created: .*/d' gui/qt/icons_rc.py
+  '';
+
+  checkPhase = ''
+    $out/bin/electrum-ltc help >/dev/null
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Litecoin thin client";
+    longDescription = ''
+      Electrum-LTC is a simple, but powerful Litecoin wallet. A twelve-word
+      security passphrase (or “seed”) leaves intruders stranded and your peace
+      of mind intact. Keep it on paper, or in your head... and never worry
+      about losing your litecoins to theft or hardware failure. No waiting, no
+      lengthy blockchain downloads and no syncing to the network.
+    '';
+    homepage = https://electrum-ltc.org/;
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ asymmetric ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/electrum/update.nix b/nixpkgs/pkgs/applications/misc/electrum/update.nix
new file mode 100644
index 000000000000..247fabe3891f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/electrum/update.nix
@@ -0,0 +1,59 @@
+{ lib
+, writeScript
+, common-updater-scripts
+, bash
+, coreutils
+, curl
+, gnugrep
+, gnupg
+, gnused
+, nix
+}:
+
+with lib;
+
+let
+  downloadPageUrl = "https://download.electrum.org";
+
+  signingKeys = ["6694 D8DE 7BE8 EE56 31BE D950 2BD5 824B 7F94 70E6"];
+in
+
+writeScript "update-electrum" ''
+#! ${bash}/bin/bash
+
+set -eu -o pipefail
+
+export PATH=${makeBinPath [
+  common-updater-scripts
+  coreutils
+  curl
+  gnugrep
+  gnupg
+  gnused
+  nix
+]}
+
+version=$(curl -L --list-only -- '${downloadPageUrl}' \
+    | grep -Po '<a href="\K([[:digit:]]+\.?)+' \
+    | sort -Vu \
+    | tail -n1)
+
+srcName=Electrum-$version
+srcFile=$srcName.tar.gz
+srcUrl="${downloadPageUrl}/$version/$srcFile"
+sigUrl=$srcUrl.asc
+sigFile=$srcFile.asc
+
+[[ -e "$srcFile" ]] || curl -L -o "$srcFile" -- "$srcUrl"
+[[ -e "$sigFile" ]] || curl -L -o "$sigFile" -- "$sigUrl"
+
+export GNUPGHOME=$PWD/gnupg
+mkdir -m 700 -p "$GNUPGHOME"
+
+gpg --batch --recv-keys ${concatStringsSep " " (map (x: "'${x}'") signingKeys)}
+gpg --batch --verify "$sigFile" "$srcFile"
+
+sha256=$(nix-prefetch-url --type sha256 "file://$PWD/$srcFile")
+
+update-source-version electrum "$version" "$sha256"
+''
diff --git a/nixpkgs/pkgs/applications/misc/emem/default.nix b/nixpkgs/pkgs/applications/misc/emem/default.nix
new file mode 100644
index 000000000000..d447e7f50d52
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/emem/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, jdk }:
+
+stdenv.mkDerivation rec {
+  pname = "emem";
+  version = "0.2.50";
+  name = "${pname}-${version}";
+
+  inherit jdk;
+
+  src = fetchurl {
+    url = "https://github.com/ebzzry/${pname}/releases/download/v${version}/${pname}.jar";
+    sha256 = "18x3s3jrph8k3pc75jgwkfqazygpsx93zjxx68zms58my17cybh1";
+  };
+
+  phases = [ "buildPhase" "installPhase" ];
+
+  buildPhase = ''
+    mkdir -p $out/bin $out/share/java
+  '';
+
+  installPhase = ''
+    cp $src $out/share/java/${pname}.jar
+
+    cat > $out/bin/${pname} << EOF
+#! $SHELL
+$jdk/bin/java -jar $out/share/java/${pname}.jar "\$@"
+EOF
+
+    chmod +x $out/bin/${pname}
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/ebzzry/emem;
+    description = "A trivial Markdown to HTML converter";
+    license = licenses.epl10;
+    maintainers = [ maintainers.ebzzry ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/epdfview/default.nix b/nixpkgs/pkgs/applications/misc/epdfview/default.nix
new file mode 100644
index 000000000000..b6c10dbebcad
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/epdfview/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, fetchpatch, pkgconfig, gtk2, poppler }:
+
+stdenv.mkDerivation rec {
+  name = "epdfview-${version}";
+  version = "0.1.8";
+
+  src = fetchurl {
+    url = "mirror://debian/pool/main/e/epdfview/epdfview_${version}.orig.tar.gz";
+    sha256 = "0ibyb60a0b4n34bsjgvhdw8yf24463ky0hpmf6a2jjqsbm5g4v64";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ gtk2 poppler ];
+
+  hardeningDisable = [ "format" ];
+
+  patches = [ (fetchpatch {
+                name = "epdfview-0.1.8-glib2-headers.patch";
+                url = "https://projects.archlinux.org/svntogit/community.git/plain/trunk/epdfview-0.1.8-glib2-headers.patch?h=packages/epdfview&id=40ba115c860bdec31d03a30fa594a7ec2864d634";
+                sha256 = "17df6s1zij5ficj67xszq6kd88cy620az3ic55065ccnmsd73f8h";
+              })
+              (fetchpatch {
+                name = "epdfview-0.1.8-modern-cups.patch";
+                url = "https://projects.archlinux.org/svntogit/community.git/plain/trunk/epdfview-0.1.8-modern-cups.patch?h=packages/epdfview&id=40ba115c860bdec31d03a30fa594a7ec2864d634";
+                sha256 = "07yvgvai2bvbr5fa1mv6lg7nqr0qyryjn1xyjlh8nidg9k9vv001";
+              })
+            ];
+
+  meta = with stdenv.lib; {
+    homepage = https://packages.debian.org/wheezy/epdfview;
+    description = "A lightweight PDF document viewer using Poppler and GTK+";
+    longDescription = ''
+        ePDFView is a free lightweight PDF document viewer using Poppler and
+        GTK+ libraries. The aim of ePDFView is to make a simple PDF document
+        viewer, in the lines of Evince but without using the Gnome libraries.
+    '';
+    license = licenses.gpl2;
+    maintainers = [ maintainers.astsmtl ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/et/default.nix b/nixpkgs/pkgs/applications/misc/et/default.nix
new file mode 100644
index 000000000000..4aaaa3339982
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/et/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchFromGitHub, pkgconfig, libnotify, gdk_pixbuf }:
+
+stdenv.mkDerivation rec {
+  name = "et-${version}";
+  version = "0.1.1";
+
+  src = fetchFromGitHub {
+    owner = "geistesk";
+    repo = "et";
+    rev = "${version}";
+    sha256 = "167w9qwfpd63rgy0xmkkkh5krmd91q42c3ijy3j099krgdfbb9bc";
+  };
+
+  buildInputs = [ libnotify gdk_pixbuf ];
+  nativeBuildInputs = [ pkgconfig ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp et $out/bin
+    cp et-status.sh $out/bin/et-status
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Minimal libnotify-based (egg) timer";
+    homepage = https://github.com/geistesk/et;
+    license = licenses.gpl3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ geistesk ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/eterm/default.nix b/nixpkgs/pkgs/applications/misc/eterm/default.nix
new file mode 100644
index 000000000000..98b47990314d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/eterm/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl
+, libX11, libXext, libXaw
+, pkgconfig, imlib2, libast }:
+
+stdenv.mkDerivation rec {
+  name = "eterm-${version}";
+  version = "0.9.6";
+  srcName = "Eterm-${version}";
+
+  src = fetchurl {
+    url = "http://www.eterm.org/download/${srcName}.tar.gz";
+    sha256 = "0g71szjklkiczxwzbjjfm59y6v9w4hp8mg7cy99z1g7qcjm0gfbj";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ libX11 libXext libXaw imlib2 ];
+  propagatedBuildInputs = [ libast ];
+
+  meta = with stdenv.lib; {
+    description = "Terminal emulator";
+    homepage = http://www.eterm.org;
+    license = licenses.bsd2;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/eureka-editor/default.nix b/nixpkgs/pkgs/applications/misc/eureka-editor/default.nix
new file mode 100644
index 000000000000..b8bd0a59bea2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/eureka-editor/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchzip, fltk, zlib, xdg_utils, xorg, libjpeg, libGL }:
+
+stdenv.mkDerivation rec {
+  name = "eureka-editor-${version}";
+  version = "1.21";
+  shortver = "121";
+
+  src = fetchzip {
+    url = "mirror://sourceforge/eureka-editor/Eureka/${version}/eureka-${shortver}-source.tar.gz";
+    sha256 = "0fpj13aq4wh3f7473cdc5jkf1c71jiiqmjc0ihqa0nm3hic1d4yv";
+  };
+
+  buildInputs = [ fltk zlib xdg_utils libjpeg xorg.libXinerama libGL ];
+
+  enableParallelBuilding = true;
+
+  preBuild = ''
+    substituteInPlace src/main.cc \
+      --replace /usr/local $out
+    substituteInPlace Makefile \
+      --replace /usr/local $out \
+      --replace "-o root " ""
+  '';
+
+  preInstall = ''
+    mkdir -p $out/bin $out/share/applications $out/share/icons $out/man/man6
+    cp misc/eureka.desktop $out/share/applications
+    cp misc/eureka.ico $out/share/icons
+    cp misc/eureka.6 $out/man/man6
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://eureka-editor.sourceforge.net;
+    description = "A map editor for the classic DOOM games, and a few related games such as Heretic and Hexen";
+    license = licenses.gpl2;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ neonfuz ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/evilvte/default.nix b/nixpkgs/pkgs/applications/misc/evilvte/default.nix
new file mode 100644
index 000000000000..c7fcf18e4e3d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/evilvte/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchgit, makeWrapper, pkgconfig,
+  gnome2, glib, pango, cairo, gdk_pixbuf, atk, freetype, xorg,
+  configH ? ""
+}:
+
+stdenv.mkDerivation rec {
+  name = "evilvte-${version}";
+  version = "0.5.2-20140827";
+
+  src = fetchgit {
+    url = https://github.com/caleb-/evilvte.git;
+    rev = "8dfa41e26bc640dd8d8c7317ff7d04e3c01ded8a";
+    sha256 = "70f1d4234d077121e2223a735d749d1b53f0b84393507b635b8a37c3716e94d3";
+  };
+
+  buildInputs = [
+    gnome2.vte glib pango gnome2.gtk cairo gdk_pixbuf atk freetype xorg.libX11
+    xorg.xorgproto xorg.libXext makeWrapper pkgconfig
+  ];
+
+  buildPhase = ''
+    cat >src/config.h <<EOF
+    ${configH}
+    EOF
+    make
+  '';
+
+  meta = with stdenv.lib; {
+    description = "VTE based, highly customizable terminal emulator";
+    homepage = http://www.calno.com/evilvte;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.bodil ];
+    platforms = platforms.linux;
+    knownVulnerabilities = [
+      "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=854585"
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/evtest/default.nix b/nixpkgs/pkgs/applications/misc/evtest/default.nix
new file mode 100644
index 000000000000..3d715a1d16bd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/evtest/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchgit, autoreconfHook, pkgconfig, libxml2 }:
+
+stdenv.mkDerivation rec {
+  name = "evtest-1.33";
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  buildInputs = [ libxml2 ];
+
+  src = fetchgit {
+    url = "git://anongit.freedesktop.org/evtest";
+    rev = "refs/tags/evtest-1.33";
+    sha256 = "168gdhzj11f4nk94a6z696sm8v1njzwww69bn6wr97l17897913g";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Simple tool for input event debugging";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/exercism/default.nix b/nixpkgs/pkgs/applications/misc/exercism/default.nix
new file mode 100644
index 000000000000..21fed2e28def
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/exercism/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, buildGoPackage, fetchFromGitHub }:
+
+buildGoPackage rec {
+  name    = "exercism-${version}";
+  version = "3.0.11";
+
+  goPackagePath = "github.com/exercism/cli";
+
+  src = fetchFromGitHub {
+    owner  = "exercism";
+    repo   = "cli";
+    rev    = "v${version}";
+    sha256 = "1wg23bvibsk6j4iqwyw35wl9plfwdqxiql81zci7r1x4d5cp26av";
+  };
+
+  goDeps = ./deps.nix;
+
+  meta = with stdenv.lib; {
+   inherit (src.meta) homepage;
+   description = "A Go based command line tool for exercism.io";
+   license     = licenses.mit;
+   maintainers = [ maintainers.rbasso ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/exercism/deps.nix b/nixpkgs/pkgs/applications/misc/exercism/deps.nix
new file mode 100644
index 000000000000..10a6baa2241b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/exercism/deps.nix
@@ -0,0 +1,201 @@
+# file generated from Gopkg.lock using dep2nix (https://github.com/nixcloud/dep2nix)
+[
+  {
+    goPackagePath  = "github.com/blang/semver";
+    fetch = {
+      type = "git";
+      url = "https://github.com/blang/semver";
+      rev =  "2ee87856327ba09384cabd113bc6b5d174e9ec0f";
+      sha256 = "13ws259bwcibkclbr82ilhk6zadm63kxklxhk12wayklj8ghhsmy";
+    };
+  }
+  {
+    goPackagePath  = "github.com/davecgh/go-spew";
+    fetch = {
+      type = "git";
+      url = "https://github.com/davecgh/go-spew";
+      rev =  "346938d642f2ec3594ed81d874461961cd0faa76";
+      sha256 = "0d4jfmak5p6lb7n2r6yvf5p1zcw0l8j74kn55ghvr7zr7b7axm6c";
+    };
+  }
+  {
+    goPackagePath  = "github.com/fsnotify/fsnotify";
+    fetch = {
+      type = "git";
+      url = "https://github.com/fsnotify/fsnotify";
+      rev =  "629574ca2a5df945712d3079857300b5e4da0236";
+      sha256 = "06wfg1mmzjj04z7d0q1x2fai9k6hm957brngsaf02fa9a3qqanv3";
+    };
+  }
+  {
+    goPackagePath  = "github.com/hashicorp/hcl";
+    fetch = {
+      type = "git";
+      url = "https://github.com/hashicorp/hcl";
+      rev =  "392dba7d905ed5d04a5794ba89f558b27e2ba1ca";
+      sha256 = "1rfm67kma2hpakabf7hxlj196jags4rpjpcirwg4kan4g9b6j0kb";
+    };
+  }
+  {
+    goPackagePath  = "github.com/inconshreveable/go-update";
+    fetch = {
+      type = "git";
+      url = "https://github.com/inconshreveable/go-update";
+      rev =  "8152e7eb6ccf8679a64582a66b78519688d156ad";
+      sha256 = "07czhspakpi7al004rm669cmf4h5l0vnygsm11280nkfn2zxqdi3";
+    };
+  }
+  {
+    goPackagePath  = "github.com/inconshreveable/mousetrap";
+    fetch = {
+      type = "git";
+      url = "https://github.com/inconshreveable/mousetrap";
+      rev =  "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75";
+      sha256 = "1mn0kg48xkd74brf48qf5hzp0bc6g8cf5a77w895rl3qnlpfw152";
+    };
+  }
+  {
+    goPackagePath  = "github.com/magiconair/properties";
+    fetch = {
+      type = "git";
+      url = "https://github.com/magiconair/properties";
+      rev =  "be5ece7dd465ab0765a9682137865547526d1dfb";
+      sha256 = "0spk58x9b0hj29cw6wy6rlvc6s9xk4r0gmlxgsc194pkzqcg1my8";
+    };
+  }
+  {
+    goPackagePath  = "github.com/mitchellh/mapstructure";
+    fetch = {
+      type = "git";
+      url = "https://github.com/mitchellh/mapstructure";
+      rev =  "d0303fe809921458f417bcf828397a65db30a7e4";
+      sha256 = "1fjwi5ghc1ibyx93apz31n4hj6gcq1hzismpdfbg2qxwshyg0ya8";
+    };
+  }
+  {
+    goPackagePath  = "github.com/pelletier/go-buffruneio";
+    fetch = {
+      type = "git";
+      url = "https://github.com/pelletier/go-buffruneio";
+      rev =  "c37440a7cf42ac63b919c752ca73a85067e05992";
+      sha256 = "0l83p1gg6g5mmhmxjisrhfimhbm71lwn1r2w7d6siwwqm9q08sd2";
+    };
+  }
+  {
+    goPackagePath  = "github.com/pelletier/go-toml";
+    fetch = {
+      type = "git";
+      url = "https://github.com/pelletier/go-toml";
+      rev =  "5ccdfb18c776b740aecaf085c4d9a2779199c279";
+      sha256 = "1jl44j58y62rhnwkzw3mvcj725gdyzs45pq4ga81qqxwqxs3czsq";
+    };
+  }
+  {
+    goPackagePath  = "github.com/pmezard/go-difflib";
+    fetch = {
+      type = "git";
+      url = "https://github.com/pmezard/go-difflib";
+      rev =  "792786c7400a136282c1664665ae0a8db921c6c2";
+      sha256 = "0c1cn55m4rypmscgf0rrb88pn58j3ysvc2d0432dp3c6fqg6cnzw";
+    };
+  }
+  {
+    goPackagePath  = "github.com/spf13/afero";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/afero";
+      rev =  "9be650865eab0c12963d8753212f4f9c66cdcf12";
+      sha256 = "12dhh6d07304lsjv7c4p95hkip0hnshqhwivdw39pbypgg0p8y34";
+    };
+  }
+  {
+    goPackagePath  = "github.com/spf13/cast";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/cast";
+      rev =  "acbeb36b902d72a7a4c18e8f3241075e7ab763e4";
+      sha256 = "0w25s6gjbbwv47b9208hysyqqphd6pib3d2phg24mjy4wigkm050";
+    };
+  }
+  {
+    goPackagePath  = "github.com/spf13/cobra";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/cobra";
+      rev =  "b26b538f693051ac6518e65672de3144ce3fbedc";
+      sha256 = "0pm3qlw35xygz9zz7hizlmin76wrfac8vsxvsd9i0zpnijbkmjv6";
+    };
+  }
+  {
+    goPackagePath  = "github.com/spf13/jwalterweatherman";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/jwalterweatherman";
+      rev =  "0efa5202c04663c757d84f90f5219c1250baf94f";
+      sha256 = "1sfd72zvw9lrzfc8haswhqf93bzm20q4yhbynm6n5fnnc56zn4gs";
+    };
+  }
+  {
+    goPackagePath  = "github.com/spf13/pflag";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/pflag";
+      rev =  "e57e3eeb33f795204c1ca35f56c44f83227c6e66";
+      sha256 = "13mhx4i913jil32j295m3a36jzvq1y64xig0naadiz7q9ja011r2";
+    };
+  }
+  {
+    goPackagePath  = "github.com/spf13/viper";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/viper";
+      rev =  "15738813a09db5c8e5b60a19d67d3f9bd38da3a4";
+      sha256 = "1mjfzg8zvnxckaq6l8gw99i2msrfqn9yr04dc3b7kd5bpxi6zr4v";
+    };
+  }
+  {
+    goPackagePath  = "github.com/stretchr/testify";
+    fetch = {
+      type = "git";
+      url = "https://github.com/stretchr/testify";
+      rev =  "69483b4bd14f5845b5a1e55bca19e954e827f1d0";
+      sha256 = "11lzrwkdzdd8yyag92akncc008h2f9d1bpc489mxiwp0jrmz4ivb";
+    };
+  }
+  {
+    goPackagePath  = "golang.org/x/net";
+    fetch = {
+      type = "git";
+      url = "https://go.googlesource.com/net";
+      rev =  "f5079bd7f6f74e23c4d65efa0f4ce14cbd6a3c0f";
+      sha256 = "0sck2mq4bwyh5iv51jpbywzwhc47ci1q5yd7pqr68xnsz7b3b55k";
+    };
+  }
+  {
+    goPackagePath  = "golang.org/x/sys";
+    fetch = {
+      type = "git";
+      url = "https://go.googlesource.com/sys";
+      rev =  "d8f5ea21b9295e315e612b4bcf4bedea93454d4d";
+      sha256 = "1gy2y20glqqqcmmrcx2wrvk4h74h8im1nxvzi91i1mxjk7p185mv";
+    };
+  }
+  {
+    goPackagePath  = "golang.org/x/text";
+    fetch = {
+      type = "git";
+      url = "https://go.googlesource.com/text";
+      rev =  "3bd178b88a8180be2df394a1fbb81313916f0e7b";
+      sha256 = "137pp3gz8ll08q0q434dn6472bbkv81h72qqqm9idhf7cc6f51w9";
+    };
+  }
+  {
+    goPackagePath  = "gopkg.in/yaml.v2";
+    fetch = {
+      type = "git";
+      url = "https://github.com/go-yaml/yaml";
+      rev =  "25c4ec802a7d637f88d584ab26798e94ad14c13b";
+      sha256 = "053mknsl3xhjscmd552005xnwbfcg0z2iphvbvj3wi0w3pvmlw44";
+    };
+  }
+]
\ No newline at end of file
diff --git a/nixpkgs/pkgs/applications/misc/extract_url/default.nix b/nixpkgs/pkgs/applications/misc/extract_url/default.nix
new file mode 100644
index 000000000000..2b7888c9cd04
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/extract_url/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, lib, fetchFromGitHub, makeWrapper, perlPackages
+, cursesSupport ? true
+, uriFindSupport ? true
+}:
+
+let
+  perlDeps =
+    [ perlPackages.MIMEtools perlPackages.HTMLParser ]
+    ++ lib.optional cursesSupport perlPackages.CursesUI
+    ++ lib.optional uriFindSupport perlPackages.URIFind;
+
+in stdenv.mkDerivation rec {
+  name = "extract_url-${version}";
+  version = "1.6.2";
+
+  src = fetchFromGitHub {
+    owner = "m3m0ryh0l3";
+    repo = "extracturl";
+    rev = "v${version}";
+    sha256 = "05589lp15jmcpbj4y9a3hmf6n2gsqrm4ybcyh3hd4j6pc7hmnhny";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ perlPackages.perl ] ++ perlDeps;
+
+  makeFlags = [ "prefix=$(out)" ];
+  installFlags = [ "INSTALL=install" ];
+
+  postFixup = ''
+    wrapProgram "$out/bin/extract_url" \
+      --set PERL5LIB "${perlPackages.makeFullPerlPath perlDeps}"
+  '';
+
+  meta = with lib; {
+    homepage = https://www.memoryhole.net/~kyle/extract_url/;
+    description = "Extracts URLs from MIME messages or plain text";
+    license = licenses.bsd2;
+    maintainers = [ maintainers.qyliss ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/far2l/default.nix b/nixpkgs/pkgs/applications/misc/far2l/default.nix
new file mode 100644
index 000000000000..51e9c4371b5b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/far2l/default.nix
@@ -0,0 +1,85 @@
+{ stdenv, fetchFromGitHub, fetchpatch, makeWrapper, cmake, pkgconfig, wxGTK30, glib, pcre, m4, bash,
+  xdg_utils, gvfs, zip, unzip, gzip, bzip2, gnutar, p7zip, xz, imagemagick, darwin }:
+
+with stdenv.lib;
+stdenv.mkDerivation rec {
+  build = "unstable-2018-07-19.git${builtins.substring 0 7 src.rev}";
+  name = "far2l-2.1.${build}";
+
+  src = fetchFromGitHub {
+    owner = "elfmz";
+    repo = "far2l";
+    rev = "dceaa3918ea2c5e43600bad3fc63f861b8d26fc4";
+    sha256 = "1ssd3hwz4b7vl4r858d9whl61cn23pgcamcjmvfa6ysf4x2b7sgi";
+  };
+
+  nativeBuildInputs = [ cmake pkgconfig m4 makeWrapper imagemagick ];
+
+  buildInputs = [ wxGTK30 glib pcre ]
+    ++ optional stdenv.isDarwin darwin.apple_sdk.frameworks.Cocoa;
+
+  postPatch = optionalString stdenv.isLinux ''
+    substituteInPlace far2l/bootstrap/trash.sh \
+      --replace 'gvfs-trash'  '${gvfs}/bin/gvfs-trash'
+  '' + optionalString stdenv.isDarwin ''
+    substituteInPlace far2l/CMakeLists.txt \
+      --replace "-framework System" -lSystem
+  '' + ''
+    echo 'echo ${build}' > far2l/bootstrap/scripts/vbuild.sh
+    substituteInPlace far2l/bootstrap/open.sh              \
+      --replace 'xdg-open'    '${xdg_utils}/bin/xdg-open'
+    substituteInPlace far2l/vtcompletor.cpp                \
+      --replace '"/bin/bash"' '"${bash}/bin/bash"'
+    substituteInPlace multiarc/src/formats/zip/zip.cpp     \
+      --replace '"unzip '     '"${unzip}/bin/unzip '       \
+      --replace '"zip '       '"${zip}/bin/zip '
+    substituteInPlace multiarc/src/formats/7z/7z.cpp       \
+      --replace '"^7z '       '"^${p7zip}/lib/p7zip/7z '   \
+      --replace '"7z '        '"${p7zip}/lib/p7zip/7z '
+    substituteInPlace multiarc/src/formats/targz/targz.cpp \
+      --replace '"xz '        '"${xz}/bin/xz '             \
+      --replace '"gzip '      '"${gzip}/bin/gzip '         \
+      --replace '"bzip2 '     '"${bzip2}/bin/bzip2 '       \
+      --replace '"tar '       '"${gnutar}/bin/tar '
+
+    ( cd colorer/configs/base
+      patch -p2 <  ${ fetchpatch {
+                        name   = "nix-language-highlighting.patch";
+                        url    = https://github.com/colorer/Colorer-schemes/commit/64bd06de0a63224b431cd8fc42cd9fa84b8ba7c0.patch;
+                        sha256 = "1mrj1wyxmk7sll9j1jzw6miwi0sfavf654klms24wngnh6hadsch";
+                      }
+                    }
+    )
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/applications $out/share/icons/hicolor/scalable/apps
+    cp -dpR install $out/share/far2l
+    mv $out/share/far2l/far2l $out/bin/
+    ln -s -r --force $out/bin/far2l $out/share/far2l/far2l_askpass
+    ln -s -r --force $out/bin/far2l $out/share/far2l/far2l_sudoapp
+
+    sed "s,/usr/bin/,$out/bin/," ../far2l/DE/far2l.desktop > $out/share/applications/far2l.desktop
+
+    cp ../far2l/DE/icons/hicolor/1024x1024/apps/far2l.svg $out/share/icons/hicolor/scalable/apps/
+    convert -size 128x128 ../far2l/DE/icons/far2l.svg $out/share/icons/far2l.png
+    for size in 16x16 24x24 32x32 48x48 64x64 72x72 96x96 128x128 192x192 256x256 512x512 1024x1024; do
+      mkdir -p $out/share/icons/hicolor/$size/apps
+      convert -size $size ../far2l/DE/icons/hicolor/$size/apps/far2l.svg $out/share/icons/hicolor/$size/apps/far2l.png
+    done
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    wrapProgram $out/bin/far2l --argv0 $out/bin/far2l
+  '';
+
+  stripDebugList = "bin share";
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "An orthodox file manager";
+    homepage = https://github.com/elfmz/far2l;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.volth ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/fbreader/default.nix b/nixpkgs/pkgs/applications/misc/fbreader/default.nix
new file mode 100644
index 000000000000..e7d0e6a63a59
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/fbreader/default.nix
@@ -0,0 +1,75 @@
+{ stdenv, fetchFromGitHub, fetchpatch, pkgconfig
+, bzip2, curl, expat, fribidi, libunibreak, sqlite, zlib
+, uiTarget ? if !stdenv.isDarwin then "desktop" else "macosx"
+, uiType ? if !stdenv.isDarwin then "qt4" else "cocoa"
+, qt4, gtk2
+, AppKit, Cocoa
+}:
+
+with stdenv.lib;
+
+assert elem uiTarget [ "desktop" "macosx" ];
+assert elem uiType [ "qt4" "gtk" "cocoa" ];
+assert uiTarget == "macosx" -> uiType == "cocoa";
+
+# Note: "qt" uiType option mentioned in ${src}/README.build is qt3,
+# which is way to old and no longer in nixpkgs.
+
+stdenv.mkDerivation {
+  name = "fbreader-${uiType}-0.99.6";
+
+  src = fetchFromGitHub {
+    owner = "geometer";
+    repo = "FBReader";
+    rev = "9e608db14372ae580beae4976eec7241fa069e75";
+    sha256 = "0lzafk02mv0cf2l2a61q5y4743zi913byik4bw1ix0gr1drnsa7y";
+  };
+
+  patches = [
+    ./typecheck.patch
+    (fetchpatch {
+      name = "curl-7_62.diff"; # see https://github.com/geometer/FBReader/pull/311
+      url = "https://github.com/geometer/FBReader/commit/b7c78e965d06f780.diff";
+      sha256 = "1dgnx9wps7hcf8fkidc7037vcf92fr3ccnjx7bgxm9x02j0hngjg";
+    })
+  ];
+
+  postPatch = ''
+    cat << EOF > makefiles/target.mk
+    TARGET_ARCH = ${uiTarget}
+    TARGET_STATUS = release
+    UI_TYPE = ${uiType}
+    EOF
+
+    substituteInPlace makefiles/arch/desktop.mk \
+      --replace ccache "" \
+      --replace moc-qt4 moc
+
+    # libunibreak supersedes liblinebreak
+    substituteInPlace zlibrary/text/Makefile \
+      --replace -llinebreak -lunibreak
+  '';
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  buildInputs = [
+    bzip2 curl expat fribidi libunibreak sqlite zlib
+  ]
+  ++ optional (uiType == "qt4") qt4
+  ++ optional (uiType == "gtk") gtk2
+  ++ optionals (uiType == "cocoa") [ AppKit Cocoa ];
+
+  makeFlags = "INSTALLDIR=$(out)";
+
+  NIX_CFLAGS_COMPILE = [ "-Wno-error=narrowing" ]; # since gcc-6
+
+  meta = with stdenv.lib; {
+    description = "An e-book reader for Linux";
+    homepage = http://www.fbreader.org/;
+    license = licenses.gpl3;
+    broken = stdenv.isDarwin  # untested, might work
+          || uiType == "gtk"; # builds, but the result is unusable, hangs a lot
+    platforms = platforms.unix;
+    maintainers = [ maintainers.coroa ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/fbreader/typecheck.patch b/nixpkgs/pkgs/applications/misc/fbreader/typecheck.patch
new file mode 100644
index 000000000000..cbac290e69c2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/fbreader/typecheck.patch
@@ -0,0 +1,11 @@
+diff --git a/fbreader/src/database/booksdb/BooksDB.cpp b/fbreader/src/database/booksdb/BooksDB.cpp
+index e33a22e76..1b6092800 100644
+--- a/fbreader/src/database/booksdb/BooksDB.cpp
++++ b/fbreader/src/database/booksdb/BooksDB.cpp
+@@ -146,5 +146,5 @@ shared_ptr<Book> BooksDB::loadBook(const std::string &fileName) {
+ 	myFindFileId->setFileName(fileName);
+ 	if (!myFindFileId->run()) {
+-		return false;
++		return 0;
+ 	}
+ 	((DBIntValue&)*myLoadBook->parameter("@file_id").value()) = myFindFileId->fileId();
diff --git a/nixpkgs/pkgs/applications/misc/fehlstart/default.nix b/nixpkgs/pkgs/applications/misc/fehlstart/default.nix
new file mode 100644
index 000000000000..db78f2ec9204
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/fehlstart/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, pkgconfig, gtk2, keybinder, fetchFromGitLab }:
+
+stdenv.mkDerivation {
+  name = "fehlstart-9f4342d7";
+
+  src = fetchFromGitLab {
+    owner = "fehlstart";
+    repo = "fehlstart";
+    rev = "9f4342d75ec5e2a46c13c99c34894bc275798441";
+    sha256 = "1rfzh7w6n2s9waprv7m1bhvqrk36a77ada7w655pqiwkhdj5q95i";
+  };
+
+  patches = [ ./use-nix-profiles.patch ];
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ gtk2 keybinder ];
+
+  preConfigure = ''
+    export PREFIX=$out
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Small desktop application launcher with reasonable memory footprint";
+    homepage = https://gitlab.com/fehlstart/fehlstart;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.mounium ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/fehlstart/use-nix-profiles.patch b/nixpkgs/pkgs/applications/misc/fehlstart/use-nix-profiles.patch
new file mode 100644
index 000000000000..0c06e53f9814
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/fehlstart/use-nix-profiles.patch
@@ -0,0 +1,21 @@
+--- fehlstart-9f4342d75ec5e2a46c13c99c34894bc275798441-src/fehlstart.c	1970-01-01 01:00:01.000000000 +0100
++++ fehlstart.c	2016-08-10 12:21:11.231638418 +0200
+@@ -779,8 +779,15 @@
+     read_settings(setting_file, &settings);
+     update_commands();
+     g_hash_table_foreach(action_map, update_launcher, NULL);
+-    add_launchers(STR_S(APPLICATIONS_DIR_0));
+-    add_launchers(STR_S(APPLICATIONS_DIR_1));
+-    add_launchers(STR_S(USER_APPLICATIONS_DIR));
++    const char* nixprofiles = getenv("NIX_PROFILES");
++    if(nixprofiles != NULL) {
++      const char* pch = strtok(nixprofiles, " ");
++      while (pch != NULL)
++      {
++          String nix_dir = str_concat((String) { pch, strlen(pch), false },STR_S("/share/applications"));
++          add_launchers(nix_dir);
++          pch = strtok(NULL, " ");
++      }
++    }
+     return NULL;
+ }
diff --git a/nixpkgs/pkgs/applications/misc/fetchmail/default.nix b/nixpkgs/pkgs/applications/misc/fetchmail/default.nix
new file mode 100644
index 000000000000..e9d194666094
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/fetchmail/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, openssl }:
+
+let
+  version = "6.3.26";
+in
+stdenv.mkDerivation {
+  name="fetchmail-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/fetchmail.berlios/fetchmail-${version}.tar.bz2";
+    sha256 = "08rafrs1dlr11myr0p99kg4k80qyy0fa63gg3ac88zn49174lwhw";
+  };
+
+  buildInputs = [ openssl ];
+
+  configureFlags = [ "--with-ssl=${openssl.dev}" ];
+
+  meta = {
+    homepage = http://www.fetchmail.info/;
+    description = "A full-featured remote-mail retrieval and forwarding utility";
+    longDescription = ''
+      A full-featured, robust, well-documented remote-mail retrieval and
+      forwarding utility intended to be used over on-demand TCP/IP links
+      (such as SLIP or PPP connections). It supports every remote-mail
+      protocol now in use on the Internet: POP2, POP3, RPOP, APOP, KPOP,
+      all flavors of IMAP, ETRN, and ODMR. It can even support IPv6 and
+      IPSEC.
+    '';
+
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.peti ];
+    license = stdenv.lib.licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/fff/default.nix b/nixpkgs/pkgs/applications/misc/fff/default.nix
new file mode 100644
index 000000000000..e87c86f1b4b3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/fff/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, makeWrapper, bashInteractive, xdg_utils, file, coreutils, w3m, xdotool }:
+
+stdenv.mkDerivation rec {
+  pname = "fff";
+  version = "2.1";
+
+  src = fetchFromGitHub {
+    owner = "dylanaraps";
+    repo = pname;
+    rev = version;
+    sha256 = "0s5gi5ghwax5gc886pvbpcmsbmzhxzywajwzjsdxwjyd1v1iynwh";
+  };
+
+  pathAdd = stdenv.lib.makeSearchPath "bin" ([ xdg_utils file coreutils w3m xdotool ]);
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ bashInteractive ];
+  dontBuild = true;
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  postInstall = ''
+    wrapProgram "$out/bin/fff" --prefix PATH : $pathAdd
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Fucking Fast File-Manager";
+    homepage = https://github.com/dylanaraps/fff;
+    license = licenses.mit;
+    maintainers = [ maintainers.tadeokondrak ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/filet/default.nix b/nixpkgs/pkgs/applications/misc/filet/default.nix
new file mode 100644
index 000000000000..edee9ab33e9e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/filet/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "filet";
+  version = "0.1.3";
+
+  src = fetchFromGitHub {
+    owner = "buffet";
+    repo = "filet";
+    rev = version;
+    sha256 = "0hm7589ih30axafqxhhs4fg1pvfhlqzyzzmfi2ilx8haq5111fsf";
+  };
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = with stdenv.lib; {
+    description = "A fucking fucking fast file fucker (afffff)";
+    homepage = https://github.com/buffet/filet;
+    license = licenses.mpl20;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ buffet ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/flamerobin/default.nix b/nixpkgs/pkgs/applications/misc/flamerobin/default.nix
new file mode 100644
index 000000000000..f70042884a8a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/flamerobin/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, wxGTK30, boost, firebird }:
+
+stdenv.mkDerivation rec {
+  version = "0.9.3.1";
+  name = "flamerobin-${version}";
+
+  src = fetchFromGitHub {
+    owner = "mariuz";
+    repo = "flamerobin";
+    rev = version;
+    sha256 = "1wwcsca01hpgi9z5flvbdhs9zv7jvahnbn97j6ymy0hdyb8lv6si";
+  };
+
+  enableParallelBuilding = true;
+
+  buildInputs = [ wxGTK30 boost firebird ];
+
+  preBuild = ''
+    sed -i 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -nostartfiles/' Makefile
+  '';
+
+  configureFlags = [
+    "--disable-debug"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Database administration tool for Firebird RDBMS";
+    homepage = https://github.com/mariuz/flamerobin;
+    license = licenses.bsdOriginal;
+    maintainers = with maintainers; [ uralbash ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/fme/default.nix b/nixpkgs/pkgs/applications/misc/fme/default.nix
new file mode 100644
index 000000000000..4e786bfb36f8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/fme/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, pkgconfig, autoconf, automake, gettext
+, fluxbox, bc, gtkmm2, glibmm, libglademm, libsigcxx }:
+
+stdenv.mkDerivation rec{
+
+  name = "fme-${version}";
+  version = "1.1.3";
+  
+  src = fetchurl {
+    url = "https://github.com/rdehouss/fme/archive/v${version}.tar.gz";
+    sha256 = "d1c81a6a38c0faad02943ad65d6d0314bd205c6de841669a2efe43e4c503e63d";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ autoconf automake gettext fluxbox bc gtkmm2 glibmm libglademm libsigcxx ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Editor for Fluxbox menus";
+    longDescription = ''
+      Fluxbox Menu Editor is a menu editor for the Window Manager Fluxbox written in C++
+      with the libraries Gtkmm, Glibmm, libglademm and gettext for internationalization.
+      Its user-friendly interface will help you to edit, delete, move (Drag and Drop)
+      a row, a submenu, etc very easily.
+    '';
+    homepage = https://github.com/rdehouss/fme/;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/font-manager/default.nix b/nixpkgs/pkgs/applications/misc/font-manager/default.nix
new file mode 100644
index 000000000000..f0da4e883517
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/font-manager/default.nix
@@ -0,0 +1,67 @@
+{ stdenv, fetchFromGitHub, meson, ninja, gettext, python3,
+  pkgconfig, libxml2, json-glib , sqlite, itstool, librsvg,
+  vala, gtk3, gnome3, desktop-file-utils, wrapGAppsHook, gobject-introspection
+}:
+
+stdenv.mkDerivation rec {
+  pname = "font-manager";
+  version = "0.7.5";
+
+  src = fetchFromGitHub {
+    owner = "FontManager";
+    repo = "master";
+    rev = version;
+    sha256 = "16hma8rrkam6ngn5vbdaryn31vdixvii6920g9z928gylz9xkd3g";
+  };
+
+  nativeBuildInputs = [
+    pkgconfig
+    meson
+    ninja
+    gettext
+    python3
+    itstool
+    desktop-file-utils
+    vala
+    gnome3.yelp-tools
+    wrapGAppsHook
+    # For https://github.com/FontManager/master/blob/master/lib/unicode/meson.build
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    libxml2
+    json-glib
+    sqlite
+    librsvg
+    gtk3
+    gnome3.adwaita-icon-theme
+  ];
+
+  mesonFlags = [
+    "-Ddisable_pycompile=true"
+  ];
+
+  postPatch = ''
+    chmod +x meson_post_install.py
+    patchShebangs meson_post_install.py
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://fontmanager.github.io/;
+    description = "Simple font management for GTK+ desktop environments";
+    longDescription = ''
+      Font Manager is intended to provide a way for average users to
+      easily manage desktop fonts, without having to resort to command
+      line tools or editing configuration files by hand. While designed
+      primarily with the Gnome Desktop Environment in mind, it should
+      work well with other Gtk+ desktop environments.
+
+      Font Manager is NOT a professional-grade font management solution.
+    '';
+    license = licenses.gpl3;
+    repositories.git = https://github.com/FontManager/master;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/freemind/default.nix b/nixpkgs/pkgs/applications/misc/freemind/default.nix
new file mode 100644
index 000000000000..5152c8aa3f7c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/freemind/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, jdk, jre, ant }:
+
+stdenv.mkDerivation rec {
+  name = "freemind-${version}";
+  version = "1.0.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/freemind/freemind-src-${version}.tar.gz";
+    sha256 = "06c6pm7hpwh9hbmyah3lj2wp1g957x8znfwc5cwygsi7dc98b0h1";
+  };
+
+  buildInputs = [ jdk ant ];
+
+  preConfigure = ''
+    chmod +x check_for_duplicate_resources.sh
+    sed 's,/bin/bash,${stdenv.shell},' -i check_for_duplicate_resources.sh
+
+    ## work around javac encoding errors
+    export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
+  '';
+
+  buildPhase = "ant dist";
+
+  installPhase = ''
+    mkdir -p $out/{bin,nix-support}
+    cp -r ../bin/dist $out/nix-support
+    sed -i 's/which/type -p/' $out/nix-support/dist/freemind.sh
+
+    cat >$out/bin/freemind <<EOF
+    #! ${stdenv.shell}
+    JAVA_HOME=${jre} $out/nix-support/dist/freemind.sh
+    EOF
+    chmod +x $out/{bin/freemind,nix-support/dist/freemind.sh}
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Mind-mapping software";
+    homepage = http://freemind.sourceforge.net/wiki/index.php/Main_Page;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/fsv/default.nix b/nixpkgs/pkgs/applications/misc/fsv/default.nix
new file mode 100644
index 000000000000..00e11858fb41
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/fsv/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchurl, fetchFromGitHub, autoreconfHook
+, libtool, pkgconfig, gtk2, libGLU, file
+}:
+
+let
+  gtkglarea = stdenv.mkDerivation rec {
+    pname    = "gtkglarea";
+    version = "2.1.0";
+    src = fetchurl {
+      url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+      sha256 = "1pl2vdj6l64j864ilhkq1bcggb3hrlxjwk5m029i7xfjfxc587lf";
+    };
+    nativeBuildInputs = [ pkgconfig ];
+    buildInputs       = [ gtk2 libGLU ];
+    hardeningDisable  = [ "format" ];
+  };
+
+in stdenv.mkDerivation rec {
+  pname   = "fsv";
+  version = "0.9-1";
+
+  src = fetchFromGitHub {
+    owner  = "mcuelenaere"; 
+    repo   = "fsv";
+    rev    = "${pname}-${version}";
+    sha256 = "0n09jd7yqj18mx6zqbg7kab4idg5llr15g6avafj74fpg1h7iimj";
+  };
+
+  nativeBuildInputs = [ autoreconfHook libtool pkgconfig ];
+  buildInputs       = [ file gtk2 libGLU gtkglarea ];
+
+  meta = with stdenv.lib; {
+    description     = "fsv is a file system visualizer in cyberspace";
+    longDescription = ''
+      fsv (pronounced eff-ess-vee) is a file system visualizer in cyberspace.
+      It lays out files and directories in three dimensions, geometrically
+      representing the file system hierarchy to allow visual overview
+      and analysis. fsv can visualize a modest home directory, a workstation's
+      hard drive, or any arbitrarily large collection of files, limited only
+      by the host computer's memory and graphics hardware.
+    '';
+    homepage    = https://github.com/mcuelenaere/fsv;
+    license     = licenses.lgpl2;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ rnhmjoj ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gImageReader/default.nix b/nixpkgs/pkgs/applications/misc/gImageReader/default.nix
new file mode 100644
index 000000000000..062bca5b215e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gImageReader/default.nix
@@ -0,0 +1,70 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, libuuid
+, sane-backends, podofo, libjpeg, djvulibre, libxmlxx3, libzip, tesseract
+, intltool, poppler, json-glib
+, ninja
+, python3
+
+# Gtk deps
+# upstream gImagereader supports Qt too
+, gobject-introspection, wrapGAppsHook
+, gtkmm3, gtksourceview3, gtksourceviewmm, gtkspell3, gtkspellmm, cairomm
+}:
+
+let
+  variant = "gtk";
+  pythonEnv = python3.withPackages( ps: with ps;[ pygobject3 ] );
+in
+stdenv.mkDerivation rec {
+  name = "gImageReader-${version}";
+  version = "3.3.0";
+
+  src = fetchFromGitHub {
+    owner= "manisandro";
+    repo = "gImageReader";
+    rev = "v${version}";
+    sha256 = "0pjk4kr7bc5q4hi1xf7na2zln9fyqdazgzq62r3bg41nzy7fakcz";
+  };
+
+  nativeBuildInputs = [
+    cmake ninja
+    intltool
+    pkgconfig
+    pythonEnv
+
+    # Gtk specific
+    wrapGAppsHook
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    libxmlxx3
+    libzip
+    libuuid
+    sane-backends
+    podofo
+    libjpeg
+    djvulibre
+    tesseract
+    poppler
+
+    # Gtk specific
+    gtkmm3
+    gtkspell3
+    gtkspellmm
+    gtksourceview3
+    gtksourceviewmm
+    cairomm
+    json-glib
+  ];
+
+  # interface type can be where <type> is either gtk, qt5, qt4
+  cmakeFlags = [ "-DINTERFACE_TYPE=${variant}" ];
+
+  meta = with stdenv.lib; {
+    description = "A simple Gtk/Qt front-end to tesseract-ocr";
+    homepage = https://github.com/manisandro/gImageReader;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [teto];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/galculator/default.nix b/nixpkgs/pkgs/applications/misc/galculator/default.nix
new file mode 100644
index 000000000000..44071b328758
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/galculator/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub
+, autoreconfHook, intltool
+, gtk, pkgconfig, flex }:
+
+stdenv.mkDerivation rec {
+  name = "galculator-${version}";
+  version = "2.1.4";
+
+  src = fetchFromGitHub {
+    owner = "galculator";
+    repo = "galculator";
+    rev = "v${version}";
+    sha256 = "0q0hb62f266709ncyq96bpx4a40a1i6dc5869byvd7x285sx1c2w";
+  };
+
+  nativeBuildInputs = [ autoreconfHook intltool pkgconfig ];
+  buildInputs = [ gtk flex ];
+
+  meta = with stdenv.lib; {
+    description = "A GTK 2/3 algebraic and RPN calculator";
+    longDescription = ''
+      galculator is a GTK 2 / GTK 3 based calculator. Its main features include:
+
+      - Algebraic, RPN (Reverse Polish Notation), Formula Entry and Paper modes;
+      - Basic and Scientific Modes
+      - Decimal, hexadecimal, octal and binary number base
+      - Radiant, degree and grad support
+      - User defined constants and functions
+      - A bunch of common functions
+      - Binary arithmetic of configurable bit length and signedness
+      - Quad-precision floating point arithmetic, and 112-bit binary arithmetic
+    '';
+    homepage = http://galculator.sourceforge.net/;
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gallery-dl/default.nix b/nixpkgs/pkgs/applications/misc/gallery-dl/default.nix
new file mode 100644
index 000000000000..cb04be4b6ea9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gallery-dl/default.nix
@@ -0,0 +1,21 @@
+{ lib, python3Packages }:
+
+python3Packages.buildPythonApplication rec {
+  pname = "gallery_dl";
+  version = "1.8.6";
+
+  src = python3Packages.fetchPypi {
+    inherit pname version;
+    sha256 = "0in47v6c82a6mqg4wzxrji7wd8a9qh5386rsr77s3a8613am1n2x";
+  };
+
+  doCheck = false;
+  propagatedBuildInputs = with python3Packages; [ requests ];
+
+  meta = {
+    description = "Command-line program to download image-galleries and -collections from several image hosting sites";
+    homepage = https://github.com/mikf/gallery-dl;
+    license = lib.licenses.gpl2;
+    maintainers = with lib.maintainers; [ dawidsowa ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gammu/bashcomp-dir.patch b/nixpkgs/pkgs/applications/misc/gammu/bashcomp-dir.patch
new file mode 100644
index 000000000000..d41aa432cf35
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gammu/bashcomp-dir.patch
@@ -0,0 +1,11 @@
+--- a/contrib/CMakeLists.txt
++++ b/contrib/CMakeLists.txt
+@@ -85,7 +85,7 @@ endif (INSTALL_PHP_EXAMPLES)
+ if (INSTALL_BASH_COMPLETION)
+     macro_optional_find_package (BashCompletion)
+     if (NOT BASH_COMPLETION_FOUND)
+-      set (BASH_COMPLETION_COMPLETIONSDIR "/etc/bash_completion.d" CACHE PATH "Location of bash_completion.d")
++      set (BASH_COMPLETION_COMPLETIONSDIR "${CMAKE_INSTALL_PREFIX}/etc/bash_completion.d" CACHE PATH "Location of bash_completion.d")
+     endif (NOT BASH_COMPLETION_FOUND)
+     install (
+         FILES bash-completion/gammu
diff --git a/nixpkgs/pkgs/applications/misc/gammu/default.nix b/nixpkgs/pkgs/applications/misc/gammu/default.nix
new file mode 100644
index 000000000000..739df59b31c5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gammu/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchFromGitHub, python, pkgconfig, cmake, bluez, libusb1, curl
+, libiconv, gettext, sqlite
+, dbiSupport ? false, libdbi ? null, libdbiDrivers ? null
+, postgresSupport ? false, postgresql ? null
+}:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "gammu-${version}";
+  version = "1.40.0";
+
+  src = fetchFromGitHub {
+    owner = "gammu";
+    repo = "gammu";
+    rev = version;
+    sha256 = "1jjaa9r3x6i8gv3yn1ngg815s6gsxblsw4wb5ddm77kamn2qyvpf";
+  };
+
+  patches = [ ./bashcomp-dir.patch ./systemd.patch ];
+
+  nativeBuildInputs = [ pkgconfig cmake ];
+
+  buildInputs = [ python bluez libusb1 curl gettext sqlite libiconv ]
+  ++ optionals dbiSupport [ libdbi libdbiDrivers ]
+  ++ optionals postgresSupport [ postgresql ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = https://wammu.eu/gammu/;
+    description = "Command line utility and library to control mobile phones";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.coroa ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gammu/systemd.patch b/nixpkgs/pkgs/applications/misc/gammu/systemd.patch
new file mode 100644
index 000000000000..22b49a5a2ffe
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gammu/systemd.patch
@@ -0,0 +1,30 @@
+diff --git a/cmake/templates/gammu.spec.in b/cmake/templates/gammu.spec.in
+index 8302353..e3ca59a 100644
+--- a/cmake/templates/gammu.spec.in
++++ b/cmake/templates/gammu.spec.in
+@@ -387,9 +387,9 @@ fi
+ %doc %{_mandir}/man7/gammu-smsd-run.7*
+ %doc %{_mandir}/man7/gammu-smsd-sql.7*
+ %doc %{_mandir}/man7/gammu-smsd-tables.7*
+-%dir %{_libexecdir}/systemd
+-%dir %{_libexecdir}/systemd/system
+-%{_libexecdir}/systemd/system/gammu-smsd.service
++%dir %{_prefix}/systemd
++%dir %{_prefix}/systemd/system
++%{_prefix}/systemd/system/gammu-smsd.service
+ 
+ %files -n libGammu%{so_ver} -f libgammu.lang
+ %defattr(-,root,root,-)
+diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt
+index 78cc7fc..d674c36 100644
+--- a/contrib/CMakeLists.txt
++++ b/contrib/CMakeLists.txt
+@@ -97,7 +97,7 @@ endif (INSTALL_BASH_COMPLETION)
+ if (WITH_SYSTEMD)
+     install (
+         FILES init/gammu-smsd.service
+-        DESTINATION "${SYSTEMD_SERVICES_INSTALL_DIR}"
++        DESTINATION "${CMAKE_INSTALL_PREFIX}/systemd"
+         COMPONENT "systemd"
+     )
+ endif (WITH_SYSTEMD)
diff --git a/nixpkgs/pkgs/applications/misc/ganttproject-bin/default.nix b/nixpkgs/pkgs/applications/misc/ganttproject-bin/default.nix
new file mode 100644
index 000000000000..dd0a5c9a4f60
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ganttproject-bin/default.nix
@@ -0,0 +1,60 @@
+{ stdenv, fetchzip, makeDesktopItem, makeWrapper
+, jre
+}:
+
+stdenv.mkDerivation rec {
+  name = "ganttproject-bin-${version}";
+  version = "2.8.10";
+
+  src = let build = "r2364"; in fetchzip {
+    sha256 = "0cclgyqv4f9pjsdlh93cqvgbzrp8ajvrpc2xszs03sknqz2kdh7r";
+    url = "https://dl.ganttproject.biz/ganttproject-${version}/"
+        + "ganttproject-${version}-${build}.zip";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ jre ];
+
+  phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
+
+  installPhase = let
+
+    desktopItem = makeDesktopItem {
+      name = "ganttproject";
+      exec = "ganttproject";
+      icon = "ganttproject";
+      desktopName = "GanttProject";
+      genericName = "Shedule and manage projects";
+      comment = meta.description;
+      categories = "Office;Application;";
+    };
+
+    javaOptions = [
+      "-Dawt.useSystemAAFontSettings=on"
+    ];
+
+  in ''
+    mkdir -pv "$out/share/ganttproject"
+    cp -rv *  "$out/share/ganttproject"
+
+    mkdir -pv "$out/bin"
+    wrapProgram "$out/share/ganttproject/ganttproject" \
+      --set JAVA_HOME "${jre}" \
+      --set _JAVA_OPTIONS "${builtins.toString javaOptions}"
+
+    mv -v "$out/share/ganttproject/ganttproject" "$out/bin"
+
+    cp -rv "${desktopItem}/share/applications" "$out/share"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Project scheduling and management";
+    homepage = https://www.ganttproject.biz/;
+    downloadPage = https://www.ganttproject.biz/download;
+    # GanttProject itself is GPL3+. All bundled libraries are declared
+    # ‘GPL3-compatible’. See ${downloadPage} for detailed information.
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.vidbina ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/garmin-plugin/default.nix b/nixpkgs/pkgs/applications/misc/garmin-plugin/default.nix
new file mode 100644
index 000000000000..b97b079ab663
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/garmin-plugin/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, garmintools, libgcrypt, libusb, pkgconfig, tinyxml, zlib }:
+stdenv.mkDerivation {
+  name = "garmin-plugin-0.3.26";
+  src = fetchurl {
+    url = https://github.com/adiesner/GarminPlugin/archive/V0.3.26.tar.gz;
+    sha256 = "15gads1fj4sj970m5960dgnhys41ksi4cm53ldkf67wn8dc9i4k0";
+  };
+  sourceRoot = "GarminPlugin-0.3.26/src";
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ garmintools libusb libgcrypt tinyxml zlib ];
+  configureFlags = [
+    "--with-libgcrypt-prefix=${libgcrypt.dev}"
+    "--with-garmintools-incdir=${garmintools}/include"
+    "--with-garmintools-libdir=${garmintools}/lib"
+  ];
+  installPhase = ''
+    mkdir -p $out/lib/mozilla/plugins
+    cp npGarminPlugin.so $out/lib/mozilla/plugins
+  '';
+  meta = {
+    homepage = http://www.andreas-diesner.de/garminplugin;
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = [ stdenv.lib.maintainers.ocharles ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gcal/default.nix b/nixpkgs/pkgs/applications/misc/gcal/default.nix
new file mode 100644
index 000000000000..a3aebf227339
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gcal/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, ncurses  }:
+
+stdenv.mkDerivation rec {
+  name = "gcal-${version}";
+  version = "4.1";
+
+  src = fetchurl {
+    url = "mirror://gnu/gcal/${name}.tar.xz";
+    sha256 = "1av11zkfirbixn05hyq4xvilin0ncddfjqzc4zd9pviyp506rdci";
+  };
+
+  enableParallelBuilding = true;
+
+  buildInputs = [ ncurses ];
+
+  meta = {
+    description = "Program for calculating and printing calendars";
+    longDescription = ''
+      Gcal is the GNU version of the trusty old cal(1). Gcal is a
+      program for calculating and printing calendars. Gcal displays
+      hybrid and proleptic Julian and Gregorian calendar sheets.  It
+      also displays holiday lists for many countries around the globe.
+    '';
+    homepage = https://www.gnu.org/software/gcal/;
+    license = stdenv.lib.licenses.gpl3Plus;
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gcalcli/default.nix b/nixpkgs/pkgs/applications/misc/gcalcli/default.nix
new file mode 100644
index 000000000000..6f380114a276
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gcalcli/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, lib, fetchFromGitHub, python3
+, libnotify ? null }:
+
+with python3.pkgs;
+
+buildPythonApplication rec {
+  pname = "gcalcli";
+  version = "4.1.1";
+
+  src = fetchFromGitHub {
+    owner  = "insanum";
+    repo   = pname;
+    rev    = "v${version}";
+    sha256 = "1qlmslywm4dfimggly4p0ckn2gj165mq1p0wkry9jpb3sg1m5fdf";
+  };
+
+  postPatch = lib.optionalString stdenv.isLinux ''
+    substituteInPlace gcalcli/argparsers.py \
+      --replace "'notify-send" "'${libnotify}/bin/notify-send"
+  '';
+
+  propagatedBuildInputs = [
+    dateutil gflags httplib2 parsedatetime six vobject
+    google_api_python_client oauth2client uritemplate
+    libnotify
+  ] ++ lib.optional (!isPy3k) futures;
+
+  # There are no tests as of 4.0.0a4
+  doCheck = false;
+
+  meta = with lib; {
+    description = "CLI for Google Calendar";
+    homepage = https://github.com/insanum/gcalcli;
+    license = licenses.mit;
+    maintainers = with maintainers; [ nocoolnametom ];
+    inherit version;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/get_iplayer/default.nix b/nixpkgs/pkgs/applications/misc/get_iplayer/default.nix
new file mode 100644
index 000000000000..baf2f5165d6d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/get_iplayer/default.nix
@@ -0,0 +1,38 @@
+{stdenv, fetchFromGitHub, atomicparsley, flvstreamer, ffmpeg, makeWrapper, perl, perlPackages, rtmpdump}:
+
+with stdenv.lib;
+
+perlPackages.buildPerlPackage rec {
+  pname = "get_iplayer";
+  version = "2.99";
+
+  src = fetchFromGitHub {
+    owner = "get-iplayer";
+    repo = "get_iplayer";
+    rev = "v${version}";
+    sha256 = "085bgwkjnaqp96gvd2s8qmkw69rz91si1sgzqdqbplkzj9bk2qii";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ perl ];
+  propagatedBuildInputs = with perlPackages; [HTMLParser HTTPCookies LWP XMLLibXML XMLSimple];
+
+  preConfigure = "touch Makefile.PL";
+  doCheck = false;
+  outputs = [ "out" "man" ];
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/man/man1
+    cp get_iplayer $out/bin
+    wrapProgram $out/bin/get_iplayer --suffix PATH : ${makeBinPath [ atomicparsley ffmpeg flvstreamer rtmpdump ]} --prefix PERL5LIB : $PERL5LIB
+    cp get_iplayer.1 $out/share/man/man1
+  '';
+
+  meta = {
+    description = "Downloads TV and radio from BBC iPlayer";
+    license = licenses.gpl3Plus;
+    homepage = https://squarepenguin.co.uk/;
+    platforms = platforms.all;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/getxbook/default.nix b/nixpkgs/pkgs/applications/misc/getxbook/default.nix
new file mode 100644
index 000000000000..a77f87f6f1f1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/getxbook/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, openssl }:
+
+stdenv.mkDerivation rec {
+  name    = "getxbook-${version}";
+  version = "1.2";
+
+  src = fetchurl {
+    url    = "https://njw.me.uk/getxbook/${name}.tar.xz";
+    sha256 = "0ihwrx4gspj8l7fc8vxch6dpjrw1lvv9z3c19f0wxnmnxhv1cjvs";
+  };
+
+  buildInputs = [ openssl ];
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = with stdenv.lib; {
+    description = "A collection of tools to download books from Google Books";
+    homepage    = https://njw.me.uk/getxbook/;
+    license     = licenses.isc;
+    maintainers = with maintainers; [ obadz ];
+    platforms   = platforms.all;
+    inherit version;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/girara/default.nix b/nixpkgs/pkgs/applications/misc/girara/default.nix
new file mode 100644
index 000000000000..4d990c69b4a3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/girara/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchurl, meson, ninja, pkgconfig, check, dbus, xvfb_run, glib, gtk, gettext, libiconv, json_c, libintl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "girara";
+  version = "0.3.2";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "https://pwmt.org/projects/girara/download/${pname}-${version}.tar.xz";
+    sha256 = "1kc6n1mxjxa7wvwnqy94qfg8l9jvx9qrvrr2kc7m4g0z20x3a00p";
+  };
+
+  nativeBuildInputs = [ meson ninja pkgconfig gettext check dbus xvfb_run ];
+  buildInputs = [ libintl libiconv json_c ];
+  propagatedBuildInputs = [ glib gtk ];
+
+  doCheck = true;
+
+  mesonFlags = [
+    "-Ddocs=disabled" # docs do not seem to be installed
+  ];
+
+  checkPhase = ''
+    export NO_AT_BRIDGE=1
+    xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
+      --config-file=${dbus.daemon}/share/dbus-1/session.conf \
+      meson test --print-errorlogs
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://pwmt.org/projects/girara/;
+    description = "User interface library";
+    longDescription = ''
+      girara is a library that implements a GTK+ based VIM-like user interface
+      that focuses on simplicity and minimalism.
+    '';
+    license = licenses.zlib;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gkrellm/default.nix b/nixpkgs/pkgs/applications/misc/gkrellm/default.nix
new file mode 100644
index 000000000000..b4fac899f66f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gkrellm/default.nix
@@ -0,0 +1,46 @@
+{ fetchurl, stdenv, gettext, pkgconfig, glib, gtk2, libX11, libSM, libICE, which
+, IOKit ? null }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "gkrellm-2.3.10";
+
+  src = fetchurl {
+    url = "http://gkrellm.srcbox.net/releases/${name}.tar.bz2";
+    sha256 = "0rnpzjr0ys0ypm078y63q4aplcgdr5nshjzhmz330n6dmnxci7lb";
+  };
+
+  nativeBuildInputs = [ pkgconfig which ];
+  buildInputs = [gettext glib gtk2 libX11 libSM libICE]
+    ++ optionals stdenv.isDarwin [ IOKit ];
+
+  hardeningDisable = [ "format" ];
+
+  # Makefiles are patched to fix references to `/usr/X11R6' and to add
+  # `-lX11' to make sure libX11's store path is in the RPATH.
+  patchPhase = ''
+    echo "patching makefiles..."
+    for i in Makefile src/Makefile server/Makefile
+    do
+      sed -i "$i" -e "s|/usr/X11R6|${libX11.dev}|g ; s|-lICE|-lX11 -lICE|g"
+    done
+  '';
+
+  makeFlags = [ "STRIP=-s" ];
+  installFlags = [ "DESTDIR=$(out)" ];
+
+  meta = {
+    description = "Themeable process stack of system monitors";
+    longDescription = ''
+      GKrellM is a single process stack of system monitors which
+      supports applying themes to match its appearance to your window
+      manager, Gtk, or any other theme.
+    '';
+
+    homepage = http://gkrellm.srcbox.net;
+    license = licenses.gpl3Plus;
+    maintainers = [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gksu/default.nix b/nixpkgs/pkgs/applications/misc/gksu/default.nix
new file mode 100644
index 000000000000..4af776674e63
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gksu/default.nix
@@ -0,0 +1,54 @@
+{ stdenv, fetchurl, pkgconfig, gtk2, gnome2, gnome3, libgksu,
+  intltool, libstartup_notification, gtk-doc, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  version = "2.0.2";
+  pname = "gksu";
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "http://people.debian.org/~kov/gksu/${name}.tar.gz";
+    sha256 = "0npfanlh28daapkg25q4fncxd89rjhvid5fwzjaw324x0g53vpm1";
+  };
+
+  nativeBuildInputs = [
+    pkgconfig intltool gtk-doc wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gtk2 gnome2.GConf libstartup_notification gnome3.libgnome-keyring
+  ];
+
+  propagatedBuildInputs = [
+    libgksu
+  ];
+
+  hardeningDisable = [ "format" ];
+
+  patches = [
+    # https://savannah.nongnu.org/bugs/index.php?36127
+    ./gksu-2.0.2-glib-2.31.patch
+  ];
+
+  postPatch = ''
+    sed -i -e 's|/usr/bin/x-terminal-emulator|-l gnome-terminal|g' gksu.desktop
+  '';
+
+  configureFlags = [ "--disable-nautilus-extension" ];
+
+  meta = {
+    description = "A graphical frontend for libgksu";
+    longDescription = ''
+      GKSu is a library that provides a Gtk+ frontend to su and sudo.
+      It supports login shells and preserving environment when acting as
+      a su frontend. It is useful to menu items or other graphical
+      programs that need to ask a user's password to run another program
+      as another user.
+    '';
+    homepage = https://www.nongnu.org/gksu/;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [ stdenv.lib.maintainers.romildo ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gksu/gksu-2.0.2-glib-2.31.patch b/nixpkgs/pkgs/applications/misc/gksu/gksu-2.0.2-glib-2.31.patch
new file mode 100644
index 000000000000..fd711a321acf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gksu/gksu-2.0.2-glib-2.31.patch
@@ -0,0 +1,29 @@
+From 10c7e67e11a56e2fe1acf9b085772bc995d35bc0 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Sat, 7 Apr 2012 17:57:36 -0400
+Subject: [PATCH] Fix glib includes for building with >=glib-2.31
+
+glib-2.31 and newer no longer allow most glib subheaders to be included
+directly.
+
+https://savannah.nongnu.org/bugs/index.php?36127
+---
+ nautilus-gksu/libnautilus-gksu.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/nautilus-gksu/libnautilus-gksu.c b/nautilus-gksu/libnautilus-gksu.c
+index 8e44d29..4acf3f8 100644
+--- a/nautilus-gksu/libnautilus-gksu.c
++++ b/nautilus-gksu/libnautilus-gksu.c
+@@ -5,7 +5,7 @@
+ #include <string.h>
+ #include <pthread.h>
+ 
+-#include <glib/gkeyfile.h>
++#include <glib.h>
+ #include <gtk/gtk.h>
+ #include <gio/gio.h>
+ #include <libnautilus-extension/nautilus-extension-types.h>
+-- 
+1.7.8.5
+
diff --git a/nixpkgs/pkgs/applications/misc/glava/default.nix b/nixpkgs/pkgs/applications/misc/glava/default.nix
new file mode 100644
index 000000000000..3831780c7919
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/glava/default.nix
@@ -0,0 +1,84 @@
+{ stdenv, writeScript, fetchFromGitHub
+, libGL, libX11, libXext, python3, libXrandr, libXrender, libpulseaudio, libXcomposite
+, enableGlfw ? false, glfw, runtimeShell }:
+
+let
+  inherit (stdenv.lib) optional makeLibraryPath;
+
+  wrapperScript = writeScript "glava" ''
+    #!${runtimeShell}
+    case "$1" in
+      --copy-config)
+        # The binary would symlink it, which won't work in Nix because the
+        # garbage collector will eventually remove the original files after
+        # updates
+        echo "Nix wrapper: Copying glava config to ~/.config/glava"
+        cp -r --no-preserve=all @out@/etc/xdg/glava ~/.config/glava
+        ;;
+      *)
+        exec @out@/bin/.glava-unwrapped "$@"
+    esac
+  '';
+in
+  stdenv.mkDerivation rec {
+    name = "glava-${version}";
+    version = "1.6.3";
+
+    src = fetchFromGitHub {
+      owner = "wacossusca34";
+      repo = "glava";
+      rev = "v${version}";
+      sha256 = "0kqkjxmpqkmgby05lsf6c6iwm45n33jk5qy6gi3zvjx4q4yzal1i";
+    };
+
+    buildInputs = [
+      libX11
+      libXext
+      libXrandr
+      libXrender
+      libpulseaudio
+      libXcomposite
+    ] ++ optional enableGlfw glfw;
+
+    nativeBuildInputs = [
+      python3
+    ];
+
+    preConfigure = ''
+      substituteInPlace Makefile \
+        --replace 'unknown' 'v${version}'
+
+      export CFLAGS="-march=native"
+    '';
+
+    makeFlags = optional (!enableGlfw) "DISABLE_GLFW=1";
+
+    installFlags = [
+      "DESTDIR=$(out)"
+    ];
+
+    fixupPhase = ''
+      mkdir -p $out/bin
+      mv $out/usr/bin/glava $out/bin/.glava-unwrapped
+      rm -rf $out/usr
+
+      patchelf \
+        --set-rpath "$(patchelf --print-rpath $out/bin/.glava-unwrapped):${makeLibraryPath [ libGL ]}" \
+        $out/bin/.glava-unwrapped
+
+      substitute ${wrapperScript} $out/bin/glava --subst-var out
+      chmod +x $out/bin/glava
+    '';
+
+    meta = with stdenv.lib; {
+      description = ''
+        OpenGL audio spectrum visualizer
+      '';
+      homepage = https://github.com/wacossusca34/glava;
+      platforms = platforms.linux;
+      license = licenses.gpl3;
+      maintainers = with maintainers; [
+        eadwu
+      ];
+    };
+  }
diff --git a/nixpkgs/pkgs/applications/misc/glom/default.nix b/nixpkgs/pkgs/applications/misc/glom/default.nix
new file mode 100644
index 000000000000..9e71837c0f5d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/glom/default.nix
@@ -0,0 +1,132 @@
+{ stdenv
+, fetchFromGitLab
+, pkgconfig
+, autoconf
+, automake
+, libtool
+, mm-common
+, intltool
+, itstool
+, doxygen
+, graphviz
+, makeFontsConf
+, freefont_ttf
+, boost
+, libxmlxx3
+, libxslt
+, libgdamm
+, libarchive
+, libepc
+, python3
+, ncurses
+, glibmm
+, gtk3
+, openssl
+, gtkmm3
+, goocanvasmm2
+, evince
+, isocodes
+, gtksourceviewmm4
+, postgresql
+, gnome3
+, gobject-introspection
+, wrapGAppsHook
+}:
+
+let
+  gda = libgdamm.override {
+    mysqlSupport = true;
+    postgresSupport = true;
+  };
+  python = python3.withPackages (pkgs: with pkgs; [ pygobject3 ]);
+  sphinx-build = python3.pkgs.sphinx.overrideAttrs (super: {
+    postFixup = super.postFixup or "" + ''
+      # Do not propagate Python
+      rm $out/nix-support/propagated-build-inputs
+    '';
+  });
+  boost_python = boost.override { enablePython = true; inherit python; };
+in stdenv.mkDerivation rec {
+  pname = "glom";
+  version = "unstable-2018-12-16";
+
+  outputs = [ "out" "lib" "dev" "doc" "devdoc" ];
+
+  src = fetchFromGitLab {
+    domain = "gitlab.gnome.org";
+    owner = "GNOME";
+    repo = pname;
+    rev = "fa5ff04f209f35bf3e97bc1c3eb1d1138d6172ce";
+    sha256 = "145hnk96xa4v35i3a3mbf3fnx4nlk8cksc0qhm7nrh8cnnrbdfgn";
+  };
+
+  nativeBuildInputs = [
+    pkgconfig
+    autoconf
+    automake
+    libtool
+    mm-common
+    intltool
+    gnome3.yelp-tools
+    itstool
+    doxygen
+    graphviz
+    sphinx-build
+    wrapGAppsHook
+    gobject-introspection # for setup hook
+  ];
+
+  buildInputs = [
+    boost_python
+    glibmm
+    gtk3
+    openssl
+    libxmlxx3
+    libxslt
+    gda
+    libarchive
+    libepc
+    python
+    ncurses # for python
+    gtkmm3
+    goocanvasmm2
+    evince
+    isocodes
+    python3.pkgs.pygobject3
+    gtksourceviewmm4
+    postgresql # for pg_config
+  ];
+
+  enableParallelBuilding = true;
+
+  preConfigure = "NOCONFIGURE=1 ./autogen.sh";
+
+  configureFlags = [
+    "--with-boost-python=boost_python${stdenv.lib.versions.major python3.version}${stdenv.lib.versions.minor python3.version}"
+  ];
+
+  makeFlags = [
+    "libdocdir=${placeholder "doc"}/share/doc/$(book_name)"
+    "devhelpdir=${placeholder "devdoc"}/share/devhelp/books/$(book_name)"
+  ];
+
+  # Fontconfig error: Cannot load default config file
+  FONTCONFIG_FILE = makeFontsConf {
+    fontDirectories = [ freefont_ttf ];
+  };
+
+  preFixup = ''
+    gappsWrapperArgs+=(
+      --prefix PYTHONPATH : "${placeholder "out"}/${python3.sitePackages}"
+      --set PYTHONHOME "${python}"
+    )
+  '';
+
+  meta = with stdenv.lib; {
+    description = "An easy-to-use database designer and user interface";
+    homepage = http://www.glom.org/;
+    license = [ licenses.lgpl2 licenses.gpl2 ];
+    maintainers = gnome3.maintainers;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gmrun/default.nix b/nixpkgs/pkgs/applications/misc/gmrun/default.nix
new file mode 100644
index 000000000000..47fb50242c1d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gmrun/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, glib, gtk2, pkgconfig, popt }:
+
+let
+  version = "0.9.2";
+in
+
+stdenv.mkDerivation rec {
+  name = "gmrun-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gmrun/${name}.tar.gz";
+    sha256 = "180z6hbax1qypy5cyy2z6nn7fzxla4ib47ck8mqwr714ag77na8p";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ glib gtk2 popt ];
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  patches = [
+      ./gcc43.patch
+      ./find-config-file-in-system-etc-dir.patch
+      ./gmrun-0.9.2-xdg.patch
+    ];
+
+  meta = {
+    description = "Gnome Completion-Run Utility";
+    longDescription = ''
+      A simple program which provides a "run program" window, featuring a bash-like TAB completion.
+      It uses GTK+ interface.
+      Also, supports CTRL-R / CTRL-S / "!" for searching through history.
+      Running commands in a terminal with CTRL-Enter. URL handlers.
+    '';
+    homepage = https://sourceforge.net/projects/gmrun/;
+    license = "GPL";
+    maintainers = [];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gmrun/find-config-file-in-system-etc-dir.patch b/nixpkgs/pkgs/applications/misc/gmrun/find-config-file-in-system-etc-dir.patch
new file mode 100644
index 000000000000..12d5370961c0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gmrun/find-config-file-in-system-etc-dir.patch
@@ -0,0 +1,18 @@
+diff -ur gmrun-0.9.2-orig/src/prefs.cc gmrun-0.9.2/src/prefs.cc
+--- gmrun-0.9.2-orig/src/prefs.cc	2019-05-02 12:56:39.025088361 +0200
++++ gmrun-0.9.2/src/prefs.cc	2019-05-02 13:21:51.179778620 +0200
+@@ -31,9 +31,11 @@
+ 
+ Prefs::Prefs()
+ {
+-  string file_name = PACKAGE_DATA_DIR"/";
+-  file_name += GMRUNRC;
+-  init(file_name);
++  string file_name = "/etc/" GMRUNRC;
++  if (!init(file_name)) {
++    file_name = PACKAGE_DATA_DIR "/" GMRUNRC;;
++    init(file_name);
++  }
+ 
+   file_name = getenv("HOME");
+   if (!file_name.empty()) {
diff --git a/nixpkgs/pkgs/applications/misc/gmrun/gcc43.patch b/nixpkgs/pkgs/applications/misc/gmrun/gcc43.patch
new file mode 100644
index 000000000000..60e4338e893d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gmrun/gcc43.patch
@@ -0,0 +1,51 @@
+--- a/src/gtkcompletionline.cc.orig	2003-11-16 11:55:07.000000000 +0100
++++ a/src/gtkcompletionline.cc	2008-05-08 08:51:22.000000000 +0200
+@@ -29,6 +29,7 @@
+ #include <set>
+ #include <sstream>
+ #include <string>
++#include <cstring>
+ #include <vector>
+ using namespace std;
+ 
+--- a/src/ci_string.h.orig	2001-05-16 16:39:31.000000000 +0200
++++ a/src/ci_string.h	2008-05-08 08:51:33.000000000 +0200
+@@ -7,6 +7,7 @@
+ #define __CI_STRING_H__
+ 
+ #include <string>
++#include <cstring>
+ #include <ctype.h>
+ 
+ struct ci_char_traits : public std::char_traits<char>
+--- a/src/prefs.cc.orig	2002-08-16 12:48:22.000000000 +0200
++++ a/src/prefs.cc	2008-05-08 08:51:54.000000000 +0200
+@@ -13,6 +13,7 @@
+ #include <fstream>
+ #include <iostream>
+ #include <stdio.h>
++#include <stdlib.h>
+ 
+ #include <list>
+ 
+--- a/src/main.cc.orig	2003-11-16 11:55:07.000000000 +0100
++++ a/src/main.cc	2008-05-08 09:03:11.000000000 +0200
+@@ -14,6 +14,7 @@
+ #include <gdk/gdkkeysyms.h>
+ 
+ #include <string>
++#include <cstring>
+ #include <iostream>
+ #include <sstream>
+ #include <vector>
+
+--- a/src/gtkcompletionline.cc.orig	2009-06-19 22:38:14.000000000 +0400
++++ a/src/gtkcompletionline.cc	2009-06-19 22:37:14.000000000 +0400
+@@ -376,7 +377,7 @@
+   return 0;
+ }
+ 
+-int my_alphasort(const void* va, const void* vb) {
++int my_alphasort(const dirent** va, const dirent** vb) {
+   const struct dirent** a = (const struct dirent**)va;
+   const struct dirent** b = (const struct dirent**)vb;
diff --git a/nixpkgs/pkgs/applications/misc/gmrun/gmrun-0.9.2-xdg.patch b/nixpkgs/pkgs/applications/misc/gmrun/gmrun-0.9.2-xdg.patch
new file mode 100644
index 000000000000..b5cd41a3c5b4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gmrun/gmrun-0.9.2-xdg.patch
@@ -0,0 +1,58 @@
+diff -ur a/src/history.cc src/history.cc
+--- a/src/history.cc	2002-08-17 15:19:31.000000000 +0200
++++ a/src/history.cc	2012-06-04 23:42:35.314653414 +0200
+@@ -24,8 +24,15 @@
+ HistoryFile::HistoryFile()
+ {
+   m_file_entries = 0;
+-  m_filename = g_get_home_dir();
+-  m_filename += "/.gmrun_history";
++  const char* filename = getenv("XDG_CACHE_HOME");
++  if (filename != 0 && *filename != '\0') {
++    m_filename = filename;
++    m_filename += "/gmrun_history";
++  }
++  else {
++    m_filename = g_get_home_dir();
++    m_filename += "/.gmrun_history";
++  }
+   m_current = 0;
+   m_default_set = false;
+   read_the_file();
+diff -ur a/src/prefs.cc src/prefs.cc
+--- a/src/prefs.cc	2012-06-04 22:35:00.671949439 +0200
++++ a/src/prefs.cc	2012-06-04 23:24:24.184445962 +0200
+@@ -35,12 +35,29 @@
+   file_name += GMRUNRC;
+   init(file_name);
+ 
+-  file_name = getenv("HOME");
+-  if (!file_name.empty()) {
++  file_name.clear();
++  const char* filename = getenv("XDG_CONFIG_HOME");
++  if (filename != 0 && *filename != '\0') {
++    file_name = filename;
+     string::iterator i = file_name.end() - 1;
+-    if (*i == '/') file_name.erase(i);
+-    file_name += "/.";
++    if (*i != '/') {
++      file_name += '/';
++    }
+     file_name += GMRUNRC;
++  }
++  else {
++    filename = getenv("HOME");
++    if (filename != 0 && *filename != '\0') {
++      file_name = filename;
++      string::iterator i = file_name.end() - 1;
++      if (*i != '/') {
++        file_name += '/';
++      }
++      file_name += '.';
++      file_name += GMRUNRC;
++    }
++  }
++  if (!file_name.empty()) {
+     init(file_name);
+   }
+ }
diff --git a/nixpkgs/pkgs/applications/misc/gmtp/default.nix b/nixpkgs/pkgs/applications/misc/gmtp/default.nix
new file mode 100644
index 000000000000..bb1556c7c4dc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gmtp/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pkgconfig, libmtp, libid3tag, flac, libvorbis, gtk3
+, gsettings-desktop-schemas, wrapGAppsHook
+}:
+
+let version = "1.3.11"; in
+
+stdenv.mkDerivation {
+  name = "gmtp-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gmtp/gMTP-${version}/gmtp-${version}.tar.gz";
+    sha256 = "04q6byyq002fhzkc2rkkahwh5b6272xakaj4m3vwm8la8jf0r0ss";
+  };
+
+  nativeBuildInputs = [ pkgconfig wrapGAppsHook ];
+  buildInputs = [ libmtp libid3tag flac libvorbis gtk3 gsettings-desktop-schemas ];
+
+  enableParallelBuilding = true;
+
+  preFixup = ''
+    gappsWrapperArgs+=(--add-flags "--datapath \"$out/share\"");
+  '';
+
+  meta = {
+    description = "A simple MP3 and Media player client for UNIX and UNIX like systems.";
+    homepage = https://gmtp.sourceforge.io;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.pbogdan ];
+    license = stdenv.lib.licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gnome-recipes/default.nix b/nixpkgs/pkgs/applications/misc/gnome-recipes/default.nix
new file mode 100644
index 000000000000..01f5af339ff0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gnome-recipes/default.nix
@@ -0,0 +1,79 @@
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, pkgconfig
+, gnome3
+, desktop-file-utils
+, gettext
+, itstool
+, python3
+, wrapGAppsHook
+, gtk3
+, glib
+, libsoup
+, gnome-online-accounts
+, librest
+, json-glib
+, gnome-autoar
+, gspell
+, libcanberra }:
+
+let
+  pname = "gnome-recipes";
+  version = "2.0.2";
+in stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
+    sha256 = "1yymii3yf823d9x28fbhqdqm1wa30s40j94x0am9fjj0nzyd5s8v";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkgconfig
+    desktop-file-utils
+    gettext
+    itstool
+    python3
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gtk3
+    glib
+    libsoup
+    gnome-online-accounts
+    librest
+    json-glib
+    gnome-autoar
+    gspell
+    libcanberra
+  ];
+
+  # https://github.com/NixOS/nixpkgs/issues/36468
+  # https://gitlab.gnome.org/GNOME/recipes/issues/76
+  NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0";
+
+  postPatch = ''
+    chmod +x src/list_to_c.py
+    patchShebangs src/list_to_c.py
+    patchShebangs meson_post_install.py
+  '';
+
+  passthru = {
+    updateScript = gnome3.updateScript {
+      packageName = pname;
+    };
+  };
+
+  meta = with stdenv.lib; {
+    description = "Recipe management application for GNOME";
+    homepage = https://wiki.gnome.org/Apps/Recipes;
+    maintainers = gnome3.maintainers;
+    license = licenses.gpl3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gnome-usage/default.nix b/nixpkgs/pkgs/applications/misc/gnome-usage/default.nix
new file mode 100644
index 000000000000..eecf9bbd88f7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gnome-usage/default.nix
@@ -0,0 +1,63 @@
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, pkgconfig
+, vala
+, gettext
+, libxml2
+, desktop-file-utils
+, wrapGAppsHook
+, glib
+, gtk3
+, libgtop
+, libdazzle
+, gnome3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gnome-usage";
+  version = "3.32.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0bgszckddfpd3czyb9fddx4pgv5yv44sxc45dfk2kgqyy169gjih";
+  };
+
+  nativeBuildInputs = [
+    desktop-file-utils
+    gettext
+    libxml2
+    meson
+    ninja
+    pkgconfig
+    vala
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    glib
+    gnome3.adwaita-icon-theme
+    gtk3
+    libdazzle
+    libgtop
+  ];
+
+  postPatch = ''
+    chmod +x build-aux/meson/postinstall.sh
+    patchShebangs build-aux/meson/postinstall.sh
+  '';
+
+  passthru = {
+    updateScript = gnome3.updateScript {
+      packageName = pname;
+    };
+  };
+
+  meta = with stdenv.lib; {
+    description = "A nice way to view information about use of system resources, like memory and disk space";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = gnome3.maintainers;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gnome15/default.nix b/nixpkgs/pkgs/applications/misc/gnome15/default.nix
new file mode 100644
index 000000000000..e2cf8245ce67
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gnome15/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, python2, gnome_python, gnome_python_desktop }:
+
+stdenv.mkDerivation rec {
+  name = "gnome15-2016-06-10";
+
+  src = fetchFromGitHub {
+    owner = "achilleas-k";
+    repo = "gnome15";
+    rev = "1077c890d9ba8ef7a5e448e70a792de5c7443c84";
+    sha256 = "0z5k2rgvv5zyi3lbbk6svncypidj44qzfchivb4vlr7clmh16m95";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig python2.pkgs.wrapPython ];
+  buildInputs = [ python2 ];
+  propagatedBuildInputs = with python2.pkgs; [
+    pygtk keyring virtkey pillow dbus-python pyinotify lxml pyxdg pyusb gnome_python gnome_python_desktop
+    python-uinput xlib pyudev pyinputevent
+  ];
+
+  postPatch = ''
+    touch README
+    export UDEV_RULES_PATH="$out/lib/udev/rules.d"
+  '';
+
+  postFixup = ''
+    wrapPythonPrograms
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A set of tools for configuring the Logitech G15 keyboard";
+    license = licenses.gpl3;
+    homepage = https://gnome15.org/;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/go-jira/default.nix b/nixpkgs/pkgs/applications/misc/go-jira/default.nix
new file mode 100644
index 000000000000..b80ddb8f303f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/go-jira/default.nix
@@ -0,0 +1,22 @@
+# This file was generated by https://github.com/kamilchm/go2nix v1.2.1
+{ stdenv, buildGoPackage, fetchgit }:
+
+buildGoPackage rec {
+  name = "go-jira-${version}";
+  version = "1.0.17";
+
+  goPackagePath = "gopkg.in/Netflix-Skunkworks/go-jira.v1";
+
+  src = fetchgit {
+    rev = "v${version}";
+    url = "https://gopkg.in/Netflix-Skunkworks/go-jira.v1";
+    sha256 = "0ap5dzikp934mawigmv7ighajr5yxpck2gpnb2cmkc1p6qa6gn4v";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Simple command line client for Atlassian's Jira service written in Go";
+    homepage = "https://github.com/Netflix-Skunkworks/go-jira";
+    license = licenses.asl20;
+    maintainers = [ maintainers.carlosdagos ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/golden-cheetah/default.nix b/nixpkgs/pkgs/applications/misc/golden-cheetah/default.nix
new file mode 100644
index 000000000000..edf16f806a6b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/golden-cheetah/default.nix
@@ -0,0 +1,59 @@
+{ stdenv, fetchurl
+, qtbase, qtsvg, qtserialport, qtwebkit, qtmultimedia, qttools, qtconnectivity
+, yacc, flex, zlib, qmake, makeDesktopItem, makeWrapper
+}:
+
+let
+  desktopItem = makeDesktopItem {
+    name = "goldencheetah";
+    exec = "GoldenCheetah";
+    icon = "goldencheetah";
+    desktopName = "GoldenCheetah";
+    genericName = "GoldenCheetah";
+    comment = "Performance software for cyclists, runners and triathletes";
+    categories = "Application;Utility;";
+  };
+in stdenv.mkDerivation rec {
+  name = "golden-cheetah-${version}";
+  version = "3.4";
+  src = fetchurl {
+    name = "${name}.tar.gz";
+    url = "https://github.com/GoldenCheetah/GoldenCheetah/archive/V${version}.tar.gz";
+    sha256 = "0fiz2pj155cd357kph50lc6rjyzwp045glfv4y68qls9j7m9ayaf";
+  };
+  buildInputs = [
+    qtbase qtsvg qtserialport qtwebkit qtmultimedia qttools zlib
+    qtconnectivity
+  ];
+  nativeBuildInputs = [ flex makeWrapper qmake yacc ];
+  NIX_LDFLAGS = [
+    "-lz"
+  ];
+  preConfigure = ''
+    cp src/gcconfig.pri.in src/gcconfig.pri
+    cp qwt/qwtconfig.pri.in qwt/qwtconfig.pri
+    echo 'QMAKE_LRELEASE = ${qttools.dev}/bin/lrelease' >> src/gcconfig.pri
+    sed -i -e '21,23d' qwt/qwtconfig.pri # Removed forced installation to /usr/local
+  '';
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin
+    cp src/GoldenCheetah $out/bin
+    wrapProgram $out/bin/GoldenCheetah --set LD_LIBRARY_PATH "${zlib.out}/lib"
+    install -Dm644 "${desktopItem}/share/applications/"* -t $out/share/applications/
+    install -Dm644 src/Resources/images/gc.png $out/share/pixmaps/goldencheetah.png
+
+    runHook postInstall
+  '';
+
+  # RCC: Error in 'Resources/application.qrc': Cannot find file 'translations/gc_fr.qm'
+  enableParallelBuilding = false;
+
+  meta = with stdenv.lib; {
+    description = "Performance software for cyclists, runners and triathletes";
+    platforms = platforms.linux;
+    maintainers = [ maintainers.ocharles ];
+    license = licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/goldendict/default.nix b/nixpkgs/pkgs/applications/misc/goldendict/default.nix
new file mode 100644
index 000000000000..42d5d83f7bdb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/goldendict/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchFromGitHub, pkgconfig, libXtst, libvorbis, hunspell
+, libao, ffmpeg, libeb, lzo, xz, libtiff
+, qtbase, qtsvg, qtwebkit, qtx11extras, qttools, qmake }:
+stdenv.mkDerivation rec {
+
+  name = "goldendict-2018-06-13";
+  src = fetchFromGitHub {
+    owner = "goldendict";
+    repo = "goldendict";
+    rev = "48e850c7ec11d83cba7499f7fdce377ef3849bbb";
+    sha256 = "0i4q4waqjv45hgwillvjik97pg26kwlmz4925djjkx8s6hxgjlq9";
+  };
+
+  nativeBuildInputs = [ pkgconfig qmake ];
+  buildInputs = [
+    qtbase qtsvg qtwebkit qtx11extras qttools
+    libXtst libvorbis hunspell libao ffmpeg libeb lzo xz libtiff
+  ];
+
+  qmakeFlags = [ "CONFIG+=zim_support" ];
+
+  meta = with stdenv.lib; {
+    homepage = http://goldendict.org/;
+    description = "A feature-rich dictionary lookup program";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ gebner astsmtl ];
+    license = licenses.gpl3Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gollum/Gemfile b/nixpkgs/pkgs/applications/misc/gollum/Gemfile
new file mode 100644
index 000000000000..525f54838b75
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gollum/Gemfile
@@ -0,0 +1,2 @@
+source 'https://rubygems.org'
+gem 'gollum'
diff --git a/nixpkgs/pkgs/applications/misc/gollum/Gemfile.lock b/nixpkgs/pkgs/applications/misc/gollum/Gemfile.lock
new file mode 100644
index 000000000000..9a12ba2bfd55
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gollum/Gemfile.lock
@@ -0,0 +1,68 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    charlock_holmes (0.7.6)
+    diff-lcs (1.3)
+    gemojione (3.3.0)
+      json
+    github-markup (1.7.0)
+    gitlab-grit (2.8.2)
+      charlock_holmes (~> 0.6)
+      diff-lcs (~> 1.1)
+      mime-types (>= 1.16)
+      posix-spawn (~> 0.3)
+    gollum (4.1.4)
+      gemojione (~> 3.2)
+      gollum-lib (~> 4.2, >= 4.2.10)
+      kramdown (~> 1.9.0)
+      mustache (>= 0.99.5, < 1.0.0)
+      sinatra (~> 1.4, >= 1.4.4)
+      useragent (~> 0.16.2)
+    gollum-grit_adapter (1.0.1)
+      gitlab-grit (~> 2.7, >= 2.7.1)
+    gollum-lib (4.2.10)
+      gemojione (~> 3.2)
+      github-markup (~> 1.6)
+      gollum-grit_adapter (~> 1.0)
+      nokogiri (>= 1.6.1, < 2.0)
+      rouge (~> 2.1)
+      sanitize (~> 2.1.1, >= 2.1.1)
+      stringex (~> 2.6)
+      twitter-text (= 1.14.7)
+    json (2.2.0)
+    kramdown (1.9.0)
+    mime-types (3.2.2)
+      mime-types-data (~> 3.2015)
+    mime-types-data (3.2019.0331)
+    mini_portile2 (2.4.0)
+    mustache (0.99.8)
+    nokogiri (1.10.3)
+      mini_portile2 (~> 2.4.0)
+    posix-spawn (0.3.13)
+    rack (1.6.11)
+    rack-protection (1.5.5)
+      rack
+    rouge (2.2.1)
+    sanitize (2.1.1)
+      nokogiri (>= 1.4.4)
+    sinatra (1.4.8)
+      rack (~> 1.5)
+      rack-protection (~> 1.4)
+      tilt (>= 1.3, < 3)
+    stringex (2.8.5)
+    tilt (2.0.9)
+    twitter-text (1.14.7)
+      unf (~> 0.1.0)
+    unf (0.1.4)
+      unf_ext
+    unf_ext (0.0.7.6)
+    useragent (0.16.10)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  gollum
+
+BUNDLED WITH
+   1.17.2
diff --git a/nixpkgs/pkgs/applications/misc/gollum/default.nix b/nixpkgs/pkgs/applications/misc/gollum/default.nix
new file mode 100644
index 000000000000..4a0a4e38a61b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gollum/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, bundlerEnv, ruby, makeWrapper
+, git }:
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "gollum";
+  # nix-shell -p bundix icu zlib
+  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;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gollum/gemset.nix b/nixpkgs/pkgs/applications/misc/gollum/gemset.nix
new file mode 100644
index 000000000000..6de5553ac7cf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gollum/gemset.nix
@@ -0,0 +1,284 @@
+{
+  charlock_holmes = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1nf1l31n10yaark2rrg5qzyzcx9w80681449s3j09qmnipsl8rl5";
+      type = "gem";
+    };
+    version = "0.7.6";
+  };
+  diff-lcs = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "18w22bjz424gzafv6nzv98h0aqkwz3d9xhm7cbr1wfbyas8zayza";
+      type = "gem";
+    };
+    version = "1.3";
+  };
+  gemojione = {
+    dependencies = ["json"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0ayk8r147k1s38nj18pwk76npx1p7jhi86silk800nj913pjvrhj";
+      type = "gem";
+    };
+    version = "3.3.0";
+  };
+  github-markup = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "17g6g18gdjg63k75sfwiskjzl9i0hfcnrkcpb4fwrnb20v3jgswp";
+      type = "gem";
+    };
+    version = "1.7.0";
+  };
+  gitlab-grit = {
+    dependencies = ["charlock_holmes" "diff-lcs" "mime-types" "posix-spawn"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0xgs3l81ghlc5nm75n0pz7b2cj3hpscfq5iy27c483nnjn2v5mc4";
+      type = "gem";
+    };
+    version = "2.8.2";
+  };
+  gollum = {
+    dependencies = ["gemojione" "gollum-lib" "kramdown" "mustache" "sinatra" "useragent"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0ik1b0f73lcxfwfml1h84dp6br79g0z9v6x54wvl46n9d1ndrhl7";
+      type = "gem";
+    };
+    version = "4.1.4";
+  };
+  gollum-grit_adapter = {
+    dependencies = ["gitlab-grit"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0fcibm63v1afc0fj5rki0mm51m7nndil4cjcjjvkh3yigfn4nr4b";
+      type = "gem";
+    };
+    version = "1.0.1";
+  };
+  gollum-lib = {
+    dependencies = ["gemojione" "github-markup" "gollum-grit_adapter" "nokogiri" "rouge" "sanitize" "stringex" "twitter-text"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1699wiir6f2a8yawk3qg0xn3zdc10mz783v53ri1ivfnzdrm3dvf";
+      type = "gem";
+    };
+    version = "4.2.10";
+  };
+  json = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0sx97bm9by389rbzv8r1f43h06xcz8vwi3h5jv074gvparql7lcx";
+      type = "gem";
+    };
+    version = "2.2.0";
+  };
+  kramdown = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "12sral2xli39mnr4b9m2sxdlgam4ni0a1mkxawc5311z107zj3p0";
+      type = "gem";
+    };
+    version = "1.9.0";
+  };
+  mime-types = {
+    dependencies = ["mime-types-data"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0fjxy1jm52ixpnv3vg9ld9pr9f35gy0jp66i1njhqjvmnvq0iwwk";
+      type = "gem";
+    };
+    version = "3.2.2";
+  };
+  mime-types-data = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1m00pg19cm47n1qlcxgl91ajh2yq0fszvn1vy8fy0s1jkrp9fw4a";
+      type = "gem";
+    };
+    version = "3.2019.0331";
+  };
+  mini_portile2 = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "15zplpfw3knqifj9bpf604rb3wc1vhq6363pd6lvhayng8wql5vy";
+      type = "gem";
+    };
+    version = "2.4.0";
+  };
+  mustache = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1g5hplm0k06vwxwqzwn1mq5bd02yp0h3rym4zwzw26aqi7drcsl2";
+      type = "gem";
+    };
+    version = "0.99.8";
+  };
+  nokogiri = {
+    dependencies = ["mini_portile2"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "02bjydih0j515szfv9mls195cvpyidh6ixm7dwbl3s2sbaxxk5s4";
+      type = "gem";
+    };
+    version = "1.10.3";
+  };
+  posix-spawn = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1pmxmpins57qrbr31bs3bm7gidhaacmrp4md6i962gvpq4gyfcjw";
+      type = "gem";
+    };
+    version = "0.3.13";
+  };
+  rack = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1g9926ln2lw12lfxm4ylq1h6nl0rafl10za3xvjzc87qvnqic87f";
+      type = "gem";
+    };
+    version = "1.6.11";
+  };
+  rack-protection = {
+    dependencies = ["rack"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0my0wlw4a5l3hs79jkx2xzv7djhajgf8d28k8ai1ddlnxxb0v7ss";
+      type = "gem";
+    };
+    version = "1.5.5";
+  };
+  rouge = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "02kpahk5nkc33yxnn75649kzxaz073wvazr2zyg491nndykgnvcs";
+      type = "gem";
+    };
+    version = "2.2.1";
+  };
+  sanitize = {
+    dependencies = ["nokogiri"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "12ip1d80r0dgc621qn7c32bk12xxgkkg3w6q21s1ckxivcd7r898";
+      type = "gem";
+    };
+    version = "2.1.1";
+  };
+  sinatra = {
+    dependencies = ["rack" "rack-protection" "tilt"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0byxzl7rx3ki0xd7aiv1x8mbah7hzd8f81l65nq8857kmgzj1jqq";
+      type = "gem";
+    };
+    version = "1.4.8";
+  };
+  stringex = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "15ns7j5smw04w6w7bqd5mm2qcl7w9lhwykyb974i4isgg9yc23ys";
+      type = "gem";
+    };
+    version = "2.8.5";
+  };
+  tilt = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0ca4k0clwf0rkvy7726x4nxpjxkpv67w043i39saxgldxd97zmwz";
+      type = "gem";
+    };
+    version = "2.0.9";
+  };
+  twitter-text = {
+    dependencies = ["unf"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1732h7hy1k152w8wfvjsx7b79alk45i5imwd37ia4qcx8hfm3gvg";
+      type = "gem";
+    };
+    version = "1.14.7";
+  };
+  unf = {
+    dependencies = ["unf_ext"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0bh2cf73i2ffh4fcpdn9ir4mhq8zi50ik0zqa1braahzadx536a9";
+      type = "gem";
+    };
+    version = "0.1.4";
+  };
+  unf_ext = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1ll6w64ibh81qwvjx19h8nj7mngxgffg7aigjx11klvf5k2g4nxf";
+      type = "gem";
+    };
+    version = "0.0.7.6";
+  };
+  useragent = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1fv5kvq494swy0p17h9qya9r50w15xsi9zmvhzb8gh55kq6ki50p";
+      type = "gem";
+    };
+    version = "0.16.10";
+  };
+}
\ No newline at end of file
diff --git a/nixpkgs/pkgs/applications/misc/googleearth/default.nix b/nixpkgs/pkgs/applications/misc/googleearth/default.nix
new file mode 100644
index 000000000000..0fccf83acf76
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/googleearth/default.nix
@@ -0,0 +1,106 @@
+{ stdenv, fetchurl, glibc, libGLU_combined, freetype, glib, libSM, libICE, libXi, libXv
+, libXrender, libXrandr, libXfixes, libXcursor, libXinerama, libXext, libX11
+, zlib, fontconfig, dpkg, libproxy, libxml2, gstreamer, gst_all_1, dbus }:
+
+let
+  arch =
+    if stdenv.hostPlatform.system == "x86_64-linux" then "amd64"
+    else if stdenv.hostPlatform.system == "i686-linux" then "i386"
+    else throw "Unsupported system ${stdenv.hostPlatform.system}";
+  sha256 =
+    if arch == "amd64"
+    then "0dwnppn5snl5bwkdrgj4cyylnhngi0g66fn2k41j3dvis83x24k6"
+    else "0gndbxrj3kgc2dhjqwjifr3cl85hgpm695z0wi01wvwzhrjqs0l2";
+  version = "7.1.8.3036";
+  fullPath = stdenv.lib.makeLibraryPath [
+    glibc
+    glib
+    stdenv.cc.cc
+    libSM
+    libICE
+    libXi
+    libXv
+    libGLU_combined
+    libXrender
+    libXrandr
+    libXfixes
+    libXcursor
+    libXinerama
+    freetype
+    libXext
+    libX11
+    zlib
+    fontconfig
+    libproxy
+    libxml2
+    gstreamer
+    dbus
+    gst_all_1.gstreamer
+    gst_all_1.gst-plugins-base
+  ];
+in
+stdenv.mkDerivation rec {
+  name = "googleearth-${version}";
+  src = fetchurl {
+    url = "https://dl.google.com/linux/earth/deb/pool/main/g/google-earth-stable/google-earth-stable_${version}-r0_${arch}.deb";
+    inherit sha256;
+  };
+
+  phases = [ "unpackPhase" "installPhase" "checkPhase" ];
+
+  doCheck = true;
+
+  buildInputs = [ dpkg ];
+
+  unpackPhase = ''
+    dpkg-deb -x ${src} ./
+  '';
+
+  installPhase =''
+    mkdir $out
+    mv usr/* $out/
+    rmdir usr
+    mv * $out/
+    rm $out/bin/google-earth $out/opt/google/earth/free/googleearth
+
+    # patch and link googleearth binary
+    ln -s $out/opt/google/earth/free/googleearth-bin $out/bin/googleearth
+    patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath "${fullPath}:\$ORIGIN" \
+      $out/opt/google/earth/free/googleearth-bin
+
+    # patch and link gpsbabel binary
+    ln -s $out/opt/google/earth/free/gpsbabel $out/bin/gpsbabel
+    patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath "${fullPath}:\$ORIGIN" \
+      $out/opt/google/earth/free/gpsbabel
+
+    # patch libraries
+    for a in $out/opt/google/earth/free/*.so* ; do
+      patchelf --set-rpath "${fullPath}:\$ORIGIN" $a
+    done
+    
+    # Add desktop config file and icons
+    mkdir -p $out/share/{applications,icons/hicolor/{16x16,22x22,24x24,32x32,48x48,64x64,128x128,256x256}/apps,pixmaps}
+    ln -s $out/opt/google/earth/free/google-earth.desktop $out/share/applications/google-earth.desktop
+    sed -i -e "s|Exec=.*|Exec=$out/bin/googleearth|g" $out/opt/google/earth/free/google-earth.desktop
+    for size in 16 22 24 32 48 64 128 256; do
+      ln -s $out/opt/google/earth/free/product_logo_"$size".png $out/share/icons/hicolor/"$size"x"$size"/apps/google-earth.png
+    done
+    ln -s $out/opt/google/earth/free/product_logo_256.png $out/share/pixmaps/google-earth.png
+  '';
+
+  checkPhase = ''
+    $out/bin/gpsbabel -V > /dev/null
+  '';
+
+  dontPatchELF = true;
+
+  meta = with stdenv.lib; {
+    description = "A world sphere viewer";
+    homepage = http://earth.google.com;
+    license = licenses.unfree;
+    maintainers = with maintainers; [ markus1189 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/googler/default.nix b/nixpkgs/pkgs/applications/misc/googler/default.nix
new file mode 100644
index 000000000000..3dcbcaf38b87
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/googler/default.nix
@@ -0,0 +1,25 @@
+{stdenv, fetchFromGitHub, python}:
+
+stdenv.mkDerivation rec {
+  version = "3.9";
+  name = "googler-${version}";
+
+  src = fetchFromGitHub {
+    owner = "jarun";
+    repo = "googler";
+    rev = "v${version}";
+    sha256 = "0zqq157i0rfrja8yqnqr9rfrp5apzc7cxb7d7ppv6abkc5bckyqc";
+  };
+
+  propagatedBuildInputs = [ python ];
+
+  makeFlags = "PREFIX=$(out)";
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/jarun/googler;
+    description = "Google Search, Google Site Search, Google News from the terminal";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ koral ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gosmore/default.nix b/nixpkgs/pkgs/applications/misc/gosmore/default.nix
new file mode 100644
index 000000000000..464e0ba53346
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gosmore/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchsvn, libxml2, gtk2, curl, pkgconfig } :
+
+let
+  version = "31801";
+in
+stdenv.mkDerivation {
+  name = "gosmore-r${version}";
+  # the gosmore svn repository does not lock revision numbers of its externals
+  # so we explicitly disable them to avoid breaking the hash
+  # especially as the externals appear to be unused
+  src = fetchsvn {
+    url = http://svn.openstreetmap.org/applications/rendering/gosmore;
+    sha256 = "0qsckpqx7i7f8gkqhkzdamr65250afk1rpnh3nbman35kdv3dsxi";
+    rev = "${version}";
+    ignoreExternals = true;
+  };
+
+  buildInputs = [ libxml2 gtk2 curl ];
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  prePatch = ''
+    sed -e '/curl.types.h/d' -i *.{c,h,hpp,cpp}
+  '';
+
+  patches = [ ./pointer_int_comparison.patch ];
+  patchFlags = [ "-p1" "--binary" ]; # patch has dos style eol
+      
+  meta = with stdenv.lib; {
+    description = "Open Street Map viewer";
+    homepage = https://sourceforge.net/projects/gosmore/;
+    maintainers = with maintainers; [
+      raskin
+    ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gosmore/pointer_int_comparison.patch b/nixpkgs/pkgs/applications/misc/gosmore/pointer_int_comparison.patch
new file mode 100644
index 000000000000..4a715b6d8591
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gosmore/pointer_int_comparison.patch
@@ -0,0 +1,11 @@
+--- blah_/jni/gosmore.cpp	1970-01-01 01:00:01.000000000 +0100

++++ /dev/stdin	2018-03-18 00:21:08.474217132 +0100

+@@ -1273,7 +1273,7 @@

+       if (deg[i] < -180 || deg[i] > 180) break;

+       if (i == 0 && (strncasecmp (t, "lat", 3) == 0 ||

+                      strncasecmp (t, "lon", 3) == 0)) { // lat=-25.7 lon=28.2

+-        for (t += 3; t != '\0' && !isalnum (*t); t++) {}

++        for (t += 3; *t != '\0' && !isalnum (*t); t++) {}

+       }

+       if (i == 1) { // Success !

+         //printf ("%lf %lf %u\n", deg[lonFirst ? 1 : 0], deg[lonFirst ? 0 : 1],

diff --git a/nixpkgs/pkgs/applications/misc/gpa/default.nix b/nixpkgs/pkgs/applications/misc/gpa/default.nix
new file mode 100644
index 000000000000..a48890144127
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gpa/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, intltool, pkgconfig, gtk2, gpgme, libgpgerror, libassuan }:
+
+stdenv.mkDerivation rec {
+  name = "gpa-0.10.0";
+
+  src = fetchurl {
+    url = "mirror://gnupg/gpa/${name}.tar.bz2";
+    sha256 = "1cbpc45f8qbdkd62p12s3q2rdq6fa5xdzwmcwd3xrj55bzkspnwm";
+  };
+
+  nativeBuildInputs = [ intltool pkgconfig ];
+  buildInputs = [ gtk2 gpgme libgpgerror libassuan ];
+
+  meta = with stdenv.lib; {
+    description = "Graphical user interface for the GnuPG";
+    homepage = https://www.gnupg.org/related_software/gpa/;
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gpg-mdp/default.nix b/nixpkgs/pkgs/applications/misc/gpg-mdp/default.nix
new file mode 100644
index 000000000000..4143f6fde559
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gpg-mdp/default.nix
@@ -0,0 +1,34 @@
+{ fetchurl, stdenv, ncurses, gnupg }:
+
+let version = "0.7.4";
+in stdenv.mkDerivation {
+  # mdp renamed to gpg-mdp because there is a mdp package already.
+  name = "gpg-mdp-${version}";
+  meta = {
+    homepage = https://tamentis.com/projects/mdp/;
+    license = [stdenv.lib.licenses.isc];
+    description = "Manage your passwords with GnuPG and a text editor";
+  };
+  src = fetchurl {
+    url = "https://tamentis.com/projects/mdp/files/mdp-${version}.tar.gz";
+    sha256 = "04mdnx4ccpxf9m2myy9nvpl9ma4jgzmv9bkrzv2b9affzss3r34g";
+  };
+  buildInputs = [ ncurses ];
+  prePatch = ''
+    substituteInPlace ./configure \
+      --replace "alias echo=/bin/echo" ""
+
+    substituteInPlace ./src/config.c \
+      --replace "/usr/bin/gpg" "${gnupg}/bin/gpg" \
+      --replace "/usr/bin/vi" "vi"
+
+    substituteInPlace ./mdp.1 \
+      --replace "/usr/bin/gpg" "${gnupg}/bin/gpg"
+  '';
+  # we add symlinks to the binary and man page with the name 'gpg-mdp', in case
+  # the completely unrelated program also named 'mdp' is already installed.
+  postFixup = ''
+    ln -s $out/bin/mdp $out/bin/gpg-mdp
+    ln -s $out/share/man/man1/mdp.1.gz $out/share/man/man1/gpg-mdp.1.gz
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/misc/gphoto2/default.nix b/nixpkgs/pkgs/applications/misc/gphoto2/default.nix
new file mode 100644
index 000000000000..d06970e8d07c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gphoto2/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, pkgconfig, libgphoto2, libexif, popt, gettext
+, libjpeg, readline, libtool
+}:
+
+stdenv.mkDerivation rec {
+  name = "gphoto2-2.5.23";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gphoto/${name}.tar.bz2";
+    sha256 = "1laqwhxr0xhbykmp0dhd3j4rr2lhj5y228s31afnqxp700hhk1yz";
+  };
+
+  nativeBuildInputs = [ pkgconfig gettext libtool ];
+  buildInputs = [ libgphoto2 libexif popt libjpeg readline ];
+
+  meta = with stdenv.lib; {
+    description = "A ready to use set of digital camera software applications";
+    longDescription = ''
+
+      A set of command line utilities for manipulating over 1400 different
+      digital cameras. Through libgphoto2, it supports PTP, MTP, and much more..
+
+    '';
+    homepage = http://www.gphoto.org/;
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.jcumming ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gphoto2/gphotofs.nix b/nixpkgs/pkgs/applications/misc/gphoto2/gphotofs.nix
new file mode 100644
index 000000000000..7b23fca2121e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gphoto2/gphotofs.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, libtool, pkgconfig, libgphoto2, fuse, glib }:
+
+stdenv.mkDerivation rec {
+  name = "gphoto2fs-${version}";
+  version = "0.5.0";
+  src = fetchurl {
+    url="mirror://sourceforge/gphoto/gphotofs/${version}/gphotofs-0.5.tar.bz2";
+    sha256 = "1k23ncbsbh64r7kz050bg31jqamchyswgg9izhzij758d7gc8vk7";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    libgphoto2 fuse glib libtool
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Fuse FS to mount a digital camera";
+    homepage = http://www.gphoto.org/;
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.linux;
+    license = with licenses; [ lgpl2 gpl2 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gpsbabel/default.nix b/nixpkgs/pkgs/applications/misc/gpsbabel/default.nix
new file mode 100644
index 000000000000..aa0ed5f64632
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gpsbabel/default.nix
@@ -0,0 +1,77 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, zlib, which, IOKit, qtbase }:
+
+stdenv.mkDerivation rec {
+  name = "gpsbabel-${version}";
+  version = "1.6.0";
+
+  src = fetchFromGitHub {
+    owner = "gpsbabel";
+    repo = "gpsbabel";
+    rev = "gpsbabel_${lib.replaceStrings ["."] ["_"] version}";
+    sha256 = "0q17jhmaf7z5lld2ff7h6jb3v1yz8hbwd2rmaq2dsamc53dls8iw";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = https://sources.debian.net/data/main/g/gpsbabel/1.5.3-2/debian/patches/use_minizip;
+      sha256 = "03fpsmlx1wc48d1j405zkzp8j64hcp0z72islf4mk1immql3ibcr";
+    })
+  ];
+
+  buildInputs = [ zlib qtbase which ]
+    ++ lib.optionals stdenv.isDarwin [ IOKit ];
+
+  /* FIXME: Building the documentation, with "make doc", requires this:
+
+      [ libxml2 libxslt perl docbook_xml_dtd_412 docbook_xsl fop ]
+
+    But FOP isn't packaged yet.  */
+
+  configureFlags = [ "--with-zlib=system" ]
+    # Floating point behavior on i686 causes test failures. Preventing
+    # extended precision fixes this problem.
+    ++ stdenv.lib.optionals stdenv.isi686 [
+      "CFLAGS=-ffloat-store" "CXXFLAGS=-ffloat-store"
+    ];
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+  preCheck = ''
+    patchShebangs testo
+    substituteInPlace testo \
+      --replace "-x /usr/bin/hexdump" ""
+  ''
+    # The raymarine and gtm tests fail on i686 despite -ffloat-store.
+  + lib.optionalString stdenv.isi686 "rm -v testo.d/raymarine.test testo.d/gtm.test;"
+    # The gtm, kml and tomtom asc tests fail on darwin, see PR #23572.
+  + lib.optionalString stdenv.isDarwin "rm -v testo.d/gtm.test testo.d/kml.test testo.d/tomtom_asc.test testo.d/classic-2.test"
+    # The arc-project test fails on aarch64.
+  + lib.optionalString stdenv.isAarch64 "rm -v testo.d/arc-project.test";
+
+  meta = with stdenv.lib; {
+    description = "Convert, upload and download data from GPS and Map programs";
+    longDescription = ''
+      GPSBabel converts waypoints, tracks, and routes between popular
+      GPS receivers and mapping programs.  It also has powerful
+      manipulation tools for such data.
+
+      By flattening the Tower of Babel that the authors of various
+      programs for manipulating GPS data have imposed upon us, it
+      returns to us the ability to freely move our own waypoint data
+      between the programs and hardware we choose to use.
+
+      It contains extensive data manipulation abilities making it a
+      convenient for server-side processing or as the backend for
+      other tools.
+
+      It does not convert, transfer, send, or manipulate maps.  We
+      process data that may (or may not be) placed on a map, such as
+      waypoints, tracks, and routes.
+    '';
+    homepage = http://www.gpsbabel.org/;
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.rycee ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gpscorrelate/default.nix b/nixpkgs/pkgs/applications/misc/gpscorrelate/default.nix
new file mode 100644
index 000000000000..5bcaccb43bcf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gpscorrelate/default.nix
@@ -0,0 +1,63 @@
+{ fetchFromGitHub, stdenv, fetchpatch, pkgconfig, exiv2, libxml2, gtk3
+, libxslt, docbook_xsl, docbook_xml_dtd_42, desktop-file-utils }:
+
+stdenv.mkDerivation rec {
+  pname = "gpscorrelate";
+  version = "unstable-2019-06-05";
+
+  src = fetchFromGitHub {
+    owner = "dfandrich";
+    repo = pname;
+    rev = "80b14fe7c10c1cc8f62c13f517c062577ce88c85";
+    sha256 = "1gaan0nd7ai0bwilfnkza7lg5mz87804mvlygj0gjc672izr37r6";
+  };
+
+  nativeBuildInputs = [
+    desktop-file-utils
+    docbook_xml_dtd_42
+    docbook_xsl
+    libxslt
+    pkgconfig
+  ];
+
+  buildInputs = [
+    exiv2
+    gtk3
+    libxml2
+  ];
+
+  makeFlags = [
+    "prefix=${placeholder ''out''}"
+    "GTK=3"
+    "CC=cc"
+    "CXX=c++"
+  ];
+
+  doCheck = true;
+
+  installTargets = [ "install" "install-desktop-file" ];
+
+  meta = with stdenv.lib; {
+    description = "A GPS photo correlation tool, to add EXIF geotags";
+
+    longDescription = ''
+      Digital cameras are cool.  So is GPS.  And, EXIF tags are really
+      cool too.
+
+      What happens when you merge the three?  You end up with a set of
+      photos taken with a digital camera that are "stamped" with the
+      location at which they were taken.
+
+      The EXIF standard defines a number of tags that are for use with GPS.
+
+      A variety of programs exist around the place to match GPS data
+      with digital camera photos, but most of them are Windows or
+      MacOS only.  Which doesn't really suit me that much. Also, each
+      one takes the GPS data in a different format.
+    '';
+
+    license = licenses.gpl2Plus;
+    homepage = "https://github.com/dfandrich/gpscorrelate";
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gpsprune/default.nix b/nixpkgs/pkgs/applications/misc/gpsprune/default.nix
new file mode 100644
index 000000000000..4f0c1864677c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gpsprune/default.nix
@@ -0,0 +1,43 @@
+{ fetchurl, stdenv, makeDesktopItem, makeWrapper, unzip, jre8 }:
+
+stdenv.mkDerivation rec {
+  name = "gpsprune-${version}";
+  version = "19.2";
+
+  src = fetchurl {
+    url = "https://activityworkshop.net/software/gpsprune/gpsprune_${version}.jar";
+    sha256 = "1q2kpkkh75b9l1x7fkmv88s8k84gzcdnrg5sgf8ih0zrp49lawg9";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ jre8 ];
+
+  desktopItem = makeDesktopItem {
+    name = "gpsprune";
+    exec = "gpsprune";
+    icon = "gpsprune";
+    desktopName = "GpsPrune";
+    genericName = "GPS Data Editor";
+    comment = meta.description;
+    categories = "Education;Geoscience;";
+  };
+
+  buildCommand = ''
+    mkdir -p $out/bin $out/share/java
+    cp -v $src $out/share/java/gpsprune.jar
+    makeWrapper ${jre8}/bin/java $out/bin/gpsprune \
+      --add-flags "-jar $out/share/java/gpsprune.jar"
+    mkdir -p $out/share/applications
+    cp $desktopItem/share/applications"/"* $out/share/applications
+    mkdir -p $out/share/pixmaps
+    ${unzip}/bin/unzip -p $src tim/prune/gui/images/window_icon_64.png > $out/share/pixmaps/gpsprune.png
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Application for viewing, editing and converting GPS coordinate data";
+    homepage = https://activityworkshop.net/software/gpsprune/;
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.rycee ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gpx-viewer/default.nix b/nixpkgs/pkgs/applications/misc/gpx-viewer/default.nix
new file mode 100644
index 000000000000..a5ee6c8e4ae5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gpx-viewer/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, intltool, libxml2, pkgconfig, gnome3, libchamplain, gdl, shared-mime-info, desktop-file-utils, wrapGAppsHook }:
+
+stdenv.mkDerivation rec {
+  name = "gpx-viewer-${version}";
+  version = "0.4.0";
+
+  src = fetchurl {
+    url = "https://launchpad.net/gpx-viewer/trunk/${version}/+download/${name}.tar.gz";
+    sha256 = "956acfaf870ac436300cd9953dece630df7fd7dff8e4ae2577a6002884466f80";
+  };
+
+  patches = fetchurl {
+    url = "https://code.launchpad.net/~chkr/gpx-viewer/gtk3-bugfix/+merge/260766/+preview-diff/628965/+files/preview.diff";
+    sha256 = "1yl7jk7skkcx10nny5zdixswcymjd9s9c1zhm1i5y3aqhchvmfs7";
+  };
+  patchFlags = [ "-p0" ];
+
+  nativeBuildInputs = [
+    intltool pkgconfig
+    shared-mime-info # For update-mime-database
+    desktop-file-utils # For update-desktop-database
+    wrapGAppsHook # Fix error: GLib-GIO-ERROR **: No GSettings schemas are installed on the system
+  ];
+  buildInputs = [ gdl libchamplain gnome3.adwaita-icon-theme libxml2 ];
+
+  meta = with stdenv.lib; {
+    homepage = https://blog.sarine.nl/tag/gpxviewer/;
+    description = "Simple tool to visualize tracks and waypoints stored in a gpx file";
+    platforms = with platforms; linux;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ dotlambda ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gpx/default.nix b/nixpkgs/pkgs/applications/misc/gpx/default.nix
new file mode 100644
index 000000000000..9fef93819492
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gpx/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  name = "gpx-${version}";
+  version = "2.5.2";
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  src = fetchFromGitHub {
+    owner = "markwal";
+    repo = "GPX";
+    rev = version;
+    sha256 = "1yab269x8qyf7rd04vaxyqyjv4pzz9lp4sc4dwh927k23avr3rw5";
+  };
+
+  meta = {
+    description = "Gcode to x3g conversion postprocessor";
+    homepage = https://github.com/markwal/GPX/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.leo60228 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gpxsee/default.nix b/nixpkgs/pkgs/applications/misc/gpxsee/default.nix
new file mode 100644
index 000000000000..8c9833ae40d1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gpxsee/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchFromGitHub, qmake, qttools, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "gpxsee";
+  version = "7.9";
+
+  src = fetchFromGitHub {
+    owner = "tumic0";
+    repo = "GPXSee";
+    rev = version;
+    sha256 = "029l5dhc9nnxiw7p0s4gyfkcqw709z7lz96aq8krs75mfk4fv07k";
+  };
+
+  nativeBuildInputs = [ qmake makeWrapper ];
+  buildInputs = [ qttools ];
+
+  preConfigure = ''
+    lrelease lang/*.ts
+  '';
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    wrapProgram $out/bin/gpxsee \
+      --prefix XDG_DATA_DIRS ":" $out/share
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://www.gpxsee.org/;
+    description = "GPS log file viewer and analyzer";
+    longDescription = ''
+      GPXSee is a Qt-based GPS log file viewer and analyzer that supports
+      all common GPS log file formats.
+    '';
+    license = licenses.gpl3;
+    maintainers = [ maintainers.womfoo ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gramps/default.nix b/nixpkgs/pkgs/applications/misc/gramps/default.nix
new file mode 100644
index 000000000000..e9026ded4702
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gramps/default.nix
@@ -0,0 +1,65 @@
+{ stdenv, fetchFromGitHub, gtk3, pythonPackages, intltool, gnome3,
+  pango, gobject-introspection, wrapGAppsHook, gettext,
+# Optional packages:
+ enableOSM ? true, osm-gps-map,
+ enableGraphviz ? true, graphviz,
+ enableGhostscript ? true, ghostscript
+ }:
+
+let
+  inherit (pythonPackages) python buildPythonApplication;
+in buildPythonApplication rec {
+  version = "5.0.1";
+  name = "gramps-${version}";
+
+  nativeBuildInputs = [ wrapGAppsHook gettext ];
+  buildInputs = [ intltool gtk3 gobject-introspection pango gnome3.gexiv2 ] 
+    # Map support
+    ++ stdenv.lib.optional enableOSM osm-gps-map
+    # Graphviz support
+    ++ stdenv.lib.optional enableGraphviz graphviz
+    # Ghostscript support
+    ++ stdenv.lib.optional enableGhostscript ghostscript
+    
+  ;
+
+  src = fetchFromGitHub {
+    owner = "gramps-project";
+    repo = "gramps";
+    rev = "v${version}";
+    sha256 = "1jz1fbjj6byndvir7qxzhd2ryirrd5h2kwndxpp53xdc05z1i8g7";
+  };
+
+  pythonPath = with pythonPackages; [ bsddb3 PyICU pygobject3 pycairo ];
+
+  # Same installPhase as in buildPythonApplication but without --old-and-unmanageble
+  # install flag.
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p "$out/lib/${python.libPrefix}/site-packages"
+
+    export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
+
+    ${python}/bin/${python.executable} setup.py install \
+      --install-lib=$out/lib/${python.libPrefix}/site-packages \
+      --prefix="$out"
+
+    eapth="$out/lib/${python.libPrefix}"/site-packages/easy-install.pth
+    if [ -e "$eapth" ]; then
+        # move colliding easy_install.pth to specifically named one
+        mv "$eapth" $(dirname "$eapth")/${name}.pth
+    fi
+
+    rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py*
+
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Genealogy software";
+    homepage = https://gramps-project.org;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ joncojonathan ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/green-pdfviewer/default.nix b/nixpkgs/pkgs/applications/misc/green-pdfviewer/default.nix
new file mode 100644
index 000000000000..00421a2e0334
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/green-pdfviewer/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, poppler, pkgconfig, gdk_pixbuf, SDL, gtk2 }:
+
+stdenv.mkDerivation rec {
+  name = "green-pdfviewer-${version}";
+  version = "nightly-2014-04-22";
+
+  src = fetchFromGitHub {
+    owner = "schandinat";
+    repo = "green";
+    rev = "0b516aec17915d9742d8e505d2ed383a3bdcea61";
+    sha256 = "0d0lv33flhgsxhc77kfp2avdz5gvml04r8l1j95yjz2rr096lzlj";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ poppler gdk_pixbuf SDL gtk2 ];
+
+  patches = [
+    ./gdk-libs.patch
+  ];
+
+  buildPhase = ''
+    make PREFIX=$out
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/man1
+    make install PREFIX=$out MANDIR=$out/share
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/schandinat/green/;
+    description = "Viewer for PDF files, uses SDL and libpoppler";
+
+    platforms = platforms.unix;
+    license  = licenses.gpl3;
+    maintainers = [ maintainers.vrthra ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/green-pdfviewer/gdk-libs.patch b/nixpkgs/pkgs/applications/misc/green-pdfviewer/gdk-libs.patch
new file mode 100644
index 000000000000..cfcab32aac99
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/green-pdfviewer/gdk-libs.patch
@@ -0,0 +1,55 @@
+Common subdirectories: green.old/debian and green.new/debian
+diff -u green.old/green.h green.new/green.h
+--- green.old/green.h	2016-06-12 18:11:56.779434416 -0700
++++ green.new/green.h	2016-06-12 18:14:38.830557379 -0700
+@@ -19,7 +19,14 @@
+ 
+ 
+ #include <stdbool.h>
+-#include "glib/poppler.h"
++#include "poppler.h"
++#include "gdk-pixbuf/gdk-pixbuf.h"
++#include "gdk-pixbuf/gdk-pixbuf-core.h"
++#include "gdk-pixbuf/gdk-pixbuf-features.h"
++#include "gdk-pixbuf/gdk-pixbuf-enum-types.h"
++ 
++ #define GREEN_FULLSCREEN	0x0001
++ 
+ 
+ 
+ #define GREEN_FULLSCREEN	0x0001
+diff -u green.old/Makefile green.new/Makefile
+--- green.old/Makefile	2016-06-12 18:11:56.779434416 -0700
++++ green.new/Makefile	2016-06-12 18:13:09.591974048 -0700
+@@ -17,6 +17,12 @@
+ SDL_CFLAGS	:=	$$(sdl-config --cflags)
+ SDL_LIBS	:=	$$(sdl-config --libs)
+ 
++GDKPIXBUF_CFLAGS	:=	$$(pkg-config gdk-pixbuf-2.0 --cflags)
++GDKPIXBUF_LIBS	:=	$$(pkg-config gdk-pixbuf-2.0 --libs)
++
++GTK_CFLAGS	:=	$$(pkg-config gtk+-2.0 --cflags)
++GTK_LIBS	:=	$$(pkg-config gtk+-2.0 --libs)
++
+ 
+ all: green
+ 
+@@ -28,13 +34,14 @@
+ 	$(INSTALL) green.1 $(MANDIR)/man1/
+ 
+ green: main.o green.o sdl.o
+-	$(CC) $^ $(POPPLER_LIBS) $(SDL_LIBS) -o $@
++	$(CC) $^ $(POPPLER_LIBS) $(SDL_LIBS) $(GDKPIXBUF_LIBS) $(GTK_LIBS) -o $@
+ 
+ main.o: main.c green.h
+-	$(CC) $(CONFIG) $(CFLAGS) -c $< $(POPPLER_CFLAGS) -o $@
++	$(CC) $(CONFIG) $(CFLAGS) $(GDKPIXBUF_CFLAGS) -c $< $(POPPLER_CFLAGS) -o $@
+ 
+ green.o: green.c green.h
+-	$(CC) $(CFLAGS) -c $< $(POPPLER_CFLAGS) -o $@
++	$(CC) $(CFLAGS) -c $< $(POPPLER_CFLAGS)  $(GDKPIXBUF_CFLAGS) -o $@
+ 
+ sdl.o: sdl.c green.h
+-	$(CC) $(CFLAGS) -c $< $(POPPLER_CFLAGS) $(SDL_CFLAGS) -o $@
++	$(CC) $(CFLAGS) -c $< $(POPPLER_CFLAGS) $(SDL_CFLAGS) $(GDKPIXBUF_CFLAGS) $(GTK_CFLAGS) -o $@
++
diff --git a/nixpkgs/pkgs/applications/misc/gremlin-console/default.nix b/nixpkgs/pkgs/applications/misc/gremlin-console/default.nix
new file mode 100644
index 000000000000..9274c2d05216
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gremlin-console/default.nix
@@ -0,0 +1,29 @@
+{ fetchzip, stdenv, makeWrapper, openjdk }:
+
+stdenv.mkDerivation rec {
+  name = "gremlin-console-${version}";
+  version = "3.3.4";
+  src = fetchzip {
+    url = "http://www-eu.apache.org/dist/tinkerpop/${version}/apache-tinkerpop-gremlin-console-${version}-bin.zip";
+    sha256 = "14xr0yqklmm4jvj1hnkj89lj83zzs2l1375ni0jbf12gy31jlb2w";
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out/opt
+    cp -r ext lib $out/opt/
+    install -D bin/gremlin.sh $out/opt/bin/gremlin-console
+    makeWrapper $out/opt/bin/gremlin-console $out/bin/gremlin-console \
+      --prefix PATH ":" "${openjdk}/bin/" \
+      --set CLASSPATH "$out/opt/lib/"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://tinkerpop.apache.org/;
+    description = "Console of the Apache TinkerPop graph computing framework";
+    license = licenses.asl20;
+    maintainers = [ maintainers.lewo ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/grip/default.nix b/nixpkgs/pkgs/applications/misc/grip/default.nix
new file mode 100644
index 000000000000..cb407fca66cb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/grip/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, gtk2, glib, pkgconfig, libgnome, libgnomeui, vte
+, curl, cdparanoia, libid3tag, ncurses, libtool }:
+
+stdenv.mkDerivation rec {
+  name = "grip-3.3.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/grip/${name}.tar.gz";
+    sha256 = "1zb6zpq7qmn6bflbgfwisyg3vrjr23yi1c1kqvwndl1f0shr8qyl";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ gtk2 glib libgnome libgnomeui vte curl cdparanoia
+    libid3tag ncurses libtool ];
+
+  hardeningDisable = [ "format" ];
+
+  meta = {
+    description = "GTK+-based audio CD player/ripper";
+    homepage = http://nostatic.org/grip;
+    license = stdenv.lib.licenses.gpl2;
+
+    maintainers = with stdenv.lib.maintainers; [ marcweber peti ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/grsync/default.nix b/nixpkgs/pkgs/applications/misc/grsync/default.nix
new file mode 100644
index 000000000000..3e1bb31091f8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/grsync/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, dee, gtk2, intltool, libdbusmenu-gtk2, libunity, pkg-config, rsync }:
+
+stdenv.mkDerivation rec {
+  version = "1.2.6";
+  pname = "grsync";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/grsync/grsync-${version}.tar.gz";
+    sha256 = "06ani65d58p8r3jvxjwpwyqrr07ya3icdqc243nxcrv7bvmarmb6";
+  };
+
+  nativeBuildInputs = [
+    intltool
+    pkg-config
+  ];
+
+  buildInputs = [
+    dee
+    gtk2
+    libdbusmenu-gtk2
+    libunity
+    rsync
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Grsync is used to synchronize folders, files and make backups";
+    homepage = "http://www.opbyte.it/grsync/";
+    license = licenses.gpl1;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.kuznero ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gsimplecal/default.nix b/nixpkgs/pkgs/applications/misc/gsimplecal/default.nix
new file mode 100644
index 000000000000..7f3b3a8d6dc5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gsimplecal/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl, automake, autoconf, pkgconfig, gtk3 }:
+
+stdenv.mkDerivation rec {
+  name = "gsimplecal-${version}";
+  version = "2.1";
+
+  src = fetchurl {
+    url = "https://github.com/dmedvinsky/gsimplecal/archive/v${version}.tar.gz";
+    sha256 = "1sa05ifjp41xipfspk5n6l3wzpzmp3i45q88l01p4l6k6drsq336";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ automake autoconf gtk3 ];
+
+  preConfigure = "./autogen.sh";
+
+  meta = {
+    homepage = http://dmedvinsky.github.io/gsimplecal/;
+    description = "Lightweight calendar application written in C++ using GTK";
+    longDescription = ''
+      gsimplecal was intentionally made for use with tint2 panel in the
+      openbox environment to be launched upon clock click, but of course it
+      will work without it. In fact, binding the gsimplecal to some hotkey in
+      you window manager will probably make you happy. The thing is that when
+      it is started it first shows up, when you run it again it closes the
+      running instance. In that way it is very easy to integrate anywhere. No
+      need to write some wrapper scripts or whatever.
+
+      Also, you can configure it to not only show the calendar, but also
+      display multiple clocks for different world time zones.
+    '';
+    license = stdenv.lib.licenses.bsd3;
+    maintainers = [ stdenv.lib.maintainers.romildo ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gtk2fontsel/default.nix b/nixpkgs/pkgs/applications/misc/gtk2fontsel/default.nix
new file mode 100644
index 000000000000..8f683272e120
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gtk2fontsel/default.nix
@@ -0,0 +1,29 @@
+{stdenv, fetchurl, pkgconfig, gtk2 }:
+
+stdenv.mkDerivation rec {
+  version = "0.1";
+  name = "gtk2fontsel-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gtk2fontsel/${name}.tar.gz";
+    sha256 = "0s2sj19n8ys92q9832hkn36ld91bb4qavicc6nygkry6qdpkkmjw";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ stdenv gtk2 ];
+
+  preferLocalBuild = true;
+
+  meta = with stdenv.lib; {
+    description = "A font selection program for X11 using the GTK2 toolkit";
+    longDescription = ''
+      Font selection tool similar to xfontsel implemented using GTK+ 2.
+      Trivial, but useful nonetheless.
+    '';
+    homepage = http://gtk2fontsel.sourceforge.net/;
+    downloadPage = https://sourceforge.net/projects/gtk2fontsel/;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.prikhi ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/guake/default.nix b/nixpkgs/pkgs/applications/misc/guake/default.nix
new file mode 100644
index 000000000000..37352915cb84
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/guake/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchFromGitHub, python3, gettext, gobject-introspection, wrapGAppsHook, glibcLocales
+, gtk3, keybinder3, libnotify, libutempter, vte, libwnck3 }:
+
+let
+  version = "3.6.3";
+in python3.pkgs.buildPythonApplication rec {
+  name = "guake-${version}";
+  format = "other";
+
+  src = fetchFromGitHub {
+    owner = "Guake";
+    repo = "guake";
+    rev = version;
+    sha256 = "13ipnmqcyixpa6qv83m0f91za4kar14s5jpib68b32z65x1h0j3b";
+  };
+
+  # Strict deps breaks guake
+  # See https://github.com/NixOS/nixpkgs/issues/59930
+  # and https://github.com/NixOS/nixpkgs/issues/56943
+  strictDeps = false;
+
+  nativeBuildInputs = [ gettext gobject-introspection wrapGAppsHook python3.pkgs.pip glibcLocales ];
+
+  buildInputs = [ gtk3 keybinder3 libnotify python3 vte ];
+
+  propagatedBuildInputs = with python3.pkgs; [ dbus-python pbr pycairo pygobject3 libwnck3 ];
+
+  LC_ALL = "en_US.UTF-8"; # fixes weird encoding error, see https://github.com/NixOS/nixpkgs/pull/38642#issuecomment-379727699
+
+  PBR_VERSION = version; # pbr needs either .git directory, sdist, or env var
+
+  makeFlags = [
+    "prefix=$(out)"
+  ];
+
+  preFixup = ''
+    gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ libutempter ]}")
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Drop-down terminal for GNOME";
+    homepage = http://guake-project.org;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.msteen ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gummi/default.nix b/nixpkgs/pkgs/applications/misc/gummi/default.nix
new file mode 100644
index 000000000000..1e237923d054
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gummi/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, pkgs, makeWrapper
+, glib, gnome2, gnome3, gtk2-x11, gtkspell2, poppler
+, pkgconfig, intltool, autoreconfHook, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  version = "0.6.6";
+  name = "gummi-${version}";
+
+  src = pkgs.fetchFromGitHub {
+    owner = "alexandervdm";
+    repo = "gummi";
+    rev = "${version}";
+    sha256 = "1vw8rhv8qj82l6l22kpysgm9mxilnki2kjmvxsnajbqcagr6s7cn";
+  };
+
+  nativeBuildInputs = [
+    pkgconfig intltool autoreconfHook makeWrapper wrapGAppsHook
+  ];
+  buildInputs = [
+    glib gnome2.gtksourceview gnome2.pango gtk2-x11 gtkspell2 poppler
+    gnome3.adwaita-icon-theme
+  ];
+
+  preConfigure = ''
+    gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "${pkgs.gnome2.gtksourceview}/share")
+  '';
+
+  postInstall = ''
+    install -Dpm644 COPYING $out/share/licenses/$name/COPYING
+  '';
+
+  meta = {
+    homepage = http://gummi.midnightcoding.org/;
+    description = "Simple LaTex editor for GTK users";
+    license = stdenv.lib.licenses.mit;
+    maintainers = with stdenv.lib.maintainers; [ flokli ];
+    platforms = with stdenv.lib.platforms; linux;
+    inherit version;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gv/default.nix b/nixpkgs/pkgs/applications/misc/gv/default.nix
new file mode 100644
index 000000000000..f94f8f5dd707
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gv/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchurl, Xaw3d, ghostscriptX, perl, pkgconfig, libiconv }:
+
+let
+  name = "gv-3.7.4";
+in
+stdenv.mkDerivation {
+  inherit name;
+
+  src = fetchurl {
+    url = "mirror://gnu/gv/${name}.tar.gz";
+    sha256 = "0q8s43z14vxm41pfa8s5h9kyyzk1fkwjhkiwbf2x70alm6rv6qi1";
+  };
+
+  configureFlags = stdenv.lib.optionals stdenv.isDarwin [
+    "--enable-SIGCHLD-fallback"
+  ];
+
+  buildInputs = [
+    Xaw3d
+    ghostscriptX
+    perl
+    pkgconfig
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+    libiconv
+  ];
+
+  patchPhase = ''
+    sed 's|\<gs\>|${ghostscriptX}/bin/gs|g' -i "src/"*.in
+    sed 's|"gs"|"${ghostscriptX}/bin/gs"|g' -i "src/"*.c
+  '';
+
+  doCheck = true;
+
+  meta = {
+    homepage = https://www.gnu.org/software/gv/;
+    description = "PostScript/PDF document viewer";
+
+    longDescription = ''
+      GNU gv allows users to view and navigate through PostScript and
+      PDF documents on an X display by providing a graphical user
+      interface for the Ghostscript interpreter.
+    '';
+
+    license = stdenv.lib.licenses.gpl3Plus;
+    maintainers = [ ];
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gxmessage/default.nix b/nixpkgs/pkgs/applications/misc/gxmessage/default.nix
new file mode 100644
index 000000000000..a9e6d905c284
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gxmessage/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, gtk3, intltool, pkgconfig, texinfo, hicolor-icon-theme }:
+
+stdenv.mkDerivation rec {
+  name = "gxmessage-${version}";
+  version = "3.4.3";
+
+  src = fetchurl {
+    url = "http://homepages.ihug.co.nz/~trmusson/stuff/${name}.tar.gz";
+    sha256 = "db4e1655fc58f31e5770a17dfca4e6c89028ad8b2c8e043febc87a0beedeef05";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ intltool gtk3 texinfo hicolor-icon-theme ];
+
+  meta = {
+    description = "A GTK enabled dropin replacement for xmessage";
+    homepage = "http://homepages.ihug.co.nz/~trmusson/programs.html#gxmessage";
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = with stdenv.lib.maintainers; [jfb];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/gxneur/default.nix b/nixpkgs/pkgs/applications/misc/gxneur/default.nix
new file mode 100644
index 000000000000..7d19a9cb1108
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/gxneur/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, pkgconfig, intltool, gtk2, xorg, glib, xneur, libglade, GConf, libappindicator-gtk2, pcre }:
+
+stdenv.mkDerivation {
+  name = "gxneur-0.20.0";
+
+  src = fetchurl {
+    url = https://github.com/AndrewCrewKuznetsov/xneur-devel/raw/f66723feb272c68f7c22a8bf0dbcafa5e3a8a5ee/dists/0.20.0/gxneur_0.20.0.orig.tar.gz;
+    sha256 = "0avmhdcj0hpr55fc0iih8fjykmdhn34c8mwdnqvl8jh4nhxxchxr";
+  };
+
+  NIX_CFLAGS_COMPILE = "-Wno-deprecated-declarations";
+
+  nativeBuildInputs = [ pkgconfig intltool ];
+  buildInputs = [
+    xorg.libX11 glib gtk2 xorg.libXpm xorg.libXt xorg.libXext xneur
+    libglade GConf pcre libappindicator-gtk2
+  ];
+
+  meta = with stdenv.lib; {
+    description = "GUI for XNEUR keyboard layout switcher";
+    platforms = platforms.linux;
+    license = with licenses; [ gpl2 gpl3 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/hamster-time-tracker/default.nix b/nixpkgs/pkgs/applications/misc/hamster-time-tracker/default.nix
new file mode 100644
index 000000000000..9360e220ab6a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/hamster-time-tracker/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchzip, pythonPackages, docbook2x, libxslt, gnome-doc-utils
+, intltool, dbus-glib, gnome_python
+, hicolor-icon-theme
+, wafHook
+}:
+
+# TODO: Add optional dependency 'wnck', for "workspace tracking" support. Fixes
+# this message:
+#
+#   WARNING:root:Could not import wnck - workspace tracking will be disabled
+
+pythonPackages.buildPythonApplication rec {
+  name = "hamster-time-tracker-1.04";
+
+  src = fetchzip {
+    name = "${name}-src";
+    url = "https://github.com/projecthamster/hamster/archive/${name}.tar.gz";
+    sha256 = "1a85rcg561792kdyv744cgzw7mmpmgv6d6li1sijfdpqa1ninf8g";
+  };
+
+  nativeBuildInputs = [ wafHook intltool ];
+  buildInputs = [
+    docbook2x libxslt gnome-doc-utils dbus-glib hicolor-icon-theme
+  ];
+
+  propagatedBuildInputs = with pythonPackages; [ pygobject2 pygtk pyxdg gnome_python dbus-python ];
+
+  postFixup = ''
+    wrapPythonProgramsIn $out/lib/hamster-time-tracker "$out $pythonPath"
+  '';
+
+  # error: invalid command 'test'
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "Time tracking application";
+    homepage = https://projecthamster.wordpress.com/;
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/haxor-news/default.nix b/nixpkgs/pkgs/applications/misc/haxor-news/default.nix
new file mode 100644
index 000000000000..7353078600d1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/haxor-news/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, python, fetchpatch }:
+
+with python.pkgs;
+
+buildPythonApplication rec {
+  pname = "haxor-news";
+  version = "0.4.3";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "5b9af8338a0f8b95a8133b66ef106553823813ac171c0aefa3f3f2dbeb4d7f88";
+  };
+
+  # allow newer click version
+  patches = fetchpatch {
+    url = "${meta.homepage}/commit/5b0d3ef1775756ca15b6d83fba1fb751846b5427.patch";
+    sha256 = "1551knh2f7yarqzcpip16ijmbx8kzdna8cihxlxx49ww55f5sg67";
+  };
+
+  propagatedBuildInputs = [
+    click
+    colorama
+    requests
+    pygments
+    prompt_toolkit
+    six
+  ];
+
+  doCheck = false;
+
+  checkInputs = [ mock ];
+
+  checkPhase = ''
+    ${python.interpreter} -m unittest discover -s tests -v
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/donnemartin/haxor-news;
+    description = "Browse Hacker News like a haxor";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ matthiasbeyer ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/hdate/default.nix b/nixpkgs/pkgs/applications/misc/hdate/default.nix
new file mode 100644
index 000000000000..e2f5f653d47c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/hdate/default.nix
@@ -0,0 +1,16 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "1.6.02";
+  name = "hdate-${version}";
+  src = fetchurl {
+    url = "https://sourceforge.net/projects/libhdate/files/libhdate/libhdate-${version}/libhdate-${version}.tar.bz2";
+    sha256 = "3c930a8deb57c01896dc37f0d7804e5a330ee8e88c4ff610b71f9d2b02c17762";
+  };
+  meta = {
+    description = "Hebrew calendar and solar astronomical times library and utilities";
+    homepage = https://sourceforge.net/projects/libhdate/;
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = with stdenv.lib.maintainers; [ CharlesHD ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/hello-unfree/default.nix b/nixpkgs/pkgs/applications/misc/hello-unfree/default.nix
new file mode 100644
index 000000000000..1647a09edfd6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/hello-unfree/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, runtimeShell }:
+
+stdenv.mkDerivation rec {
+  name = "example-unfree-package-${version}";
+  version = "1.0";
+
+  phases = [ "installPhase" "fixupPhase" ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cat > $out/bin/hello-unfree << EOF
+    #!${runtimeShell}
+    echo "Hello, you are running an unfree system!"
+    EOF
+    chmod +x $out/bin/hello-unfree
+  '';
+
+  meta = {
+    description = "An example package with unfree license (for testing)";
+    license = stdenv.lib.licenses.unfree;
+    maintainers = [ stdenv.lib.maintainers.oxij ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/hello/default.nix b/nixpkgs/pkgs/applications/misc/hello/default.nix
new file mode 100644
index 000000000000..63a8af99f7cf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/hello/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "hello-${version}";
+  version = "2.10";
+
+  src = fetchurl {
+    url = "mirror://gnu/hello/${name}.tar.gz";
+    sha256 = "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i";
+  };
+
+  doCheck = true;
+
+  meta = with stdenv.lib; {
+    description = "A program that produces a familiar, friendly greeting";
+    longDescription = ''
+      GNU Hello is a program that prints "Hello, world!" when you run it.
+      It is fully customizable.
+    '';
+    homepage = https://www.gnu.org/software/hello/manual/;
+    changelog = "https://git.savannah.gnu.org/cgit/hello.git/plain/NEWS?h=v${version}";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.eelco ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/hivemind/default.nix b/nixpkgs/pkgs/applications/misc/hivemind/default.nix
new file mode 100644
index 000000000000..0431f35057be
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/hivemind/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, buildGoPackage, fetchFromGitHub }:
+
+buildGoPackage rec {
+  name = "hivemind-${version}";
+  version = "1.0.4";
+  goPackagePath = "github.com/DarthSim/hivemind";
+
+  src = fetchFromGitHub {
+    owner = "DarthSim";
+    repo = "hivemind";
+    rev = "v${version}";
+    sha256 = "1z2izvyf0j3gi0cas5v22kkmkls03sg67182k8v3p6kwhzn0jw67";
+  };
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/DarthSim/;
+    description = "Process manager for Procfile-based applications";
+    license = with licenses; [ mit ];
+    maintainers = [ maintainers.sveitser ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/houdini/default.nix b/nixpkgs/pkgs/applications/misc/houdini/default.nix
new file mode 100644
index 000000000000..607dff293189
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/houdini/default.nix
@@ -0,0 +1,14 @@
+{ callPackage, buildFHSUserEnv, undaemonize }:
+
+let
+  houdini-runtime = callPackage ./runtime.nix { };
+in buildFHSUserEnv rec {
+  name = "houdini-${houdini-runtime.version}";
+
+  extraBuildCommands = ''
+    mkdir -p $out/usr/lib/sesi
+  '';
+
+  runScript = "${undaemonize}/bin/undaemonize ${houdini-runtime}/bin/houdini";
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/houdini/runtime.nix b/nixpkgs/pkgs/applications/misc/houdini/runtime.nix
new file mode 100644
index 000000000000..500f1df36a0c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/houdini/runtime.nix
@@ -0,0 +1,86 @@
+{ stdenv, requireFile, zlib, libpng, libSM, libICE, fontconfig, xorg, libGLU, libGL, alsaLib, dbus, xkeyboardconfig, bc }:
+
+let
+  ld_library_path = builtins.concatStringsSep ":" [
+    "${stdenv.cc.cc.lib}/lib64"
+    (stdenv.lib.makeLibraryPath [
+      libGLU
+      libGL
+      xorg.libXmu
+      xorg.libXi
+      xorg.libXext
+      xorg.libX11
+      xorg.libXrender
+      xorg.libXcursor
+      xorg.libXfixes
+      xorg.libXrender
+      xorg.libXcomposite
+      xorg.libXdamage
+      xorg.libXtst
+      alsaLib
+      fontconfig
+      libSM
+      libICE
+      zlib
+      libpng
+      dbus
+    ])
+  ];
+  license_dir = "~/.config/houdini";
+in
+stdenv.mkDerivation rec {
+  version = "17.0.352";
+  name = "houdini-runtime-${version}";
+  src = requireFile rec {
+    name = "houdini-${version}-linux_x86_64_gcc6.3.tar.gz";
+    sha256 = "0cl5fkgaplb0cvv7mli06ffc9j4ngpy8hl5zqabj3d645gcgafjg";
+    message = ''
+      This nix expression requires that ${name} is already part of the store.
+      Download it from https://sidefx.com and add it to the nix store with:
+
+          nix-prefetch-url <URL>
+
+      This can't be done automatically because you need to create an account on
+      their website and agree to their license terms before you can download
+      it. That's what you get for using proprietary software.
+    '';
+  };
+
+  buildInputs = [ bc ];
+  installPhase = ''
+    patchShebangs houdini.install
+    mkdir -p $out
+    sed -i "s|/usr/lib/sesi|${license_dir}|g" houdini.install
+    ./houdini.install --install-houdini \
+                      --no-install-menus \
+                      --no-install-bin-symlink \
+                      --auto-install \
+                      --no-root-check \
+                      --accept-EULA \
+                      $out
+    echo -e "localValidatorDir = ${license_dir}\nlicensingMode = localValidator" > $out/houdini/Licensing.opt
+    sed -i "s|/usr/lib/sesi|${license_dir}|g" $out/houdini/sbin/sesinetd_safe
+    sed -i "s|/usr/lib/sesi|${license_dir}|g" $out/houdini/sbin/sesinetd.startup
+    echo "export LD_LIBRARY_PATH=${ld_library_path}" >> $out/bin/app_init.sh
+    echo "export QT_XKB_CONFIG_ROOT="${xkeyboardconfig}/share/X11/xkb"" >> $out/bin/app_init.sh
+    echo "export LD_LIBRARY_PATH=${ld_library_path}" >> $out/houdini/sbin/app_init.sh
+    echo "export QT_XKB_CONFIG_ROOT="${xkeyboardconfig}/share/X11/xkb"" >> $out/houdini/sbin/app_init.sh
+  '';
+  postFixup = ''
+    INTERPRETER="$(cat "$NIX_CC"/nix-support/dynamic-linker)"
+    for BIN in $(find $out/bin -type f -executable); do
+      if patchelf $BIN 2>/dev/null ; then
+        echo "Patching ELF $BIN"
+        patchelf --set-interpreter "$INTERPRETER" "$BIN"
+      fi
+    done
+  '';
+  meta = {
+    description = "3D animation application software";
+    homepage = https://sidefx.com;
+    license = stdenv.lib.licenses.unfree;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.canndrew ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/hovercraft/default.nix b/nixpkgs/pkgs/applications/misc/hovercraft/default.nix
new file mode 100644
index 000000000000..ba23078bba93
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/hovercraft/default.nix
@@ -0,0 +1,35 @@
+{ lib
+, buildPythonApplication
+, isPy3k
+, fetchFromGitHub
+, manuel
+, setuptools
+, docutils
+, lxml
+, svg-path
+, pygments
+, watchdog
+}:
+
+buildPythonApplication rec {
+  pname = "hovercraft";
+  version = "2.6";
+  disabled = ! isPy3k;
+
+  src = fetchFromGitHub {
+    owner = "regebro";
+    repo = "hovercraft";
+    rev = version;
+    sha256 = "150sn6kvqi2s89di1akl5i0g81fasji2ipr12zq5s4dcnhw4r5wp";
+  };
+
+  checkInputs = [ manuel ];
+  propagatedBuildInputs = [ setuptools docutils lxml svg-path pygments watchdog ];
+
+  meta = with lib; {
+    description = "Makes impress.js presentations from reStructuredText";
+    homepage = https://github.com/regebro/hovercraft;
+    license = licenses.mit;
+    maintainers = with maintainers; [ goibhniu makefu ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/hr/default.nix b/nixpkgs/pkgs/applications/misc/hr/default.nix
new file mode 100644
index 000000000000..2fd56e3c5552
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/hr/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  name = "hr-${version}";
+  version = "1.2";
+
+  src = fetchFromGitHub {
+    owner = "LuRsT";
+    repo = "hr";
+    rev = version;
+    sha256 = "162vkip2772jl59lschpinimpg4ssiyg7fq0va5cx4d7wldpqmks";
+  };
+
+  dontBuild = true;
+  installFlags = [ "PREFIX=$(out)" "MANPREFIX=$(out)/share" ];
+
+  preInstall = ''
+    mkdir -p $out/{bin,share}
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/LuRsT/hr;
+    description = "A horizontal bar for your terminal";
+    license = licenses.mit;
+    maintainers = [ maintainers.matthiasbeyer ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/hstr/default.nix b/nixpkgs/pkgs/applications/misc/hstr/default.nix
new file mode 100644
index 000000000000..1eae8c57fc4e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/hstr/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, readline, ncurses }:
+
+stdenv.mkDerivation rec {
+  name    = "hstr-${version}";
+  version = "1.25";
+
+  src = fetchurl {
+    url = "https://github.com/dvorka/hstr/releases/download/${version}/hh-${version}-src.tgz";
+    sha256 = "10njj0a3s5czv497wk3whka3gxr7vmhabs12vaw7kgb07h4ssnhg";
+  };
+
+  buildInputs = [ readline ncurses ];
+
+  meta = {
+    homepage = https://github.com/dvorka/hstr;
+    description = "Shell history suggest box - easily view, navigate, search and use your command history";
+    license = stdenv.lib.licenses.asl20;
+    maintainers = [ stdenv.lib.maintainers.matthiasbeyer ];
+    platforms = with stdenv.lib.platforms; linux; # Cannot test others
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/hubstaff/default.nix b/nixpkgs/pkgs/applications/misc/hubstaff/default.nix
new file mode 100644
index 000000000000..acdeec10d300
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/hubstaff/default.nix
@@ -0,0 +1,65 @@
+{ stdenv, fetchurl, unzip, makeWrapper, libX11, zlib, libSM, libICE
+, libXext , freetype, libXrender, fontconfig, libXft, libXinerama
+, libXfixes, libXScrnSaver, libnotify, glib , gtk3, libappindicator-gtk3
+, curl }:
+
+let
+
+  data = builtins.fromJSON (builtins.readFile ./revision.json);
+
+  inherit (data) version url sha256;
+
+  rpath = stdenv.lib.makeLibraryPath
+    [ libX11 zlib libSM libICE libXext freetype libXrender fontconfig libXft
+      libXinerama stdenv.cc.cc.lib libnotify glib gtk3 libappindicator-gtk3
+      curl libXfixes libXScrnSaver ];
+
+in
+
+stdenv.mkDerivation {
+  name = "hubstaff-${version}";
+
+  src = fetchurl { inherit sha256 url; };
+
+  nativeBuildInputs = [ unzip makeWrapper ];
+
+  unpackCmd = ''
+    # MojoSetups have a ZIP file at the end. ZIP’s magic string is
+    # most often PK\x03\x04. This has worked for all past updates,
+    # but feel free to come up with something more reasonable.
+    dataZipOffset=$(grep --max-count=1 --byte-offset --only-matching --text ''$'PK\x03\x04' $curSrc | cut -d: -f1)
+    dd bs=$dataZipOffset skip=1 if=$curSrc of=data.zip 2>/dev/null
+    unzip -q data.zip "data/*"
+    rm data.zip
+  '';
+
+  dontBuild = true;
+
+  installPhase = ''
+    # TODO: handle 32-bit arch?
+    rm -r x86
+    rm -r x86_64/lib64
+
+    opt=$out/opt/hubstaff
+    mkdir -p $out/bin $opt
+    cp -r . $opt/
+
+    for f in "$opt/x86_64/"*.bin.x86_64 ; do
+      patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) $f
+      wrapProgram $f --prefix LD_LIBRARY_PATH : ${rpath}
+    done
+
+    ln -s $opt/x86_64/HubstaffClient.bin.x86_64 $out/bin/HubstaffClient
+
+    # Why is this needed? SEGV otherwise.
+    ln -s $opt/data/resources $opt/x86_64/resources
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Time tracking software";
+    homepage = https://hubstaff.com/;
+    license = licenses.unfree;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ michalrus srghma ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/hubstaff/revision.json b/nixpkgs/pkgs/applications/misc/hubstaff/revision.json
new file mode 100644
index 000000000000..f39860fac583
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/hubstaff/revision.json
@@ -0,0 +1,5 @@
+{
+  "url": "https://hubstaff-production.s3.amazonaws.com/downloads/HubstaffClient/Builds/Release/1.4.6-4aba8ab5/Hubstaff-1.4.6-4aba8ab5.sh",
+  "version": "1.4.6-4aba8ab5",
+  "sha256": "14js4d7wazn5r5p9n3iic9kwqrinm079jj1k7r00v684jrgq62fc"
+}
diff --git a/nixpkgs/pkgs/applications/misc/hubstaff/update.sh b/nixpkgs/pkgs/applications/misc/hubstaff/update.sh
new file mode 100755
index 000000000000..c4c1caf55db4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/hubstaff/update.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p nix-prefetch-git curl
+
+SCRIPT_DIR=$(dirname "$(readlink -f "$BASH_SOURCE")")
+
+installation_script_url=$(curl --fail --head --location --silent --output /dev/null --write-out %{url_effective} https://app.hubstaff.com/download/linux)
+
+version=$(echo "$installation_script_url" | sed -r 's/^https:\/\/hubstaff\-production\.s3\.amazonaws\.com\/downloads\/HubstaffClient\/Builds\/Release\/([^\/]+)\/Hubstaff.+$/\1/')
+
+sha256=$(nix-prefetch-url "$installation_script_url")
+
+cat <<EOT > $SCRIPT_DIR/revision.json
+{
+  "url": "$installation_script_url",
+  "version": "$version",
+  "sha256": "$sha256"
+}
+EOT
diff --git a/nixpkgs/pkgs/applications/misc/hugo/default.nix b/nixpkgs/pkgs/applications/misc/hugo/default.nix
new file mode 100644
index 000000000000..0bb3f15fdc18
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/hugo/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  name = "hugo-${version}";
+  version = "0.55.4";
+
+  goPackagePath = "github.com/gohugoio/hugo";
+
+  src = fetchFromGitHub {
+    owner  = "gohugoio";
+    repo   = "hugo";
+    rev    = "v${version}";
+    sha256 = "0hbkl8dhhdic0admrkvlp1h1bmfrrwfnvipx27clyk0f88jcvb7y";
+  };
+
+  modSha256 = "0yrwkaaasj9ihjjfbywnzkppix1y2znagg3dkyikk21sl5n0nz23";
+
+  buildFlags = "-tags extended";
+
+  subPackages = [ "." ];
+
+  meta = with stdenv.lib; {
+    description = "A fast and modern static website engine.";
+    homepage = https://gohugo.io;
+    license = licenses.asl20;
+    maintainers = with maintainers; [ schneefux ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/hyper/default.nix b/nixpkgs/pkgs/applications/misc/hyper/default.nix
new file mode 100644
index 000000000000..2fd7e2f94af0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/hyper/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, lib, fetchurl, dpkg, atk, glib, pango, gdk_pixbuf, gnome2, gtk2, cairo
+, freetype, fontconfig, dbus, libXi, libXcursor, libXdamage, libXrandr
+, libXcomposite, libXext, libXfixes, libXrender, libX11, libXtst, libXScrnSaver
+, libxcb, nss, nspr, alsaLib, cups, expat, udev, libpulseaudio }:
+
+let
+  libPath = stdenv.lib.makeLibraryPath [
+    stdenv.cc.cc gtk2 gnome2.GConf atk glib pango gdk_pixbuf cairo freetype fontconfig dbus
+    libXi libXcursor libXdamage libXrandr libXcomposite libXext libXfixes libxcb
+    libXrender libX11 libXtst libXScrnSaver nss nspr alsaLib cups expat udev libpulseaudio
+  ];
+in
+stdenv.mkDerivation rec {
+  version = "2.1.2";
+  name = "hyper-${version}";
+  src = fetchurl {
+    url = "https://github.com/zeit/hyper/releases/download/${version}/hyper_${version}_amd64.deb";
+    sha256 = "1n4qlbk7q9zkhhg72mdks95g15xgyrc6ixf882ghvrqghd4zxplm";
+  };
+  buildInputs = [ dpkg ];
+  unpackPhase = ''
+    mkdir pkg
+    dpkg-deb -x $src pkg
+    sourceRoot=pkg
+  '';
+  installPhase = ''
+    mkdir -p "$out/bin"
+    mv opt "$out/"
+    ln -s "$out/opt/Hyper/hyper" "$out/bin/hyper"
+    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath "${libPath}:\$ORIGIN" "$out/opt/Hyper/hyper"
+    mv usr/* "$out/"
+  '';
+  dontPatchELF = true;
+  meta = with lib; {
+    description = "A terminal built on web technologies";
+    homepage    = https://hyper.is/;
+    maintainers = with maintainers; [ puffnfresh ];
+    license     = licenses.mit;
+    platforms   = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/icesl/default.nix b/nixpkgs/pkgs/applications/misc/icesl/default.nix
new file mode 100644
index 000000000000..c0c1faef09d2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/icesl/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, lib, fetchzip, freeglut, libXmu, libXi, libX11, libICE, libGLU_combined, libSM, libXext, dialog, makeWrapper }:
+let
+  lpath = stdenv.lib.makeLibraryPath [ libXmu libXi libX11 freeglut libICE libGLU_combined libSM libXext ];
+in
+stdenv.mkDerivation rec {
+  name = "iceSL-${version}";
+  version = "2.1.10";
+
+  src =  if stdenv.hostPlatform.system == "x86_64-linux" then fetchzip {
+    url = "https://gforge.inria.fr/frs/download.php/file/37268/icesl${version}-amd64.zip";
+    sha256 = "0dv3mq6wy46xk9blzzmgbdxpsjdaxid3zadfrysxlhmgl7zb2cn2";
+  } else if stdenv.hostPlatform.system == "i686-linux" then fetchzip {
+    url = "https://gforge.inria.fr/frs/download.php/file/37267/icesl${version}-i386.zip";
+    sha256 = "0sl54fsb2gz6dy0bwdscpdq1ab6ph5b7zald3bwzgkqsvna7p1jr";
+  } else throw "Unsupported architecture";
+
+  buildInputs = [ makeWrapper ];
+  installPhase = ''
+    cp -r ./ $out
+    mkdir $out/oldbin
+    mv $out/bin/IceSL-slicer $out/oldbin/IceSL-slicer
+    runHook postInstall
+  '';
+
+  postInstall = ''
+    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath "${lpath}" \
+      $out/oldbin/IceSL-slicer
+    makeWrapper $out/oldbin/IceSL-slicer $out/bin/icesl --prefix PATH : ${dialog}/bin
+  '';
+
+  meta = with lib; {
+    description = "IceSL is a GPU-accelerated procedural modeler and slicer for 3D printing.";
+    homepage = http://shapeforge.loria.fr/icesl/index.html;
+    license = licenses.inria-icesl;
+    platforms = [ "i686-linux" "x86_64-linux" ];
+    maintainers = with maintainers; [ mgttlinger ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/ikiwiki/default.nix b/nixpkgs/pkgs/applications/misc/ikiwiki/default.nix
new file mode 100644
index 000000000000..957f0f7f68bb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ikiwiki/default.nix
@@ -0,0 +1,88 @@
+{ stdenv, fetchurl, perlPackages, gettext, makeWrapper, PerlMagick, which
+, gitSupport ? false, git ? null
+, docutilsSupport ? false, python ? null, docutils ? null
+, monotoneSupport ? false, monotone ? null
+, bazaarSupport ? false, bazaar ? null
+, cvsSupport ? false, cvs ? null, cvsps ? null
+, subversionSupport ? false, subversion ? null
+, mercurialSupport ? false, mercurial ? null
+, extraUtils ? []
+}:
+
+assert docutilsSupport -> (python != null && docutils != null);
+assert gitSupport -> (git != null);
+assert monotoneSupport -> (monotone != null);
+assert bazaarSupport -> (bazaar != null);
+assert cvsSupport -> (cvs != null && cvsps != null && perlPackages.Filechdir != null);
+assert subversionSupport -> (subversion != null);
+assert mercurialSupport -> (mercurial != null);
+
+let
+  name = "ikiwiki";
+  version = "3.20170111";
+
+  lib = stdenv.lib;
+in
+stdenv.mkDerivation {
+  name = "${name}-${version}";
+
+  src = fetchurl {
+    url = "mirror://debian/pool/main/i/ikiwiki/${name}_${version}.tar.xz";
+    sha256 = "00d7yzv426fvqbhvzyafddv7fa6b4j2647b0wi371wd5yjj9j3sz";
+  };
+
+  buildInputs = [ which ]
+    ++ (with perlPackages; [ perl TextMarkdown URI HTMLParser HTMLScrubber HTMLTemplate
+          TimeDate gettext makeWrapper DBFile CGISession CGIFormBuilder LocaleGettext
+          RpcXML XMLSimple PerlMagick YAML YAMLLibYAML HTMLTree AuthenPassphrase
+          NetOpenIDConsumer LWPxParanoidAgent CryptSSLeay ])
+    ++ lib.optionals docutilsSupport [python docutils]
+    ++ lib.optionals gitSupport [git]
+    ++ lib.optionals monotoneSupport [monotone]
+    ++ lib.optionals bazaarSupport [bazaar]
+    ++ lib.optionals cvsSupport [cvs cvsps perlPackages.Filechdir]
+    ++ lib.optionals subversionSupport [subversion]
+    ++ lib.optionals mercurialSupport [mercurial];
+
+  patchPhase = ''
+    sed -i s@/usr/bin/perl@${perlPackages.perl}/bin/perl@ pm_filter mdwn2man
+    sed -i s@/etc/ikiwiki@$out/etc@ Makefile.PL
+    sed -i /ENV{PATH}/d ikiwiki.in
+    # State the gcc dependency, and make the cgi use our wrapper
+    sed -i -e 's@$0@"'$out/bin/ikiwiki'"@' \
+        -e "s@'cc'@'${stdenv.cc}/bin/gcc'@" IkiWiki/Wrapper.pm
+  '';
+
+  configurePhase = "perl Makefile.PL PREFIX=$out";
+
+  postInstall = ''
+    for a in "$out/bin/"*; do
+      wrapProgram $a --suffix PERL5LIB : $PERL5LIB --prefix PATH : ${perlPackages.perl}/bin:$out/bin \
+      ${lib.optionalString gitSupport ''--prefix PATH : ${git}/bin \''}
+      ${lib.optionalString monotoneSupport ''--prefix PATH : ${monotone}/bin \''}
+      ${lib.optionalString bazaarSupport ''--prefix PATH : ${bazaar}/bin \''}
+      ${lib.optionalString cvsSupport ''--prefix PATH : ${cvs}/bin \''}
+      ${lib.optionalString cvsSupport ''--prefix PATH : ${cvsps}/bin \''}
+      ${lib.optionalString subversionSupport ''--prefix PATH : ${subversion.out}/bin \''}
+      ${lib.optionalString mercurialSupport ''--prefix PATH : ${mercurial}/bin \''}
+      ${lib.concatMapStrings (x: "--prefix PATH : ${x}/bin ") extraUtils}
+    done
+  '';
+
+  preCheck = ''
+    # Git needs some help figuring this out during test suite run.
+    export EMAIL="nobody@example.org"
+  '';
+
+  checkTarget = "test";
+  doCheck = true;
+
+  meta = {
+    description = "Wiki compiler, storing pages and history in a RCS";
+    homepage = http://ikiwiki.info/;
+    license = stdenv.lib.licenses.gpl2Plus;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.peti ];
+    broken = true; # https://ikiwiki.info/bugs/imagemagick_6.9.8_test_suite_failure/
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/img2pdf/default.nix b/nixpkgs/pkgs/applications/misc/img2pdf/default.nix
new file mode 100644
index 000000000000..902e9268f722
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/img2pdf/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, python3Packages }:
+
+with python3Packages;
+
+buildPythonApplication rec {
+  pname = "img2pdf";
+  version = "0.3.3";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1ksn33j9d9df04n4jx7dli70d700rafbm37gjaz6lwsswrzc2xwx";
+  };
+
+  doCheck = false; # needs pdfrw
+
+  propagatedBuildInputs = [
+    pillow
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Convert images to PDF via direct JPEG inclusion";
+    homepage = https://gitlab.mister-muffin.de/josch/img2pdf;
+    license = licenses.lgpl2;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/ipmicfg/default.nix b/nixpkgs/pkgs/applications/misc/ipmicfg/default.nix
new file mode 100644
index 000000000000..d9bccee889ab
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ipmicfg/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchzip }:
+
+stdenv.mkDerivation rec {
+  name = "ipmicfg-${version}";
+  version = "1.29.0";
+  buildVersion = "181029";
+
+  src = fetchzip {
+    url = "ftp://ftp.supermicro.com/utility/IPMICFG/IPMICFG_${version}_build.${buildVersion}.zip";
+    sha256 = "18nljs4xg6hffahyd0d5zlg1jhbwl7zr9ym925bkzwcnrkgqs2v3";
+    extraPostFetch = "chmod u+rwX,go-rwx+X $out/";
+  };
+
+  installPhase = ''
+    mkdir -p "$out/bin" "$out/opt/ipmicfg"
+    cp Linux/64bit/* "$out/opt/ipmicfg"
+
+    patchelf \
+       --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+       --set-rpath "${stdenv.lib.makeLibraryPath [ stdenv.cc.cc ]}" \
+       "$out/opt/ipmicfg/IPMICFG-Linux.x86_64"
+
+    ln -s "$out/opt/ipmicfg/IPMICFG-Linux.x86_64" "$out/bin/ipmicfg"
+  '';
+
+   dontPatchShebangs = true; # There are no scripts and it complains about null bytes.
+
+   meta = with stdenv.lib; {
+     description = "Supermicro IPMI configuration tool";
+     homepage = "http://www.supermicro.com/products/nfo/ipmi.cfm";
+     license = licenses.unfree;
+     platforms = [ "x86_64-linux" ];
+     maintainers = with maintainers; [ sorki ];
+   };
+}
diff --git a/nixpkgs/pkgs/applications/misc/ipmiview/default.nix b/nixpkgs/pkgs/applications/misc/ipmiview/default.nix
new file mode 100644
index 000000000000..b5fa9143ddbb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ipmiview/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, patchelf, makeWrapper, xorg, gcc, gcc-unwrapped }:
+
+stdenv.mkDerivation rec {
+   name = "IPMIView-${version}";
+   version = "2.14.0";
+   buildVersion = "180213";
+
+   src = fetchurl {
+    url = "ftp://ftp.supermicro.com/utility/IPMIView/Linux/IPMIView_${version}_build.${buildVersion}_bundleJRE_Linux_x64.tar.gz";
+    sha256 = "1wp22wm7smlsb25x0cck4p660cycfczxj381930crd1qrf68mw4h";
+  };
+
+   nativeBuildInputs = [ patchelf makeWrapper ];
+
+   buildPhase = with xorg; ''
+     patchelf --set-rpath "${stdenv.lib.makeLibraryPath [ libX11 libXext libXrender libXtst libXi ]}" ./jre/lib/amd64/xawt/libmawt.so
+     patchelf --set-rpath "${gcc-unwrapped.lib}/lib" ./libiKVM64.so
+     patchelf --set-rpath "${stdenv.lib.makeLibraryPath [ libXcursor libX11 libXext libXrender libXtst libXi ]}" --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" ./jre/bin/javaws
+     patchelf --set-rpath "${gcc.cc}/lib:$out/jre/lib/amd64/jli" --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" ./jre/bin/java
+   '';
+
+   installPhase = ''
+     mkdir -p $out/bin
+     cp -R . $out/
+     makeWrapper $out/jre/bin/java $out/bin/IPMIView \
+       --prefix PATH : "$out/jre/bin" \
+       --add-flags "-jar $out/IPMIView20.jar"
+   '';
+
+   meta = with stdenv.lib; {
+    license = licenses.unfree;
+   };
+  }
diff --git a/nixpkgs/pkgs/applications/misc/iterm2/default.nix b/nixpkgs/pkgs/applications/misc/iterm2/default.nix
new file mode 100644
index 000000000000..e493226be60a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/iterm2/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  name = "iterm2-${version}";
+  version = "3.0.14";
+
+  src = fetchFromGitHub {
+    owner = "gnachman";
+    repo = "iTerm2";
+    rev = "v${version}";
+    sha256 = "03m0ja11w9910z96yi8fzq3436y8xl14q031rdb2w3sapjd54qrj";
+  };
+
+  patches = [ ./disable_updates.patch ];
+  postPatch = ''
+    sed -i -e 's/CODE_SIGN_IDENTITY = "Developer ID Application"/CODE_SIGN_IDENTITY = ""/g' ./iTerm2.xcodeproj/project.pbxproj
+  '';
+  preConfigure = "LD=$CC";
+  makeFlagsArray = ["Deployment"];
+  installPhase = ''
+    mkdir -p "$out/Applications"
+    mv "build/Deployment/iTerm2.app" "$out/Applications/iTerm.app"
+  '';
+
+  meta = {
+    description = "A replacement for Terminal and the successor to iTerm";
+    homepage = https://www.iterm2.com/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/iterm2/disable_updates.patch b/nixpkgs/pkgs/applications/misc/iterm2/disable_updates.patch
new file mode 100644
index 000000000000..e717c58f30f1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/iterm2/disable_updates.patch
@@ -0,0 +1,11 @@
+--- iTerm2/sources/iTermPreferences.m   2016-06-23 16:55:28.000000000 +0200
++++ iTerm2/sources/iTermPreferences.m   2016-06-23 16:55:42.000000000 +0200
+@@ -189,7 +189,7 @@
+                   kPreferenceKeyInstantReplayMemoryMegabytes: @4,
+                   kPreferenceKeySavePasteAndCommandHistory: @NO,
+                   kPreferenceKeyAddBonjourHostsToProfiles: @NO,
+-                  kPreferenceKeyCheckForUpdatesAutomatically: @YES,
++                  kPreferenceKeyCheckForUpdatesAutomatically: @NO,
+                   kPreferenceKeyCheckForTestReleases: @NO,
+                   kPreferenceKeyLoadPrefsFromCustomFolder: @NO,
+                   kPreferenceKeyNeverRemindPrefsChangesLostForFileHaveSelection: @NO,
diff --git a/nixpkgs/pkgs/applications/misc/j4-dmenu-desktop/default.nix b/nixpkgs/pkgs/applications/misc/j4-dmenu-desktop/default.nix
new file mode 100644
index 000000000000..c20fa4ed9d9b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/j4-dmenu-desktop/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, cmake, dmenu }:
+
+stdenv.mkDerivation rec {
+  pname = "j4-dmenu-desktop";
+  version = "2.17";
+
+  src = fetchFromGitHub {
+    owner = "enkore";
+    repo = pname;
+    rev = "r${version}";
+    sha256 = "0v23fimkn83dcm5p53y2ymhklff3kwppxhf75sm8xmswrzkixpgc";
+  };
+
+  postPatch = ''
+    sed -e 's,dmenu -i,${dmenu}/bin/dmenu -i,g' -i ./src/Main.hh
+  '';
+
+  nativeBuildInputs = [ cmake ];
+
+  # tests are fetching an external git repository
+  cmakeFlags = [
+    "-DWITH_TESTS=OFF"
+    "-DWITH_GIT_CATCH=OFF"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "A wrapper for dmenu that recognize .desktop files";
+    homepage = "https://github.com/enkore/j4-dmenu-desktop";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ ericsagnes ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/jbidwatcher/default.nix b/nixpkgs/pkgs/applications/misc/jbidwatcher/default.nix
new file mode 100644
index 000000000000..5939d7789b4e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/jbidwatcher/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, java, runtimeShell }:
+
+stdenv.mkDerivation rec {
+  pname = "jbidwatcher";
+  version = "2.5.6";
+
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "http://www.jbidwatcher.com/download/JBidwatcher-${version}.jar";
+    sha256 = "1cw59wh72w1zzibs8x64dma3jc4hry64wjksqs52nc3vpnf0fzfr";
+  };
+
+  buildInputs = [ java ];
+
+  jarfile = "$out/share/java/${pname}/JBidwatcher.jar";
+
+  dontUnpack = true;
+
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir -p "$out/bin"
+    echo > "$out/bin/${pname}" "#!${runtimeShell}"
+    echo >>"$out/bin/${pname}" "${java}/bin/java -Xmx512m -jar ${jarfile}"
+    chmod +x "$out/bin/${pname}"
+    install -D -m644 ${src} ${jarfile}
+  '';
+
+  meta = {
+    homepage = http://www.jbidwatcher.com/;
+    description = "Monitor and snipe Ebay auctions";
+    license = "LGPL";
+
+    longDescription = ''
+      A Java-based application allowing you to monitor auctions you're
+      not part of, submit bids, snipe (bid at the last moment), and
+      otherwise track your auction-site experience. It includes
+      adult-auction management, MANY currencies (pound, dollar (US,
+      Canada, Australian, and New Taiwanese) and euro, presently),
+      drag-and-drop of auction URLs, an original, unique and powerful
+      'multisniping' feature, a relatively nice UI, and is known to work
+      cleanly under Linux, Windows, Solaris, and MacOSX from the same
+      binary.
+    '';
+
+    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/jekyll/basic/Gemfile b/nixpkgs/pkgs/applications/misc/jekyll/basic/Gemfile
new file mode 100644
index 000000000000..2d3446a81134
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/jekyll/basic/Gemfile
@@ -0,0 +1,10 @@
+source "https://rubygems.org"
+gem "jekyll"
+# jekyll alone might be enough for most use-cases
+gem "rouge"
+gem "activesupport", "~> 4.2"
+gem "jekyll-avatar"
+gem "jekyll-mentions"
+gem "jekyll-seo-tag"
+gem "jekyll-sitemap"
+gem "jemoji"
diff --git a/nixpkgs/pkgs/applications/misc/jekyll/basic/Gemfile.lock b/nixpkgs/pkgs/applications/misc/jekyll/basic/Gemfile.lock
new file mode 100644
index 000000000000..7954b6dc03ed
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/jekyll/basic/Gemfile.lock
@@ -0,0 +1,99 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    activesupport (4.2.11.1)
+      i18n (~> 0.7)
+      minitest (~> 5.1)
+      thread_safe (~> 0.3, >= 0.3.4)
+      tzinfo (~> 1.1)
+    addressable (2.6.0)
+      public_suffix (>= 2.0.2, < 4.0)
+    colorator (1.1.0)
+    concurrent-ruby (1.1.5)
+    em-websocket (0.5.1)
+      eventmachine (>= 0.12.9)
+      http_parser.rb (~> 0.6.0)
+    eventmachine (1.2.7)
+    ffi (1.11.1)
+    forwardable-extended (2.6.0)
+    gemoji (3.0.1)
+    html-pipeline (2.11.0)
+      activesupport (>= 2)
+      nokogiri (>= 1.4)
+    http_parser.rb (0.6.0)
+    i18n (0.9.5)
+      concurrent-ruby (~> 1.0)
+    jekyll (3.8.6)
+      addressable (~> 2.4)
+      colorator (~> 1.0)
+      em-websocket (~> 0.5)
+      i18n (~> 0.7)
+      jekyll-sass-converter (~> 1.0)
+      jekyll-watch (~> 2.0)
+      kramdown (~> 1.14)
+      liquid (~> 4.0)
+      mercenary (~> 0.3.3)
+      pathutil (~> 0.9)
+      rouge (>= 1.7, < 4)
+      safe_yaml (~> 1.0)
+    jekyll-avatar (0.6.0)
+      jekyll (~> 3.0)
+    jekyll-mentions (1.5.1)
+      html-pipeline (~> 2.3)
+      jekyll (>= 3.7, < 5.0)
+    jekyll-sass-converter (1.5.2)
+      sass (~> 3.4)
+    jekyll-seo-tag (2.6.1)
+      jekyll (>= 3.3, < 5.0)
+    jekyll-sitemap (1.3.1)
+      jekyll (>= 3.7, < 5.0)
+    jekyll-watch (2.2.1)
+      listen (~> 3.0)
+    jemoji (0.11.0)
+      gemoji (~> 3.0)
+      html-pipeline (~> 2.2)
+      jekyll (>= 3.0, < 5.0)
+    kramdown (1.17.0)
+    liquid (4.0.3)
+    listen (3.1.5)
+      rb-fsevent (~> 0.9, >= 0.9.4)
+      rb-inotify (~> 0.9, >= 0.9.7)
+      ruby_dep (~> 1.2)
+    mercenary (0.3.6)
+    mini_portile2 (2.4.0)
+    minitest (5.11.3)
+    nokogiri (1.10.3)
+      mini_portile2 (~> 2.4.0)
+    pathutil (0.16.2)
+      forwardable-extended (~> 2.6)
+    public_suffix (3.1.1)
+    rb-fsevent (0.10.3)
+    rb-inotify (0.10.0)
+      ffi (~> 1.0)
+    rouge (3.5.1)
+    ruby_dep (1.5.0)
+    safe_yaml (1.0.5)
+    sass (3.7.4)
+      sass-listen (~> 4.0.0)
+    sass-listen (4.0.0)
+      rb-fsevent (~> 0.9, >= 0.9.4)
+      rb-inotify (~> 0.9, >= 0.9.7)
+    thread_safe (0.3.6)
+    tzinfo (1.2.5)
+      thread_safe (~> 0.1)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  activesupport (~> 4.2)
+  jekyll
+  jekyll-avatar
+  jekyll-mentions
+  jekyll-seo-tag
+  jekyll-sitemap
+  jemoji
+  rouge
+
+BUNDLED WITH
+   1.17.2
diff --git a/nixpkgs/pkgs/applications/misc/jekyll/basic/gemset.nix b/nixpkgs/pkgs/applications/misc/jekyll/basic/gemset.nix
new file mode 100644
index 000000000000..741b5e2a0691
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/jekyll/basic/gemset.nix
@@ -0,0 +1,402 @@
+{
+  activesupport = {
+    dependencies = ["i18n" "minitest" "thread_safe" "tzinfo"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1vbq7a805bfvyik2q3kl9s3r418f5qzvysqbz2cwy4hr7m2q4ir6";
+      type = "gem";
+    };
+    version = "4.2.11.1";
+  };
+  addressable = {
+    dependencies = ["public_suffix"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0bcm2hchn897xjhqj9zzsxf3n9xhddymj4lsclz508f4vw3av46l";
+      type = "gem";
+    };
+    version = "2.6.0";
+  };
+  colorator = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0f7wvpam948cglrciyqd798gdc6z3cfijciavd0dfixgaypmvy72";
+      type = "gem";
+    };
+    version = "1.1.0";
+  };
+  concurrent-ruby = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1x07r23s7836cpp5z9yrlbpljcxpax14yw4fy4bnp6crhr6x24an";
+      type = "gem";
+    };
+    version = "1.1.5";
+  };
+  em-websocket = {
+    dependencies = ["eventmachine" "http_parser.rb"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1bsw8vjz0z267j40nhbmrvfz7dvacq4p0pagvyp17jif6mj6v7n3";
+      type = "gem";
+    };
+    version = "0.5.1";
+  };
+  eventmachine = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0wh9aqb0skz80fhfn66lbpr4f86ya2z5rx6gm5xlfhd05bj1ch4r";
+      type = "gem";
+    };
+    version = "1.2.7";
+  };
+  ffi = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "06mvxpjply8qh4j3fj9wh08kdzwkbnvsiysh0vrhlk5cwxzjmblh";
+      type = "gem";
+    };
+    version = "1.11.1";
+  };
+  forwardable-extended = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "15zcqfxfvsnprwm8agia85x64vjzr2w0xn9vxfnxzgcv8s699v0v";
+      type = "gem";
+    };
+    version = "2.6.0";
+  };
+  gemoji = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0vgklpmhdz98xayln5hhqv4ffdyrglzwdixkn5gsk9rj94pkymc0";
+      type = "gem";
+    };
+    version = "3.0.1";
+  };
+  html-pipeline = {
+    dependencies = ["activesupport" "nokogiri"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "14659ap360gzmrxl8mb28ys6mld7xw3q4q7pqy0l1cn67szdq779";
+      type = "gem";
+    };
+    version = "2.11.0";
+  };
+  "http_parser.rb" = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "15nidriy0v5yqfjsgsra51wmknxci2n2grliz78sf9pga3n0l7gi";
+      type = "gem";
+    };
+    version = "0.6.0";
+  };
+  i18n = {
+    dependencies = ["concurrent-ruby"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "038qvz7kd3cfxk8bvagqhakx68pfbnmghpdkx7573wbf0maqp9a3";
+      type = "gem";
+    };
+    version = "0.9.5";
+  };
+  jekyll = {
+    dependencies = ["addressable" "colorator" "em-websocket" "i18n" "jekyll-sass-converter" "jekyll-watch" "kramdown" "liquid" "mercenary" "pathutil" "rouge" "safe_yaml"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1ph1jjjl25vmzif7bvxzviq7azjm384pm7ba4k24cah94285bzhz";
+      type = "gem";
+    };
+    version = "3.8.6";
+  };
+  jekyll-avatar = {
+    dependencies = ["jekyll"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "124624r83pmn7sp2idnsph9m1bbdiha5jnza4ypna8w2inpih51p";
+      type = "gem";
+    };
+    version = "0.6.0";
+  };
+  jekyll-mentions = {
+    dependencies = ["html-pipeline" "jekyll"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1r81nbw598s485jsppbpy9kwa471w1rdkpdn3a1mq0swg87cp67v";
+      type = "gem";
+    };
+    version = "1.5.1";
+  };
+  jekyll-sass-converter = {
+    dependencies = ["sass"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "008ikh5fk0n6ri54mylcl8jn0mq8p2nfyfqif2q3pp0lwilkcxsk";
+      type = "gem";
+    };
+    version = "1.5.2";
+  };
+  jekyll-seo-tag = {
+    dependencies = ["jekyll"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1p9fl2r4ni10lbx143zp41caldjs4hg27az5wg42sbwzb7s6z66m";
+      type = "gem";
+    };
+    version = "2.6.1";
+  };
+  jekyll-sitemap = {
+    dependencies = ["jekyll"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0d3wqvbn37b24ag31xchb5hhnwfl6fnw6pyzp434jggbssxy0a5m";
+      type = "gem";
+    };
+    version = "1.3.1";
+  };
+  jekyll-watch = {
+    dependencies = ["listen"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1qd7hy1kl87fl7l0frw5qbn22x7ayfzlv9a5ca1m59g0ym1ysi5w";
+      type = "gem";
+    };
+    version = "2.2.1";
+  };
+  jemoji = {
+    dependencies = ["gemoji" "html-pipeline" "jekyll"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0x463l6a8ikaf6pzap0dgh4gfvlkx56g6kdasj9jfb1ld3fvl99k";
+      type = "gem";
+    };
+    version = "0.11.0";
+  };
+  kramdown = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1n1c4jmrh5ig8iv1rw81s4mw4xsp4v97hvf8zkigv4hn5h542qjq";
+      type = "gem";
+    };
+    version = "1.17.0";
+  };
+  liquid = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0zhg5ha8zy8zw9qr3fl4wgk4r5940n4128xm2pn4shpbzdbsj5by";
+      type = "gem";
+    };
+    version = "4.0.3";
+  };
+  listen = {
+    dependencies = ["rb-fsevent" "rb-inotify" "ruby_dep"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "01v5mrnfqm6sgm8xn2v5swxsn1wlmq7rzh2i48d4jzjsc7qvb6mx";
+      type = "gem";
+    };
+    version = "3.1.5";
+  };
+  mercenary = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "10la0xw82dh5mqab8bl0dk21zld63cqxb1g16fk8cb39ylc4n21a";
+      type = "gem";
+    };
+    version = "0.3.6";
+  };
+  mini_portile2 = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "15zplpfw3knqifj9bpf604rb3wc1vhq6363pd6lvhayng8wql5vy";
+      type = "gem";
+    };
+    version = "2.4.0";
+  };
+  minitest = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0icglrhghgwdlnzzp4jf76b0mbc71s80njn5afyfjn4wqji8mqbq";
+      type = "gem";
+    };
+    version = "5.11.3";
+  };
+  nokogiri = {
+    dependencies = ["mini_portile2"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "02bjydih0j515szfv9mls195cvpyidh6ixm7dwbl3s2sbaxxk5s4";
+      type = "gem";
+    };
+    version = "1.10.3";
+  };
+  pathutil = {
+    dependencies = ["forwardable-extended"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "12fm93ljw9fbxmv2krki5k5wkvr7560qy8p4spvb9jiiaqv78fz4";
+      type = "gem";
+    };
+    version = "0.16.2";
+  };
+  public_suffix = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0g9ds2ffzljl6jjmkjffwxc1z6lh5nkqqmhhkxjk71q5ggv0rkpm";
+      type = "gem";
+    };
+    version = "3.1.1";
+  };
+  rb-fsevent = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1lm1k7wpz69jx7jrc92w3ggczkjyjbfziq5mg62vjnxmzs383xx8";
+      type = "gem";
+    };
+    version = "0.10.3";
+  };
+  rb-inotify = {
+    dependencies = ["ffi"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1fs7hxm9g6ywv2yih83b879klhc4fs8i0p9166z795qmd77dk0a4";
+      type = "gem";
+    };
+    version = "0.10.0";
+  };
+  rouge = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0yfhazlhjc4abgzhkgq8zqmdphvkh52211widkl4zhsbhqh8wg2q";
+      type = "gem";
+    };
+    version = "3.5.1";
+  };
+  ruby_dep = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1c1bkl97i9mkcvkn1jks346ksnvnnp84cs22gwl0vd7radybrgy5";
+      type = "gem";
+    };
+    version = "1.5.0";
+  };
+  safe_yaml = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0j7qv63p0vqcd838i2iy2f76c3dgwzkiz1d1xkg7n0pbnxj2vb56";
+      type = "gem";
+    };
+    version = "1.0.5";
+  };
+  sass = {
+    dependencies = ["sass-listen"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0p95lhs0jza5l7hqci1isflxakz83xkj97lkvxl919is0lwhv2w0";
+      type = "gem";
+    };
+    version = "3.7.4";
+  };
+  sass-listen = {
+    dependencies = ["rb-fsevent" "rb-inotify"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0xw3q46cmahkgyldid5hwyiwacp590zj2vmswlll68ryvmvcp7df";
+      type = "gem";
+    };
+    version = "4.0.0";
+  };
+  thread_safe = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0nmhcgq6cgz44srylra07bmaw99f5271l0dpsvl5f75m44l0gmwy";
+      type = "gem";
+    };
+    version = "0.3.6";
+  };
+  tzinfo = {
+    dependencies = ["thread_safe"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1fjx9j327xpkkdlxwmkl3a8wqj7i4l4jwlrv3z13mg95z9wl253z";
+      type = "gem";
+    };
+    version = "1.2.5";
+  };
+}
\ No newline at end of file
diff --git a/nixpkgs/pkgs/applications/misc/jekyll/default.nix b/nixpkgs/pkgs/applications/misc/jekyll/default.nix
new file mode 100644
index 000000000000..9ae9ab254e80
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/jekyll/default.nix
@@ -0,0 +1,54 @@
+{ lib, bundlerApp, ruby
+, writeShellScriptBin, makeWrapper
+, withOptionalDependencies ? false
+}:
+
+let
+  rubyWrapper = writeShellScriptBin "ruby" ''
+    if [[ "$#" -eq 2 ]]; then
+      if [[ "''${1##*/}" == "bundle" && "$2" == "install" ]]; then
+        # See https://github.com/NixOS/nixpkgs/issues/58126 for more details.
+        echo 'Skipping "bundle install" as it fails due to the Nix wrapper.'
+        echo 'Please enter the new directory and run the following commands to serve the page:'
+        echo 'nix-shell -p bundler --run "bundle install --gemfile=Gemfile --path vendor/cache"'
+        echo 'nix-shell -p bundler --run "bundle exec jekyll serve"'
+        exit 0
+        # The following nearly works:
+        unset BUNDLE_FROZEN
+        exec ${ruby}/bin/ruby "$@" --gemfile=Gemfile --path=vendor/cache
+      fi
+    fi
+    # Else: Don't modify the arguments:
+    exec ${ruby}/bin/ruby "$@"
+  '';
+in bundlerApp rec {
+  pname = "jekyll";
+  exes = [ "jekyll" ];
+
+  inherit ruby;
+  gemdir = if withOptionalDependencies
+    then ./full
+    else ./basic;
+
+  buildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    wrapProgram $out/bin/jekyll --prefix PATH : ${rubyWrapper}/bin
+  '';
+
+  meta = with lib; {
+    description = "A blog-aware, static site generator, written in Ruby";
+    longDescription = ''
+      Jekyll is a simple, blog-aware, static site generator, written in Ruby.
+      Think of it like a file-based CMS, without all the complexity. Jekyll
+      takes your content, renders Markdown and Liquid templates, and spits out a
+      complete, static website ready to be served by Apache, Nginx or another
+      web server. Jekyll is the engine behind GitHub Pages, which you can use to
+      host sites right from your GitHub repositories.
+    '';
+    homepage    = https://jekyllrb.com/;
+    license     = licenses.mit;
+    maintainers = with maintainers; [ primeos pesterhazy ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/jekyll/full/Gemfile b/nixpkgs/pkgs/applications/misc/jekyll/full/Gemfile
new file mode 100644
index 000000000000..aba5e06e3769
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/jekyll/full/Gemfile
@@ -0,0 +1,30 @@
+source "https://rubygems.org"
+gem "jekyll"
+gem "rouge"
+gem "activesupport", "~> 4.2"
+gem "jekyll-avatar"
+gem "jekyll-mentions"
+gem "jekyll-seo-tag"
+gem "jekyll-sitemap"
+gem "jemoji"
+# Optional dependencies:
+gem "coderay", "~> 1.1.0"
+gem "jekyll-coffeescript"
+#gem "jekyll-docs"
+gem "jekyll-feed", "~> 0.9"
+gem "jekyll-gist"
+gem "jekyll-paginate"
+gem "jekyll-redirect-from"
+gem "kramdown", "~> 1.14"
+gem "mime-types", "~> 3.0"
+gem "rdoc", RUBY_VERSION >= "2.2.2" ? "~> 6.0" : "~> 5.1"
+gem "tomlrb", "~> 1.2"
+
+platform :ruby, :mswin, :mingw, :x64_mingw do
+  gem "classifier-reborn", "~> 2.2.0"
+  gem "liquid-c", "~> 3.0"
+  gem "pygments.rb", "~> 1.0"
+  gem "rdiscount", "~> 2.0"
+  gem "redcarpet", "~> 3.2", ">= 3.2.3"
+  gem "yajl-ruby", "~> 1.3.1"
+end
diff --git a/nixpkgs/pkgs/applications/misc/jekyll/full/Gemfile.lock b/nixpkgs/pkgs/applications/misc/jekyll/full/Gemfile.lock
new file mode 100644
index 000000000000..7baf6a45fc54
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/jekyll/full/Gemfile.lock
@@ -0,0 +1,155 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    activesupport (4.2.11.1)
+      i18n (~> 0.7)
+      minitest (~> 5.1)
+      thread_safe (~> 0.3, >= 0.3.4)
+      tzinfo (~> 1.1)
+    addressable (2.6.0)
+      public_suffix (>= 2.0.2, < 4.0)
+    classifier-reborn (2.2.0)
+      fast-stemmer (~> 1.0)
+    coderay (1.1.2)
+    coffee-script (2.4.1)
+      coffee-script-source
+      execjs
+    coffee-script-source (1.12.2)
+    colorator (1.1.0)
+    concurrent-ruby (1.1.5)
+    em-websocket (0.5.1)
+      eventmachine (>= 0.12.9)
+      http_parser.rb (~> 0.6.0)
+    eventmachine (1.2.7)
+    execjs (2.7.0)
+    faraday (0.15.4)
+      multipart-post (>= 1.2, < 3)
+    fast-stemmer (1.0.2)
+    ffi (1.11.1)
+    forwardable-extended (2.6.0)
+    gemoji (3.0.1)
+    html-pipeline (2.11.0)
+      activesupport (>= 2)
+      nokogiri (>= 1.4)
+    http_parser.rb (0.6.0)
+    i18n (0.9.5)
+      concurrent-ruby (~> 1.0)
+    jekyll (3.8.6)
+      addressable (~> 2.4)
+      colorator (~> 1.0)
+      em-websocket (~> 0.5)
+      i18n (~> 0.7)
+      jekyll-sass-converter (~> 1.0)
+      jekyll-watch (~> 2.0)
+      kramdown (~> 1.14)
+      liquid (~> 4.0)
+      mercenary (~> 0.3.3)
+      pathutil (~> 0.9)
+      rouge (>= 1.7, < 4)
+      safe_yaml (~> 1.0)
+    jekyll-avatar (0.6.0)
+      jekyll (~> 3.0)
+    jekyll-coffeescript (1.2.2)
+      coffee-script (~> 2.2)
+      coffee-script-source (~> 1.12)
+    jekyll-feed (0.12.1)
+      jekyll (>= 3.7, < 5.0)
+    jekyll-gist (1.5.0)
+      octokit (~> 4.2)
+    jekyll-mentions (1.5.1)
+      html-pipeline (~> 2.3)
+      jekyll (>= 3.7, < 5.0)
+    jekyll-paginate (1.1.0)
+    jekyll-redirect-from (0.15.0)
+      jekyll (>= 3.3, < 5.0)
+    jekyll-sass-converter (1.5.2)
+      sass (~> 3.4)
+    jekyll-seo-tag (2.6.1)
+      jekyll (>= 3.3, < 5.0)
+    jekyll-sitemap (1.3.1)
+      jekyll (>= 3.7, < 5.0)
+    jekyll-watch (2.2.1)
+      listen (~> 3.0)
+    jemoji (0.11.0)
+      gemoji (~> 3.0)
+      html-pipeline (~> 2.2)
+      jekyll (>= 3.0, < 5.0)
+    kramdown (1.17.0)
+    liquid (4.0.3)
+    liquid-c (3.0.0)
+      liquid (>= 3.0.0)
+    listen (3.1.5)
+      rb-fsevent (~> 0.9, >= 0.9.4)
+      rb-inotify (~> 0.9, >= 0.9.7)
+      ruby_dep (~> 1.2)
+    mercenary (0.3.6)
+    mime-types (3.2.2)
+      mime-types-data (~> 3.2015)
+    mime-types-data (3.2019.0331)
+    mini_portile2 (2.4.0)
+    minitest (5.11.3)
+    multi_json (1.13.1)
+    multipart-post (2.1.1)
+    nokogiri (1.10.3)
+      mini_portile2 (~> 2.4.0)
+    octokit (4.14.0)
+      sawyer (~> 0.8.0, >= 0.5.3)
+    pathutil (0.16.2)
+      forwardable-extended (~> 2.6)
+    public_suffix (3.1.1)
+    pygments.rb (1.2.1)
+      multi_json (>= 1.0.0)
+    rb-fsevent (0.10.3)
+    rb-inotify (0.10.0)
+      ffi (~> 1.0)
+    rdiscount (2.2.0.1)
+    rdoc (6.1.1)
+    redcarpet (3.4.0)
+    rouge (3.5.1)
+    ruby_dep (1.5.0)
+    safe_yaml (1.0.5)
+    sass (3.7.4)
+      sass-listen (~> 4.0.0)
+    sass-listen (4.0.0)
+      rb-fsevent (~> 0.9, >= 0.9.4)
+      rb-inotify (~> 0.9, >= 0.9.7)
+    sawyer (0.8.2)
+      addressable (>= 2.3.5)
+      faraday (> 0.8, < 2.0)
+    thread_safe (0.3.6)
+    tomlrb (1.2.8)
+    tzinfo (1.2.5)
+      thread_safe (~> 0.1)
+    yajl-ruby (1.3.1)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  activesupport (~> 4.2)
+  classifier-reborn (~> 2.2.0)
+  coderay (~> 1.1.0)
+  jekyll
+  jekyll-avatar
+  jekyll-coffeescript
+  jekyll-feed (~> 0.9)
+  jekyll-gist
+  jekyll-mentions
+  jekyll-paginate
+  jekyll-redirect-from
+  jekyll-seo-tag
+  jekyll-sitemap
+  jemoji
+  kramdown (~> 1.14)
+  liquid-c (~> 3.0)
+  mime-types (~> 3.0)
+  pygments.rb (~> 1.0)
+  rdiscount (~> 2.0)
+  rdoc (~> 6.0)
+  redcarpet (~> 3.2, >= 3.2.3)
+  rouge
+  tomlrb (~> 1.2)
+  yajl-ruby (~> 1.3.1)
+
+BUNDLED WITH
+   1.17.2
diff --git a/nixpkgs/pkgs/applications/misc/jekyll/full/gemset.nix b/nixpkgs/pkgs/applications/misc/jekyll/full/gemset.nix
new file mode 100644
index 000000000000..63209d4ff45a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/jekyll/full/gemset.nix
@@ -0,0 +1,772 @@
+{
+  activesupport = {
+    dependencies = ["i18n" "minitest" "thread_safe" "tzinfo"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1vbq7a805bfvyik2q3kl9s3r418f5qzvysqbz2cwy4hr7m2q4ir6";
+      type = "gem";
+    };
+    version = "4.2.11.1";
+  };
+  addressable = {
+    dependencies = ["public_suffix"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0bcm2hchn897xjhqj9zzsxf3n9xhddymj4lsclz508f4vw3av46l";
+      type = "gem";
+    };
+    version = "2.6.0";
+  };
+  classifier-reborn = {
+    dependencies = ["fast-stemmer"];
+    groups = ["default"];
+    platforms = [{
+      engine = "maglev";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mswin";
+    } {
+      engine = "rbx";
+    } {
+      engine = "ruby";
+    }];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "04nxmm5b7j7r0ij9pcpdr7xqpig559gfzrw042ycxcfyav2pv6ij";
+      type = "gem";
+    };
+    version = "2.2.0";
+  };
+  coderay = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "15vav4bhcc2x3jmi3izb11l4d9f3xv8hp2fszb7iqmpsccv1pz4y";
+      type = "gem";
+    };
+    version = "1.1.2";
+  };
+  coffee-script = {
+    dependencies = ["coffee-script-source" "execjs"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0rc7scyk7mnpfxqv5yy4y5q1hx3i7q3ahplcp4bq2g5r24g2izl2";
+      type = "gem";
+    };
+    version = "2.4.1";
+  };
+  coffee-script-source = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1907v9q1zcqmmyqzhzych5l7qifgls2rlbnbhy5vzyr7i7yicaz1";
+      type = "gem";
+    };
+    version = "1.12.2";
+  };
+  colorator = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0f7wvpam948cglrciyqd798gdc6z3cfijciavd0dfixgaypmvy72";
+      type = "gem";
+    };
+    version = "1.1.0";
+  };
+  concurrent-ruby = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1x07r23s7836cpp5z9yrlbpljcxpax14yw4fy4bnp6crhr6x24an";
+      type = "gem";
+    };
+    version = "1.1.5";
+  };
+  em-websocket = {
+    dependencies = ["eventmachine" "http_parser.rb"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1bsw8vjz0z267j40nhbmrvfz7dvacq4p0pagvyp17jif6mj6v7n3";
+      type = "gem";
+    };
+    version = "0.5.1";
+  };
+  eventmachine = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0wh9aqb0skz80fhfn66lbpr4f86ya2z5rx6gm5xlfhd05bj1ch4r";
+      type = "gem";
+    };
+    version = "1.2.7";
+  };
+  execjs = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1yz55sf2nd3l666ms6xr18sm2aggcvmb8qr3v53lr4rir32y1yp1";
+      type = "gem";
+    };
+    version = "2.7.0";
+  };
+  faraday = {
+    dependencies = ["multipart-post"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0s72m05jvzc1pd6cw1i289chas399q0a14xrwg4rvkdwy7bgzrh0";
+      type = "gem";
+    };
+    version = "0.15.4";
+  };
+  fast-stemmer = {
+    groups = ["default"];
+    platforms = [{
+      engine = "maglev";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mswin";
+    } {
+      engine = "rbx";
+    } {
+      engine = "ruby";
+    }];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0688clyk4xxh3kdb18vi089k90mca8ji5fwaknh3da5wrzcrzanh";
+      type = "gem";
+    };
+    version = "1.0.2";
+  };
+  ffi = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "06mvxpjply8qh4j3fj9wh08kdzwkbnvsiysh0vrhlk5cwxzjmblh";
+      type = "gem";
+    };
+    version = "1.11.1";
+  };
+  forwardable-extended = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "15zcqfxfvsnprwm8agia85x64vjzr2w0xn9vxfnxzgcv8s699v0v";
+      type = "gem";
+    };
+    version = "2.6.0";
+  };
+  gemoji = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0vgklpmhdz98xayln5hhqv4ffdyrglzwdixkn5gsk9rj94pkymc0";
+      type = "gem";
+    };
+    version = "3.0.1";
+  };
+  html-pipeline = {
+    dependencies = ["activesupport" "nokogiri"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "14659ap360gzmrxl8mb28ys6mld7xw3q4q7pqy0l1cn67szdq779";
+      type = "gem";
+    };
+    version = "2.11.0";
+  };
+  "http_parser.rb" = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "15nidriy0v5yqfjsgsra51wmknxci2n2grliz78sf9pga3n0l7gi";
+      type = "gem";
+    };
+    version = "0.6.0";
+  };
+  i18n = {
+    dependencies = ["concurrent-ruby"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "038qvz7kd3cfxk8bvagqhakx68pfbnmghpdkx7573wbf0maqp9a3";
+      type = "gem";
+    };
+    version = "0.9.5";
+  };
+  jekyll = {
+    dependencies = ["addressable" "colorator" "em-websocket" "i18n" "jekyll-sass-converter" "jekyll-watch" "kramdown" "liquid" "mercenary" "pathutil" "rouge" "safe_yaml"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1ph1jjjl25vmzif7bvxzviq7azjm384pm7ba4k24cah94285bzhz";
+      type = "gem";
+    };
+    version = "3.8.6";
+  };
+  jekyll-avatar = {
+    dependencies = ["jekyll"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "124624r83pmn7sp2idnsph9m1bbdiha5jnza4ypna8w2inpih51p";
+      type = "gem";
+    };
+    version = "0.6.0";
+  };
+  jekyll-coffeescript = {
+    dependencies = ["coffee-script" "coffee-script-source"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "040i6cyv20qmxlpm74kh5hfci8208ja4903yxdv4x0qs0z172kl9";
+      type = "gem";
+    };
+    version = "1.2.2";
+  };
+  jekyll-feed = {
+    dependencies = ["jekyll"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "01f0ivjdr3qc9dh9n8lj6paiy7zmlb7hs9nk6rgni6jjn5plslg3";
+      type = "gem";
+    };
+    version = "0.12.1";
+  };
+  jekyll-gist = {
+    dependencies = ["octokit"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "03wz9j6yq3552nzf4g71qrdm9pfdgbm68abml9sjjgiaan1n8ns9";
+      type = "gem";
+    };
+    version = "1.5.0";
+  };
+  jekyll-mentions = {
+    dependencies = ["html-pipeline" "jekyll"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1r81nbw598s485jsppbpy9kwa471w1rdkpdn3a1mq0swg87cp67v";
+      type = "gem";
+    };
+    version = "1.5.1";
+  };
+  jekyll-paginate = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0r7bcs8fq98zldih4787zk5i9w24nz5wa26m84ssja95n3sas2l8";
+      type = "gem";
+    };
+    version = "1.1.0";
+  };
+  jekyll-redirect-from = {
+    dependencies = ["jekyll"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1cwpr1z7irar81nm60prvl8ywadc82xhpdxs50n7kiic6q6lkjsb";
+      type = "gem";
+    };
+    version = "0.15.0";
+  };
+  jekyll-sass-converter = {
+    dependencies = ["sass"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "008ikh5fk0n6ri54mylcl8jn0mq8p2nfyfqif2q3pp0lwilkcxsk";
+      type = "gem";
+    };
+    version = "1.5.2";
+  };
+  jekyll-seo-tag = {
+    dependencies = ["jekyll"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1p9fl2r4ni10lbx143zp41caldjs4hg27az5wg42sbwzb7s6z66m";
+      type = "gem";
+    };
+    version = "2.6.1";
+  };
+  jekyll-sitemap = {
+    dependencies = ["jekyll"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0d3wqvbn37b24ag31xchb5hhnwfl6fnw6pyzp434jggbssxy0a5m";
+      type = "gem";
+    };
+    version = "1.3.1";
+  };
+  jekyll-watch = {
+    dependencies = ["listen"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1qd7hy1kl87fl7l0frw5qbn22x7ayfzlv9a5ca1m59g0ym1ysi5w";
+      type = "gem";
+    };
+    version = "2.2.1";
+  };
+  jemoji = {
+    dependencies = ["gemoji" "html-pipeline" "jekyll"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0x463l6a8ikaf6pzap0dgh4gfvlkx56g6kdasj9jfb1ld3fvl99k";
+      type = "gem";
+    };
+    version = "0.11.0";
+  };
+  kramdown = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1n1c4jmrh5ig8iv1rw81s4mw4xsp4v97hvf8zkigv4hn5h542qjq";
+      type = "gem";
+    };
+    version = "1.17.0";
+  };
+  liquid = {
+    groups = ["default"];
+    platforms = [{
+      engine = "maglev";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mswin";
+    } {
+      engine = "rbx";
+    } {
+      engine = "ruby";
+    }];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0zhg5ha8zy8zw9qr3fl4wgk4r5940n4128xm2pn4shpbzdbsj5by";
+      type = "gem";
+    };
+    version = "4.0.3";
+  };
+  liquid-c = {
+    dependencies = ["liquid"];
+    groups = ["default"];
+    platforms = [{
+      engine = "maglev";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mswin";
+    } {
+      engine = "rbx";
+    } {
+      engine = "ruby";
+    }];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0a5n7q314ma32y7v9a1g6ps60b14zfn2q4nip4j5aknblz51v7gi";
+      type = "gem";
+    };
+    version = "3.0.0";
+  };
+  listen = {
+    dependencies = ["rb-fsevent" "rb-inotify" "ruby_dep"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "01v5mrnfqm6sgm8xn2v5swxsn1wlmq7rzh2i48d4jzjsc7qvb6mx";
+      type = "gem";
+    };
+    version = "3.1.5";
+  };
+  mercenary = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "10la0xw82dh5mqab8bl0dk21zld63cqxb1g16fk8cb39ylc4n21a";
+      type = "gem";
+    };
+    version = "0.3.6";
+  };
+  mime-types = {
+    dependencies = ["mime-types-data"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0fjxy1jm52ixpnv3vg9ld9pr9f35gy0jp66i1njhqjvmnvq0iwwk";
+      type = "gem";
+    };
+    version = "3.2.2";
+  };
+  mime-types-data = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1m00pg19cm47n1qlcxgl91ajh2yq0fszvn1vy8fy0s1jkrp9fw4a";
+      type = "gem";
+    };
+    version = "3.2019.0331";
+  };
+  mini_portile2 = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "15zplpfw3knqifj9bpf604rb3wc1vhq6363pd6lvhayng8wql5vy";
+      type = "gem";
+    };
+    version = "2.4.0";
+  };
+  minitest = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0icglrhghgwdlnzzp4jf76b0mbc71s80njn5afyfjn4wqji8mqbq";
+      type = "gem";
+    };
+    version = "5.11.3";
+  };
+  multi_json = {
+    groups = ["default"];
+    platforms = [{
+      engine = "maglev";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mswin";
+    } {
+      engine = "rbx";
+    } {
+      engine = "ruby";
+    }];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1rl0qy4inf1mp8mybfk56dfga0mvx97zwpmq5xmiwl5r770171nv";
+      type = "gem";
+    };
+    version = "1.13.1";
+  };
+  multipart-post = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1zgw9zlwh2a6i1yvhhc4a84ry1hv824d6g2iw2chs3k5aylpmpfj";
+      type = "gem";
+    };
+    version = "2.1.1";
+  };
+  nokogiri = {
+    dependencies = ["mini_portile2"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "02bjydih0j515szfv9mls195cvpyidh6ixm7dwbl3s2sbaxxk5s4";
+      type = "gem";
+    };
+    version = "1.10.3";
+  };
+  octokit = {
+    dependencies = ["sawyer"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1w7agbfg39jzqk81yad9xhscg31869277ysr2iwdvpjafl5lj4ha";
+      type = "gem";
+    };
+    version = "4.14.0";
+  };
+  pathutil = {
+    dependencies = ["forwardable-extended"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "12fm93ljw9fbxmv2krki5k5wkvr7560qy8p4spvb9jiiaqv78fz4";
+      type = "gem";
+    };
+    version = "0.16.2";
+  };
+  public_suffix = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0g9ds2ffzljl6jjmkjffwxc1z6lh5nkqqmhhkxjk71q5ggv0rkpm";
+      type = "gem";
+    };
+    version = "3.1.1";
+  };
+  "pygments.rb" = {
+    dependencies = ["multi_json"];
+    groups = ["default"];
+    platforms = [{
+      engine = "maglev";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mswin";
+    } {
+      engine = "rbx";
+    } {
+      engine = "ruby";
+    }];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0lbvnwvz770ambm4d6lxgc2097rydn5rcc5d6986bnkzyxfqqjnv";
+      type = "gem";
+    };
+    version = "1.2.1";
+  };
+  rb-fsevent = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1lm1k7wpz69jx7jrc92w3ggczkjyjbfziq5mg62vjnxmzs383xx8";
+      type = "gem";
+    };
+    version = "0.10.3";
+  };
+  rb-inotify = {
+    dependencies = ["ffi"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1fs7hxm9g6ywv2yih83b879klhc4fs8i0p9166z795qmd77dk0a4";
+      type = "gem";
+    };
+    version = "0.10.0";
+  };
+  rdiscount = {
+    groups = ["default"];
+    platforms = [{
+      engine = "maglev";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mswin";
+    } {
+      engine = "rbx";
+    } {
+      engine = "ruby";
+    }];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1arvk3k06prxasq1djbj065ixar4zl171340g7wr1ww4gj9makx3";
+      type = "gem";
+    };
+    version = "2.2.0.1";
+  };
+  rdoc = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "07b7ac2nls2yskaicqshxgip6dwpxl80hlx4pslq90jgpxgs2kkp";
+      type = "gem";
+    };
+    version = "6.1.1";
+  };
+  redcarpet = {
+    groups = ["default"];
+    platforms = [{
+      engine = "maglev";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mswin";
+    } {
+      engine = "rbx";
+    } {
+      engine = "ruby";
+    }];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0h9qz2hik4s9knpmbwrzb3jcp3vc5vygp9ya8lcpl7f1l9khmcd7";
+      type = "gem";
+    };
+    version = "3.4.0";
+  };
+  rouge = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0yfhazlhjc4abgzhkgq8zqmdphvkh52211widkl4zhsbhqh8wg2q";
+      type = "gem";
+    };
+    version = "3.5.1";
+  };
+  ruby_dep = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1c1bkl97i9mkcvkn1jks346ksnvnnp84cs22gwl0vd7radybrgy5";
+      type = "gem";
+    };
+    version = "1.5.0";
+  };
+  safe_yaml = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0j7qv63p0vqcd838i2iy2f76c3dgwzkiz1d1xkg7n0pbnxj2vb56";
+      type = "gem";
+    };
+    version = "1.0.5";
+  };
+  sass = {
+    dependencies = ["sass-listen"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0p95lhs0jza5l7hqci1isflxakz83xkj97lkvxl919is0lwhv2w0";
+      type = "gem";
+    };
+    version = "3.7.4";
+  };
+  sass-listen = {
+    dependencies = ["rb-fsevent" "rb-inotify"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0xw3q46cmahkgyldid5hwyiwacp590zj2vmswlll68ryvmvcp7df";
+      type = "gem";
+    };
+    version = "4.0.0";
+  };
+  sawyer = {
+    dependencies = ["addressable" "faraday"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0yrdchs3psh583rjapkv33mljdivggqn99wkydkjdckcjn43j3cz";
+      type = "gem";
+    };
+    version = "0.8.2";
+  };
+  thread_safe = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0nmhcgq6cgz44srylra07bmaw99f5271l0dpsvl5f75m44l0gmwy";
+      type = "gem";
+    };
+    version = "0.3.6";
+  };
+  tomlrb = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0g28ssfal6vry3cmhy509ba3vi5d5aggz1gnffnvvmc8ml8vkpiv";
+      type = "gem";
+    };
+    version = "1.2.8";
+  };
+  tzinfo = {
+    dependencies = ["thread_safe"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1fjx9j327xpkkdlxwmkl3a8wqj7i4l4jwlrv3z13mg95z9wl253z";
+      type = "gem";
+    };
+    version = "1.2.5";
+  };
+  yajl-ruby = {
+    groups = ["default"];
+    platforms = [{
+      engine = "maglev";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mingw";
+    } {
+      engine = "mswin";
+    } {
+      engine = "rbx";
+    } {
+      engine = "ruby";
+    }];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1rn4kc9fha990yd252wglh6rcyh35cavm1vpyfj8krlcwph09g30";
+      type = "gem";
+    };
+    version = "1.3.1";
+  };
+}
\ No newline at end of file
diff --git a/nixpkgs/pkgs/applications/misc/jekyll/update.sh b/nixpkgs/pkgs/applications/misc/jekyll/update.sh
new file mode 100755
index 000000000000..528f1062c733
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/jekyll/update.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p bundix zlib
+
+set -o errexit
+set -o nounset
+
+readonly BASEDIR="$(dirname $(readlink -f $0))"
+
+for directory in "basic" "full"; do
+  pushd "$BASEDIR/$directory"
+  rm -f Gemfile.lock gemset.nix
+  bundix --magic
+  rm -rf .bundle vendor
+  popd
+done
diff --git a/nixpkgs/pkgs/applications/misc/jgmenu/default.nix b/nixpkgs/pkgs/applications/misc/jgmenu/default.nix
new file mode 100644
index 000000000000..6ba0bed78476
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/jgmenu/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchFromGitHub, pkgconfig, python3Packages, pango, librsvg, libxml2, menu-cache, xorg, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "jgmenu";
+  version = "3.0";
+
+  src = fetchFromGitHub {
+    owner = "johanmalm";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "01r92nili4v4pdmw4g5z0rsg1q7m7q3a5hjc47mnchgibdiissvl";
+  };
+
+  nativeBuildInputs = [
+    pkgconfig
+    makeWrapper
+    python3Packages.wrapPython
+  ];
+
+  buildInputs = [
+    pango
+    librsvg
+    libxml2
+    menu-cache
+    xorg.libXinerama
+    xorg.libXrandr
+    python3Packages.python
+  ];
+
+  makeFlags = [ "prefix=${placeholder "out"}" ];
+
+  postFixup = ''
+    wrapPythonProgramsIn "$out/lib/jgmenu"
+    for f in $out/bin/jgmenu{,_run}; do
+      wrapProgram $f --prefix PATH : $out/bin
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/johanmalm/jgmenu;
+    description = "Small X11 menu intended to be used with openbox and tint2";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/jigdo/default.nix b/nixpkgs/pkgs/applications/misc/jigdo/default.nix
new file mode 100644
index 000000000000..3561fcde839d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/jigdo/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, db, gtk2, bzip2 }:
+
+stdenv.mkDerivation {
+  name = "jigdo-0.7.3";
+
+  # Debian sources
+  src = fetchurl {
+    url = http://ftp.de.debian.org/debian/pool/main/j/jigdo/jigdo_0.7.3.orig.tar.gz;
+    sha256 = "1qvqzgzb0dzq82fa1ffs6hyij655rajnfwkljk1y0mnkygnha1xv";
+  };
+
+  patches = [
+    (fetchurl {
+      url = http://ftp.de.debian.org/debian/pool/main/j/jigdo/jigdo_0.7.3-4.diff.gz;
+      sha256 = "03zsh57fijciiv23lf55k6fbfhhzm866xjhx83x54v5s1g2h6m8y";
+    })
+    ./sizewidth.patch
+  ];
+
+  buildInputs = [ db gtk2 bzip2 ];
+
+  configureFlags = [ "--without-libdb" ];
+
+  meta = {
+    description = "Download utility that can fetch files from several sources simultaneously";
+    homepage = http://atterer.net/jigdo/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/jigdo/sizewidth.patch b/nixpkgs/pkgs/applications/misc/jigdo/sizewidth.patch
new file mode 100644
index 000000000000..17b1749fcf77
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/jigdo/sizewidth.patch
@@ -0,0 +1,40 @@
+diff --git i/src/mkimage.cc w/src/mkimage.cc
+index 02e65b1..b263796 100755
+--- i/src/mkimage.cc
++++ w/src/mkimage.cc
+@@ -285,27 +285,27 @@ bostream& JigdoDescVec::put(bostream& file, MD5Sum* md) const {
+ //______________________________________________________________________
+ 
+ namespace {
+-  const int SIZE_WIDTH = 12;
++  const int MKIMAGE_SIZE_WIDTH = 12;
+ }
+ 
+ ostream& JigdoDesc::ImageInfo::put(ostream& s) const {
+-  s << "image-info  " << setw(SIZE_WIDTH) << size() << "              "
++  s << "image-info  " << setw(MKIMAGE_SIZE_WIDTH) << size() << "              "
+     << md5() << ' ' << blockLength() << '\n';
+   return s;
+ }
+ ostream& JigdoDesc::UnmatchedData::put(ostream& s) const {
+-  s << "in-template " << setw(SIZE_WIDTH) << offset() << ' '
+-    << setw(SIZE_WIDTH) << size() << '\n';
++  s << "in-template " << setw(MKIMAGE_SIZE_WIDTH) << offset() << ' '
++    << setw(MKIMAGE_SIZE_WIDTH) << size() << '\n';
+   return s;
+ }
+ ostream& JigdoDesc::MatchedFile::put(ostream& s) const {
+-  s << "need-file   " << setw(SIZE_WIDTH) << offset() << ' '
+-    << setw(SIZE_WIDTH) << size() << ' ' << md5() << ' ' << rsync() << '\n';
++  s << "need-file   " << setw(MKIMAGE_SIZE_WIDTH) << offset() << ' '
++    << setw(MKIMAGE_SIZE_WIDTH) << size() << ' ' << md5() << ' ' << rsync() << '\n';
+   return s;
+ }
+ ostream& JigdoDesc::WrittenFile::put(ostream& s) const {
+-  s << "have-file   " << setw(SIZE_WIDTH) << offset() << ' '
+-    << setw(SIZE_WIDTH) << size() << ' ' << md5() << ' ' << rsync() << '\n';
++  s << "have-file   " << setw(MKIMAGE_SIZE_WIDTH) << offset() << ' '
++    << setw(MKIMAGE_SIZE_WIDTH) << size() << ' ' << md5() << ' ' << rsync() << '\n';
+   return s;
+ }
+ 
diff --git a/nixpkgs/pkgs/applications/misc/joplin-desktop/default.nix b/nixpkgs/pkgs/applications/misc/joplin-desktop/default.nix
new file mode 100644
index 000000000000..410b04d5dcbd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/joplin-desktop/default.nix
@@ -0,0 +1,37 @@
+{ appimageTools, fetchurl, lib, gsettings-desktop-schemas, gtk3 }:
+
+let
+  pname = "joplin-desktop";
+  version = "1.0.158";
+in appimageTools.wrapType2 rec {
+  name = "${pname}-${version}";
+  src = fetchurl {
+    url = "https://github.com/laurent22/joplin/releases/download/v${version}/Joplin-${version}-x86_64.AppImage";
+    sha256 = "1xaamwcasihja3agwb0nnfnzc1wmmr0d2ng73qmfil9nhf9v3j6q";
+  };
+
+
+  profile = ''
+    export LC_ALL=C.UTF-8
+    export XDG_DATA_DIRS=${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS
+  '';
+
+  multiPkgs = null; # no 32bit needed
+  extraPkgs = appimageTools.defaultFhsEnvArgs.multiPkgs;
+  extraInstallCommands = "mv $out/bin/{${name},${pname}}";
+
+  meta = with lib; {
+    description = "An open source note taking and to-do application with synchronisation capabilities";
+    longDescription = ''
+      Joplin is a free, open source note taking and to-do application, which can
+      handle a large number of notes organised into notebooks. The notes are
+      searchable, can be copied, tagged and modified either from the
+      applications directly or from your own text editor. The notes are in
+      Markdown format.
+    '';
+    homepage = https://joplin.cozic.net/;
+    license = licenses.mit;
+    maintainers = with maintainers; [ rafaelgg raquelgb ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/josm/default.nix b/nixpkgs/pkgs/applications/misc/josm/default.nix
new file mode 100644
index 000000000000..4f7acb7731ab
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/josm/default.nix
@@ -0,0 +1,46 @@
+{ fetchurl, stdenv, makeDesktopItem, makeWrapper, unzip, jdk11, libXxf86vm }:
+
+stdenv.mkDerivation rec {
+  name = "josm-${version}";
+  version = "15155";
+
+  src = fetchurl {
+    url = "https://josm.openstreetmap.de/download/josm-snapshot-${version}.jar";
+    sha256 = "0qws5bgv7mm1iynsdrn7cdi16rd8k4139iia3bnjpm04xn69i5im";
+  };
+
+  buildInputs = [ jdk11 makeWrapper ];
+
+  desktopItem = makeDesktopItem {
+    name = "josm";
+    exec = "josm";
+    icon = "josm";
+    desktopName = "JOSM";
+    genericName = "OpenStreetMap Editor";
+    comment = meta.description;
+    categories = "Education;Geoscience;Maps;";
+  };
+
+  # Add libXxf86vm to path because it is needed by at least Kendzi3D plugin
+  buildCommand = ''
+    mkdir -p $out/bin $out/share/java
+    cp -v $src $out/share/java/josm.jar
+
+    makeWrapper ${jdk11}/bin/java $out/bin/josm \
+      --add-flags "-jar $out/share/java/josm.jar" \
+      --prefix LD_LIBRARY_PATH ":" '${libXxf86vm}/lib'
+
+    mkdir -p $out/share/applications
+    cp $desktopItem/share/applications"/"* $out/share/applications
+    mkdir -p $out/share/pixmaps
+    ${unzip}/bin/unzip -p $src images/logo_48x48x32.png > $out/share/pixmaps/josm.png
+  '';
+
+  meta = with stdenv.lib; {
+    description = "An extensible editor for OpenStreetMap";
+    homepage = https://josm.openstreetmap.de/;
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.rycee ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/jp2a/default.nix b/nixpkgs/pkgs/applications/misc/jp2a/default.nix
new file mode 100644
index 000000000000..138ee397d3fd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/jp2a/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, libjpeg, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  version = "1.0.7";
+  name = "jp2a-${version}";
+
+  src = fetchFromGitHub {
+    owner = "cslarsen";
+    repo = "jp2a";
+    rev = "v${version}";
+    sha256 = "12a1z9ba2j16y67f41y8ax5sgv1wdjd71pg7circdxkj263n78ql";
+  };
+
+  makeFlags = "PREFIX=$(out)";
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ libjpeg ];
+
+  meta = with stdenv.lib; {
+    homepage = https://csl.name/jp2a/;
+    description = "A small utility that converts JPG images to ASCII";
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/jrnl/default.nix b/nixpkgs/pkgs/applications/misc/jrnl/default.nix
new file mode 100644
index 000000000000..3260f6a50690
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/jrnl/default.nix
@@ -0,0 +1,30 @@
+{ stdenv
+, python3
+}:
+
+with python3.pkgs;
+
+buildPythonApplication rec {
+  pname = "jrnl";
+  version = "1.9.8";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "d254c9c8f24dcf985b98a1d5311337c7f416e6305107eec34c567f58c95b06f4";
+  };
+
+  propagatedBuildInputs = [
+    pytz six tzlocal keyring dateutil
+    parsedatetime pycrypto
+  ];
+
+  # No tests in archive
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    homepage = http://maebert.github.io/jrnl/;
+    description = "A simple command line journal application that stores your journal in a plain text file";
+    license = licenses.mit;
+    maintainers = with maintainers; [ zalakain ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/k2pdfopt/default.nix b/nixpkgs/pkgs/applications/misc/k2pdfopt/default.nix
new file mode 100644
index 000000000000..7c5845b35419
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/k2pdfopt/default.nix
@@ -0,0 +1,132 @@
+{ stdenv, fetchzip, fetchurl, fetchpatch, cmake, pkgconfig
+, zlib, libpng
+, enableGSL ? true, gsl
+, enableGhostScript ? true, ghostscript
+, enableMuPDF ? true, mupdf
+, enableJPEG2K ? true, jasper
+, enableDJVU ? true, djvulibre
+, enableGOCR ? false, gocr # Disabled by default due to crashes
+, enableTesseract ? true, leptonica, tesseract4
+}:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "k2pdfopt-${version}";
+  version = "2.51a";
+
+  src = (fetchzip {
+    url = "http://www.willus.com/k2pdfopt/src/k2pdfopt_v2.51_src.zip";
+    sha256 = "133l7xkvi67s6sfk8cfh7rmavbsf7ib5fyksk1ci6b6sch3z2sw9";
+  });
+
+  # Note: the v2.51a zip contains only files to be replaced in the v2.50 zip.
+  v251a_src = (fetchzip {
+    url = "http://www.willus.com/k2pdfopt/src/k2pdfopt_v2.51a_src.zip";
+    sha256 = "0vvwblii7kgdwfxw8dzk6jbmz4dv94d7rkv18i60y8wkayj6yhl6";
+  });
+
+  postUnpack = ''
+    cp -r ${v251a_src}/* $sourceRoot
+  '';
+
+  patches = [ ./k2pdfopt.patch ];
+
+  nativeBuildInputs = [ cmake pkgconfig ];
+
+  buildInputs =
+  let
+    mupdf_modded = mupdf.overrideAttrs (attrs: {
+      # Excluded the pdf-*.c files, since they mostly just broke the #includes
+      prePatch = ''
+        cp ${src}/mupdf_mod/{font,stext-device,string}.c source/fitz/
+        cp ${src}/mupdf_mod/font-win32.c source/pdf/
+      '';
+    });
+
+    leptonica_modded = leptonica.overrideAttrs (attrs: {
+      name = "leptonica-1.74.4";
+      # Modified source files apply to this particular version of leptonica
+      version = "1.74.4";
+
+      src = fetchurl {
+        url = "http://www.leptonica.org/source/leptonica-1.74.4.tar.gz";
+        sha256 = "0fw39amgyv8v6nc7x8a4c7i37dm04i6c5zn62d24bgqnlhk59hr9";
+      };
+
+      prePatch = ''
+        cp ${src}/leptonica_mod/{allheaders.h,dewarp2.c,leptwin.c} src/
+      '';
+      patches = [
+        # stripped down copy of upstream commit b88c821f8d347bce0aea86d606c710303919f3d2
+        ./leptonica-CVE-2018-3836.patch
+        (fetchpatch {
+          # CVE-2018-7186
+          url = "https://github.com/DanBloomberg/leptonica/commit/"
+              + "ee301cb2029db8a6289c5295daa42bba7715e99a.patch";
+          sha256 = "0cgb7mvz2px1rg5i80wk1wxxjvzjga617d8q6j7qygkp7jm6495d";
+        })
+        (fetchpatch {
+          # CVE-2018-7247
+          url = "https://github.com/DanBloomberg/leptonica/commit/"
+              + "c1079bb8e77cdd426759e466729917ca37a3ed9f.patch";
+          sha256 = "1z4iac5gwqggh7aa8cvyp6nl9fwd1v7wif26caxc9y5qr3jj34qf";
+        })
+        (fetchpatch {
+          # CVE-2018-7440
+          url = "https://github.com/DanBloomberg/leptonica/commit/"
+              + "49ecb6c2dfd6ed5078c62f4a8eeff03e3beced3b.patch";
+          sha256 = "1hjmva98iaw9xj7prg7aimykyayikcwnk4hk0380007hqb35lqmy";
+        })
+      ];
+    });
+    tesseract_modded = tesseract4.override {
+      tesseractBase = tesseract4.tesseractBase.overrideAttrs (_: {
+        prePatch = ''
+          cp ${src}/tesseract_mod/baseapi.{h,cpp} src/api/
+          cp ${src}/tesseract_mod/ccutil.{h,cpp} src/ccutil/
+          cp ${src}/tesseract_mod/genericvector.h src/ccutil/
+          cp ${src}/tesseract_mod/input.cpp src/lstm/
+          cp ${src}/tesseract_mod/lstmrecognizer.cpp src/lstm/
+          cp ${src}/tesseract_mod/mainblk.cpp src/ccutil/
+          cp ${src}/tesseract_mod/params.cpp src/ccutil/
+          cp ${src}/tesseract_mod/serialis.{h,cpp} src/ccutil/
+          cp ${src}/tesseract_mod/tesscapi.cpp src/api/
+          cp ${src}/tesseract_mod/tessdatamanager.cpp src/ccstruct/
+          cp ${src}/tesseract_mod/tessedit.cpp src/ccmain/
+          cp ${src}/include_mod/{tesseract.h,leptonica.h} src/api/
+        '';
+        patches = [ ./tesseract.patch ];
+      });
+    };
+  in
+    [ zlib libpng ] ++
+    optional enableGSL gsl ++
+    optional enableGhostScript ghostscript ++
+    optional enableMuPDF mupdf_modded ++
+    optional enableJPEG2K jasper ++
+    optional enableDJVU djvulibre ++
+    optional enableGOCR gocr ++
+    optionals enableTesseract [ leptonica_modded tesseract_modded ];
+
+  dontUseCmakeBuildDir = true;
+
+  cmakeFlags = [ "-DCMAKE_C_FLAGS=-I${src}/include_mod" ];
+
+  NIX_LDFLAGS = [
+    "-lpthread"
+  ];
+
+  installPhase = ''
+    install -D -m 755 k2pdfopt $out/bin/k2pdfopt
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Optimizes PDF/DJVU files for mobile e-readers (e.g. the Kindle) and smartphones";
+    homepage = http://www.willus.com/k2pdfopt;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ bosu danielfullmer ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/k2pdfopt/k2pdfopt.patch b/nixpkgs/pkgs/applications/misc/k2pdfopt/k2pdfopt.patch
new file mode 100644
index 000000000000..cf7e4896b803
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/k2pdfopt/k2pdfopt.patch
@@ -0,0 +1,99 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4a2378b..502c477 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -52,6 +52,7 @@ endif(JPEG_FOUND)
+ include(FindJasper)
+ if(JASPER_FOUND)
+   set(HAVE_JASPER_LIB 1)
++  set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${JASPER_LIBRARY})
+ endif(JASPER_FOUND)
+ 
+ # paths from willuslib/wgs.c
+@@ -66,8 +67,12 @@ else()
+   message(STATUS "Could NOT find ghostscript executable")
+ endif(GHOSTSCRIPT_EXECUTABLE)
+ 
+-# willus.h
+-# HAVE_GSL_LIB
++pkg_check_modules(GSL gsl)
++if(GSL_FOUND)
++  set(HAVE_GSL_LIB 1)
++  include_directories(SYSTEM ${GSL_INCLUDEDIR})
++  set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${GSL_LDFLAGS})
++endif(GSL_FOUND)
+ 
+ 
+ # libfreetype6 (>= 2.3.9), libjbig2dec0, libjpeg8 (>= 8c), libx11-6, libxext6, zlib1g (>= 1:1.2.0)
+@@ -80,7 +85,7 @@ if(MUPDF_FOUND)
+   include_directories(SYSTEM ${MUPDF_INCLUDEDIR})
+   message(STATUS "mupdf libraries: ${MUPDF_LDFLAGS}")
+   set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${MUPDF_LDFLAGS} 
+-    -lmupdf-js-none -lopenjpeg -ljbig2dec -ljpeg -lfreetype
++ 
+   )
+ endif(MUPDF_FOUND)
+ 
+@@ -91,9 +96,25 @@ if(DJVU_FOUND)
+   set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${DJVU_LDFLAGS})
+ endif(DJVU_FOUND)
+ 
+-# HAVE_GOCR_LIB
+-# HAVE_LEPTONICA_LIB
+-# HAVE_TESSERACT_LIB
++find_library(GOCR_LIB NAMES Pgm2asc)
++if(GOCR_LIB)
++  set(HAVE_GOCR_LIB 1)
++  set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${GOCR_LIB})
++endif(GOCR_LIB)
++
++pkg_check_modules(LEPTONICA lept)
++if(LEPTONICA_FOUND)
++  set(HAVE_LEPTONICA_LIB 1)
++  include_directories(SYSTEM ${LEPTONICA_INCLUDEDIR})
++  set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${LEPTONICA_LDFLAGS})
++endif(LEPTONICA_FOUND)
++
++pkg_check_modules(TESSERACT tesseract)
++if(TESSERACT_FOUND)
++  set(HAVE_TESSERACT_LIB 1)
++  include_directories(SYSTEM ${TESSERACT_INCLUDEDIR})
++  set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${TESSERACT_LDFLAGS})
++endif(TESSERACT_FOUND)
+ 
+ # ---- Describe project
+ 
+diff --git a/willuslib/CMakeLists.txt b/willuslib/CMakeLists.txt
+index 463bbc9..8043db5 100644
+--- a/willuslib/CMakeLists.txt
++++ b/willuslib/CMakeLists.txt
+@@ -6,7 +6,7 @@ include_directories(..)
+ set(WILLUSLIB_SRC
+     ansi.c array.c bmp.c bmpdjvu.c bmpmupdf.c dtcompress.c filelist.c
+     fontdata.c fontrender.c gslpolyfit.c linux.c math.c mem.c ocr.c
+-    ocrjocr.c ocrtess.c pdfwrite.c point2d.c render.c strbuf.c string.c
++    ocrgocr.c ocrtess.c pdfwrite.c point2d.c render.c strbuf.c string.c
+     token.c wfile.c wgs.c wgui.c willusversion.c win.c winbmp.c
+     wincomdlg.c winmbox.c winshell.c wmupdf.c wmupdfinfo.c wpdf.c wsys.c
+     wzfile.c wleptonica.c
+diff --git a/willuslib/ocrgocr.c b/willuslib/ocrgocr.c
+index 6027e9a..fbe10f0 100644
+--- a/willuslib/ocrgocr.c
++++ b/willuslib/ocrgocr.c
+@@ -29,6 +29,8 @@
+ #ifdef HAVE_GOCR_LIB
+ #include <gocr.h>
+ 
++job_t *OCR_JOB;
++
+ /*
+ ** bmp8 must be grayscale
+ ** (x1,y1) and (x2,y2) from top left of bitmap
+@@ -63,6 +65,7 @@ void gocr_single_word_from_bmp8(char *text,int maxlen,WILLUSBITMAP *bmp8,
+     h=y2-y1+1;
+     dh=h+bw*2;
+     job=&_job;
++    OCR_JOB=job;
+     job_init(job);
+     job_init_image(job);
+     // willus_mem_alloc_warn((void **)&job->src.p.p,w*h,funcname,10);
diff --git a/nixpkgs/pkgs/applications/misc/k2pdfopt/leptonica-CVE-2018-3836.patch b/nixpkgs/pkgs/applications/misc/k2pdfopt/leptonica-CVE-2018-3836.patch
new file mode 100644
index 000000000000..f1b4170fbaae
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/k2pdfopt/leptonica-CVE-2018-3836.patch
@@ -0,0 +1,95 @@
+--- a/src/allheaders.h
++++ b/src/allheaders.h
+@@ -2600,6 +2600,7 @@
+ LEPT_DLL extern char * stringReverse ( const char *src );
+ LEPT_DLL extern char * strtokSafe ( char *cstr, const char *seps, char **psaveptr );
+ LEPT_DLL extern l_int32 stringSplitOnToken ( char *cstr, const char *seps, char **phead, char **ptail );
++LEPT_DLL extern l_int32 stringCheckForChars ( const char *src, const char *chars, l_int32 *pfound );
+ LEPT_DLL extern char * stringRemoveChars ( const char *src, const char *remchars );
+ LEPT_DLL extern l_int32 stringFindSubstr ( const char *src, const char *sub, l_int32 *ploc );
+ LEPT_DLL extern char * stringReplaceSubstr ( const char *src, const char *sub1, const char *sub2, l_int32 *pfound, l_int32 *ploc );
+--- a/src/gplot.c
++++ b/src/gplot.c
+@@ -141,9 +141,10 @@
+             const char  *xlabel,
+             const char  *ylabel)
+ {
+-char   *newroot;
+-char    buf[L_BUF_SIZE];
+-GPLOT  *gplot;
++char    *newroot;
++char     buf[L_BUF_SIZE];
++l_int32  badchar;
++GPLOT   *gplot;
+ 
+     PROCNAME("gplotCreate");
+ 
+@@ -152,6 +153,9 @@
+     if (outformat != GPLOT_PNG && outformat != GPLOT_PS &&
+         outformat != GPLOT_EPS && outformat != GPLOT_LATEX)
+         return (GPLOT *)ERROR_PTR("outformat invalid", procName, NULL);
++    stringCheckForChars(rootname, "`;&|><\"?*", &badchar);
++    if (badchar)  /* danger of command injection */
++        return (GPLOT *)ERROR_PTR("invalid rootname", procName, NULL);
+ 
+     if ((gplot = (GPLOT *)LEPT_CALLOC(1, sizeof(GPLOT))) == NULL)
+         return (GPLOT *)ERROR_PTR("gplot not made", procName, NULL);
+--- a/src/utils2.c
++++ b/src/utils2.c
+@@ -42,6 +42,7 @@
+  *           l_int32    stringSplitOnToken()
+  *
+  *       Find and replace string and array procs
++ *           l_int32    stringCheckForChars()
+  *           char      *stringRemoveChars()
+  *           l_int32    stringFindSubstr()
+  *           char      *stringReplaceSubstr()
+@@ -701,6 +702,48 @@
+ /*--------------------------------------------------------------------*
+  *                       Find and replace procs                       *
+  *--------------------------------------------------------------------*/
++/*!
++ * \brief   stringCheckForChars()
++ *
++ * \param[in]    src      input string; can be of zero length
++ * \param[in]    chars    string of chars to be searched for in %src
++ * \param[out]   pfound   1 if any characters are found; 0 otherwise
++ * \return  0 if OK, 1 on error
++ *
++ * <pre>
++ * Notes:
++ *      (1) This can be used to sanitize an operation by checking for
++ *          special characters that don't belong in a string.
++ * </pre>
++ */
++l_int32
++stringCheckForChars(const char  *src,
++                    const char  *chars,
++                    l_int32     *pfound)
++{
++char     ch;
++l_int32  i, n;
++
++    PROCNAME("stringCheckForChars");
++
++    if (!pfound)
++        return ERROR_INT("&found not defined", procName, 1);
++    *pfound = FALSE;
++    if (!src || !chars)
++        return ERROR_INT("src and chars not both defined", procName, 1);
++
++    n = strlen(src);
++    for (i = 0; i < n; i++) {
++        ch = src[i];
++        if (strchr(chars, ch)) {
++            *pfound = TRUE;
++            break;
++        }
++    }
++    return 0;
++}
++
++
+ /*!
+  * \brief   stringRemoveChars()
+  *
diff --git a/nixpkgs/pkgs/applications/misc/k2pdfopt/tesseract.patch b/nixpkgs/pkgs/applications/misc/k2pdfopt/tesseract.patch
new file mode 100644
index 000000000000..b882f5b949c3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/k2pdfopt/tesseract.patch
@@ -0,0 +1,13 @@
+diff --git a/src/api/Makefile.am b/src/api/Makefile.am
+index d8c1e54..46ead13 100644
+--- a/src/api/Makefile.am
++++ b/src/api/Makefile.am
+@@ -42,7 +42,7 @@ libtesseract_api_la_CPPFLAGS = $(AM_CPPFLAGS)
+ if VISIBILITY
+ libtesseract_api_la_CPPFLAGS += -DTESS_EXPORTS
+ endif
+-libtesseract_api_la_SOURCES = baseapi.cpp capi.cpp renderer.cpp pdfrenderer.cpp
++libtesseract_api_la_SOURCES = baseapi.cpp capi.cpp renderer.cpp pdfrenderer.cpp tesscapi.cpp
+ 
+ lib_LTLIBRARIES += libtesseract.la
+ libtesseract_la_LDFLAGS = 
diff --git a/nixpkgs/pkgs/applications/misc/kanboard/default.nix b/nixpkgs/pkgs/applications/misc/kanboard/default.nix
new file mode 100644
index 000000000000..ecfcc7717281
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/kanboard/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  name = "kanboard-${version}";
+  version = "1.2.9";
+
+  src = fetchFromGitHub {
+    owner = "kanboard";
+    repo = "kanboard";
+    rev = "v${version}";
+    sha256 = "1hdr95cpxgdzrzhffs63gdl0g7122ma2zg8bkqwp42p5xphx0xan";
+  };
+
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir -p $out/share/kanboard
+    cp -rv . $out/share/kanboard
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Kanban project management software";
+    homepage = https://kanboard.net;
+    license = licenses.mit;
+    maintainers = with maintainers; [ fpletz ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/kdbplus/default.nix b/nixpkgs/pkgs/applications/misc/kdbplus/default.nix
new file mode 100644
index 000000000000..b518481e29ad
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/kdbplus/default.nix
@@ -0,0 +1,75 @@
+{ stdenv, requireFile, unzip, rlwrap, bash }:
+
+assert (stdenv.hostPlatform.system == "i686-linux");
+
+let
+  libPath = stdenv.lib.makeLibraryPath
+    [ stdenv.cc.libc stdenv.cc.cc ];
+in
+stdenv.mkDerivation rec {
+  name    = "kdbplus-${version}";
+  version = "3.3";
+
+  src = requireFile {
+    message = ''
+      Nix can't download kdb+ for you automatically. Go to
+      http://kx.com and download the free, 32-bit version for
+      Linux. Then run "nix-prefetch-url file://\$PWD/linux.zip" in
+      the directory where you saved it. Note you need version 3.3.
+    '';
+    name   = "linux.zip";
+    sha256 = "5fd0837599e24f0f437a8314510888a86ab0787684120a8fcf592299800aa940";
+  };
+
+  dontStrip = true;
+  buildInputs = [ unzip ];
+
+  phases = "unpackPhase installPhase";
+  unpackPhase = "mkdir ${name} && cd ${name} && unzip -qq ${src}";
+  installPhase = ''
+    mkdir -p $out/bin $out/libexec
+
+    patchelf \
+      --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath ${libPath} \
+      ./q/l32/q
+    mv ./q/l32/q $out/libexec/q
+
+    # Shell script wrappers to make things more convenient...
+
+    cat > $out/bin/q-install <<- EOF
+    #!${bash}/bin/bash
+    if [ -f \$HOME/q/q.k ]; then
+      echo "kdb has already been unpacked in \$HOME. Skipping..."
+      exit 0
+    fi
+    echo -n "Unzipping ${src} into \$HOME... "
+    cd \$HOME && ${unzip}/bin/unzip -qq ${src}
+    echo "Done"
+    EOF
+
+    cat > $out/bin/q <<- EOF
+    #!${bash}/bin/bash
+    if [ ! -f \$HOME/q/q.k ]; then
+      echo "ERROR: You need to unzip the Q sources into \$HOME before running q."
+      echo
+      echo "Try:"
+      echo "  cd \$HOME && unzip ${src}"
+      echo "(or run q-install)"
+      exit 1
+    fi
+
+    exec ${rlwrap}/bin/rlwrap $out/libexec/q \$@
+    EOF
+
+    chmod +x $out/bin/q $out/bin/q-install
+  '';
+
+  meta = {
+    description = "Analytics and time-series database";
+    homepage    = "http://www.kx.com/";
+    license     = stdenv.lib.licenses.unfree;
+    platforms   = [ "i686-linux" ];
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/kdeconnect/default.nix b/nixpkgs/pkgs/applications/misc/kdeconnect/default.nix
new file mode 100644
index 000000000000..b92a7ac476c9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/kdeconnect/default.nix
@@ -0,0 +1,50 @@
+{ stdenv
+, lib
+, fetchurl
+, extra-cmake-modules
+, kcmutils
+, kconfigwidgets
+, kdbusaddons
+, kdoctools
+, kiconthemes
+, ki18n
+, knotifications
+, qca-qt5
+, libfakekey
+, libXtst
+, qtx11extras
+, sshfs
+, makeWrapper
+, kwayland
+}:
+
+stdenv.mkDerivation rec {
+  pname = "kdeconnect";
+  version = "1.3.4";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/${pname}/${version}/${pname}-kde-${version}.tar.xz";
+    sha256 = "12ijvp86wm6k81dggypxh3c0dmwg5mczxy43ra8rgv63aavmf42h";
+  };
+
+  buildInputs = [
+    libfakekey libXtst
+    ki18n kiconthemes kcmutils kconfigwidgets kdbusaddons knotifications
+    qca-qt5 qtx11extras makeWrapper kwayland
+  ];
+
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+
+  postInstall = ''
+    wrapProgram $out/lib/libexec/kdeconnectd --prefix PATH : ${lib.makeBinPath [ sshfs ]}
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "KDE Connect provides several features to integrate your phone and your computer";
+    homepage    = https://community.kde.org/KDEConnect;
+    license     = with licenses; [ gpl2 ];
+    maintainers = with maintainers; [ fridh ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/keepass-plugins/keeagent/default.nix b/nixpkgs/pkgs/applications/misc/keepass-plugins/keeagent/default.nix
new file mode 100644
index 000000000000..80bf5deceb16
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/keepass-plugins/keeagent/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, buildEnv, fetchzip, mono }:
+
+let
+  version = "0.10.1";
+  drv = stdenv.mkDerivation {
+    name = "keeagent-${version}";
+
+    src = fetchzip {
+      url = "https://lechnology.com/wp-content/uploads/2018/04/KeeAgent_v0.10.1.zip";
+      sha256 = "0j7az6l9wcr8z66mfplkxwydd4bgz2p2vd69xncf0nxlfb0lshh7";
+      stripRoot = false;
+    };
+
+    meta = {
+      description = "KeePass plugin to allow other programs to access SSH keys stored in a KeePass database for authentication";
+      homepage    = "http://lechnology.com/software/keeagent";
+      platforms   = with stdenv.lib.platforms; linux;
+      license     = stdenv.lib.licenses.gpl2;
+      maintainers = [ ];
+    };
+
+    pluginFilename = "KeeAgent.plgx";
+
+    installPhase = ''
+      mkdir -p $out/lib/dotnet/keepass/
+      cp $pluginFilename $out/lib/dotnet/keepass/$pluginFilename
+    '';
+  };
+in
+  # Mono is required to compile plugin at runtime, after loading.
+  buildEnv { name = drv.name; paths = [ mono drv ]; }
diff --git a/nixpkgs/pkgs/applications/misc/keepass-plugins/keepasshttp/default.nix b/nixpkgs/pkgs/applications/misc/keepass-plugins/keepasshttp/default.nix
new file mode 100644
index 000000000000..e64632d529b1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/keepass-plugins/keepasshttp/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, buildEnv, fetchFromGitHub, mono }:
+
+let
+  version = "1.8.4.2";
+  drv = stdenv.mkDerivation {
+    name = "keepasshttp-${version}";
+    src = fetchFromGitHub {
+      owner = "pfn";
+      repo = "keepasshttp";
+      #rev = "${version}";
+      # for 1.8.4.2 the tag is at the wrong commit (they fixed stuff
+      # afterwards and didn't move the tag), hence reference by commitid
+      rev = "c2c4eb5388a02169400cba7a67be325caabdcc37";
+      sha256 = "0bkzxggbqx7sql3sp46bqham6r457in0vrgh3ai3lw2jrw79pwmh";
+    };
+
+    meta = {
+      description = "KeePass plugin to expose password entries securely (256bit AES/CBC) over HTTP";
+      homepage    = https://github.com/pfn/keepasshttp;
+      platforms   = with stdenv.lib.platforms; linux;
+      license     = stdenv.lib.licenses.gpl3;
+    };
+
+    pluginFilename = "KeePassHttp.plgx";
+
+    installPhase = ''
+      mkdir -p $out/lib/dotnet/keepass/
+      cp $pluginFilename $out/lib/dotnet/keepass/$pluginFilename
+    '';
+  };
+in
+  # Mono is required to compile plugin at runtime, after loading.
+  buildEnv { name = drv.name; paths = [ mono drv ]; }
diff --git a/nixpkgs/pkgs/applications/misc/keepass-plugins/keepassrpc/default.nix b/nixpkgs/pkgs/applications/misc/keepass-plugins/keepassrpc/default.nix
new file mode 100644
index 000000000000..b45cb24b1b51
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/keepass-plugins/keepassrpc/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, buildEnv, fetchurl, mono }:
+
+let
+  version = "1.8.0";
+  drv = stdenv.mkDerivation {
+    name = "keepassrpc-${version}";
+    src = fetchurl {
+      url    = "https://github.com/kee-org/keepassrpc/releases/download/v${version}/KeePassRPC.plgx";
+      sha256 = "1dclfpia559cqf78qw29zz235h1df5md4kgjv3bbi8y41wwmx7cd";
+    };
+
+    meta = with stdenv.lib; {
+      description = "The KeePassRPC plugin that needs to be installed inside KeePass in order for Kee to be able to connect your browser to your passwords";
+      homepage    = https://github.com/kee-org/keepassrpc;
+      platforms   = [ "x86_64-linux" ];
+      license     = licenses.gpl2;
+      maintainers = with maintainers; [ mjanczyk svsdep mgregoire ];
+    };
+
+    pluginFilename = "KeePassRPC.plgx";
+
+    unpackCmd = ''
+      mkdir deps/
+      cp -p $src deps/$pluginFilename
+    '';
+    sourceRoot = "deps";
+
+    installPhase = ''
+      mkdir -p $out/lib/dotnet/keepass/
+      cp $pluginFilename $out/lib/dotnet/keepass/$pluginFilename
+    '';
+  };
+in
+  # Mono is required to compile plugin at runtime, after loading.
+  buildEnv { name = drv.name; paths = [ mono drv ]; }
diff --git a/nixpkgs/pkgs/applications/misc/keepass/default.nix b/nixpkgs/pkgs/applications/misc/keepass/default.nix
new file mode 100644
index 000000000000..b954d2d3cdb8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/keepass/default.nix
@@ -0,0 +1,115 @@
+{ stdenv, lib, fetchurl, buildDotnetPackage, substituteAll, makeWrapper, makeDesktopItem,
+  unzip, icoutils, gtk2, xorg, xdotool, xsel, plugins ? [] }:
+
+with builtins; buildDotnetPackage rec {
+  baseName = "keepass";
+  version = "2.40";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/keepass/KeePass-${version}-Source.zip";
+    sha256 = "1gldl74wz2lvsci6rn71d6q1zmnhr52z6fjib9nsragsazq5byz9";
+  };
+
+  sourceRoot = ".";
+
+  buildInputs = [ unzip makeWrapper icoutils ];
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      xsel = "${xsel}/bin/xsel";
+      xprop = "${xorg.xprop}/bin/xprop";
+      xdotool = "${xdotool}/bin/xdotool";
+    })
+  ];
+
+  # KeePass looks for plugins in under directory in which KeePass.exe is
+  # located. It follows symlinks where looking for that directory, so
+  # buildEnv is not enough to bring KeePass and plugins together.
+  #
+  # This derivation patches KeePass to search for plugins in specified
+  # plugin derivations in the Nix store and nowhere else.
+  pluginLoadPathsPatch =
+    let outputLc = toString (add 7 (length plugins));
+        patchTemplate = readFile ./keepass-plugins.patch;
+        loadTemplate  = readFile ./keepass-plugins-load.patch;
+        loads =
+          lib.concatStrings
+            (map
+              (p: replaceStrings ["$PATH$"] [ (unsafeDiscardStringContext (toString p)) ] loadTemplate)
+              plugins);
+    in replaceStrings ["$OUTPUT_LC$" "$DO_LOADS$"] [outputLc loads] patchTemplate;
+
+  passAsFile = [ "pluginLoadPathsPatch" ];
+  postPatch = ''
+    sed -i 's/\r*$//' KeePass/Forms/MainForm.cs
+    patch -p1 <$pluginLoadPathsPatchPath
+  '';
+
+  preConfigure = ''
+    rm -rvf Build/*
+    find . -name "*.sln" -print -exec sed -i 's/Format Version 10.00/Format Version 11.00/g' {} \;
+    find . -name "*.csproj" -print -exec sed -i '
+      s#ToolsVersion="3.5"#ToolsVersion="4.0"#g
+      s#<TargetFrameworkVersion>.*</TargetFrameworkVersion>##g
+      s#<PropertyGroup>#<PropertyGroup><TargetFrameworkVersion>v4.5</TargetFrameworkVersion>#g
+      s#<SignAssembly>.*$#<SignAssembly>false</SignAssembly>#g
+      s#<PostBuildEvent>.*sgen.exe.*$##
+    ' {} \;
+  '';
+
+  desktopItem = makeDesktopItem {
+    name = "keepass";
+    exec = "keepass";
+    comment = "Password manager";
+    icon = "keepass";
+    desktopName = "Keepass";
+    genericName = "Password manager";
+    categories = "Application;Utility;";
+    mimeType = stdenv.lib.concatStringsSep ";" [
+      "application/x-keepass2"
+      ""
+    ];
+  };
+
+  outputFiles = [ "Build/KeePass/Release/*" "Build/KeePassLib/Release/*" ];
+  dllFiles = [ "KeePassLib.dll" ];
+  exeFiles = [ "KeePass.exe" ];
+
+  # plgx plugin like keefox requires mono to compile at runtime
+  # after loading. It is brought into plugins bin/ directory using
+  # buildEnv in the plugin derivation. Wrapper below makes sure it
+  # is found and does not pollute output path.
+  binPaths = lib.concatStrings (lib.intersperse ":" (map (x: x + "/bin") plugins));
+
+  dynlibPath = stdenv.lib.makeLibraryPath [ gtk2 ];
+
+  postInstall = 
+  let
+    extractFDeskIcons = ./extractWinRscIconsToStdFreeDesktopDir.sh;
+  in
+  ''
+    mkdir -p "$out/share/applications"
+    cp ${desktopItem}/share/applications/* $out/share/applications
+    wrapProgram $out/bin/keepass \
+      --prefix PATH : "$binPaths" \
+      --prefix LD_LIBRARY_PATH : "$dynlibPath"
+
+    ${extractFDeskIcons} \
+      "./Translation/TrlUtil/Resources/KeePass.ico" \
+      '[^\.]+_[0-9]+_([0-9]+x[0-9]+)x[0-9]+\.png' \
+      '\1' \
+      '([^\.]+).+' \
+      'keepass' \
+      "$out" \
+      "./tmp"
+  '';
+
+  meta = {
+    description = "GUI password manager with strong cryptography";
+    homepage = http://www.keepass.info/;
+    maintainers = with stdenv.lib.maintainers; [ amorsillo obadz joncojonathan jraygauthier ];
+    platforms = with stdenv.lib.platforms; all;
+    license = stdenv.lib.licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/keepass/extractWinRscIconsToStdFreeDesktopDir.sh b/nixpkgs/pkgs/applications/misc/keepass/extractWinRscIconsToStdFreeDesktopDir.sh
new file mode 100755
index 000000000000..04485b146a04
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/keepass/extractWinRscIconsToStdFreeDesktopDir.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# The file from which to extract *.ico files.
+#rscFile="./KeePass.exe"
+rscFile=$1
+
+# A regexp that can extract the image size from the file name.
+# sizeRegex='[^\.]+\.exe_[0-9]+_[0-9]+_[0-9]+_[0-9]+_([0-9]+x[0-9]+)x[0-9]+\.png'
+sizeRegex=$2
+
+# sizeReplaceExp='\1'
+sizeReplaceExp=$3
+
+# A regexp that can extract the name of the target image from the file name.
+# nameRegex='([^\.]+)\.exe.+'
+nameRegex=$4
+
+# nameReplaceExp='\1'
+nameReplaceExp=$5
+
+# out=./myOut
+out=$6
+
+# An optional temp dir. TODO: Generate it randomly by default instead.
+tmp=./tmp
+if [ "" != "$4" ]; then
+    tmp=$7
+fi
+
+
+
+rm -rf $tmp/png $tmp/ico
+mkdir -p $tmp/png $tmp/ico
+
+# Extract the ressource file's extension.
+rscFileExt=`echo "$rscFile" | sed -re 's/.+\.(.+)$/\1/'`
+
+# Debug ressource file extension.
+echo "rscFileExt=$rscFileExt"
+
+if [ "ico" = "$rscFileExt" ]; then
+    cp -p $rscFile $tmp/ico
+else
+    wrestool -x --output=$tmp/ico -t14 $rscFile
+fi
+    
+icotool --icon -x --palette-size=0 -o $tmp/png $tmp/ico/*.ico
+
+mkdir -p $out
+
+for i in $tmp/png/*.png; do
+  fn=`basename "$i"`
+  size=$(echo $fn | sed -re 's/'${sizeRegex}'/'${sizeReplaceExp}'/')
+  name=$(echo $fn | sed -re 's/'${nameRegex}'/'${nameReplaceExp}'/')
+  targetDir=$out/share/icons/hicolor/$size/apps
+  targetFile=$targetDir/$name.png
+  mkdir -p $targetDir
+  mv $i $targetFile
+done
+
+rm -rf $tmp/png $tmp/ico
diff --git a/nixpkgs/pkgs/applications/misc/keepass/fix-paths.patch b/nixpkgs/pkgs/applications/misc/keepass/fix-paths.patch
new file mode 100644
index 000000000000..318f8a358985
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/keepass/fix-paths.patch
@@ -0,0 +1,87 @@
+diff --git a/KeePass/Native/NativeMethods.Unix.cs b/KeePass/Native/NativeMethods.Unix.cs
+index 7495a1c..4ef4727 100644
+--- a/KeePass/Native/NativeMethods.Unix.cs
++++ b/KeePass/Native/NativeMethods.Unix.cs
+@@ -128,7 +128,7 @@ namespace KeePass.Native
+ 			try

+ 			{

+ 				Application.DoEvents(); // E.g. for clipboard updates

+-				string strOutput = NativeLib.RunConsoleApp("xdotool", strParams);

++				string strOutput = NativeLib.RunConsoleApp("@xdotool@", strParams);

+ 				Application.DoEvents(); // E.g. for clipboard updates

+ 				return (strOutput ?? string.Empty);

+ 			}

+diff --git a/KeePass/Util/ClipboardUtil.Unix.cs b/KeePass/Util/ClipboardUtil.Unix.cs
+index e93a22a..3fd9a2b 100644
+--- a/KeePass/Util/ClipboardUtil.Unix.cs
++++ b/KeePass/Util/ClipboardUtil.Unix.cs
+@@ -62,7 +62,7 @@ namespace KeePass.Util
+ 			//	"-out -selection clipboard");

+ 			// if(str != null) return str;

+ 

+-			string str = NativeLib.RunConsoleApp("xsel",

++			string str = NativeLib.RunConsoleApp("@xsel@",

+ 				"--output --clipboard", null, XSelFlags);

+ 			if(str != null) return str;

+ 

+@@ -83,10 +83,10 @@ namespace KeePass.Util
+ 			if(string.IsNullOrEmpty(str))

+ 			{

+ 				// xsel with an empty input can hang, thus use --clear

+-				if(NativeLib.RunConsoleApp("xsel", "--clear --primary",

++				if(NativeLib.RunConsoleApp("@xsel@", "--clear --primary",

+ 					null, XSelFlags) != null)

+ 				{

+-					NativeLib.RunConsoleApp("xsel", "--clear --clipboard",

++					NativeLib.RunConsoleApp("@xsel@", "--clear --clipboard",

+ 						null, XSelFlags);

+ 					return;

+ 				}

+@@ -97,10 +97,10 @@ namespace KeePass.Util
+ 			}

+ 

+ 			// xsel does not support --primary and --clipboard together

+-			if(NativeLib.RunConsoleApp("xsel", "--input --primary",

++			if(NativeLib.RunConsoleApp("@xsel@", "--input --primary",

+ 				str, XSelFlags) != null)

+ 			{

+-				NativeLib.RunConsoleApp("xsel", "--input --clipboard",

++				NativeLib.RunConsoleApp("@xsel@", "--input --clipboard",

+ 					str, XSelFlags);

+ 				return;

+ 			}

+diff --git a/KeePassLib/Native/ClipboardU.cs b/KeePassLib/Native/ClipboardU.cs
+index ddd8f57..150eb82 100644
+--- a/KeePassLib/Native/ClipboardU.cs
++++ b/KeePassLib/Native/ClipboardU.cs
+@@ -27,7 +27,7 @@ namespace KeePassLib.Native
+ {

+ 	internal static class ClipboardU

+ 	{

+-		private const string XSel = "xsel";

++		private const string XSel = "@xsel@";

+ 		private const string XSelV = "--version";

+ 		private const string XSelR = "--output --clipboard";

+ 		private const string XSelC = "--clear --clipboard";

+diff --git a/KeePassLib/Utility/MonoWorkarounds.cs b/KeePassLib/Utility/MonoWorkarounds.cs
+index 0da7019..f6a1022 100644
+--- a/KeePassLib/Utility/MonoWorkarounds.cs
++++ b/KeePassLib/Utility/MonoWorkarounds.cs
+@@ -41,7 +41,7 @@ namespace KeePassLib.Utility
+ {

+ 	public static class MonoWorkarounds

+ 	{

+-		private const string AppXDoTool = "xdotool";

++		private const string AppXDoTool = "@xdotool@";

+ 

+ 		private static Dictionary<uint, bool> g_dForceReq = new Dictionary<uint, bool>();

+ 		private static Thread g_thFixClip = null;

+@@ -303,7 +303,7 @@ namespace KeePassLib.Utility
+ 				// }

+ 				// else { Debug.Assert(false); }

+ 

+-				string strWmClass = (NativeLib.RunConsoleApp("xprop",

++				string strWmClass = (NativeLib.RunConsoleApp("@xprop@",

+ 					"-id " + strHandle + " WM_CLASS") ?? string.Empty);

+ 

+ 				if(strWmClass.IndexOf("\"" + PwDefs.ResClass + "\"",

diff --git a/nixpkgs/pkgs/applications/misc/keepass/keepass-plugins-load.patch b/nixpkgs/pkgs/applications/misc/keepass/keepass-plugins-load.patch
new file mode 100644
index 000000000000..ca52e7ef191a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/keepass/keepass-plugins-load.patch
@@ -0,0 +1 @@
++			m_pluginManager.LoadAllPlugins("$PATH$/lib/dotnet/keepass", SearchOption.TopDirectoryOnly, new string[] {});
diff --git a/nixpkgs/pkgs/applications/misc/keepass/keepass-plugins.patch b/nixpkgs/pkgs/applications/misc/keepass/keepass-plugins.patch
new file mode 100644
index 000000000000..cde6e7252bc3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/keepass/keepass-plugins.patch
@@ -0,0 +1,13 @@
+diff --git a/KeePass/Forms/MainForm.cs b/KeePass/Forms/MainForm.cs
+index 3d5fca0..4c3f3d4 100644
+--- a/KeePass/Forms/MainForm.cs
++++ b/KeePass/Forms/MainForm.cs
+@@ -406,7 +406,$OUTPUT_LC$ @@ namespace KeePass.Forms
+ 			m_pluginManager.Initialize(m_pluginDefaultHost);
+ 
+ 			m_pluginManager.UnloadAllPlugins();
+-			if(AppPolicy.Current.Plugins) m_pluginManager.LoadAllPlugins();
+$DO_LOADS$+
+ 
+ 			// Delete old files *after* loading plugins (when timestamps
+ 			// of loaded plugins have been updated already)
diff --git a/nixpkgs/pkgs/applications/misc/keepassx/2.0.nix b/nixpkgs/pkgs/applications/misc/keepassx/2.0.nix
new file mode 100644
index 000000000000..8a3aaf202a70
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/keepassx/2.0.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, cmake, libgcrypt, qt4, xorg, ... }:
+
+stdenv.mkDerivation rec {
+  name = "keepassx2-${version}";
+  version = "2.0.3";
+
+  src = fetchurl {
+    url = "https://www.keepassx.org/releases/${version}/keepassx-${version}.tar.gz";
+    sha256 = "1ia7cqx9ias38mnffsl7da7g1f66bcbjsi23k49sln0c6spb9zr3";
+  };
+
+  buildInputs = [ cmake libgcrypt qt4 xorg.libXtst ];
+
+  meta = {
+    description = "Qt password manager compatible with its Win32 and Pocket PC versions";
+    homepage = https://www.keepassx.org/;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = with stdenv.lib.maintainers; [ qknight ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/keepassx/community.nix b/nixpkgs/pkgs/applications/misc/keepassx/community.nix
new file mode 100644
index 000000000000..b52cff784e5f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/keepassx/community.nix
@@ -0,0 +1,119 @@
+{ stdenv, fetchFromGitHub, cmake, makeWrapper, qttools
+
+, curl
+, glibcLocales
+, libXi
+, libXtst
+, libargon2
+, libgcrypt
+, libgpgerror
+, libmicrohttpd
+, libsodium
+, libyubikey
+, pkg-config
+, qrencode
+, qtbase
+, qtmacextras
+, qtsvg
+, qtx11extras
+, quazip
+, yubikey-personalization
+, zlib
+
+, withKeePassBrowser ? true
+, withKeePassKeeShare ? true
+, withKeePassKeeShareSecure ? true
+, withKeePassSSHAgent ? true
+, withKeePassNetworking ? false
+}:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "keepassxc-${version}";
+  version = "2.4.1";
+
+  src = fetchFromGitHub {
+    owner = "keepassxreboot";
+    repo = "keepassxc";
+    rev = "${version}";
+    sha256 = "1cbfsfdvb4qw6yb0zl6mymdbphnb7lxbfrc5a8cjmn9w8b09kv6m";
+  };
+
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang [
+    "-Wno-old-style-cast"
+    "-Wno-error"
+    "-D__BIG_ENDIAN__=${if stdenv.isBigEndian then "1" else "0"}"
+  ];
+
+  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+    substituteInPlace CMakeLists.txt \
+      --replace "/usr/local/bin" "../bin" \
+      --replace "/usr/local/share/man" "../share/man"
+  '';
+  NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-rpath ${libargon2}/lib";
+
+  patches = [
+    ./darwin.patch
+  ];
+
+  cmakeFlags = [
+    "-DKEEPASSXC_BUILD_TYPE=Release"
+    "-DWITH_GUI_TESTS=ON"
+    "-DWITH_XC_AUTOTYPE=ON"
+    "-DWITH_XC_UPDATECHECK=OFF"
+    "-DWITH_XC_YUBIKEY=ON"
+  ]
+  ++ (optional withKeePassBrowser "-DWITH_XC_BROWSER=ON")
+  ++ (optional withKeePassKeeShare "-DWITH_XC_KEESHARE=ON")
+  ++ (optional withKeePassKeeShareSecure "-DWITH_XC_KEESHARE_SECURE=ON")
+  ++ (optional withKeePassNetworking "-DWITH_XC_NETWORKING=ON")
+  ++ (optional withKeePassSSHAgent "-DWITH_XC_SSHAGENT=ON");
+
+  doCheck = true;
+  checkPhase = ''
+    export LC_ALL="en_US.UTF-8"
+    export QT_PLUGIN_PATH="${qtbase.bin}/${qtbase.qtPluginPrefix}"
+    export QT_QPA_PLATFORM=offscreen
+    make test ARGS+="-E testgui --output-on-failure"
+  '';
+
+  nativeBuildInputs = [ cmake makeWrapper qttools ];
+
+  buildInputs = [
+    curl
+    glibcLocales
+    libXi
+    libXtst
+    libargon2
+    libgcrypt
+    libgpgerror
+    libmicrohttpd
+    libsodium
+    libyubikey
+    pkg-config
+    qrencode
+    qtbase
+    qtsvg
+    qtx11extras
+    yubikey-personalization
+    zlib
+  ]
+  ++ stdenv.lib.optional withKeePassKeeShareSecure quazip
+  ++ stdenv.lib.optional stdenv.isDarwin qtmacextras;
+
+  postInstall = optionalString stdenv.isDarwin ''
+    # Make it work without Qt in PATH.
+    wrapProgram $out/Applications/KeePassXC.app/Contents/MacOS/KeePassXC \
+      --set QT_PLUGIN_PATH ${qtbase.bin}/${qtbase.qtPluginPrefix}
+  '';
+
+  meta = {
+    description = "Password manager to store your passwords safely and auto-type them into your everyday websites and applications";
+    longDescription = "A community fork of KeePassX, which is itself a port of KeePass Password Safe. The goal is to extend and improve KeePassX with new features and bugfixes to provide a feature-rich, fully cross-platform and modern open-source password manager. Accessible via native cross-platform GUI, CLI, and browser integration with the KeePassXC Browser Extension (https://github.com/keepassxreboot/keepassxc-browser).";
+    homepage = https://keepassxc.org/;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ s1lvester jonafato ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/keepassx/darwin.patch b/nixpkgs/pkgs/applications/misc/keepassx/darwin.patch
new file mode 100644
index 000000000000..d7ffb7dbba1f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/keepassx/darwin.patch
@@ -0,0 +1,53 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 658548f7..f8f10bdb 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -288,6 +288,7 @@ if(MINGW)
+     set(PLUGIN_INSTALL_DIR ".")
+     set(DATA_INSTALL_DIR "share")
+ elseif(APPLE AND WITH_APP_BUNDLE)
++	set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/Applications")
+     set(CMAKE_INSTALL_MANDIR "${PROGNAME}.app/Contents/Resources/man")
+     set(CLI_INSTALL_DIR "${PROGNAME}.app/Contents/MacOS")
+     set(PROXY_INSTALL_DIR "${PROGNAME}.app/Contents/MacOS")
+@@ -350,12 +351,6 @@ set(CMAKE_AUTORCC ON)
+ 
+ if(APPLE)
+     set(CMAKE_MACOSX_RPATH TRUE)
+-    find_program(MACDEPLOYQT_EXE macdeployqt HINTS ${Qt5_PREFIX}/bin ENV PATH)
+-    if(NOT MACDEPLOYQT_EXE)
+-        message(FATAL_ERROR "macdeployqt is required to build in macOS")
+-    else()
+-        message(STATUS "Using macdeployqt: ${MACDEPLOYQT_EXE}")
+-    endif()
+ endif()
+ 
+ # Debian sets the the build type to None for package builds.
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 110dc606..f9b58818 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -343,11 +343,6 @@ if(APPLE AND WITH_APP_BUNDLE)
+     set(CPACK_PACKAGE_FILE_NAME "${PROGNAME}-${KEEPASSXC_VERSION}")
+     include(CPack)
+ 
+-    add_custom_command(TARGET ${PROGNAME}
+-            POST_BUILD
+-            COMMAND ${MACDEPLOYQT_EXE} ${PROGNAME}.app
+-            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src
+-            COMMENT "Deploying app bundle")
+ endif()
+ 
+ install(TARGETS ${PROGNAME}
+diff --git a/src/autotype/mac/CMakeLists.txt b/src/autotype/mac/CMakeLists.txt
+index f1c5387f..abf70b48 100644
+--- a/src/autotype/mac/CMakeLists.txt
++++ b/src/autotype/mac/CMakeLists.txt
+@@ -12,7 +12,6 @@ if(WITH_APP_BUNDLE)
+     add_custom_command(TARGET keepassx-autotype-cocoa
+             POST_BUILD
+             COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/libkeepassx-autotype-cocoa.so ${PLUGIN_INSTALL_DIR}
+-            COMMAND ${MACDEPLOYQT_EXE} ${PROGNAME}.app -executable=${PLUGIN_INSTALL_DIR}/libkeepassx-autotype-cocoa.so -no-plugins
+             WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src
+             COMMENT "Deploying autotype plugin")
+ else()
diff --git a/nixpkgs/pkgs/applications/misc/keepassx/default.nix b/nixpkgs/pkgs/applications/misc/keepassx/default.nix
new file mode 100644
index 000000000000..05ad9b05abb0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/keepassx/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, bzip2, qt4, qmake4Hook, libX11, xorgproto, libXtst }:
+
+stdenv.mkDerivation rec {
+  name = "keepassx-${version}";
+  version = "0.4.4";
+
+  src = fetchurl {
+    url = "https://www.keepassx.org/releases/${version}/${name}.tar.gz";
+    sha256 = "1i5dq10x28mg7m4c0yacm32xfj4j7imir4ph8x9p0s2ym260c9ry";
+  };
+
+  patches = [ ./random.patch ];
+
+  buildInputs = [ bzip2 qt4 libX11 xorgproto libXtst ];
+
+  nativeBuildInputs = [ qmake4Hook ];
+
+  meta = {
+    description = "Qt password manager compatible with its Win32 and Pocket PC versions";
+    homepage = https://www.keepassx.org/;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = with stdenv.lib.maintainers; [ qknight ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/keepassx/random.patch b/nixpkgs/pkgs/applications/misc/keepassx/random.patch
new file mode 100644
index 000000000000..0a0b26f6e8c9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/keepassx/random.patch
@@ -0,0 +1,13 @@
+--- a/src/lib/random.cpp	2014-01-21 21:15:55.829312723 +0000
++++ b/src/lib/random.cpp	2014-01-21 21:16:36.752535839 +0000
+@@ -28,6 +28,10 @@
+ 	#include <wincrypt.h>
+ 	#include <QSysInfo>
+ #endif
++#ifndef Q_WS_WIN
++	#include <sys/types.h>
++	#include <unistd.h>
++#endif
+ 
+ #include <QCryptographicHash>
+ #include <QCursor>
diff --git a/nixpkgs/pkgs/applications/misc/khal/default.nix b/nixpkgs/pkgs/applications/misc/khal/default.nix
new file mode 100644
index 000000000000..2e32bbd611a1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/khal/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, pkgs, python3 }:
+
+with python3.pkgs; buildPythonApplication rec {
+  pname = "khal";
+  version = "0.10.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1r8bkgjwkh7i8ygvsv51h1cnax50sb183vafg66x5snxf3dgjl6l";
+  };
+
+  propagatedBuildInputs = [
+    atomicwrites
+    click
+    click-log
+    configobj
+    dateutil
+    icalendar
+    lxml
+    pkgs.vdirsyncer
+    pytz
+    pyxdg
+    requests_toolbelt
+    tzlocal
+    urwid
+    pkginfo
+    freezegun
+  ];
+  nativeBuildInputs = [ setuptools_scm ];
+  checkInputs = [ pytest ];
+
+  postInstall = ''
+    install -D misc/__khal $out/share/zsh/site-functions/__khal
+  '';
+
+  doCheck = !stdenv.isAarch64;
+
+  checkPhase = ''
+    py.test
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://lostpackets.de/khal/;
+    description = "CLI calendar application";
+    license = licenses.mit;
+    maintainers = with maintainers; [ gebner ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/khard/default.nix b/nixpkgs/pkgs/applications/misc/khard/default.nix
new file mode 100644
index 000000000000..61eb959a1dda
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/khard/default.nix
@@ -0,0 +1,55 @@
+{ stdenv, fetchurl, glibcLocales, python3 }:
+
+let
+  python = python3.override {
+    packageOverrides = self: super: {
+
+      # https://github.com/pimutils/khal/issues/780
+      python-dateutil = super.python-dateutil.overridePythonAttrs (oldAttrs: rec {
+        version = "2.6.1";
+        src = oldAttrs.src.override {
+          inherit version;
+          sha256 = "891c38b2a02f5bb1be3e4793866c8df49c7d19baabf9c1bad62547e0b4866aca";
+        };
+      });
+
+    };
+  };
+
+in with python.pkgs; buildPythonApplication rec {
+  version = "0.13.0";
+  name = "khard-${version}";
+  namePrefix = "";
+
+  src = fetchurl {
+    url = "https://github.com/scheibler/khard/archive/v${version}.tar.gz";
+    sha256 = "06b9xcdg1na6mxa2pnlh0wfsk02k2h6hlki089aaikbg8k8ykj8f";
+  };
+
+  # setup.py reads the UTF-8 encoded readme.
+  LC_ALL = "en_US.UTF-8";
+  buildInputs = [ glibcLocales ];
+
+  propagatedBuildInputs = [
+    atomicwrites
+    configobj
+    vobject
+    ruamel_yaml
+    ruamel_base
+    unidecode
+  ];
+
+  postInstall = ''
+    install -D misc/zsh/_khard $out/share/zsh/site-functions/_khard
+  '';
+
+  # Fails; but there are no tests anyway.
+  doCheck = false;
+
+  meta = {
+    homepage = https://github.com/scheibler/khard;
+    description = "Console carddav client";
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = with stdenv.lib.maintainers; [ matthiasbeyer ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/kitty/default.nix b/nixpkgs/pkgs/applications/misc/kitty/default.nix
new file mode 100644
index 000000000000..9b77bdcd2a54
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/kitty/default.nix
@@ -0,0 +1,122 @@
+{ stdenv, substituteAll, fetchFromGitHub, python3Packages, glfw, libunistring,
+  harfbuzz, fontconfig, pkgconfig, ncurses, imagemagick, xsel,
+  libstartup_notification, libX11, libXrandr, libXinerama, libXcursor,
+  libxkbcommon, libXi, libXext, wayland-protocols, wayland,
+  which, dbus,
+  Cocoa,
+  CoreGraphics,
+  Foundation,
+  IOKit,
+  Kernel,
+  OpenGL,
+  cf-private,
+  libicns,
+  libpng,
+  librsvg,
+  optipng,
+  python3,
+  zlib,
+}:
+
+with python3Packages;
+buildPythonApplication rec {
+  pname = "kitty";
+  version = "0.14.2";
+  format = "other";
+
+  src = fetchFromGitHub {
+    owner = "kovidgoyal";
+    repo = "kitty";
+    rev = "v${version}";
+    sha256 = "15iv3k7iryf10n8n67d37x24pzcarq97a3dr42lbld00k1lx19az";
+  };
+
+  buildInputs = [
+    ncurses harfbuzz
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+    Cocoa
+    CoreGraphics
+    Foundation
+    IOKit
+    Kernel
+    OpenGL
+    cf-private
+    libpng
+    python3
+    zlib
+  ] ++ stdenv.lib.optionals stdenv.isLinux [
+    fontconfig glfw libunistring libX11
+    libXrandr libXinerama libXcursor libxkbcommon libXi libXext
+    wayland-protocols wayland dbus
+  ];
+
+  nativeBuildInputs = [
+    pkgconfig which sphinx ncurses
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+    imagemagick
+    libicns  # For the png2icns tool.
+    librsvg
+    optipng
+  ];
+
+  outputs = [ "out" "terminfo" ];
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      libstartup_notification = "${libstartup_notification}/lib/libstartup-notification-1.so";
+    })
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+    ./no-lto.patch
+    ./no-werror.patch
+    ./png2icns.patch
+  ];
+
+  buildPhase = if stdenv.isDarwin then ''
+    make app
+  '' else ''
+    ${python.interpreter} setup.py linux-package
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out
+    ${if stdenv.isDarwin then ''
+    mkdir "$out/bin"
+    ln -s ../Applications/kitty.app/Contents/MacOS/kitty-deref-symlink "$out/bin/kitty"
+    mkdir "$out/Applications"
+    cp -r kitty.app "$out/Applications/kitty.app"
+    '' else ''
+    cp -r linux-package/{bin,share,lib} $out
+    ''}
+    wrapProgram "$out/bin/kitty" --prefix PATH : "$out/bin:${stdenv.lib.makeBinPath [ imagemagick xsel ]}"
+    runHook postInstall
+
+    # ZSH completions need to be invoked with `source`:
+    # https://github.com/kovidgoyal/kitty/blob/8ceb941051b89b7c50850778634f0b6137aa5e6e/docs/index.rst#zsh
+    mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
+    "$out/bin/kitty" + complete setup fish > "$out/share/fish/vendor_completions.d/kitty.fish"
+    "$out/bin/kitty" + complete setup bash > "$out/share/bash-completion/completions/kitty.bash"
+  '';
+
+  postInstall = ''
+    terminfo_src=${if stdenv.isDarwin then
+      ''"$out/Applications/kitty.app/Contents/Resources/terminfo"''
+      else
+      "$out/share/terminfo"}
+
+    mkdir -p $terminfo/share
+    mv "$terminfo_src" $terminfo/share/terminfo
+
+    mkdir -p $out/nix-support
+    echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/kovidgoyal/kitty;
+    description = "A modern, hackable, featureful, OpenGL based terminal emulator";
+    license = licenses.gpl3;
+    platforms = platforms.darwin ++ platforms.linux;
+    maintainers = with maintainers; [ tex rvolosatovs ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/kitty/fix-paths.patch b/nixpkgs/pkgs/applications/misc/kitty/fix-paths.patch
new file mode 100644
index 000000000000..704605813071
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/kitty/fix-paths.patch
@@ -0,0 +1,27 @@
+--- a/kitty/desktop.c
++++ b/kitty/desktop.c
+@@ -30,7 +30,7 @@
+ static PyObject*
+ init_x11_startup_notification(PyObject UNUSED *self, PyObject *args) {
+     static bool done = false;
+-    static const char* libname = "libstartup-notification-1.so";
++    static const char* libname = "@libstartup_notification@";
+     // some installs are missing the .so symlink, so try the full name
+     static const char* libname2 = "libstartup-notification-1.so.0";
+
+--- a/docs/Makefile
++++ b/docs/Makefile
+@@ -3,7 +3,7 @@
+# Patching is needed here for the following reason:
+# * importing the `constants` package from Kitty has a side effect that it
+#   creates the user configuration directory. This package gets imported
+#   while sphinx scans the code for documentation strings.
+#
+ 
+ # You can set these variables from the command line.
+ SPHINXOPTS    = -j auto -T $(FAIL_WARN)
+-SPHINXBUILD   = sphinx-build
++SPHINXBUILD   = PYTHONPATH=${PYTHONPATH}:.. HOME=${TMPDIR}/kitty-build-home sphinx-build
+ SPHINXPROJ    = kitty
+ SOURCEDIR     = .
+ BUILDDIR      = _build
diff --git a/nixpkgs/pkgs/applications/misc/kitty/no-lto.patch b/nixpkgs/pkgs/applications/misc/kitty/no-lto.patch
new file mode 100644
index 000000000000..44d231cb07f9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/kitty/no-lto.patch
@@ -0,0 +1,12 @@
+--- a/setup.py
++++ b/setup.py
+@@ -233,9 +233,6 @@ def init_env(
+     cppflags += shlex.split(os.environ.get('CPPFLAGS', ''))
+     cflags += shlex.split(os.environ.get('CFLAGS', ''))
+     ldflags += shlex.split(os.environ.get('LDFLAGS', ''))
+-    if not debug and not sanitize:
+-        # See https://github.com/google/sanitizers/issues/647
+-        cflags.append('-flto'), ldflags.append('-flto')
+
+     if profile:
+         cppflags.append('-DWITH_PROFILER')
diff --git a/nixpkgs/pkgs/applications/misc/kitty/no-werror.patch b/nixpkgs/pkgs/applications/misc/kitty/no-werror.patch
new file mode 100644
index 000000000000..8217b5ef51a6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/kitty/no-werror.patch
@@ -0,0 +1,11 @@
+--- a/setup.py
++++ b/setup.py
+@@ -212,7 +212,7 @@
+     cflags = os.environ.get(
+         'OVERRIDE_CFLAGS', (
+             '-Wextra -Wno-missing-field-initializers -Wall -Wstrict-prototypes -std=c11'
+-            ' -pedantic-errors -Werror {} {} -fwrapv {} {} -pipe {} -fvisibility=hidden'
++            ' {} {} -fwrapv {} {} -pipe {} -fvisibility=hidden'
+         ).format(
+             optimize,
+             ' '.join(sanitize_args),
diff --git a/nixpkgs/pkgs/applications/misc/kitty/png2icns.patch b/nixpkgs/pkgs/applications/misc/kitty/png2icns.patch
new file mode 100644
index 000000000000..d2d0806c862f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/kitty/png2icns.patch
@@ -0,0 +1,19 @@
+--- a/setup.py
++++ b/setup.py
+@@ -744,9 +744,15 @@ Categories=System;TerminalEmulator;
+         if not os.path.exists(logo_dir):
+             raise SystemExit('The kitty logo has not been generated, you need to run logo/make.py')
+         subprocess.check_call([
+-            'iconutil', '-c', 'icns', logo_dir, '-o',
++            'png2icns',
+             os.path.join('Resources', os.path.basename(logo_dir).partition('.')[0] + '.icns')
+-        ])
++        ] + [os.path.join(logo_dir, logo) for logo in (
++            'icon_128x128.png',
++            'icon_16x16.png',
++            'icon_256x256.png',
++            'icon_32x32.png',
++            'icon_512x512.png',
++        )])
+     # }}}
+ # }}}
diff --git a/nixpkgs/pkgs/applications/misc/kiwix/default.nix b/nixpkgs/pkgs/applications/misc/kiwix/default.nix
new file mode 100644
index 000000000000..bc49e810d4e5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/kiwix/default.nix
@@ -0,0 +1,110 @@
+{ stdenv, fetchurl, makeWrapper, pkgconfig
+, zip, python, zlib, which, icu, libmicrohttpd, lzma, aria2, wget, bc
+, libuuid, libX11, libXext, libXt, libXrender, glib, dbus, dbus-glib
+, gtk2, gdk_pixbuf, pango, cairo, freetype, fontconfig, alsaLib, atk, cmake
+, xapian, ctpp2, zimlib
+}:
+
+with stdenv.lib;
+
+let
+  xulrunner64_tar = fetchurl {
+    url = http://download.kiwix.org/dev/xulrunner-29.0.en-US.linux-x86_64.tar.bz2;
+    sha256 = "0i3m30gm5z7qmas14id6ypvbmnb2k7jhz8aby2wz5vvv49zqmx3s";
+  };
+  xulrunnersdk64_tar = fetchurl {
+    url = http://download.kiwix.org/dev/xulrunner-29.0.en-US.linux-x86_64.sdk.tar.bz2;
+    sha256 = "0z90v7c4mq15g5klmsj8vs2r10fbygj3qzynx4952hkv8ihw8n3a";
+  };
+  xulrunner32_tar = fetchurl {
+    url = http://download.kiwix.org/dev/xulrunner-29.0.en-US.linux-i686.tar.bz2;
+    sha256 = "0yln6pxz8f6b9wm9124sx049z8mgi17lgd63rcv2hnix825y8gjb";
+  };
+  xulrunnersdk32_tar = fetchurl {
+    url = http://download.kiwix.org/dev/xulrunner-29.0.en-US.linux-i686.sdk.tar.bz2;
+    sha256 = "1h9vcbvf8wgds6i2z20y7krpys0mqsqhv1ijyfljanp6vyll9fvi";
+  };
+
+  xulrunner = if stdenv.hostPlatform.system == "x86_64-linux"
+              then { tar = xulrunner64_tar; sdk = xulrunnersdk64_tar; }
+              else { tar = xulrunner32_tar; sdk = xulrunnersdk32_tar; };
+
+  pugixml = stdenv.mkDerivation rec {
+    version = "1.2";
+    name = "pugixml-${version}";
+
+    src = fetchurl {
+      url = "http://download.kiwix.org/dev/${name}.tar.gz";
+      sha256 = "0sqk0vdwjq44jxbbkj1cy8qykrmafs1sickzldb2w2nshsnjshhg";
+    };
+
+    buildInputs = [ cmake ];
+
+    unpackPhase = ''
+      # not a nice src archive: all the files are in the root :(
+      mkdir ${name}
+      cd ${name}
+      tar -xf ${src}
+
+      # and the build scripts are in there :'(
+      cd scripts
+    '';
+  };
+
+in
+
+stdenv.mkDerivation rec {
+  name = "kiwix-${version}";
+  version = "0.9";
+
+  src = fetchurl {
+    url = "http://download.kiwix.org/src/kiwix-${version}-src.tar.xz";
+    sha256 = "0577phhy2na59cpcqjgldvksp0jwczyg0l6c9ghnr19i375l7yqc";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    zip python zlib xapian which icu libmicrohttpd
+    lzma zimlib ctpp2 aria2 wget bc libuuid makeWrapper pugixml
+  ];
+
+  postUnpack = ''
+    cd kiwix*
+    mkdir static
+    cp Makefile.in static/
+
+    cd src/dependencies
+
+    tar -xf ${xulrunner.tar}
+    tar -xf ${xulrunner.sdk}
+
+    cd ../../..
+  '';
+
+  configureFlags = [
+    "--disable-static"
+    "--disable-staticbins"
+  ];
+
+  postInstall = ''
+    cp -r src/dependencies/xulrunner $out/lib/kiwix
+
+    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/lib/kiwix/xulrunner/xulrunner
+
+    rm $out/bin/kiwix
+    makeWrapper $out/lib/kiwix/kiwix-launcher $out/bin/kiwix \
+      --suffix LD_LIBRARY_PATH : ${makeLibraryPath [stdenv.cc.cc libX11 libXext libXt libXrender glib dbus dbus-glib gtk2 gdk_pixbuf pango cairo freetype fontconfig alsaLib atk]} \
+      --suffix PATH : ${aria2}/bin
+  '';
+
+  meta = {
+    description = "An offline reader for Web content";
+    homepage = https://kiwix.org;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ robbinch ];
+    knownVulnerabilities = [
+      "CVE-2015-1032"
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/krename/default.nix b/nixpkgs/pkgs/applications/misc/krename/default.nix
new file mode 100644
index 000000000000..8b6b7741c7df
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/krename/default.nix
@@ -0,0 +1,33 @@
+{
+  mkDerivation, fetchurl, lib,
+  extra-cmake-modules, kdoctools, wrapGAppsHook,
+  kconfig, kinit, kjsembed, taglib, exiv2, podofo,
+  kcrash
+}:
+
+let
+  pname = "krename";
+  version = "5.0.0";
+
+in mkDerivation rec {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/${pname}/${version}/src/${name}.tar.xz";
+    sha256 = "136j1dkqrhv458rjh5v3vzjhvq6dhz7k79zk6mmx8zvqacc7cq8a";
+  };
+
+  buildInputs = [ taglib exiv2 podofo ];
+
+  nativeBuildInputs = [ extra-cmake-modules kdoctools wrapGAppsHook ];
+
+  propagatedBuildInputs = [ kconfig kcrash kinit kjsembed ];
+
+  meta = with lib; {
+    description = "A powerful batch renamer for KDE";
+    homepage = https://kde.org/applications/utilities/krename/;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ peterhoeg ];
+    inherit (kconfig.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/krusader/default.nix b/nixpkgs/pkgs/applications/misc/krusader/default.nix
new file mode 100644
index 000000000000..70915ca87073
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/krusader/default.nix
@@ -0,0 +1,27 @@
+{
+  mkDerivation, fetchurl, lib,
+  extra-cmake-modules, kdoctools, wrapGAppsHook,
+  karchive, kconfig, kcrash, kguiaddons, kinit, kparts, kwindowsystem
+}:
+
+let
+  pname = "krusader";
+  version = "2.7.1";
+in mkDerivation rec {
+  name = "krusader-${version}";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/${pname}/${version}/${name}.tar.xz";
+    sha256 = "1svxj1qygyr3a4dkx0nh2d6r4q7pfj00brzghl94mf4q0rz4vhfm";
+  };
+
+  meta = with lib; {
+    description = "Norton/Total Commander clone for KDE";
+    license = licenses.gpl2;
+    homepage = http://www.krusader.org;
+    maintainers = with maintainers; [ sander ];
+  };
+
+  nativeBuildInputs = [ extra-cmake-modules kdoctools wrapGAppsHook ];
+  propagatedBuildInputs = [ karchive kconfig kcrash kguiaddons kinit kparts kwindowsystem ];
+}
diff --git a/nixpkgs/pkgs/applications/misc/kupfer/default.nix b/nixpkgs/pkgs/applications/misc/kupfer/default.nix
new file mode 100644
index 000000000000..81cba3f56378
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/kupfer/default.nix
@@ -0,0 +1,57 @@
+{ stdenv
+, fetchurl
+, intltool
+, python3Packages
+, gobject-introspection
+, gtk3
+, libwnck3
+, keybinder3
+, hicolor-icon-theme
+, wrapGAppsHook
+, wafHook
+}:
+
+with python3Packages;
+
+buildPythonApplication rec {
+  pname = "kupfer";
+  version = "319";
+
+  src = fetchurl {
+    url = "https://github.com/kupferlauncher/kupfer/releases/download/v${version}/kupfer-v${version}.tar.xz";
+    sha256 = "0c9xjx13r8ckfr4az116bhxsd3pk78v04c3lz6lqhraak0rp4d92";
+  };
+
+  nativeBuildInputs = [
+    wrapGAppsHook intltool
+    # For setup hook
+    gobject-introspection wafHook
+  ];
+  buildInputs = [ hicolor-icon-theme docutils libwnck3 keybinder3 ];
+  propagatedBuildInputs = [ pygobject3 gtk3 pyxdg dbus-python pycairo ];
+
+  # without strictDeps kupfer fails to build: Could not find the python module 'gi.repository.Gtk'
+  # see https://github.com/NixOS/nixpkgs/issues/56943 for details
+  strictDeps = false;
+
+  postInstall = let
+    pythonPath = (stdenv.lib.concatMapStringsSep ":"
+      (m: "${m}/lib/${python.libPrefix}/site-packages")
+      propagatedBuildInputs);
+  in ''
+    gappsWrapperArgs+=(
+      "--prefix" "PYTHONPATH" : "${pythonPath}"
+      "--set" "PYTHONNOUSERSITE" "1"
+    )
+  '';
+
+  doCheck = false; # no tests
+
+  meta = with stdenv.lib; {
+    description = "A smart, quick launcher";
+    homepage    = "https://kupferlauncher.github.io/";
+    license     = licenses.gpl3;
+    maintainers = with maintainers; [ cobbal ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/latte-dock/default.nix b/nixpkgs/pkgs/applications/misc/latte-dock/default.nix
new file mode 100644
index 000000000000..bdbdef45fe7b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/latte-dock/default.nix
@@ -0,0 +1,31 @@
+{ mkDerivation, lib, cmake, xorg, plasma-framework, fetchurl
+, extra-cmake-modules, karchive, kwindowsystem, qtx11extras, kcrash, knewstuff }:
+
+mkDerivation rec {
+  pname = "latte-dock";
+  version = "0.8.9";
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "https://download.kde.org/stable/${pname}/${name}.tar.xz";
+    sha256 = "1kkpxa39crjpqgamrcpgp1mrcdg0aq9850yb6cf7lw7d3x2fdrxj";
+    name = "${name}.tar.xz";
+  };
+
+  buildInputs = [ plasma-framework xorg.libpthreadstubs xorg.libXdmcp xorg.libSM ];
+
+  nativeBuildInputs = [ extra-cmake-modules cmake karchive kwindowsystem
+    qtx11extras kcrash knewstuff ];
+
+
+
+  meta = with lib; {
+    description = "Dock-style app launcher based on Plasma frameworks";
+    homepage = https://github.com/psifidotos/Latte-Dock;
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.benley maintainers.ysndr ];
+  };
+
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/lenmus/default.nix b/nixpkgs/pkgs/applications/misc/lenmus/default.nix
new file mode 100644
index 000000000000..9018a5926424
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/lenmus/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, pkgconfig, fetchFromGitHub, fetchpatch
+, cmake, boost
+, portmidi, sqlite
+, freetype, libpng, pngpp, zlib
+, wxGTK30, wxsqlite3
+}:
+
+stdenv.mkDerivation rec {
+  name = "lenmus-${version}";
+  version = "5.4.2";
+
+  src = fetchFromGitHub {
+    owner = "lenmus";
+    repo = "lenmus";
+    rev = "Release_${version}";
+    sha256 = "1n639xr1qxx6rhqs0c6sjxp3bv8cwkmw1vfk1cji7514gj2a9v3p";
+  };
+
+  enableParallelBuilding = true;
+
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/lenmus/lenmus/commit/421760d84694a0e6e72d0e9b1d4fd30a7e129c6f.patch";
+      sha256 = "1z1wwh0pcr8w1zlr8swx99si9y2kxx5bmavgwvy6bvdhxgm58yqs";
+    })
+    (fetchpatch {
+      url = "https://github.com/lenmus/lenmus/commit/6613d20d4051effc782203c9c6d92962a3f66b5f.patch";
+      sha256 = "01vvzzpamv90jpqbbq1f2m2b4gb9xab9z70am8i41d90nqvg6agn";
+    })
+  ];
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    cmake boost
+    portmidi sqlite
+    freetype libpng pngpp zlib
+    wxGTK30 wxsqlite3
+  ];
+
+  meta = with stdenv.lib; {
+    description = "LenMus Phonascus is a program for learning music";
+    longDescription = ''
+      LenMus Phonascus is a free open source program (GPL v3) for learning music.
+      It allows you to focus on specific skills and exercises, on both theory and aural training.
+      The different activities can be customized to meet your needs
+    '';
+    homepage = http://www.lenmus.org/;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers;  [ ramkromberg ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/libosmocore/default.nix b/nixpkgs/pkgs/applications/misc/libosmocore/default.nix
new file mode 100644
index 000000000000..c9583961de41
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/libosmocore/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
+, pcsclite, talloc, python2, gnutls
+}:
+
+stdenv.mkDerivation rec {
+  name = "libosmocore-${version}";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "osmocom";
+    repo = "libosmocore";
+    rev = version;
+    sha256 = "1ayxpq03mv547sirdy3j9vnsjd1q07adhwwnl3wffz3c39wlax68";
+  };
+
+  propagatedBuildInputs = [
+    talloc
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook pkgconfig
+  ];
+
+  buildInputs = [
+    pcsclite python2 gnutls
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "libosmocore";
+    homepage = https://github.com/osmocom/libosmocore;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ mog ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/librecad/default.nix b/nixpkgs/pkgs/applications/misc/librecad/default.nix
new file mode 100644
index 000000000000..c049ed2374fd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/librecad/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, qt4, qmake4Hook, muparser, which, boost, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  version = "2.1.3";
+  name = "librecad-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/LibreCAD/LibreCAD/tarball/${version}";
+    name = name + ".tar.gz";
+    sha256 = "1czp8bja61hfav2m7184cq1np1n76w3w6vn0hlkp81hhz9zc62sx";
+  };
+
+  patchPhase = ''
+    sed -i -e s,/bin/bash,`type -P bash`, scripts/postprocess-unix.sh
+    sed -i -e s,/usr/share,$out/share, librecad/src/lib/engine/rs_system.cpp
+  '';
+
+  qmakeFlags = [ "MUPARSER_DIR=${muparser}" "BOOST_DIR=${boost.dev}" ];
+
+  installPhase = ''
+    install -m 555 -D unix/librecad $out/bin/librecad
+    install -m 444 -D desktop/librecad.desktop $out/share/applications/librecad.desktop
+    install -m 444 -D desktop/librecad.sharedmimeinfo $out/share/mime/packages/librecad.xml
+    install -m 444 -D desktop/graphics_icons_and_splash/Icon\ LibreCAD/Icon_Librecad.svg \
+      $out/share/icons/hicolor/scalable/apps/librecad.svg
+    cp -R unix/resources $out/share/librecad
+  '';
+
+  buildInputs = [ qt4 muparser which boost ];
+  nativeBuildInputs = [ pkgconfig qmake4Hook ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "A 2D CAD package based upon Qt";
+    homepage = https://librecad.org;
+    repositories.git = git://github.com/LibreCAD/LibreCAD.git;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/lifelines/default.nix b/nixpkgs/pkgs/applications/misc/lifelines/default.nix
new file mode 100644
index 000000000000..7207dea9d522
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/lifelines/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchFromGitHub, gettext, libiconv, bison, ncurses, perl, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "lifelines";
+  version = "unstable-2019-05-07";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "43f29285ed46fba322b6a14322771626e6b02c59";
+    sha256 = "1agszzlmkxmznpc1xj0vzxkskrcfagfjvqsdyw1yp5yg6bsq272y";
+  };
+
+  buildInputs = [
+    gettext
+    libiconv
+    ncurses
+    perl
+  ];
+  nativeBuildInputs = [ autoreconfHook bison ];
+
+  meta = with stdenv.lib; {
+    description = "Genealogy tool with ncurses interface";
+    homepage = "https://lifelines.github.io/lifelines/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ disassembler ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/lighthouse/default.nix b/nixpkgs/pkgs/applications/misc/lighthouse/default.nix
new file mode 100644
index 000000000000..7b5b40d65a36
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/lighthouse/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, pkgconfig
+, libX11, libxcb, cairo, gtk2, pango, python27, python3
+}:
+
+stdenv.mkDerivation rec {
+  name = "lighthouse-${date}";
+  date = "2016-07-20";
+
+  src = fetchFromGitHub {
+    owner = "emgram769";
+    repo = "lighthouse";
+    rev = "d1813ef8e2aca9f6b3609b1e0c6d1d5ee683281a";
+    sha256 = "0v6ylm49f1b44zwq1y1gqxp2csyqblplr24ajllc2q3r0sc9m1ys";
+   };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    libX11 libxcb cairo gtk2 pango python27 python3
+  ];
+
+  makeFlags = [ "PREFIX=\${out}" ];
+
+  preFixup = "chmod +x $out/share/lighthouse/.config/lighthouse/google.py";
+
+  postFixup = "chmod -x $out/share/lighthouse/.config/lighthouse/google.py";
+
+  meta = with stdenv.lib; {
+    description = "A simple flexible popup dialog to run on X";
+    homepage = https://github.com/emgram769/lighthouse;
+    license = licenses.mit;
+    maintainers = with maintainers; [ ramkromberg ];
+    platforms = platforms.linux;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/lilyterm/default.nix b/nixpkgs/pkgs/applications/misc/lilyterm/default.nix
new file mode 100644
index 000000000000..948ae7b14a11
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/lilyterm/default.nix
@@ -0,0 +1,57 @@
+{ stdenv, lib, fetchurl, fetchFromGitHub
+, pkgconfig
+, autoconf, automake, intltool, gettext
+, gtk, vte
+
+, flavour ? "stable"
+}:
+
+assert lib.assertOneOf "flavour" flavour [ "stable"  "git" ];
+
+let
+  stuff =
+    if flavour == "stable"
+    then rec {
+        version = "0.9.9.4";
+        src = fetchurl {
+          url = "https://lilyterm.luna.com.tw/file/lilyterm-${version}.tar.gz";
+          sha256 = "0x2x59qsxq6d6xg5sd5lxbsbwsdvkwqlk17iw3h4amjg3m1jc9mp";
+        };
+      }
+    else {
+        version = "2017-01-06";
+        src = fetchFromGitHub {
+          owner = "Tetralet";
+          repo = "lilyterm";
+          rev = "20cce75d34fd24901c9828469d4881968183c389";
+          sha256 = "0am0y65674rfqy69q4qz8izb8cq0isylr4w5ychi40jxyp68rkv2";
+        };
+      };
+
+in
+stdenv.mkDerivation rec {
+  name = "lilyterm-${version}";
+
+  inherit (stuff) src version;
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ autoconf automake intltool gettext gtk vte ];
+
+  preConfigure = "sh autogen.sh";
+
+  configureFlags = [
+    "--enable-nls"
+    "--enable-safe-mode"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "A fast, lightweight terminal emulator";
+    longDescription = ''
+      LilyTerm is a terminal emulator based off of libvte that aims to be fast and lightweight.
+    '';
+    homepage = https://lilyterm.luna.com.tw/;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ AndersonTorres Profpatsch ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/llpp/default.nix b/nixpkgs/pkgs/applications/misc/llpp/default.nix
new file mode 100644
index 000000000000..5ae652d750d1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/llpp/default.nix
@@ -0,0 +1,57 @@
+{ stdenv, lib, substituteAll, makeWrapper, fetchgit, ocaml, mupdf, libX11,
+libGLU_combined, freetype, xclip, inotify-tools, procps }:
+
+assert lib.versionAtLeast (lib.getVersion ocaml) "4.07";
+
+stdenv.mkDerivation rec {
+  name = "llpp-${version}";
+  version = "30";
+
+  src = fetchgit {
+    url = "git://repo.or.cz/llpp.git";
+    rev = "v${version}";
+    sha256 = "0iilpzf12hs0zky58j55l4y5dvzv7fc53nsrg324n9vka92mppvd";
+    fetchSubmodules = false;
+  };
+
+  patches = (substituteAll {
+    inherit version;
+    src = ./fix-build-bash.patch;
+  });
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ ocaml mupdf libX11 libGLU_combined freetype ];
+
+  dontStrip = true;
+
+  configurePhase = ''
+    mkdir -p build/mupdf/thirdparty
+    ln -s ${freetype.dev} build/mupdf/thirdparty/freetype
+  '';
+
+  buildPhase = ''
+    bash ./build.bash build
+  '';
+
+  installPhase = ''
+    install -d $out/bin
+    install build/llpp $out/bin
+    install misc/llpp.inotify $out/bin/llpp.inotify
+
+    wrapProgram $out/bin/llpp \
+        --prefix PATH ":" "${xclip}/bin"
+
+    wrapProgram $out/bin/llpp.inotify \
+        --prefix PATH ":" "$out/bin" \
+        --prefix PATH ":" "${inotify-tools}/bin" \
+        --prefix PATH ":" "${procps}/bin"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://repo.or.cz/w/llpp.git;
+    description = "A MuPDF based PDF pager written in OCaml";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ pSub enzime ];
+    license = licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/llpp/fix-build-bash.patch b/nixpkgs/pkgs/applications/misc/llpp/fix-build-bash.patch
new file mode 100644
index 000000000000..25d503290ce8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/llpp/fix-build-bash.patch
@@ -0,0 +1,88 @@
+From cccadedfbcb6764a38382154838113a6b2fd4dee Mon Sep 17 00:00:00 2001
+From: Michael Hoang <enzime@users.noreply.github.com>
+Date: Mon, 10 Dec 2018 15:08:01 +1100
+Subject: [PATCH] Patch build.bash for nixpkgs
+
+---
+ build.bash | 37 ++-----------------------------------
+ 1 file changed, 2 insertions(+), 35 deletions(-)
+
+diff --git a/build.bash b/build.bash
+index 1588011..72117d9 100755
+--- a/build.bash
++++ b/build.bash
+@@ -29,7 +29,6 @@ srcd="$(dirname $0)"
+ mudir=$outd/mupdf
+ muinc="-I $mudir/include -I $mudir/thirdparty/freetype/include"
+ 
+-test -d "$mudir" || die muPDF not found, consult $(dirname $0)/BUILDING
+ 
+ mkdir -p $outd/{$wsid,lablGL}
+ :>$outd/ordered
+@@ -39,12 +38,6 @@ isfresh() { test -r "$1.past" && . "$1.past" && test "$k" = "$2"; }
+ mbt=native
+ mulibs="$mudir/build/$mbt/libmupdf.a" # $mudir/build/$mbt/libmupdf-third.a
+ 
+-keycmd="(cd $mudir && git describe --tags --dirty); digest $mulibs"
+-isfresh "$mulibs" "$(eval $keycmd)" || (
+-    make -C "$mudir" build=$mbt -j $mjobs libs
+-    echo "k='$(eval $keycmd)'" >$mudir/build/$mbt/libmupdf.a.past
+-) && vecho "fresh mupdf"
+-
+ oincs() {
+     local i=
+     local incs1=
+@@ -90,32 +83,6 @@ mflags() {
+ }
+ 
+ overs="$(ocamlc -vnum 2>/dev/null)" || overs=""
+-test "$overs" = "4.07.0" || {
+-    url=https://caml.inria.fr/pub/distrib/ocaml-4.07/ocaml-4.07.0.tar.xz
+-    txz=$outd/$(basename $url)
+-    isfresh $txz $url || {
+-        executable_p() { command -v "$1" >/dev/null 2>&1; }
+-        if executable_p wget; then dl() { wget -q "$1" -O "$2"; }
+-        elif executable_p curl; then dl() { curl -L "$1" -o "$2"; }
+-        else die "no program to fetch remote urls found"
+-        fi
+-        dl $url $txz
+-        echo "k=$url" >$txz.past
+-    } && vecho "fresh $txz"
+-    absprefix=$(cd $outd &>/dev/null; pwd -P)
+-    export PATH=$absprefix/bin:$PATH
+-    isfresh $absprefix/bin/ocamlc "$url" || (
+-        tar xf $txz -C $outd
+-        bn=$(basename $url)
+-        cd $outd/${bn%.tar.xz}
+-        ./configure -prefix $absprefix                                      \
+-                    -no-graph -no-debugger -no-ocamldoc -no-native-compiler
+-        make -j $mjobs world
+-        make install
+-        echo "k='$url'" >$absprefix/bin/ocamlc.past
+-    ) && vecho "fresh ocamlc"
+-    overs=$(ocamlc -vnum 2>/dev/null)
+-}
+ 
+ bocaml1() {
+     grep -q "$3" $outd/ordered || {
+@@ -224,7 +191,7 @@ bobjc() {
+     } && vecho "fresh $o"
+ }
+ 
+-ver=$(cd $srcd && git describe --tags --dirty) || ver=unknown
++ver=@version@
+ 
+ cmd="(. $srcd/genconfstr.sh >$outd/confstruct.ml)"
+ keycmd="digest $srcd/genconfstr.sh $outd/confstruct.ml"
+@@ -278,7 +245,7 @@ for m in ml_gl ml_glarray ml_raw; do
+ done
+ 
+ libs="str.cma unix.cma"
+-clibs="-L$mudir/build/$mbt -lmupdf -lmupdf-third -lpthread"
++clibs="-lmupdf -lfreetype -lpthread"
+ if $darwin; then
+     mcomp=$(ocamlc -config | grep bytecomp_c_co | { read _ c; echo $c; })
+     clibs="$clibs -framework Cocoa -framework OpenGL"
+-- 
+2.19.2
+
diff --git a/nixpkgs/pkgs/applications/misc/loxodo/default.nix b/nixpkgs/pkgs/applications/misc/loxodo/default.nix
new file mode 100644
index 000000000000..291e225d6c4f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/loxodo/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, python27Packages, fetchgit }:
+let
+  py = python27Packages;
+  python = py.python;
+in
+py.buildPythonApplication rec {
+  name = "loxodo-0.20150124";
+
+  src = fetchgit {
+    url = "https://github.com/sommer/loxodo.git";
+    rev = "6c56efb4511fd6f645ad0f8eb3deafc8071c5795";
+    sha256 = "1cg0dfcv57ps54f1a0ksib7hgkrbdi9q699w302xyyfyvjcb5dd2";
+  };
+
+  propagatedBuildInputs = with py; [ wxPython ];
+
+  postInstall = ''
+    mv $out/bin/loxodo.py $out/bin/loxodo
+    mkdir -p $out/share/applications
+    cat > $out/share/applications/loxodo.desktop <<EOF
+    [Desktop Entry]
+    Type=Application
+    Exec=$out/bin/loxodo
+    Icon=$out/lib/${python.libPrefix}/site-packages/resources/loxodo-icon.png
+    Name=Loxodo
+    GenericName=Password Vault
+    Categories=Application;Other;
+    EOF
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A Password Safe V3 compatible password vault";
+    homepage = http://www.christoph-sommer.de/loxodo/;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/ltwheelconf/default.nix b/nixpkgs/pkgs/applications/misc/ltwheelconf/default.nix
new file mode 100644
index 000000000000..4972aa28e589
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ltwheelconf/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, libusb1, pkgconfig, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "ltwheelconf";
+  version = "0.2.7";
+  name = "${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "thk";
+    repo = "ltwheelconf";
+    rev = "df55451f059d593b0259431662612ab5c2bef859";
+    sha256 = "1fsz7k73yln987gcx1jvb5irxfbp1x2c457a60a8yap27nkp5y2w";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ libusb1 ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp ltwheelconf $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/thk/LTWheelConf;
+    description = "Logitech wheels configuration tool";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.ebzzry ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/lutris/default.nix b/nixpkgs/pkgs/applications/misc/lutris/default.nix
new file mode 100644
index 000000000000..5a74bd931c0b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/lutris/default.nix
@@ -0,0 +1,178 @@
+{ stdenv, pkgs, buildFHSUserEnv, makeDesktopItem, fetchFromGitHub
+, wrapGAppsHook, python3Packages }:
+
+let
+  qt5Deps = with pkgs; with qt5; [ qtbase qtmultimedia ];
+  gnome3Deps = with pkgs; with gnome3; [ zenity gtksourceview gnome-desktop libgnome-keyring webkitgtk ];
+
+  python3Deps = with pkgs; with python3Packages; [
+    evdev pyyaml pyxdg pygobject3 pyqt5 dbus-python requests pillow
+  ];
+
+  xorgDeps = with pkgs; with xorg; [
+    libX11 libXrender libXrandr libxcb libXmu libpthreadstubs libXext libXdmcp
+    libXxf86vm libXinerama libSM libXv libXaw libXi libXcursor libXcomposite
+    xrandr xdg_utils
+  ];
+
+  gstDeps = with pkgs; with gst_all_1; [
+    gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly
+    gst-libav
+  ];
+
+  deps = with pkgs; [
+    # Common
+    stdenv.cc.cc libGL libGLU_combined libsndfile libtheora libogg libvorbis
+    libopus libGLU libpcap libpulseaudio libao libusb libevdev libudev libgcrypt
+    libxml2 libusb libpng libmpeg2 libv4l libjpeg libxkbcommon libass libcdio
+    libjack2 libsamplerate libzip libmad libaio libcap libtiff libva libgphoto2
+    libxslt libtxc_dxtn libsndfile giflib zlib glib alsaLib zziplib bash dbus
+    keyutils zip cabextract freetype unzip coreutils readline gcc SDL SDL2 curl
+    graphite2 gtk2 gtk3 udev ncurses wayland libglvnd vulkan-loader
+
+    # Lutris
+    gobject-introspection gdk_pixbuf hicolor-icon-theme pango openssl sqlite xterm libnotify procps
+
+    # Adventure Game Studio
+    allegro dumb
+
+    # Desmume
+    lua agg soundtouch openal desktop-file-utils pangox_compat atk
+
+    # DGen // TODO: libarchive is broken
+
+    # Dolphin
+    bluez ffmpeg gettext portaudio wxGTK30 miniupnpc mbedtls lzo sfml gsm
+    wavpack gnutls-kdh orc nettle gmp pcre vulkan-loader
+
+    # DOSBox
+    SDL_net SDL_sound
+
+    # GOG
+    glib-networking
+
+    # Higan // TODO: "higan is not available for the x86_64 architecture"
+
+    # Libretro
+    fluidsynth hidapi mesa libdrm
+
+    # MAME
+    qt48 fontconfig SDL2_ttf
+
+    # Mednafen
+    freeglut mesa_glu
+
+    # MESS
+    expat
+
+    # Minecraft
+    nss
+
+    # Mupen64Plus
+    boost dash
+
+    # Osmose
+    qt4
+
+    # PCSX2 // TODO: "libgobject-2.0.so.0: wrong ELF class: ELFCLASS64"
+
+    # PPSSPP
+    glew snappy
+
+    # Redream // "redream is not available for the x86_64 architecture"
+
+    # ResidualVM
+    flac
+
+    # rpcs3 // TODO: "error while loading shared libraries: libz.so.1..."
+    llvm_4
+
+    # ScummVM
+    nasm sndio
+
+    # Snes9x
+    epoxy minizip
+
+    # Steam
+    steam
+
+    # Vice
+    bison flex
+
+    # WINE
+    perl which p7zip gnused gnugrep psmisc cups lcms2 mpg123 cairo unixODBC
+    samba4 sane-backends openldap opencl-headers ocl-icd utillinux
+
+    wineWowPackages.staging
+
+    # ZDOOM
+    soundfont-fluid bzip2 game-music-emu
+  ] ++ qt5Deps
+    ++ gnome3Deps
+    ++ python3Deps
+    ++ xorgDeps
+    ++ gstDeps;
+
+  lutris = python3Packages.buildPythonApplication rec {
+    name = "lutris-original-${version}";
+    version = "0.5.2.1";
+
+    src = fetchFromGitHub {
+      owner = "lutris";
+      repo = "lutris";
+      rev = "v${version}";
+      sha256 = "023yqnzmnkfpq21r6ky6jzwbjxjcw1a5zqrrdl6fwwlr78fdhgpv";
+    };
+
+    enableParallelBuilding = true;
+    nativeBuildInputs = [ wrapGAppsHook ];
+    propagatedBuildInputs = deps;
+    fullPath = stdenv.lib.makeLibraryPath deps;
+    preConfigure = "export HOME=$PWD";
+
+    makeWrapperArgs = [
+      "--prefix LD_LIBRARY_PATH : ${fullPath}:$out/lib"
+      "--set GI_TYPELIB_PATH $GI_TYPELIB_PATH"
+      "--prefix XDG_DATA_DIRS : $out/share"
+      "--suffix XDG_DATA_DIRS : $XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH"
+    ];
+
+    postInstall = ''
+      mkdir -p $out/lib
+      ln -sf ${pkgs.gsm}/lib/libgsm.so $out/lib/libgsm.so.1
+      mv $out/bin/lutris $out/bin/lutris-${version}
+    '';
+
+    meta = with stdenv.lib; {
+      homepage = "https://lutris.net";
+      description = "Open Source gaming platform for GNU/Linux";
+      license = licenses.gpl3;
+      maintainers = with maintainers; [ chiiruno ];
+      platforms = platforms.linux;
+    };
+  };
+
+  desktopItem = makeDesktopItem {
+    name = "Lutris";
+    exec = "lutris";
+    icon = "lutris";
+    comment = lutris.meta.description;
+    desktopName = "Lutris";
+    genericName = "Gaming Platform";
+    categories = "Network;Game;Emulator;";
+    startupNotify = "false";
+  };
+
+in buildFHSUserEnv rec {
+  name = "lutris";
+
+  runScript = "lutris-${lutris.version}";
+  targetPkgs = pkgs: [ lutris pkgs.glxinfo pkgs.pciutils ];
+  passthru.lutris = lutris;
+
+  extraInstallCommands = ''
+    mkdir -p $out/share
+    cp -r ${desktopItem}/share/applications $out/share
+    ln -sf ${lutris}/share/icons $out/share
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/misc/lxterminal/default.nix b/nixpkgs/pkgs/applications/misc/lxterminal/default.nix
new file mode 100644
index 000000000000..4fd86a5a4f52
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/lxterminal/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, automake, autoconf, intltool, pkgconfig, gtk3, vte, wrapGAppsHook
+, libxslt, docbook_xml_dtd_412, docbook_xsl, libxml2, findXMLCatalogs
+}:
+
+let version = "0.3.2"; in
+
+stdenv.mkDerivation rec {
+  name = "lxterminal-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/lxde/lxterminal/archive/${version}.tar.gz";
+    sha256 = "1iafqmccsm3nnzwp6pb2c04iniqqnscj83bq1rvf58ppzk0bvih3";
+  };
+
+  configureFlags = [
+    "--enable-man"
+    "--enable-gtk3"
+  ];
+
+  nativeBuildInputs = [
+    automake autoconf intltool pkgconfig wrapGAppsHook
+    libxslt docbook_xml_dtd_412 docbook_xsl libxml2 findXMLCatalogs
+  ];
+
+  buildInputs = [ gtk3 vte ];
+
+  patches = [
+    ./respect-xml-catalog-files-var.patch
+  ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  doCheck = true;
+
+  meta = {
+    description = "The standard terminal emulator of LXDE";
+    longDescription = ''
+      LXTerminal is the standard terminal emulator of LXDE. The terminal is a
+      desktop-independent VTE-based terminal emulator for LXDE without any
+      unnecessary dependencies.
+    '';
+    homepage = https://wiki.lxde.org/en/LXTerminal;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [ stdenv.lib.maintainers.velovix ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/lxterminal/respect-xml-catalog-files-var.patch b/nixpkgs/pkgs/applications/misc/lxterminal/respect-xml-catalog-files-var.patch
new file mode 100644
index 000000000000..598f506118f2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/lxterminal/respect-xml-catalog-files-var.patch
@@ -0,0 +1,15 @@
+diff --git a/acinclude.m4 b/acinclude.m4
+index be626c5..b449b1b 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -40,8 +40,8 @@ AC_DEFUN([JH_CHECK_XML_CATALOG],
+ [
+   AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl
+   AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
+-  if $jh_found_xmlcatalog && \
+-     AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
++  # empty argument forces libxml to use XML_CATALOG_FILES variable
++  if AC_RUN_LOG([$XMLCATALOG --noout "" "$1" >&2]); then
+     AC_MSG_RESULT([found])
+     ifelse([$3],,,[$3
+ ])dnl
diff --git a/nixpkgs/pkgs/applications/misc/lyx/default.nix b/nixpkgs/pkgs/applications/misc/lyx/default.nix
new file mode 100644
index 000000000000..ad3bd499cde9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/lyx/default.nix
@@ -0,0 +1,53 @@
+{ fetchurl, stdenv, pkgconfig, python, file, bc, fetchpatch
+, qtbase, qtsvg, hunspell, makeWrapper #, mythes, boost
+}:
+
+stdenv.mkDerivation rec {
+  version = "2.3.0";
+  name = "lyx-${version}";
+
+  src = fetchurl {
+    url = "ftp://ftp.lyx.org/pub/lyx/stable/2.3.x/${name}.tar.xz";
+    sha256 = "0axri2h8xkna4mkfchfyyysbjl7s486vx80p5hzj9zgsvdm5a3ri";
+  };
+
+  # LaTeX is used from $PATH, as people often want to have it with extra pkgs
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    qtbase qtsvg python file/*for libmagic*/ bc
+    hunspell makeWrapper # enchant
+  ];
+
+  configureFlags = [
+    "--enable-qt5"
+    #"--without-included-boost"
+    /*  Boost is a huge dependency from which 1.4 MB of libs would be used.
+        Using internal boost stuff only increases executable by around 0.2 MB. */
+    #"--without-included-mythes" # such a small library isn't worth a separate package
+  ];
+
+  enableParallelBuilding = true;
+  doCheck = true;
+
+  # python is run during runtime to do various tasks
+  postFixup = ''
+    wrapProgram "$out/bin/lyx" \
+      --prefix PATH : '${python}/bin'
+  '';
+
+  patches = [
+    (fetchpatch {
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-office/lyx/files/lyx-2.3.0-qt-5.11.patch?id=07e82fd1fc07bf055c78b81eaa128f8f837da80d";
+      sha256 = "1bnx0il2iv36lnrnyb370wyvww0rd8bphcy6z8d7zmvd3pwhyfql";
+    })
+  ];
+
+  meta = with stdenv.lib; {
+    description = "WYSIWYM frontend for LaTeX, DocBook";
+    homepage = http://www.lyx.org;
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.vcunat ];
+    platforms = platforms.linux;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/madonctl/default.nix b/nixpkgs/pkgs/applications/misc/madonctl/default.nix
new file mode 100644
index 000000000000..f2dacb7890f0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/madonctl/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, buildGoPackage, fetchFromGitHub }:
+
+buildGoPackage rec {
+  name = "madonctl-${version}";
+  version = "1.1.0";
+
+  goPackagePath = "github.com/McKael/madonctl";
+
+  src = fetchFromGitHub {
+    owner = "McKael";
+    repo = "madonctl";
+    rev  = "v${version}";
+    sha256 = "1dnc1xaafhwhhf5afhb0wc2wbqq0s1r7qzj5k0xzc58my541gadc";
+  };
+
+  # How to update:
+  # go get -u github.com/McKael/madonctl
+  # cd $GOPATH/src/github.com/McKael/madonctl
+  # git checkout v<version-number>
+  # go2nix save
+
+  goDeps = ./deps.nix;
+
+  meta = with stdenv.lib; {
+    description = "CLI for the Mastodon social network API";
+    homepage = https://github.com/McKael/madonctl;
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/madonctl/deps.nix b/nixpkgs/pkgs/applications/misc/madonctl/deps.nix
new file mode 100644
index 000000000000..9f94bb09ce4e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/madonctl/deps.nix
@@ -0,0 +1,228 @@
+# This file was generated by https://github.com/kamilchm/go2nix v1.2.0
+[
+  {
+    goPackagePath = "github.com/McKael/madon";
+    fetch = {
+      type = "git";
+      url = "https://github.com/McKael/madon";
+      rev = "e580cd41ac42bbb0b2ea5b3843b3f1f854db357c";
+      sha256 = "0jvvfkf3wlzisvcq54xv3jxncx178ks5wxd6cx8k8215437b3hra";
+    };
+  }
+  {
+    goPackagePath = "github.com/fsnotify/fsnotify";
+    fetch = {
+      type = "git";
+      url = "https://github.com/fsnotify/fsnotify";
+      rev = "4da3e2cfbabc9f751898f250b49f2439785783a1";
+      sha256 = "1y2l9jaf99j6gidcfdgq3hifxyiwv4f7awpll80p170ixdbqxvl3";
+    };
+  }
+  {
+    goPackagePath = "github.com/ghodss/yaml";
+    fetch = {
+      type = "git";
+      url = "https://github.com/ghodss/yaml";
+      rev = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7";
+      sha256 = "0skwmimpy7hlh7pva2slpcplnm912rp3igs98xnqmn859kwa5v8g";
+    };
+  }
+  {
+    goPackagePath = "github.com/gorilla/websocket";
+    fetch = {
+      type = "git";
+      url = "https://github.com/gorilla/websocket";
+      rev = "a91eba7f97777409bc2c443f5534d41dd20c5720";
+      sha256 = "13cg6wwkk2ddqbm0nh9fpx4mq7f6qym12ch4lvs53n028ycdgw87";
+    };
+  }
+  {
+    goPackagePath = "github.com/hashicorp/hcl";
+    fetch = {
+      type = "git";
+      url = "https://github.com/hashicorp/hcl";
+      rev = "392dba7d905ed5d04a5794ba89f558b27e2ba1ca";
+      sha256 = "1rfm67kma2hpakabf7hxlj196jags4rpjpcirwg4kan4g9b6j0kb";
+    };
+  }
+  {
+    goPackagePath = "github.com/kr/text";
+    fetch = {
+      type = "git";
+      url = "https://github.com/kr/text";
+      rev = "7cafcd837844e784b526369c9bce262804aebc60";
+      sha256 = "0br693pf6vdr1sfvzdz6zxq7hjpdgci0il4wj0v636r8lyy21vsx";
+    };
+  }
+  {
+    goPackagePath = "github.com/m0t0k1ch1/gomif";
+    fetch = {
+      type = "git";
+      url = "https://github.com/m0t0k1ch1/gomif";
+      rev = "f5864f63e1ed5a138f015cc2cb71a2e99c148d21";
+      sha256 = "0djg8chax1g0m02xz84ic19758jzv5m50b7vpwjkpjk3181j5z9k";
+    };
+  }
+  {
+    goPackagePath = "github.com/magiconair/properties";
+    fetch = {
+      type = "git";
+      url = "https://github.com/magiconair/properties";
+      rev = "51463bfca2576e06c62a8504b5c0f06d61312647";
+      sha256 = "0d7hr78y8gg2mrm5z4jjgm2w3awkznz383b7wvyzk3l33jw6i288";
+    };
+  }
+  {
+    goPackagePath = "github.com/mattn/go-isatty";
+    fetch = {
+      type = "git";
+      url = "https://github.com/mattn/go-isatty";
+      rev = "fc9e8d8ef48496124e79ae0df75490096eccf6fe";
+      sha256 = "1r5f9gkavkb1w6sr0qs5kj16706xirl3qnlq3hqpszkw9w27x65a";
+    };
+  }
+  {
+    goPackagePath = "github.com/mitchellh/mapstructure";
+    fetch = {
+      type = "git";
+      url = "https://github.com/mitchellh/mapstructure";
+      rev = "cc8532a8e9a55ea36402aa21efdf403a60d34096";
+      sha256 = "0705c0hq7b993sabnjy65yymvpy9w1j84bg9bjczh5607z16nw86";
+    };
+  }
+  {
+    goPackagePath = "github.com/pelletier/go-buffruneio";
+    fetch = {
+      type = "git";
+      url = "https://github.com/pelletier/go-buffruneio";
+      rev = "c37440a7cf42ac63b919c752ca73a85067e05992";
+      sha256 = "0l83p1gg6g5mmhmxjisrhfimhbm71lwn1r2w7d6siwwqm9q08sd2";
+    };
+  }
+  {
+    goPackagePath = "github.com/pelletier/go-toml";
+    fetch = {
+      type = "git";
+      url = "https://github.com/pelletier/go-toml";
+      rev = "5c26a6ff6fd178719e15decac1c8196da0d7d6d1";
+      sha256 = "0f4l7mq0nb2p2vjfjqx251s6jzkl646n1vw45chykwvv1sbad8nq";
+    };
+  }
+  {
+    goPackagePath = "github.com/pkg/errors";
+    fetch = {
+      type = "git";
+      url = "https://github.com/pkg/errors";
+      rev = "c605e284fe17294bda444b34710735b29d1a9d90";
+      sha256 = "1izjk4msnc6wn1mclg0ypa6i31zfwb1r3032k8q4jfbd57hp0bz6";
+    };
+  }
+  {
+    goPackagePath = "github.com/sendgrid/rest";
+    fetch = {
+      type = "git";
+      url = "https://github.com/sendgrid/rest";
+      rev = "14de1ac72d9ae5c3c0d7c02164c52ebd3b951a4e";
+      sha256 = "0wrggvgnqdmhscim52hvhg77jhksprxp52sc4ipd69kasd32b5dm";
+    };
+  }
+  {
+    goPackagePath = "github.com/spf13/afero";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/afero";
+      rev = "9be650865eab0c12963d8753212f4f9c66cdcf12";
+      sha256 = "12dhh6d07304lsjv7c4p95hkip0hnshqhwivdw39pbypgg0p8y34";
+    };
+  }
+  {
+    goPackagePath = "github.com/spf13/cast";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/cast";
+      rev = "acbeb36b902d72a7a4c18e8f3241075e7ab763e4";
+      sha256 = "0w25s6gjbbwv47b9208hysyqqphd6pib3d2phg24mjy4wigkm050";
+    };
+  }
+  {
+    goPackagePath = "github.com/spf13/cobra";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/cobra";
+      rev = "ca5710c94eabe15aa1f74490b8e5976dc652e8c6";
+      sha256 = "1z5fxh9akwn95av6ra8p6804nhyxjc63m0s6abxi3l424n30b08i";
+    };
+  }
+  {
+    goPackagePath = "github.com/spf13/jwalterweatherman";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/jwalterweatherman";
+      rev = "8f07c835e5cc1450c082fe3a439cf87b0cbb2d99";
+      sha256 = "1dhl6kdbyczhnsgiyc8mcb7kmxd9garx8gy3q2gx5mmv96xxzxx7";
+    };
+  }
+  {
+    goPackagePath = "github.com/spf13/pflag";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/pflag";
+      rev = "e57e3eeb33f795204c1ca35f56c44f83227c6e66";
+      sha256 = "13mhx4i913jil32j295m3a36jzvq1y64xig0naadiz7q9ja011r2";
+    };
+  }
+  {
+    goPackagePath = "github.com/spf13/viper";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/viper";
+      rev = "0967fc9aceab2ce9da34061253ac10fb99bba5b2";
+      sha256 = "016syis0rvccp2indjqi1vnz3wk7c9dhkvkgam0j79sb019kl80f";
+    };
+  }
+  {
+    goPackagePath = "golang.org/x/net";
+    fetch = {
+      type = "git";
+      url = "https://go.googlesource.com/net";
+      rev = "513929065c19401a1c7b76ecd942f9f86a0c061b";
+      sha256 = "19ziin0k3n45nccjbk094f61hr198wzqnas93cmcxdja8f8fz27q";
+    };
+  }
+  {
+    goPackagePath = "golang.org/x/oauth2";
+    fetch = {
+      type = "git";
+      url = "https://go.googlesource.com/oauth2";
+      rev = "f047394b6d14284165300fd82dad67edb3a4d7f6";
+      sha256 = "1l1a2iz1nmfmzzbjj1h8066prag4jvjqh13iv1jdlh05fgv6769i";
+    };
+  }
+  {
+    goPackagePath = "golang.org/x/sys";
+    fetch = {
+      type = "git";
+      url = "https://go.googlesource.com/sys";
+      rev = "a2e06a18b0d52d8cb2010e04b372a1965d8e3439";
+      sha256 = "0m0r2w2qk8jkdk21h52n66g4yqckmzpx3mph73cilkhvdfgwfd21";
+    };
+  }
+  {
+    goPackagePath = "golang.org/x/text";
+    fetch = {
+      type = "git";
+      url = "https://go.googlesource.com/text";
+      rev = "19e51611da83d6be54ddafce4a4af510cb3e9ea4";
+      sha256 = "09pcfzx7nrma0gjv93jx57c28farf8m1qm4x07vk5505wlcgvvfl";
+    };
+  }
+  {
+    goPackagePath = "gopkg.in/yaml.v2";
+    fetch = {
+      type = "git";
+      url = "https://gopkg.in/yaml.v2";
+      rev = "cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b";
+      sha256 = "1hj2ag9knxflpjibck0n90jrhsrqz7qvad4qnif7jddyapi9bqzl";
+    };
+  }
+]
diff --git a/nixpkgs/pkgs/applications/misc/makeself/Use-rm-from-PATH.patch b/nixpkgs/pkgs/applications/misc/makeself/Use-rm-from-PATH.patch
new file mode 100644
index 000000000000..80b9ebf4d571
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/makeself/Use-rm-from-PATH.patch
@@ -0,0 +1,43 @@
+From 81cf57e4653360af7f1718391e424fa05d8ea000 Mon Sep 17 00:00:00 2001
+From: Keshav Kini <keshav.kini@gmail.com>
+Date: Thu, 9 Aug 2018 18:36:15 -0700
+Subject: [PATCH] Use `rm` from PATH
+
+On NixOS (a Linux distribution), there is no `/bin/rm`, but an `rm`
+command will generally be available in one's path when running shell
+scripts. Here, I change a couple of invocations of `/bin/rm` into
+invocations of `rm` to deal with this issue.
+
+Since `rm` is already called elsewhere in the script without an
+absolute path, I assume this change will not cause any
+regressions. Still, I've tested this on a CentOS machine and a NixOS
+machine, though not other platforms.
+---
+ makeself-header.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/makeself-header.sh b/makeself-header.sh
+index 4d2c005..2babf34 100755
+--- a/makeself-header.sh
++++ b/makeself-header.sh
+@@ -515,7 +515,7 @@ if test x"\$quiet" = xn; then
+ fi
+ res=3
+ if test x"\$keep" = xn; then
+-    trap 'echo Signal caught, cleaning up >&2; cd \$TMPROOT; /bin/rm -rf "\$tmpdir"; eval \$finish; exit 15' 1 2 3 15
++    trap 'echo Signal caught, cleaning up >&2; cd \$TMPROOT; rm -rf "\$tmpdir"; eval \$finish; exit 15' 1 2 3 15
+ fi
+ 
+ if test x"\$nodiskspace" = xn; then
+@@ -581,7 +581,7 @@ if test x"\$script" != x; then
+ fi
+ if test x"\$keep" = xn; then
+     cd "\$TMPROOT"
+-    /bin/rm -rf "\$tmpdir"
++    rm -rf "\$tmpdir"
+ fi
+ eval \$finish; exit \$res
+ EOF
+-- 
+2.14.1
+
diff --git a/nixpkgs/pkgs/applications/misc/makeself/default.nix b/nixpkgs/pkgs/applications/misc/makeself/default.nix
new file mode 100644
index 000000000000..a6af1762e289
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/makeself/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  version = "2.4.0";
+  name = "makeself-${version}";
+
+  src = fetchFromGitHub {
+    owner = "megastep";
+    repo = "makeself";
+    rev = "release-${version}";
+    sha256 = "1lw3gx1zpzp2wmzrw5v7k31vfsrdzadqha9ni309fp07g8inrr9n";
+  };
+
+  # backported from https://github.com/megastep/makeself/commit/77156e28ff21231c400423facc7049d9c60fd1bd
+  patches = [ ./Use-rm-from-PATH.patch ];
+
+  postPatch = ''
+    sed -e "s|^HEADER=.*|HEADER=$out/share/${name}/makeself-header.sh|" -i makeself.sh
+  '';
+
+  installPhase = ''
+    mkdir -p $out/{bin,share/{${name},man/man1}}
+    cp makeself.lsm README.md $out/share/${name}
+    cp makeself.sh $out/bin/makeself
+    cp makeself.1  $out/share/man/man1/
+    cp makeself-header.sh $out/share/${name}
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://megastep.org/makeself;
+    description = "Utility to create self-extracting packages";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.wmertens ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/mako/default.nix b/nixpkgs/pkgs/applications/misc/mako/default.nix
new file mode 100644
index 000000000000..32aa15b09e49
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mako/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, scdoc
+, systemd, pango, cairo, gdk_pixbuf
+, wayland, wayland-protocols
+, fetchpatch }:
+
+stdenv.mkDerivation rec {
+  pname = "mako";
+  version = "1.3";
+
+  src = fetchFromGitHub {
+    owner = "emersion";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "17azdc37xsbmx13fkfp23vg9lznrv9fh6nhagn64wdq3nhsxm3b6";
+  };
+
+  # to be removed with next release
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/emersion/mako/commit/ca8e763f06756136c534b1bbd2e5b536be6b1995.patch";
+      sha256 = "09mi7nn2vwc69igxxc6y2m36n3snhsz0ady99yabhrzl17k4ryds";
+    })
+  ];
+
+  nativeBuildInputs = [ meson ninja pkgconfig scdoc wayland-protocols ];
+  buildInputs = [ systemd pango cairo gdk_pixbuf wayland ];
+
+  mesonFlags = [
+    "-Dicons=enabled" "-Dman-pages=enabled" "-Dzsh-completions=true"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "A lightweight Wayland notification daemon";
+    homepage = https://wayland.emersion.fr/mako/;
+    license = licenses.mit;
+    maintainers = with maintainers; [ dywedir ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/masterpdfeditor/default.nix b/nixpkgs/pkgs/applications/misc/masterpdfeditor/default.nix
new file mode 100644
index 000000000000..7acebfad488b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/masterpdfeditor/default.nix
@@ -0,0 +1,53 @@
+{ stdenv, fetchurl, sane-backends, qtbase, qtsvg, nss, autoPatchelfHook, lib, makeWrapper }:
+
+let
+  version = "5.4.10";
+
+in stdenv.mkDerivation {
+  name = "masterpdfeditor-${version}";
+
+  src = fetchurl {
+    url = "https://code-industry.net/public/master-pdf-editor-${version}_qt5.amd64.tar.gz";
+    sha256 = "1902ahb2g9xanrip1n0ihr31az8sv9fsvzddnzf70kbwlfclnqf7";
+  };
+
+  nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
+
+  buildInputs = [ nss qtbase qtsvg sane-backends stdenv.cc.cc ];
+
+  dontStrip = true;
+
+  # Please remove this when #44047 is fixed
+  postInstall = ''
+    wrapProgram $out/bin/masterpdfeditor5 --prefix QT_PLUGIN_PATH : ${lib.getBin qtbase}/${qtbase.qtPluginPrefix}
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    p=$out/opt/masterpdfeditor
+    mkdir -p $out/bin
+
+    substituteInPlace masterpdfeditor5.desktop \
+      --replace 'Exec=/opt/master-pdf-editor-5' "Exec=$out/bin" \
+      --replace 'Path=/opt/master-pdf-editor-5' "Path=$out/bin" \
+      --replace 'Icon=/opt/master-pdf-editor-5' "Icon=$out/share/pixmaps"
+
+    install -Dm644 -t $out/share/pixmaps      masterpdfeditor5.png
+    install -Dm644 -t $out/share/applications masterpdfeditor5.desktop
+    install -Dm755 -t $p                      masterpdfeditor5
+    install -Dm644 license.txt $out/share/$name/LICENSE
+    ln -s $p/masterpdfeditor5 $out/bin/masterpdfeditor5
+    cp -v -r stamps templates lang fonts $p
+
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Master PDF Editor";
+    homepage = "https://code-industry.net/free-pdf-editor/";
+    license = licenses.unfreeRedistributable;
+    platforms = with platforms; [ "x86_64-linux" ];
+    maintainers = with maintainers; [ cmcdragonkai flokli ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/mdp/default.nix b/nixpkgs/pkgs/applications/misc/mdp/default.nix
new file mode 100644
index 000000000000..6c58dde00d36
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mdp/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, ncurses }:
+
+stdenv.mkDerivation rec {
+  version = "1.0.15";
+  name = "mdp-${version}";
+
+  src = fetchFromGitHub {
+    owner = "visit1985";
+    repo = "mdp";
+    rev = version;
+    sha256 = "1m9a0vvyw2m55cn7zcq011vrjkiaj5a3g5g6f2dpq953gyi7gff9";
+  };
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  buildInputs = [ ncurses ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/visit1985/mdp;
+    description = "A command-line based markdown presentation tool";
+    maintainers = with maintainers; [ matthiasbeyer vrthra ];
+    license = licenses.gpl3;
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/mediainfo-gui/default.nix b/nixpkgs/pkgs/applications/misc/mediainfo-gui/default.nix
new file mode 100644
index 000000000000..0d9fffd1bb7e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mediainfo-gui/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, autoreconfHook, pkgconfig, libzen, libmediainfo, wxGTK
+, desktop-file-utils, libSM, imagemagick }:
+
+stdenv.mkDerivation rec {
+  version = "19.04";
+  name = "mediainfo-gui-${version}";
+  src = fetchurl {
+    url = "https://mediaarea.net/download/source/mediainfo/${version}/mediainfo_${version}.tar.xz";
+    sha256 = "11wag23gx7nprrm1qlgvbc83rs9zxdsshqrp98zwia80xh8c9bk5";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  buildInputs = [ libzen libmediainfo wxGTK desktop-file-utils libSM
+                  imagemagick ];
+
+  sourceRoot = "./MediaInfo/Project/GNU/GUI/";
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Supplies technical and tag information about a video or audio file (GUI version)";
+    longDescription = ''
+      MediaInfo is a convenient unified display of the most relevant technical
+      and tag data for video and audio files.
+    '';
+    homepage = https://mediaarea.net/;
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.devhell ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/mediainfo/default.nix b/nixpkgs/pkgs/applications/misc/mediainfo/default.nix
new file mode 100644
index 000000000000..8bbb179d9d51
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mediainfo/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, autoreconfHook, pkgconfig, libzen, libmediainfo, zlib }:
+
+stdenv.mkDerivation rec {
+  version = "19.04";
+  name = "mediainfo-${version}";
+  src = fetchurl {
+    url = "https://mediaarea.net/download/source/mediainfo/${version}/mediainfo_${version}.tar.xz";
+    sha256 = "11wag23gx7nprrm1qlgvbc83rs9zxdsshqrp98zwia80xh8c9bk5";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  buildInputs = [ libzen libmediainfo zlib ];
+
+  sourceRoot = "./MediaInfo/Project/GNU/CLI/";
+
+  configureFlags = [ "--with-libmediainfo=${libmediainfo}" ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Supplies technical and tag information about a video or audio file";
+    longDescription = ''
+      MediaInfo is a convenient unified display of the most relevant technical
+      and tag data for video and audio files.
+    '';
+    homepage = https://mediaarea.net/;
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.devhell ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/megasync/default.nix b/nixpkgs/pkgs/applications/misc/megasync/default.nix
new file mode 100644
index 000000000000..b3e739864171
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/megasync/default.nix
@@ -0,0 +1,125 @@
+{ stdenv
+, autoconf
+, automake
+, c-ares
+, cryptopp
+, curl
+, doxygen
+, fetchFromGitHub
+, ffmpeg
+, hicolor-icon-theme
+, libmediainfo
+, libraw
+, libsodium
+, libtool
+, libuv
+, libzen
+, lsb-release
+, pkgconfig
+, qt5
+, sqlite
+, swig
+, unzip
+, wget
+}:
+
+stdenv.mkDerivation rec {
+  name = "megasync-${version}";
+  version = "4.1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "meganz";
+    repo = "MEGAsync";
+    rev = "v${version}_Linux";
+    sha256 = "0lc228q3s9xp78dxjn22g6anqlsy1hi7a6yfs4q3l6gyfc3qcxl2";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    doxygen
+    lsb-release
+    pkgconfig
+    qt5.qmake
+    qt5.qttools
+    swig
+  ];
+  buildInputs = [
+    c-ares
+    cryptopp
+    curl
+    ffmpeg
+    hicolor-icon-theme
+    libmediainfo
+    libraw
+    libsodium
+    libtool
+    libuv
+    libzen
+    qt5.qtbase
+    qt5.qtsvg
+    sqlite
+    unzip
+    wget
+  ];
+
+  patches = [
+    # Distro and version targets attempt to use lsb_release which is broken
+    # (see issue: https://github.com/NixOS/nixpkgs/issues/22729)
+    ./noinstall-distro-version.patch
+    # megasync target is not part of the install rule thanks to a commented block
+    ./install-megasync.patch
+  ];
+
+  postPatch = ''
+    for file in $(find src/ -type f \( -iname configure -o -iname \*.sh  \) ); do
+      substituteInPlace "$file" --replace "/bin/bash" "${stdenv.shell}"
+    done
+  '';
+
+  dontUseQmakeConfigure = true;
+  enableParallelBuilding = true;
+
+  preConfigure = ''
+    cd src/MEGASync/mega
+    ./autogen.sh
+  '';
+
+  configureFlags = [
+          "--disable-examples"
+          "--disable-java"
+          "--disable-php"
+          "--enable-chat"
+          "--with-cares"
+          "--with-cryptopp"
+          "--with-curl"
+          "--with-ffmpeg"
+          "--without-freeimage"  # unreferenced even when found
+          "--without-readline"
+          "--without-termcap"
+          "--with-sodium"
+          "--with-sqlite"
+          "--with-zlib"
+    ];
+
+  postConfigure = ''
+    cd ../..
+  '';
+
+  preBuild = ''
+    qmake CONFIG+="release" MEGA.pro
+    pushd MEGASync
+      lrelease MEGASync.pro
+      DESKTOP_DESTDIR="$out" qmake PREFIX="$out" -o Makefile MEGASync.pro CONFIG+=release
+    popd
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Easy automated syncing between your computers and your MEGA Cloud Drive";
+    homepage    = https://mega.nz/;
+    license     = licenses.unfree;
+    platforms   = [ "i686-linux" "x86_64-linux" ];
+    maintainers = [ maintainers.michojel ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/megasync/install-megasync.patch b/nixpkgs/pkgs/applications/misc/megasync/install-megasync.patch
new file mode 100644
index 000000000000..7d8748528e7f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/megasync/install-megasync.patch
@@ -0,0 +1,21 @@
+Index: source/src/MEGASync/MEGASync.pro
+===================================================================
+--- source.orig/src/MEGASync/MEGASync.pro
++++ source/src/MEGASync/MEGASync.pro
+@@ -28,11 +28,11 @@ unix:!macx {
+     TARGET = megasync
+ 
+ #    Uncomment the following if "make install" doesn't copy megasync in /usr/bin directory
+-#    isEmpty(PREFIX) {
+-#        PREFIX = /usr
+-#    }
+-#    target.path = $$PREFIX/bin
+-#    INSTALLS += target
++    isEmpty(PREFIX) {
++        PREFIX = /usr
++    }
++    target.path = $$PREFIX/bin
++    INSTALLS += target
+ }
+ else {
+     TARGET = MEGAsync
diff --git a/nixpkgs/pkgs/applications/misc/megasync/noinstall-distro-version.patch b/nixpkgs/pkgs/applications/misc/megasync/noinstall-distro-version.patch
new file mode 100644
index 000000000000..bbf100737bc4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/megasync/noinstall-distro-version.patch
@@ -0,0 +1,13 @@
+Index: source/src/MEGASync/platform/platform.pri
+===================================================================
+--- source.orig/src/MEGASync/platform/platform.pri
++++ source/src/MEGASync/platform/platform.pri
+@@ -37,7 +37,7 @@ unix:!macx {
+     system(command -v lsb_release): version.commands = lsb_release -rs > $$version.target
+ 	version.files = $$version.target
+ 
+-	INSTALLS += distro version
++	# INSTALLS += distro version
+ 
+     QT += dbus
+     SOURCES += $$PWD/linux/LinuxPlatform.cpp \
diff --git a/nixpkgs/pkgs/applications/misc/memo/default.nix b/nixpkgs/pkgs/applications/misc/memo/default.nix
new file mode 100644
index 000000000000..c112cf0c928f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/memo/default.nix
@@ -0,0 +1,52 @@
+{ fetchFromGitHub, silver-searcher, tree, man, stdenv,
+  git,
+  pandocSupport ? true, pandoc ? null
+  , ... }:
+
+assert pandocSupport -> pandoc != null;
+
+stdenv.mkDerivation rec {
+
+  name = "memo-${version}";
+
+  version = "0.6";
+
+  src = fetchFromGitHub {
+    owner  = "mrVanDalo";
+    repo   = "memo";
+    rev    = "${version}";
+    sha256 = "1cvjs36f6vxzfz5d63yhyw8j7gdw5hn6cfzccf7ag08lamjhfhbr";
+  };
+
+  installPhase = let
+    pandocReplacement = if pandocSupport then
+      "pandoc_cmd=${pandoc}/bin/pandoc"
+    else
+      "#pandoc_cmd=pandoc";
+  in ''
+    mkdir -p $out/{bin,share/man/man1,share/bash-completion/completions,share/zsh/site-functions}
+    substituteInPlace memo \
+      --replace "ack_cmd=ack"       "ack_cmd=${silver-searcher}/bin/ag" \
+      --replace "tree_cmd=tree"     "tree_cmd=${tree}/bin/tree" \
+      --replace "man_cmd=man"       "man_cmd=${man}/bin/man" \
+      --replace "git_cmd=git"       "git_cmd=${git}/bin/git" \
+      --replace "pandoc_cmd=pandoc" "${pandocReplacement}"
+    mv memo $out/bin/
+    mv doc/memo.1 $out/share/man/man1/memo.1
+    mv completion/bash/memo.sh $out/share/bash-completion/completions/memo.sh
+    mv completion/zsh/_memo    $out/share/zsh/site-functions/_memo
+  '';
+
+  meta = {
+    description = "A simple tool written in bash to memorize stuff";
+    longDescription = ''
+      A simple tool written in bash to memorize stuff.
+      Memo organizes is structured through topics which are folders in ~/memo.
+    '';
+    homepage = http://palovandalo.com/memo/;
+    downloadPage = https://github.com/mrVanDalo/memo/releases;
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = [ stdenv.lib.maintainers.mrVanDalo ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/mencal/default.nix b/nixpkgs/pkgs/applications/misc/mencal/default.nix
new file mode 100644
index 000000000000..df0a4db7fc70
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mencal/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, perl }:
+
+stdenv.mkDerivation rec {
+  name = "mencal-3.0";
+
+  src = fetchurl {
+    url = "http://kyberdigi.cz/projects/mencal/files/${name}.tar.gz";
+    sha256 = "9328d0b2f3f57847e8753c5184531f4832be7123d1b6623afdff892074c03080";
+  };
+
+  installPhase = ''
+      mkdir -p $out/bin
+      cp mencal $out/bin/
+    '';
+
+  buildInputs = [ perl ];
+
+  meta = with stdenv.lib; {
+    description = "Menstruation calendar";
+    longDescription = ''
+      Mencal is a simple variation of the well-known unix command cal.
+      The main difference is that you can have some periodically repeating
+      days highlighted in color. This can be used to track
+      menstruation (or other) cycles conveniently.
+    '';
+    homepage = "http://www.kyberdigi.cz/projects/mencal/english.html";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.mmahut ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/menumaker/default.nix b/nixpkgs/pkgs/applications/misc/menumaker/default.nix
new file mode 100644
index 000000000000..56854e7863fe
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/menumaker/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, pythonPackages }:
+
+pythonPackages.buildPythonApplication rec {
+  name = "menumaker-${version}";
+  version = "0.99.10";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/menumaker/${name}.tar.gz";
+    sha256 = "1mm4cvg3kphkkd8nwrhcg6d9nm5ar7mgc0wf6fxk6zck1l7xn8ky";
+  };
+
+  format = "other";
+
+  meta = with stdenv.lib; {
+    description = "Heuristics-driven menu generator for several window managers";
+    homepage = http://menumaker.sourceforge.net;
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/merkaartor/default.nix b/nixpkgs/pkgs/applications/misc/merkaartor/default.nix
new file mode 100644
index 000000000000..0833464f2c25
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/merkaartor/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, makeWrapper, qmake, pkgconfig, boost, gdal, proj
+, qtbase, qtsvg, qtwebkit }:
+
+stdenv.mkDerivation rec {
+  name = "merkaartor-${version}";
+  version = "0.18.3";
+
+  src = fetchFromGitHub {
+    owner = "openstreetmap";
+    repo = "merkaartor";
+    rev = version;
+    sha256 = "0ls3q8m1hxiwyrypy6qca8wczhl4969ncl0sszfdwfv70rzxjk88";
+  };
+
+  nativeBuildInputs = [ makeWrapper qmake pkgconfig ];
+
+  buildInputs = [ boost gdal proj qtbase qtsvg qtwebkit ];
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    wrapProgram $out/bin/merkaartor \
+      --set QT_QPA_PLATFORM_PLUGIN_PATH ${qtbase.bin}/lib/qt-*/plugins/platforms
+  '';
+
+  meta = with stdenv.lib; {
+    description = "OpenStreetMap editor";
+    homepage = http://merkaartor.be/;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/metamorphose2/default.nix b/nixpkgs/pkgs/applications/misc/metamorphose2/default.nix
new file mode 100644
index 000000000000..602d4a032efd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/metamorphose2/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchgit, makeWrapper, gettext
+, python27, python2Packages
+}:
+
+stdenv.mkDerivation rec {
+  name    = "metamorphose2-${version}";
+  version = "0.9.0beta";
+
+  # exif-py vendored via submodule
+  # mutagen vendored via copy
+  src = fetchgit {
+    url = "https://github.com/metamorphose/metamorphose2.git";
+    #rev = "refs/tags/v2.${version}"; #for when wxPython3 support is released
+    rev = "d2bdd6a86340b9668e93b35a6a568894c9909d68";
+    sha256 = "0ivcb3c8hidrff0ivl4dnwa2p3ihpqjdbvdig8dhg9mm5phdbabn";
+  };
+
+  postPatch = ''
+    substituteInPlace messages/Makefile \
+      --replace "\$(shell which msgfmt)" "${gettext}/bin/msgfmt"
+  '';
+
+  postInstall = ''
+    rm $out/bin/metamorphose2
+    makeWrapper ${python27}/bin/python $out/bin/metamorphose2 \
+      --prefix PYTHONPATH : $PYTHONPATH:$(toPythonPath "$out") \
+      --add-flags "-O $out/share/metamorphose2/metamorphose2.py -w=3"
+  '';
+
+  buildInput = [ gettext python27 ];
+  nativeBuildInputs = [ makeWrapper ];
+  propagatedBuildInputs = [ python2Packages.wxPython python2Packages.pillow ];
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = with stdenv.lib; {
+    description = "a graphical mass renaming program for files and folders";
+    homepage    = "https://github.com/metamorphose/metamorphose2";
+    license     = with licenses; gpl3Plus;
+    maintainers = with maintainers; [ ramkromberg ];
+    platforms   = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/metar/default.nix b/nixpkgs/pkgs/applications/misc/metar/default.nix
new file mode 100644
index 000000000000..ca4f91533ecf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/metar/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchgit, curl }:
+
+stdenv.mkDerivation {
+  name = "metar-20161013.1";
+
+  src = fetchgit {
+    url = "https://github.com/keesL/metar.git";
+    rev = "20e9ca69faea330f6c2493b6829131c24cb55147";
+    sha256 = "1fgrlnpasqf1ihh9y6zy6mzzybqx0lxvh7gmv03rjdb55dr42dxj";
+  };
+
+  buildInputs = [ curl ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/keesL/metar;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.zalakain ];
+    description = "Downloads weather reports and optionally decodes them";
+    longDescription = ''
+      METAR reports are meteorogical weather reports for aviation. Metar is a small
+      program which downloads weather reports for user-specified stations and
+      optionally decodes them into a human-readable format.
+
+      Currently, metar supports decoding date/time, wind, visibility, cloud layers,
+      temperature, air pressure and weather phenomena, such as rain, fog, etc. Also,
+      more work in the area of clouds need to be done, as support for Cumulus or
+      Cumulunimbus is not yet decoded.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/milu/default.nix b/nixpkgs/pkgs/applications/misc/milu/default.nix
new file mode 100644
index 000000000000..09c4d1db2904
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/milu/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchFromGitHub, unzip, pkgconfig, glib, llvmPackages }:
+
+stdenv.mkDerivation rec {
+  name = "milu-nightly-${version}";
+  version = "2016-05-09";
+
+  src = fetchFromGitHub {
+    sha256 = "14cglw04cliwlpvw7qrs6rfm5sv6qa558d7iby5ng3wdjcwx43nk";
+    rev = "b5f2521859c0319d321ad3c1ad793b826ab5f6e1";
+    repo = "Milu";
+    owner = "yuejia";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  preConfigure = ''
+    sed -i 's#/usr/bin/##g' Makefile
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp bin/milu $out/bin
+  '';
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+     glib
+     unzip
+     llvmPackages.libclang
+  ];
+
+  meta = {
+    description = "Higher Order Mutation Testing Tool for C and C++ programs";
+    homepage = https://github.com/yuejia/Milu;
+    license = stdenv.lib.licenses.bsd2;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.vrthra ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/minergate-cli/default.nix b/nixpkgs/pkgs/applications/misc/minergate-cli/default.nix
new file mode 100644
index 000000000000..6aa7eea3d7e9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/minergate-cli/default.nix
@@ -0,0 +1,36 @@
+{ fetchurl, stdenv, dpkg, makeWrapper, openssl }:
+
+stdenv.mkDerivation rec {
+  version = "8.2";
+  name = "minergate-cli-${version}";
+  src = fetchurl {
+    url = "https://minergate.com/download/ubuntu-cli";
+    sha256 = "393c5ba236f6f92c449496fcda9509f4bfd3887422df98ffa59b3072124a99d8";
+  };
+
+  nativeBuildInputs = [ dpkg makeWrapper ];
+
+  phases = [ "installPhase" ];
+
+  installPhase = ''
+    dpkg-deb -x $src $out
+    pgm=$out/opt/minergate-cli/minergate-cli
+
+    interpreter=${stdenv.glibc}/lib/ld-linux-x86-64.so.2
+    patchelf --set-interpreter "$interpreter" $pgm
+
+    wrapProgram $pgm --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ openssl stdenv.cc.cc ]} 
+
+    rm $out/usr/bin/minergate-cli
+    mkdir -p $out/bin
+    ln -s $pgm $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Minergate CPU/GPU console client mining software";
+    homepage = https://www.minergate.com/;
+    license = licenses.unfree;
+    maintainers = with maintainers; [ bfortz ];
+    platforms = [ "x86_64-linux" ];
+};
+}
diff --git a/nixpkgs/pkgs/applications/misc/minergate/default.nix b/nixpkgs/pkgs/applications/misc/minergate/default.nix
new file mode 100644
index 000000000000..d11e889e932c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/minergate/default.nix
@@ -0,0 +1,36 @@
+{ fetchurl, stdenv, dpkg, makeWrapper, fontconfig, freetype, openssl, xorg, xkeyboard_config }:
+
+stdenv.mkDerivation rec {
+  version = "8.1";
+  name = "minergate-${version}";
+  src = fetchurl {
+    url = "https://minergate.com/download/ubuntu";
+    sha256 = "1dbbbb8e0735cde239fca9e82c096dcc882f6cecda20bba7c14720a614c16e13";
+  };
+
+  nativeBuildInputs = [ dpkg makeWrapper ];
+
+  phases = [ "installPhase" ];
+
+  installPhase = ''
+    dpkg-deb -x $src $out
+    pgm=$out/opt/minergate/minergate
+
+    interpreter=${stdenv.glibc}/lib/ld-linux-x86-64.so.2
+    patchelf --set-interpreter "$interpreter" $pgm
+
+    wrapProgram $pgm --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ fontconfig freetype openssl stdenv.cc.cc xorg.libX11 xorg.libxcb ]} --prefix "QT_XKB_CONFIG_ROOT" ":" "${xkeyboard_config}/share/X11/xkb"
+
+    rm $out/usr/bin/minergate
+    mkdir -p $out/bin
+    ln -s $out/opt/minergate/minergate $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Minergate CPU/GPU mining software";
+    homepage = https://www.minergate.com/;
+    license = licenses.unfree;
+    maintainers = with maintainers; [ bfortz ];
+    platforms = [ "x86_64-linux" ];
+};
+}
diff --git a/nixpkgs/pkgs/applications/misc/mlterm/default.nix b/nixpkgs/pkgs/applications/misc/mlterm/default.nix
new file mode 100644
index 000000000000..2cfa6010853f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mlterm/default.nix
@@ -0,0 +1,94 @@
+{ stdenv, fetchurl, pkgconfig, autoconf, makeDesktopItem
+, libX11, gdk_pixbuf, cairo, libXft, gtk3, vte
+, harfbuzz #substituting glyphs with opentype fonts
+, fribidi, m17n_lib #bidi and encoding
+, openssl, libssh2 #build-in ssh
+}:
+
+stdenv.mkDerivation rec {
+  name = "mlterm-${version}";
+  version = "3.8.8";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/mlterm/01release/${name}/${name}.tar.gz";
+    sha256 = "1jq3fv2wqhszfipkzj8d0lykr6g0zzksn7xy4d3kwincmzfskv7k";
+  };
+
+  nativeBuildInputs = [ pkgconfig autoconf ];
+  buildInputs = [
+    libX11 gdk_pixbuf.dev cairo libXft gtk3 vte
+    harfbuzz fribidi m17n_lib openssl libssh2
+  ];
+
+  #bad configure.ac and Makefile.in everywhere
+  preConfigure = ''
+    sed -ie 's;-L/usr/local/lib -R/usr/local/lib;;g' \
+      main/Makefile.in \
+      tool/mlfc/Makefile.in \
+      tool/mlimgloader/Makefile.in \
+      tool/mlconfig/Makefile.in \
+      uitoolkit/libtype/Makefile.in \
+      uitoolkit/libotl/Makefile.in
+    sed -ie 's;cd ..srcdir. && rm -f ...lang..gmo.*;;g' \
+      tool/mlconfig/po/Makefile.in.in
+    #utmp and mlterm-fb
+    substituteInPlace configure.in \
+      --replace "-m 2755 -g utmp" " " \
+      --replace "-m 4755 -o root" " "
+    substituteInPlace configure \
+      --replace "-m 2755 -g utmp" " " \
+      --replace "-m 4755 -o root" " "
+  '';
+  NIX_LDFLAGS = "
+    -L${stdenv.cc.cc.lib}/lib
+    -lX11 -lgdk_pixbuf-2.0 -lcairo -lfontconfig -lfreetype -lXft
+    -lvte-2.91 -lgtk-3 -lharfbuzz -lfribidi -lm17n
+  " + stdenv.lib.optionalString (openssl != null) "
+    -lcrypto
+  " + stdenv.lib.optionalString (libssh2 != null) "
+    -lssh2
+  ";
+
+  configureFlags = [
+    "--with-x=yes"
+    "--with-gui=xlib,fb"
+    "--with-imagelib=gdk-pixbuf" #or mlimgloader depending on your bugs of choice
+    "--with-type-engines=cairo,xft,xcore"
+    "--with-gtk=3.0"
+    "--enable-ind" #indic scripts
+    "--enable-fribidi" #bidi scripts
+    "--enable-m17nlib" #character encodings
+    "--with-tools=mlclient,mlconfig,mlcc,mlterm-menu,mlimgloader,registobmp,mlfc"
+     #mlterm-menu and mlconfig depend on enabling gnome3.at-spi2-core
+     #and configuring ~/.mlterm/key correctly.
+ ] ++ stdenv.lib.optional (libssh2 == null) [
+    "--disable-ssh2"
+ ];
+
+  postInstall = ''
+    install -D contrib/icon/mlterm-icon.svg "$out/share/icons/hicolor/scalable/apps/mlterm.svg"
+    install -D contrib/icon/mlterm-icon-gnome2.png "$out/share/icons/hicolor/48x48/apps/mlterm.png"
+    install -D -t $out/share/applications $desktopItem/share/applications/*
+  '';
+
+  desktopItem = makeDesktopItem rec {
+    name = "mlterm";
+    exec = "mlterm %U";
+    icon = "mlterm";
+    type = "Application";
+    comment = "Terminal emulator";
+    desktopName = "mlterm";
+    genericName = "Terminal emulator";
+    categories = stdenv.lib.concatStringsSep ";" [
+      "Application" "System" "TerminalEmulator"
+    ];
+    startupNotify = "false";
+  };
+
+  meta = with stdenv.lib; {
+    homepage = http://mlterm.sourceforge.net/;
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ vrthra ramkromberg ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/moonlight-embedded/default.nix b/nixpkgs/pkgs/applications/misc/moonlight-embedded/default.nix
new file mode 100644
index 000000000000..920c1c3f095b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/moonlight-embedded/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, cmake, perl
+, alsaLib, libevdev, libopus, udev, SDL2
+, ffmpeg, pkgconfig, xorg, libvdpau, libpulseaudio, libcec
+, curl, expat, avahi, enet, libuuid, libva
+}:
+
+stdenv.mkDerivation rec {
+  name = "moonlight-embedded-${version}";
+  version = "2.4.10";
+
+  src = fetchFromGitHub {
+    owner = "irtimmer";
+    repo = "moonlight-embedded";
+    rev = "v${version}";
+    sha256 = "0m5i3q3hbjl51cndjpz5hxi3br6fvpn1fzdv0f6lxjxgw9z32413";
+    fetchSubmodules = true;
+  };
+
+  outputs = [ "out" "man" ];
+
+  nativeBuildInputs = [ cmake perl ];
+  buildInputs = [
+    alsaLib libevdev libopus udev SDL2
+    ffmpeg pkgconfig xorg.libxcb libvdpau libpulseaudio libcec
+    xorg.libpthreadstubs curl expat avahi enet libuuid libva
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Open source implementation of NVIDIA's GameStream";
+    homepage = https://github.com/irtimmer/moonlight-embedded;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.globin ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/mop/default.nix b/nixpkgs/pkgs/applications/misc/mop/default.nix
new file mode 100644
index 000000000000..b9179bbe5463
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mop/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, buildGoPackage, fetchgit }:
+
+buildGoPackage rec {
+  name = "mop-${version}";
+  version = "0.2.0";
+  rev = "bc666ec165d08b43134f7ec0bf29083ad5466243";
+
+  goPackagePath = "github.com/michaeldv/mop";
+  goDeps = ./deps.nix;
+
+  preConfigure = ''
+    for i in $(find . -type f);do
+        substituteInPlace $i --replace michaeldv/termbox-go nsf/termbox-go
+    done
+    substituteInPlace Makefile --replace mop/cmd mop/mop
+    mv cmd mop
+  '';
+
+  src = fetchgit {
+    inherit rev;
+    url = "https://github.com/mop-tracker/mop";
+    sha256 = "0zp51g9i8rw6acs4vnrxclbxa5z1v0a0m1xx27szszp0rphcczkx";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Simple stock tracker implemented in go";
+    homepage =  https://github.com/mop-tracker/mop;
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/mop/deps.nix b/nixpkgs/pkgs/applications/misc/mop/deps.nix
new file mode 100644
index 000000000000..4081cd1ddaa2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mop/deps.nix
@@ -0,0 +1,11 @@
+[
+  {
+    goPackagePath = "github.com/nsf/termbox-go";
+    fetch = {
+      type = "git";
+      url = "https://github.com/nsf/termbox-go";
+      rev = "9aecf65084a5754f12d27508fa2e6ed56851953b";
+      sha256 = "16sak07bgvmax4zxfrd4jia1dgygk733xa8vk8cdx28z98awbfsh";
+    };
+  }
+]
diff --git a/nixpkgs/pkgs/applications/misc/mpvc/default.nix b/nixpkgs/pkgs/applications/misc/mpvc/default.nix
new file mode 100644
index 000000000000..fffa95952622
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mpvc/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, socat, fetchFromGitHub, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "mpvc-unstable-2017-03-18";
+
+  src = fetchFromGitHub {
+    owner = "wildefyr";
+    repo = "mpvc";
+    rev = "aea5c661455248cde7ac9ddba5f63cc790d26512";
+    sha256 = "0qiyvb3ck1wyd3izajwvlq4bwgsbq7x8ya3fgi5i0g2qr39a1qml";
+  };
+
+  makeFlags = [ "PREFIX=$(out)" ];
+  installFlags = [ "PREFIX=$(out)" ];
+
+  postInstall = ''
+    wrapProgram $out/bin/mpvc --prefix PATH : "${socat}/bin/"
+  '';
+
+  buildInputs = [ socat makeWrapper ];
+
+  meta = with stdenv.lib; {
+    description = "A mpc-like control interface for mpv";
+    homepage = https://github.com/wildefyr/mpvc;
+    license = licenses.mit;
+    maintainers = [ maintainers.neeasade ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/mqtt-bench/default.nix b/nixpkgs/pkgs/applications/misc/mqtt-bench/default.nix
new file mode 100644
index 000000000000..eea166d8df75
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mqtt-bench/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, buildGoPackage, fetchFromGitHub, fetchpatch }:
+
+buildGoPackage rec {
+  name = "mqtt-bench-${version}";
+  version = "0.3.0";
+  rev = "v${version}";
+
+  goPackagePath = "github.com/takanorig/mqtt-bench";
+
+  src = fetchFromGitHub {
+    inherit rev;
+    owner = "takanorig";
+    repo = "mqtt-bench";
+    sha256 = "03b9ak2j303iwq6abd7j10f2cs2ianwnbflwmyx9g96i7zd74f5m";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://patch-diff.githubusercontent.com/raw/takanorig/mqtt-bench/pull/13.patch";
+      name = "mqtt-paho-changes.patch";
+      sha256 = "17c8ajrp5dmbsasj6njxrlhy0x08b65fignzm3yccqbhb4ijcvha";
+    })
+  ];
+
+  goDeps = ./deps.nix;
+
+  meta = with stdenv.lib; {
+    description = "Mosquitto benchmark tool";
+    homepage = https://github.com/takanorig/mqtt-bench;
+    maintainers = with maintainers; [ disassembler ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/mqtt-bench/deps.nix b/nixpkgs/pkgs/applications/misc/mqtt-bench/deps.nix
new file mode 100644
index 000000000000..d93d3c468145
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mqtt-bench/deps.nix
@@ -0,0 +1,21 @@
+# This file was generated by https://github.com/kamilchm/go2nix v1.2.1
+[
+  {
+    goPackagePath = "github.com/eclipse/paho.mqtt.golang";
+    fetch = {
+      type = "git";
+      url = "https://github.com/eclipse/paho.mqtt.golang";
+      rev = "65f43bda5f7edbbf6b7533d3a5a13b2c67cf3545";
+      sha256 = "1ad136xf78br599ya43j45f8dycjip1k0hkplayy1slg8ckwrhdr";
+    };
+  }
+  {
+    goPackagePath = "golang.org/x/net";
+    fetch = {
+      type = "git";
+      url = "https://go.googlesource.com/net";
+      rev = "8351a756f30f1297fe94bbf4b767ec589c6ea6d0";
+      sha256 = "0b6m579i3wrx1m69mqkdng5gjfssprxx0pg45kzrdi68sh0zr5d1";
+    };
+  }
+]
diff --git a/nixpkgs/pkgs/applications/misc/mrxvt/default.nix b/nixpkgs/pkgs/applications/misc/mrxvt/default.nix
new file mode 100644
index 000000000000..a6efb19b5774
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mrxvt/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl, libX11, libXft, libXi, xorgproto, libSM, libICE
+, freetype, pkgconfig, which }:
+
+stdenv.mkDerivation {
+  name = "mrxvt-0.5.4";
+
+  buildInputs =
+    [ libX11 libXft libXi xorgproto libSM libICE freetype pkgconfig which ];
+
+  configureFlags = [
+    "--with-x"
+    "--enable-frills"
+    "--enable-xft"
+    "--enable-xim"
+    # "--with-term=xterm"
+    "--with-max-profiles=100"
+    "--with-max-term=100"
+    "--with-save-lines=10000"
+  ];
+
+  preConfigure = ''
+    NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype.dev}/include/freetype2";
+  '';
+
+  src = fetchurl {
+    url = mirror://sourceforge/materm/mrxvt-0.5.4.tar.gz;
+    sha256 = "1mqhmnlz32lvld9rc6c1hyz7gjw4anwf39yhbsjkikcgj1das0zl";
+  };
+
+  meta = { 
+    description = "Lightweight multitabbed feature-rich X11 terminal emulator";
+    longDescription = "
+    	Multitabbed lightweight terminal emulator based on rxvt. 
+	Supports transparency, backgroundimages, freetype fonts, ...
+    ";
+    homepage = https://sourceforge.net/projects/materm;
+    license = "GPL";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/mucommander/default.nix b/nixpkgs/pkgs/applications/misc/mucommander/default.nix
new file mode 100644
index 000000000000..d6153d2268b6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mucommander/default.nix
@@ -0,0 +1,84 @@
+{ stdenv, fetchFromGitHub, gradle_3_5, perl, makeWrapper, jre, gsettings-desktop-schemas }:
+
+let
+  version = "0.9.2";
+  name = "mucommander-${version}";
+
+  src = fetchFromGitHub {
+    owner = "mucommander";
+    repo = "mucommander";
+    rev = version;
+    sha256 = "1fvij0yjjz56hsyddznx7mdgq1zm25fkng3axl03iyrij976z7b8";
+  };
+
+  postPatch = ''
+    # there is no .git anyway
+    substituteInPlace build.gradle \
+      --replace "git = org.ajoberstar.grgit.Grgit.open(file('.'))"  "" \
+      --replace "revision = git.head().id"                          "revision = 'abcdefgh'"
+
+    # disable gradle plugins with native code and their targets
+    perl -i.bak1 -pe "s#(^\s*id '.+' version '.+'$)#// \1#" build.gradle
+    perl -i.bak2 -pe "s#(.*)#// \1# if /^(buildscript|task portable|task nsis|task proguard|task tgz|task\(afterEclipseImport\)|launch4j|macAppBundle|buildRpm|buildDeb|shadowJar)/ ... /^}/" build.gradle
+
+    # fix source encoding
+    find . -type f -name build.gradle \
+      -exec perl -i.bak3 -pe "s#(repositories\.jcenter\(\))#
+                                \1
+                                compileJava.options.encoding = 'UTF-8'
+                                compileTestJava.options.encoding = 'UTF-8'
+                               #" {} \;
+  '';
+
+  # fake build to pre-download deps into fixed-output derivation
+  deps = stdenv.mkDerivation {
+    name = "${name}-deps";
+    inherit src postPatch;
+    nativeBuildInputs = [ gradle_3_5 perl ];
+    buildPhase = ''
+      export GRADLE_USER_HOME=$(mktemp -d)
+      gradle --no-daemon build
+    '';
+    # perl code mavenizes pathes (com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar -> com/squareup/okio/okio/1.13.0/okio-1.13.0.jar)
+    installPhase = ''
+      find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \
+        | perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \
+        | sh
+    '';
+    outputHashAlgo = "sha256";
+    outputHashMode = "recursive";
+    outputHash = "199a9rc1pp9jjwpy83743qhjczfz0d1mkbic6si9bh8l62nw8qc7";
+  };
+
+in stdenv.mkDerivation {
+  inherit name src postPatch;
+  nativeBuildInputs = [ gradle_3_5 perl makeWrapper ];
+
+  buildPhase = ''
+    export GRADLE_USER_HOME=$(mktemp -d)
+
+    # point to offline repo
+    find . -type f -name build.gradle \
+      -exec perl -i.bak3 -pe "s#repositories\.jcenter\(\)#
+                                repositories { mavenLocal(); maven { url '${deps}' } }
+                               #" {} \;
+
+    gradle --offline --no-daemon build
+  '';
+
+  installPhase = ''
+    mkdir $out
+    tar xvf build/distributions/mucommander-${version}.tar --directory=$out --strip=1
+    wrapProgram $out/bin/mucommander \
+      --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name} \
+      --set JAVA_HOME ${jre}
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://www.mucommander.com/;
+    description = "Cross-platform file manager";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ volth ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/multibootusb/default.nix b/nixpkgs/pkgs/applications/misc/multibootusb/default.nix
new file mode 100644
index 000000000000..a2678d6067f9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/multibootusb/default.nix
@@ -0,0 +1,59 @@
+{ stdenv, python36Packages, fetchFromGitHub, libxcb, mtools, p7zip, parted, procps, utillinux, qt5, runtimeShell }:
+python36Packages.buildPythonApplication rec {
+  pname = "multibootusb";
+  name = "${pname}-${version}";
+  version = "9.2.0";
+
+  buildInputs = [
+    python36Packages.dbus-python
+    python36Packages.pyqt5
+    python36Packages.pytest-shutil
+    python36Packages.python
+    python36Packages.pyudev
+    python36Packages.six
+    libxcb
+    mtools
+    p7zip
+    parted
+    procps
+    qt5.full
+    utillinux
+  ];
+
+  src = fetchFromGitHub {
+    owner = "mbusb";
+    repo = pname;
+    rev = "v${version}";
+
+    sha256 = "0wlan0cp6c2i0nahixgpmkm0h4n518gj8rc515d579pqqp91p2h3";
+  };
+
+  # Skip the fixup stage where stuff is shrinked (can't shrink text files)
+  phases = [ "unpackPhase" "installPhase" ];
+
+  installPhase = ''
+    share="$out/share/${pname}"
+    mkdir -p "$share"
+    cp -r data "$share/data"
+    cp -r scripts "$share/scripts"
+    cp "${pname}" "$share/${pname}"
+
+    mkdir "$out/bin"
+    cat > "$out/bin/${pname}" <<EOF
+      #!${runtimeShell}
+      cd "$share"
+      export PYTHONPATH="$PYTHONPATH:$share"
+      export PATH="$PATH:${parted}/bin:${procps}/bin"
+
+      "${python36Packages.python}/bin/python" "${pname}"
+    EOF
+    chmod +x "$out/bin/${pname}"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Multiboot USB creator for Linux live disks";
+    homepage = http://multibootusb.org/;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ jD91mZM2 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/mupdf/darwin.patch b/nixpkgs/pkgs/applications/misc/mupdf/darwin.patch
new file mode 100644
index 000000000000..be1b84b0012f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mupdf/darwin.patch
@@ -0,0 +1,30 @@
+diff -ruN mupdf-1.14.0-source.orig/Makerules mupdf-1.14.0-source/Makerules
+--- mupdf-1.14.0-source.orig/Makerules	2018-11-02 06:57:12.114012496 +0100
++++ mupdf-1.14.0-source/Makerules	2018-11-02 10:11:56.717232992 +0100
+@@ -80,13 +80,6 @@
+   HAVE_GLUT := yes
+   SYS_GLUT_CFLAGS := -Wno-deprecated-declarations
+   SYS_GLUT_LIBS := -framework GLUT -framework OpenGL
+-  CC = xcrun cc
+-  AR = xcrun ar
+-  LD = xcrun ld
+-  RANLIB = xcrun ranlib
+-
+-else ifeq ($(OS),Linux)
+-  HAVE_OBJCOPY := yes
+ 
+   ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
+ 	SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
+@@ -119,12 +112,6 @@
+ 	SYS_CURL_LIBS := $(shell pkg-config --libs libcurl)
+   endif
+ 
+-  HAVE_GLUT := yes
+-  ifeq ($(HAVE_GLUT),yes)
+-	SYS_GLUT_CFLAGS :=
+-	SYS_GLUT_LIBS := -lglut -lGL
+-  endif
+-
+   HAVE_X11 := $(shell pkg-config --exists x11 xext && echo yes)
+   ifeq ($(HAVE_X11),yes)
+ 	X11_CFLAGS := $(shell pkg-config --cflags x11 xext)
diff --git a/nixpkgs/pkgs/applications/misc/mupdf/default.nix b/nixpkgs/pkgs/applications/misc/mupdf/default.nix
new file mode 100644
index 000000000000..38f5075d10f2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mupdf/default.nix
@@ -0,0 +1,97 @@
+{ stdenv, lib, fetchurl, fetchpatch, pkgconfig, freetype, harfbuzz, openjpeg
+, jbig2dec, libjpeg , darwin
+, enableX11 ? true, libX11, libXext, libXi, libXrandr
+, enableCurl ? true, curl, openssl
+, enableGL ? true, freeglut, libGLU
+}:
+
+let
+
+  # OpenJPEG version is hardcoded in package source
+  openJpegVersion = with stdenv;
+    lib.concatStringsSep "." (lib.lists.take 2
+      (lib.splitString "." (lib.getVersion openjpeg)));
+
+
+in stdenv.mkDerivation rec {
+  version = "1.14.0";
+  name = "mupdf-${version}";
+
+  src = fetchurl {
+    url = "https://mupdf.com/downloads/archive/${name}-source.tar.gz";
+    sha256 = "093p7lv6pgyymagn28n58fs0np928r0i5p2az9cc4gwccwx4hhy4";
+  };
+
+  patches =
+    # Use shared libraries to decrease size
+    [( fetchpatch
+      {
+          name = "CVE-2018-18662";
+          url = "http://git.ghostscript.com/?p=mupdf.git;a=patch;h=164ddc22ee0d5b63a81d5148f44c37dd132a9356";
+          sha256 = "1jkzh20n3b854871h86cy5y7fvy0d5wyqy51b3fg6gj3a0jqpzzd";
+      }
+    )]
+    ++ stdenv.lib.optional (!stdenv.isDarwin) ./mupdf-1.14-shared_libs.patch
+    ++ stdenv.lib.optional stdenv.isDarwin ./darwin.patch
+  ;
+
+  postPatch = ''
+    sed -i "s/__OPENJPEG__VERSION__/${openJpegVersion}/" source/fitz/load-jpx.c
+  '';
+
+  makeFlags = [ "prefix=$(out) USE_SYSTEM_LIBS=yes" ];
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ freetype harfbuzz openjpeg jbig2dec libjpeg freeglut libGLU ]
+                ++ lib.optionals enableX11 [ libX11 libXext libXi libXrandr ]
+                ++ lib.optionals enableCurl [ curl openssl ]
+                ++ lib.optionals enableGL (
+                  if stdenv.isDarwin then
+                    with darwin.apple_sdk.frameworks; [ GLUT OpenGL ]
+                  else
+                    [ freeglut libGLU ])
+                ;
+  outputs = [ "bin" "dev" "out" "man" "doc" ];
+
+  preConfigure = ''
+    # Don't remove mujs because upstream version is incompatible
+    rm -rf thirdparty/{curl,freetype,glfw,harfbuzz,jbig2dec,libjpeg,openjpeg,zlib}
+  '';
+
+  postInstall = ''
+    mkdir -p "$out/lib/pkgconfig"
+    cat >"$out/lib/pkgconfig/mupdf.pc" <<EOF
+    prefix=$out
+    libdir=$out/lib
+    includedir=$out/include
+
+    Name: mupdf
+    Description: Library for rendering PDF documents
+    Version: ${version}
+    Libs: -L$out/lib -lmupdf -lmupdf-third
+    Cflags: -I$dev/include
+    EOF
+
+    moveToOutput "bin" "$bin"
+    mkdir -p $bin/share/applications
+    cat > $bin/share/applications/mupdf.desktop <<EOF
+    [Desktop Entry]
+    Type=Application
+    Version=1.0
+    Name=mupdf
+    Comment=PDF viewer
+    Exec=$bin/bin/mupdf-x11 %f
+    Terminal=false
+    EOF
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = https://mupdf.com;
+    repositories.git = git://git.ghostscript.com/mupdf.git;
+    description = "Lightweight PDF, XPS, and E-book viewer and toolkit written in portable C";
+    license = licenses.agpl3Plus;
+    maintainers = with maintainers; [ vrthra fpletz ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/mupdf/default.upstream b/nixpkgs/pkgs/applications/misc/mupdf/default.upstream
new file mode 100644
index 000000000000..852233633ca5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mupdf/default.upstream
@@ -0,0 +1,7 @@
+url https://mupdf.com/downloads/archive/
+do_overwrite(){
+  ensure_hash
+  ensure_version
+  set_var_value version $CURRENT_VERSION
+  set_var_value sha256 $CURRENT_HASH
+}
diff --git a/nixpkgs/pkgs/applications/misc/mupdf/mupdf-1.14-shared_libs.patch b/nixpkgs/pkgs/applications/misc/mupdf/mupdf-1.14-shared_libs.patch
new file mode 100644
index 000000000000..131a1bbbf6bd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mupdf/mupdf-1.14-shared_libs.patch
@@ -0,0 +1,39 @@
+--- mupdf-1.14.0-source.orig/Makefile	2018-11-02 06:57:12.114012496 +0100
++++ mupdf-1.14.0-source/Makefile	2018-11-02 09:57:10.067945307 +0100
+@@ -20,7 +20,7 @@
+ # Do not specify CFLAGS or LIBS on the make invocation line - specify
+ # XCFLAGS or XLIBS instead. Make ignores any lines in the makefile that
+ # set a variable that was set on the command line.
+-CFLAGS += $(XCFLAGS) -Iinclude
++CFLAGS += $(XCFLAGS) -Iinclude -fPIC
+ LIBS += $(XLIBS) -lm
+ 
+ ifneq ($(threading),no)
+@@ -190,17 +190,21 @@
+ 
+ # --- Library ---
+ 
+-MUPDF_LIB = $(OUT)/libmupdf.a
+-THIRD_LIB = $(OUT)/libmupdf-third.a
+-THREAD_LIB = $(OUT)/libmupdf-threads.a
+-PKCS7_LIB = $(OUT)/libmupdf-pkcs7.a
++MUPDF_LIB = $(OUT)/libmupdf.so
++THIRD_LIB = $(OUT)/libmupdf-third.so
++THREAD_LIB = $(OUT)/libmupdf-threads.so
++PKCS7_LIB = $(OUT)/libmupdf-pkcs7.so
+ 
+-$(MUPDF_LIB) : $(MUPDF_OBJ)
++$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_LIB) $(THREAD_LIB)
++	$(LINK_CMD) $(THIRD_LIBS) -shared -Wl,-soname -Wl,libmupdf.so -Wl,--no-undefined
+ $(THIRD_LIB) : $(THIRD_OBJ)
++	$(LINK_CMD) -shared -Wl,-soname -Wl,libmupdf-third.so -Wl,--no-undefined
+ $(THREAD_LIB) : $(THREAD_OBJ)
++	$(LINK_CMD) -shared -Wl,-soname -Wl,libmupdf-threads.so -Wl,--no-undefined -lpthread
+ $(PKCS7_LIB) : $(PKCS7_OBJ)
++	$(LINK_CMD) -shared -Wl,-soname -Wl,libmupdf-pkcs7.so
+ 
+-INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB)
++INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB) $(PKCS7_LIB)
+ 
+ # --- Main tools and viewers ---
+ 
diff --git a/nixpkgs/pkgs/applications/misc/mwic/default.nix b/nixpkgs/pkgs/applications/misc/mwic/default.nix
new file mode 100644
index 000000000000..c08a21e87978
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mwic/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pythonPackages }:
+
+stdenv.mkDerivation rec {
+  version = "0.7.7";
+  name = "mwic-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/jwilk/mwic/releases/download/${version}/${name}.tar.gz";
+    sha256 = "0l4anwiiqclymx0awwn4hzaj8n26ycg8nz76wjphsyscn7z2awad";
+  };
+
+  makeFlags=["PREFIX=\${out}"];
+
+  nativeBuildInputs = [
+    pythonPackages.wrapPython
+  ];
+
+  propagatedBuildInputs = with pythonPackages; [ pyenchant regex ];
+
+  postFixup = ''
+    buildPythonPath "$out"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://jwilk.net/software/mwic;
+    description = "spell-checker that groups possible misspellings and shows them in their contexts";
+    license = licenses.mit;
+    maintainers = with maintainers; [ matthiasbeyer ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/mysql-workbench/default.nix b/nixpkgs/pkgs/applications/misc/mysql-workbench/default.nix
new file mode 100644
index 000000000000..cccd36d7ead8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mysql-workbench/default.nix
@@ -0,0 +1,109 @@
+{ stdenv, fetchurl, substituteAll, cmake, ninja, pkgconfig
+, glibc, gtk3, gtkmm3, pcre, swig, antlr4_7, sudo
+, mysql, libxml2, libmysqlconnectorcpp
+, vsqlite, gdal, libiodbc, libpthreadstubs
+, libXdmcp, libuuid, libzip, libsecret, libssh
+, python2, jre
+, boost, libsigcxx, libX11, openssl
+, proj, cairo, libxkbcommon, epoxy, wrapGAppsHook
+, at-spi2-core, dbus, bash, coreutils
+}:
+
+let
+  inherit (python2.pkgs) paramiko pycairo pyodbc;
+in stdenv.mkDerivation rec {
+  pname = "mysql-workbench";
+  version = "8.0.15";
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-community-${version}-src.tar.gz";
+    sha256 = "0ca93azasya5xiw6j2map8drmxf445qqydpvrb512kjfqdiv67x6";
+  };
+
+  patches = [
+    ./fix-gdal-includes.patch
+    (substituteAll {
+      src = ./hardcode-paths.patch;
+      catchsegv = "${glibc.bin}/bin/catchsegv";
+      bash = "${bash}/bin/bash";
+      cp = "${coreutils}/bin/cp";
+      dd = "${coreutils}/bin/dd";
+      ls = "${coreutils}/bin/ls";
+      mkdir = "${coreutils}/bin/mkdir";
+      nohup = "${coreutils}/bin/nohup";
+      rm = "${coreutils}/bin/rm";
+      rmdir = "${coreutils}/bin/rmdir";
+      sudo = "${sudo}/bin/sudo";
+    })
+  ];
+
+  nativeBuildInputs = [
+    cmake ninja pkgconfig jre swig wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gtk3 gtkmm3 libX11 antlr4_7.runtime.cpp python2 mysql libxml2
+    libmysqlconnectorcpp vsqlite gdal boost libssh openssl
+    libiodbc pcre cairo libuuid libzip libsecret
+    libsigcxx proj
+    # python dependencies:
+    paramiko pycairo pyodbc # sqlanydb
+    # transitive dependencies:
+    libpthreadstubs libXdmcp libxkbcommon epoxy at-spi2-core dbus
+  ];
+
+  postPatch = ''
+    patchShebangs tools/get_wb_version.sh
+  '';
+
+  NIX_CFLAGS_COMPILE = [
+    # error: 'OGRErr OGRSpatialReference::importFromWkt(char**)' is deprecated
+    "-Wno-error=deprecated-declarations"
+  ];
+
+  cmakeFlags = [
+    "-DMySQL_CONFIG_PATH=${mysql}/bin/mysql_config"
+    "-DIODBC_CONFIG_PATH=${libiodbc}/bin/iodbc-config"
+    "-DWITH_ANTLR_JAR=${antlr4_7.jarLocation}"
+  ];
+
+  # There is already an executable and a wrapper in bindir
+  # No need to wrap both
+  dontWrapGApps = true;
+
+  preFixup = ''
+    gappsWrapperArgs+=(
+      --prefix PATH : "${python2}/bin"
+      --prefix PROJSO : "${proj}/lib/libproj.so"
+      --set PYTHONPATH $PYTHONPATH
+    )
+  '';
+
+  # Let’s wrap the programs not ending with bin
+  # until https://bugs.mysql.com/bug.php?id=91948 is fixed
+  postFixup = ''
+    find -L "$out/bin" -type f -executable -print0 \
+      | while IFS= read -r -d ''' file; do
+      if [[ "''${file}" != *-bin ]]; then
+        echo "Wrapping program ''${file}"
+        wrapProgram "''${file}" "''${gappsWrapperArgs[@]}"
+      fi
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Visual MySQL database modeling, administration and querying tool";
+    longDescription = ''
+      MySQL Workbench is a modeling tool that allows you to design
+      and generate MySQL databases graphically. It also has administration
+      and query development modules where you can manage MySQL server instances
+      and execute SQL queries.
+    '';
+
+    homepage = http://wb.mysql.com/;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.kkallio ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/mysql-workbench/fix-gdal-includes.patch b/nixpkgs/pkgs/applications/misc/mysql-workbench/fix-gdal-includes.patch
new file mode 100644
index 000000000000..0a5c31fd40a2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mysql-workbench/fix-gdal-includes.patch
@@ -0,0 +1,47 @@
+--- a/backend/wbpublic/grt/spatial_handler.h
++++ b/backend/wbpublic/grt/spatial_handler.h
+@@ -24,12 +24,12 @@
+ #ifndef SPATIAL_HANDLER_H_
+ #define SPATIAL_HANDLER_H_
+ 
+-#include <gdal/ogrsf_frmts.h>
+-#include <gdal/ogr_api.h>
+-#include <gdal/gdal_pam.h>
+-#include <gdal/memdataset.h>
+-#include <gdal/gdal_alg.h>
+-#include <gdal/gdal.h>
++#include <ogrsf_frmts.h>
++#include <ogr_api.h>
++#include <gdal_pam.h>
++#include <memdataset.h>
++#include <gdal_alg.h>
++#include <gdal.h>
+ #include <deque>
+ #include "base/geometry.h"
+ #include "wbpublic_public_interface.h"
+--- a/backend/wbpublic/grtui/geom_draw_box.h
++++ b/backend/wbpublic/grtui/geom_draw_box.h
+@@ -25,7 +25,7 @@
+ #define _GEOM_DRAW_BOX_H_
+ 
+ #include <mforms/drawbox.h>
+-#include <gdal/ogr_geometry.h>
++#include <ogr_geometry.h>
+ #include "wbpublic_public_interface.h"
+ 
+ class WBPUBLICBACKEND_PUBLIC_FUNC GeomDrawBox : public mforms::DrawBox {
+--- a/backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp
++++ b/backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp
+@@ -21,9 +21,9 @@
+  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 
+  */
+ 
+-#include <gdal/ogrsf_frmts.h>
+-#include <gdal/ogr_api.h>
+-#include <gdal/gdal.h>
++#include <ogrsf_frmts.h>
++#include <ogr_api.h>
++#include <gdal.h>
+ 
+ #include <grts/structs.db.query.h>
+ #include <grtpp_util.h>
diff --git a/nixpkgs/pkgs/applications/misc/mysql-workbench/hardcode-paths.patch b/nixpkgs/pkgs/applications/misc/mysql-workbench/hardcode-paths.patch
new file mode 100644
index 000000000000..dddf992e4c12
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mysql-workbench/hardcode-paths.patch
@@ -0,0 +1,187 @@
+--- a/frontend/linux/workbench/mysql-workbench.in
++++ b/frontend/linux/workbench/mysql-workbench.in
+@@ -99,8 +99,8 @@
+ if test "$WB_DEBUG" != ""; then
+   $WB_DEBUG $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
+ else
+-  if type -p catchsegv > /dev/null; then
+-  catchsegv $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
++  if type -p @catchsegv@ > /dev/null; then
++  @catchsegv@ $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
+   else
+   $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
+   fi
+--- a/plugins/migration/frontend/migration_bulk_copy_data.py
++++ b/plugins/migration/frontend/migration_bulk_copy_data.py
+@@ -110,7 +110,7 @@
+         return 'sh'
+ 
+     def generate_import_script(self, connection_args, path_to_file, schema_name):
+-        output = ['#!/bin/bash']
++        output = ['#!/usr/bin/env bash']
+         output.append('MYPATH=\`pwd\`')
+         
+         output.append('if [ -f \$MYPATH/%s ] ; then' % self.error_log_name)
+@@ -164,7 +164,7 @@
+         return 'sh'
+ 
+     def generate_import_script(self, connection_args, path_to_file, schema_name):
+-        output = ['#!/bin/bash']
++        output = ['#!/usr/bin/env bash']
+         output.append('MYPATH=\`pwd\`')
+         
+         output.append('if [ -f \$MYPATH/%s ] ; then' % self.error_log_name)
+@@ -417,7 +417,7 @@
+     
+         with open(script_path, 'w+') as f:
+             os.chmod(script_path, 0700)
+-            f.write('#!/bin/bash\n\n')
++            f.write('#!/usr/bin/env bash\n\n')
+             f.write('MYPATH=`pwd`\n')
+             
+             f.write("arg_source_password=\"<put source password here>\"\n")
+@@ -521,7 +521,7 @@
+     
+         with open(script_path, 'w+') as f:
+             os.chmod(script_path, 0700)
+-            f.write('#!/bin/bash\n\n')
++            f.write('#!/usr/bin/env bash\n\n')
+             f.write('MYPATH=`pwd`\n')
+             
+             f.write("arg_source_password=\"<put source password here>\"\n")
+--- a/plugins/wb.admin/backend/wb_server_control.py
++++ b/plugins/wb.admin/backend/wb_server_control.py
+@@ -39,7 +39,7 @@
+ 
+ UnixVariant = {
+     "" : {
+-        'sudo_command' : "/usr/bin/sudo -k -S -p EnterPasswordHere ",
++        'sudo_command' : "@sudo@ -k -S -p EnterPasswordHere ",
+     }
+ }
+ 
+--- a/plugins/wb.admin/backend/wb_server_management.py
++++ b/plugins/wb.admin/backend/wb_server_management.py
+@@ -40,7 +40,7 @@
+ 
+ def reset_sudo_prefix():
+     global default_sudo_prefix
+-    default_sudo_prefix       = '/usr/bin/sudo -k -S -p EnterPasswordHere'
++    default_sudo_prefix       = '@sudo@ -k -S -p EnterPasswordHere'
+ 
+ reset_sudo_prefix()
+ 
+@@ -100,7 +100,7 @@
+ 
+     if to_spawn:
+         command += ' &'
+-        sudo_prefix += ' /usr/bin/nohup'
++        sudo_prefix += ' @nohup@'
+       
+     # If as_user is the CURRENT then there's no need to sudo
+     if as_user != Users.CURRENT:
+@@ -111,7 +111,7 @@
+         if '/bin/sh' in sudo_prefix or '/bin/bash' in sudo_prefix:
+             command = "LANG=C " + sudo_prefix + " \"" + command.replace('\\', '\\\\').replace('"', r'\"').replace('$','\\$') + "\""
+         else:
+-            command = "LANG=C " + sudo_prefix + " /bin/bash -c \"" + command.replace('\\', '\\\\').replace('"', r'\"').replace('$','\\$') + "\""
++            command = "LANG=C " + sudo_prefix + " @bash@ -c \"" + command.replace('\\', '\\\\').replace('"', r'\"').replace('$','\\$') + "\""
+ 
+     return command
+ 
+@@ -896,9 +896,9 @@
+             if as_user == Users.CURRENT:
+                 raise PermissionDeniedError("Cannot set owner of directory %s" % path)        
+             else:
+-                command = "/bin/mkdir %s && chown %s %s" % (quote_path(path), with_owner, quote_path(path))
++                command = "@mkdir@ %s && chown %s %s" % (quote_path(path), with_owner, quote_path(path))
+         else:
+-            command = "/bin/mkdir %s" % (quote_path(path))
++            command = "@mkdir@ %s" % (quote_path(path))
+             
+         res = self.process_ops.exec_cmd(command,
+                                         as_user   = as_user,
+@@ -927,7 +927,7 @@
+     @useAbsPath("path")
+     def remove_directory(self, path, as_user = Users.CURRENT, user_password = None):
+         output = StringIO.StringIO()
+-        res = self.process_ops.exec_cmd('/bin/rmdir ' + quote_path(path),
++        res = self.process_ops.exec_cmd('@rmdir@ ' + quote_path(path),
+                                         as_user   = as_user,
+                                         user_password = user_password,
+                                         output_handler = output.write,
+@@ -940,7 +940,7 @@
+     @useAbsPath("path")
+     def remove_directory_recursive(self, path, as_user = Users.CURRENT, user_password = None):
+         output = StringIO.StringIO()
+-        res = self.process_ops.exec_cmd('/bin/rm -R ' + quote_path(path),
++        res = self.process_ops.exec_cmd('@rm@ -R ' + quote_path(path),
+                                         as_user   = as_user,
+                                         user_password = user_password,
+                                         output_handler = output.write,
+@@ -953,7 +953,7 @@
+     @useAbsPath("path")
+     def delete_file(self, path, as_user = Users.CURRENT, user_password = None):
+         output = StringIO.StringIO()
+-        res = self.process_ops.exec_cmd("/bin/rm " + quote_path(path),
++        res = self.process_ops.exec_cmd("@rm@ " + quote_path(path),
+                                         as_user   = as_user,
+                                         user_password = user_password,
+                                         output_handler = output.write,
+@@ -1001,7 +1001,7 @@
+     def _copy_file(self, source, dest, as_user = Users.CURRENT, user_password = None):
+         output = StringIO.StringIO()
+         
+-        res = self.process_ops.exec_cmd("LC_ALL=C /bin/cp " + quote_path(source) + " " + quote_path(dest),
++        res = self.process_ops.exec_cmd("LC_ALL=C @cp@ " + quote_path(source) + " " + quote_path(dest),
+                       as_user   = as_user,
+                       user_password = user_password,
+                       output_handler = output.write,
+@@ -1077,9 +1077,9 @@
+             # for ls -l, the output format changes depending on stdout being a terminal or not
+             # since both cases are possible, we need to handle both at the same time (1st line being total <nnnn> or not)
+             # the good news is that if the line is there, then it will always start with total, regardless of the locale
+-            command = 'LC_ALL=C /bin/ls -l -p %s' % quote_path(path)
++            command = 'LC_ALL=C @ls@ -l -p %s' % quote_path(path)
+         else:
+-            command = 'LC_ALL=C /bin/ls -1 -p %s' % quote_path(path)
++            command = 'LC_ALL=C @ls@ -1 -p %s' % quote_path(path)
+             
+         output = StringIO.StringIO()
+         res = self.process_ops.exec_cmd(command,
+@@ -2160,9 +2160,9 @@
+     def get_range(self, start, end):
+         f = StringIO.StringIO()
+         if not self._need_sudo:
+-            ret = self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.CURRENT, user_password=None, output_handler=f.write)
++            ret = self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.CURRENT, user_password=None, output_handler=f.write)
+         else:
+-            ret = self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.ADMIN, user_password=self.get_password, output_handler=f.write)
++            ret = self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.ADMIN, user_password=self.get_password, output_handler=f.write)
+ 
+         if ret != 0:
+             raise RuntimeError("Could not get data from file %s" % self.path)
+@@ -2170,9 +2170,9 @@
+ 
+     def read_task(self, offset, file):
+         if not self._need_sudo:
+-            self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=file.write)
++            self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=file.write)
+         else:
+-            self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self.get_password, output_handler=file.write)
++            self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self.get_password, output_handler=file.write)
+         # this will signal the reader end that there's no more data
+         file.close()
+ 
+@@ -2198,9 +2198,9 @@
+         self._pos = offset
+         f = StringIO.StringIO()
+         if not self._need_sudo:
+-            self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=f.write)
++            self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=f.write)
+         else:
+-            self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self._password, output_handler=f.write)
++            self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self._password, output_handler=f.write)
+         self.data = f
+         self.data.seek(0)
+         if self.skip_first_newline:
diff --git a/nixpkgs/pkgs/applications/misc/mystem/default.nix b/nixpkgs/pkgs/applications/misc/mystem/default.nix
new file mode 100644
index 000000000000..45b83b727485
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/mystem/default.nix
@@ -0,0 +1,26 @@
+{stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "mystem-${version}";
+  version = "3.1";
+
+  src = fetchurl {
+    url = "http://download.cdn.yandex.net/mystem/${name}-linux-64bit.tar.gz";
+    sha256 = "0q3vxvyj5bqllqnlivy5llss39z7j0bgpn6kv8mrc54vjdhppx10";
+  };
+
+  buildCommand = ''
+    tar -xaf "$src"
+    mkdir -p $out/bin
+    install -Dm755 mystem $out/bin/mystem
+    patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) $out/bin/mystem
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Morphological analysis of Russian text";
+    homepage = https://yandex.ru/dev/mystem/;
+    license = licenses.unfreeRedistributable;
+    maintainers = with maintainers; [ abbradar ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/nanoblogger/default.nix b/nixpkgs/pkgs/applications/misc/nanoblogger/default.nix
new file mode 100644
index 000000000000..022829040b81
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/nanoblogger/default.nix
@@ -0,0 +1,30 @@
+{ fetchurl, stdenv, bash }:
+
+stdenv.mkDerivation rec {
+  version = "3.5-rc1";
+  name = "nanoblogger-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/nanoblogger/${name}.tar.gz";
+    sha256 = "09mv52a5f0h3das8x96irqyznm69arfskx472b7w3b9q4a2ipxbq";
+  };
+
+  buildInputs = [ ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -r * $out
+    cat > $out/bin/nb << EOF 
+    #!${bash}/bin/bash
+    $out/nb "\$@"
+    EOF
+    chmod 755 $out/bin/nb
+  '';
+
+  meta = {
+    description = "Small weblog engine written in Bash for the command line";
+    homepage = http://nanoblogger.sourceforge.net/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/navipowm/default.nix b/nixpkgs/pkgs/applications/misc/navipowm/default.nix
new file mode 100644
index 000000000000..9a40e3bc1053
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/navipowm/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, qt4, qmake4Hook }:
+stdenv.mkDerivation rec {
+  name = "navipowm-0.2.4";
+
+  src = fetchurl {
+    url = mirror://sourceforge/navipowm/NaviPOWM-0.2.4.tar.gz;
+    sha256 = "1kdih8kwpgcgfh6l6njkr9gq2j5hv39xvzmzgvhip553kn6bss7b";
+  };
+
+  preConfigure = ''
+    cd Qt/KDevelop
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/${name}/Icons
+    cp bin/NaviPOWM $out/bin
+    cp ../../common/Config/navipowm.ini $out/share/${name}
+    cp ../../common/Images/* $out/share/${name}
+  '';
+
+  buildInputs = [ qt4 ];
+  nativeBuildInputs = [ qmake4Hook ];
+
+  meta = {
+    homepage = http://navipowm.sourceforge.net/;
+    description = "Car navigation system";
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = with stdenv.lib.maintainers; [ ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/navit/CMakeLists.txt.patch b/nixpkgs/pkgs/applications/misc/navit/CMakeLists.txt.patch
new file mode 100644
index 000000000000..7f8a75f319be
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/navit/CMakeLists.txt.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 763f75b..defa74a 100755
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -212,7 +212,7 @@ CHECK_INCLUDE_FILES(endian.h HAVE_ENDIAN_H)
+ CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)
+ CHECK_INCLUDE_FILES(byteswap.h HAVE_BYTESWAP_H)
+ CHECK_LIBRARY_EXISTS(gypsy gypsy_control_get_default "" GYPSY_FOUND)
+-CHECK_INCLUDE_FILES(libspeechd.h HAVE_LIBSPEECHD)
++CHECK_INCLUDE_FILES(speech-dispatcher/libspeechd.h HAVE_LIBSPEECHD)
+ CHECK_INCLUDE_FILES(sys/socket.h HAVE_SOCKET)
+ CHECK_INCLUDE_FILES(sys/shm.h HAVE_SHMEM)
+ CHECK_FUNCTION_EXISTS(snprintf   HAVE_SNPRINTF)
diff --git a/nixpkgs/pkgs/applications/misc/navit/default.nix b/nixpkgs/pkgs/applications/misc/navit/default.nix
new file mode 100644
index 000000000000..8dc288c01625
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/navit/default.nix
@@ -0,0 +1,90 @@
+{ stdenv, fetchFromGitHub, pkgconfig, gtk2, fontconfig, freetype, imlib2
+, SDL_image, libGLU_combined, libXmu, freeglut, pcre, dbus, dbus-glib, glib
+, librsvg, freeimage, libxslt, cairo, gdk_pixbuf, pango
+, atk, patchelf, fetchurl, bzip2, python, gettext, quesoglc
+, gd, cmake, shapelib, SDL_ttf, fribidi, makeWrapper
+, qtquickcontrols, qtmultimedia, qtspeech, qtsensors
+, qtlocation, qtdeclarative, qtsvg
+, qtSupport ? false, qtbase #need to fix qt_qpainter
+, sdlSupport ? true, SDL
+, xkbdSupport ? true, xkbd
+, espeakSupport ? true, espeak
+, postgresqlSupport ? false, postgresql
+, speechdSupport ? false, speechd ? null
+}:
+
+assert speechdSupport -> speechd != null;
+
+with stdenv.lib;
+stdenv.mkDerivation rec {
+  name = "navit-${version}";
+  version = "0.5.3";
+
+  src = fetchFromGitHub {
+    owner = "navit-gps";
+    repo = "navit";
+    rev = "v${version}";
+    sha256 = "071drvqzxpxbfh0lf0lra5a97rv8ny40l96n9xl0dx0s8w30j61i";
+  };
+
+  sample_map = fetchurl {
+    url = "http://www.navit-project.org/maps/osm_bbox_11.3,47.9,11.7,48.2.osm.bz2";
+    name = "sample_map.bz2";
+    sha256 = "0vg6b6rhsa2cxqj4rbhfhhfss71syhnfa6f1jg2i2d7l88dm5x7d";
+  };
+
+  patches = [ ./CMakeLists.txt.patch ];
+
+  NIX_CFLAGS_COMPILE = optional sdlSupport "-I${SDL.dev}/include/SDL"
+    ++ optional speechdSupport "-I${speechd}/include/speech-dispatcher";
+
+  # we choose only cmdline and speech-dispatcher speech options.
+  # espeak builtins is made for non-cmdline OS as winCE
+  cmakeFlags = [
+    "-DSAMPLE_MAP=n " "-DCMAKE_BUILD_TYPE=Release"
+    "-Dspeech/qt5_espeak=FALSE" "-Dsupport/espeak=FALSE"
+  ];
+
+  buildInputs = [
+    gtk2 fontconfig freetype imlib2 libGLU_combined freeimage
+    libxslt libXmu freeglut python gettext quesoglc gd
+    fribidi pcre  dbus dbus-glib librsvg shapelib glib
+    cairo gdk_pixbuf pango atk
+  ] ++ optionals sdlSupport [ SDL SDL_ttf SDL_image ]
+    ++ optional postgresqlSupport postgresql
+    ++ optional speechdSupport speechd
+    ++ optionals qtSupport [
+      qtquickcontrols qtmultimedia qtspeech qtsensors
+      qtbase qtlocation qtdeclarative qtsvg
+  ];
+
+  nativeBuildInputs = [ makeWrapper pkgconfig cmake patchelf bzip2 ];
+
+  # we dont want blank screen by defaut
+  postInstall = ''
+    # emulate DSAMPLE_MAP
+    mkdir -p $out/share/navit/maps/
+    bzcat "${sample_map}" | $out/bin/maptool "$out/share/navit/maps/osm_bbox_11.3,47.9,11.7,48.2.bin"
+  '';
+
+  # TODO: fix upstream?
+  libPath = stdenv.lib.makeLibraryPath ([ stdenv.cc.libc ] ++ buildInputs );
+  postFixup =
+  ''
+    find "$out/lib" -type f -name "*.so" -exec patchelf --set-rpath $libPath {} \;
+
+    wrapProgram $out/bin/navit \
+      --prefix PATH : ${makeBinPath (
+        optional xkbdSupport xkbd
+        ++ optional espeakSupport espeak
+        ++ optional speechdSupport speechd ) }
+  '';
+
+  meta = {
+    homepage = https://www.navit-project.org;
+    description = "Car navigation system with routing engine using OSM maps";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.genesis ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/neap/default.nix b/nixpkgs/pkgs/applications/misc/neap/default.nix
new file mode 100644
index 000000000000..21a5ab0cd0f6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/neap/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchFromGitHub, python2Packages }:
+
+stdenv.mkDerivation rec {
+  name = "neap-${version}";
+  version = "0.7.2";
+
+  src = fetchFromGitHub {
+    owner = "vzxwco";
+    repo = "neap";
+    rev = "v${version}";
+    sha256 = "04da8rq23rl1qcvrdm5m3l90xbwyli7x601sckv7hmkip2q3g1kz";
+  };
+
+  nativeBuildInputs = [
+    python2Packages.wrapPython
+  ];
+
+  buildInputs = [
+    python2Packages.python
+  ];
+
+  pythonPath = [
+    python2Packages.xlib
+    python2Packages.pygtk
+  ];
+
+  installPhase = ''
+    install -D -t $out/bin neap
+    install -D -t $out/share/man/man1 neap.1
+    install -D -t $out/share/applications neap.desktop
+  '';
+
+  postFixup = ''
+    wrapPythonPrograms
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Systray workspace pager";
+    homepage = https://github.com/vzxwco/neap;
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/netsurf/browser/default.nix b/nixpkgs/pkgs/applications/misc/netsurf/browser/default.nix
new file mode 100644
index 000000000000..1b800f654340
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/netsurf/browser/default.nix
@@ -0,0 +1,76 @@
+{ stdenv, fetchurl, pkgconfig, libpng, openssl, curl, gtk2, check, SDL
+, libxml2, libidn, perl, nettools, perlPackages
+, libXcursor, libXrandr, makeWrapper
+, uilib ? "framebuffer"
+, buildsystem
+, nsgenbind
+, libnsfb
+, libwapcaplet
+, libparserutils
+, libcss
+, libhubbub
+, libdom
+, libnsbmp
+, libnsgif
+, libnsutils
+, libutf8proc
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "netsurf-${version}";
+  version = "3.5";
+
+  # UI libs incldue Framebuffer, and gtk
+
+  src = fetchurl {
+    url = "http://download.netsurf-browser.org/netsurf/releases/source/netsurf-${version}-src.tar.gz";
+    sha256 = "1k0x8mzgavfy7q9kywl6kzsc084g1xlymcnsxi5v6jp279nsdwwq";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ libpng openssl curl gtk2 check libxml2 libidn perl
+    nettools perlPackages.HTMLParser libXcursor libXrandr makeWrapper SDL
+    buildsystem
+    nsgenbind
+    libnsfb
+    libwapcaplet
+    libparserutils
+    libcss
+    libhubbub
+    libdom
+    libnsbmp
+    libnsgif
+    libnsutils
+    libutf8proc
+ ];
+
+  preConfigure = ''
+    cat <<EOF > Makefile.conf
+    override NETSURF_GTK_RESOURCES := $out/share/Netsurf/${uilib}/res
+    override NETSURF_USE_GRESOURCE := YES
+    EOF
+  '';
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "NSSHARED=${buildsystem}/share/netsurf-buildsystem"
+    "TARGET=${uilib}"
+  ];
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/Netsurf/${uilib}
+    cmd=$(case "${uilib}" in framebuffer) echo nsfb;; gtk) echo nsgtk;; esac)
+    cp $cmd $out/bin/netsurf
+    wrapProgram $out/bin/netsurf --set NETSURFRES $out/share/Netsurf/${uilib}/res
+    tar -hcf - ${uilib}/res | (cd $out/share/Netsurf/ && tar -xvpf -)
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://www.netsurf-browser.org/;
+    description = "Free opensource web browser";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/netsurf/buildsystem/default.nix b/nixpkgs/pkgs/applications/misc/netsurf/buildsystem/default.nix
new file mode 100644
index 000000000000..882bb75219d6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/netsurf/buildsystem/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+
+  name = "netsurf-buildsystem-${version}";
+  version = "1.7";
+
+  src = fetchurl {
+    url = "http://download.netsurf-browser.org/libs/releases/buildsystem-${version}.tar.gz";
+    sha256 = "1q23aaycv35ma5471l1gxib8lfq2s9kprrkaqgfc926d04rlbmhw";
+  };
+
+  makeFlags = [
+    "PREFIX=$(out)"
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = http://www.netsurf-browser.org/;
+    description = "Build system for netsurf browser";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/netsurf/libcss/default.nix b/nixpkgs/pkgs/applications/misc/netsurf/libcss/default.nix
new file mode 100644
index 000000000000..e97452249bcf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/netsurf/libcss/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, pkgconfig, perl
+, buildsystem
+, libwapcaplet
+, libparserutils
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "netsurf-${libname}-${version}";
+  libname = "libcss";
+  version = "0.6.0";
+
+  src = fetchurl {
+    url = "http://download.netsurf-browser.org/libs/releases/${libname}-${version}-src.tar.gz";
+    sha256 = "0qp4p1q1dwgdra4pkrzd081zjzisxkgwx650ijx323j8bj725daf";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ perl
+    buildsystem
+    libwapcaplet
+    libparserutils
+  ];
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "NSSHARED=${buildsystem}/share/netsurf-buildsystem"
+  ];
+
+  NIX_CFLAGS_COMPILE=[ "-Wno-error=implicit-fallthrough" ];
+
+  meta = with stdenv.lib; {
+    homepage = http://www.netsurf-browser.org/;
+    description = "Cascading Style Sheets library for netsurf browser";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/netsurf/libdom/default.nix b/nixpkgs/pkgs/applications/misc/netsurf/libdom/default.nix
new file mode 100644
index 000000000000..50a6dadadb5c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/netsurf/libdom/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, pkgconfig, expat
+, buildsystem
+, libparserutils
+, libwapcaplet
+, libhubbub
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "netsurf-${libname}-${version}";
+  libname = "libdom";
+  version = "0.3.0";
+
+  src = fetchurl {
+    url = "http://download.netsurf-browser.org/libs/releases/${libname}-${version}-src.tar.gz";
+    sha256 = "1kk6qbqagx5ypiy9kf0059iqdzyz8fqaw336vzhb5gnrzjw3wv4a";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ expat
+    buildsystem
+    libparserutils
+    libwapcaplet
+    libhubbub
+  ];
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "NSSHARED=${buildsystem}/share/netsurf-buildsystem"
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = http://www.netsurf-browser.org/;
+    description = "Document Object Model library for netsurf browser";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/netsurf/libhubbub/default.nix b/nixpkgs/pkgs/applications/misc/netsurf/libhubbub/default.nix
new file mode 100644
index 000000000000..715196871512
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/netsurf/libhubbub/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, pkgconfig, perl
+, buildsystem
+, libparserutils
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "netsurf-${libname}-${version}";
+  libname = "libhubbub";
+  version = "0.3.3";
+
+  src = fetchurl {
+    url = "http://download.netsurf-browser.org/libs/releases/${libname}-${version}-src.tar.gz";
+    sha256 = "101781iw32p47386fxqr01nrkywi12w17ajh02k2vlga4z8zyv86";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ perl
+    buildsystem
+    libparserutils
+  ];
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "NSSHARED=${buildsystem}/share/netsurf-buildsystem"
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = http://www.netsurf-browser.org/;
+    description = "HTML5 parser library for netsurf browser";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/netsurf/libnsbmp/default.nix b/nixpkgs/pkgs/applications/misc/netsurf/libnsbmp/default.nix
new file mode 100644
index 000000000000..7e99f8f5b86a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/netsurf/libnsbmp/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, pkgconfig
+, buildsystem
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "netsurf-${libname}-${version}";
+  libname = "libnsbmp";
+  version = "0.1.3";
+
+  src = fetchurl {
+    url = "http://download.netsurf-browser.org/libs/releases/${libname}-${version}-src.tar.gz";
+    sha256 = "0gmvzw1whh7553d6s98vr4ri2whjwrgggcq1z5b160gwjw20mzyy";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    buildsystem
+  ];
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "NSSHARED=${buildsystem}/share/netsurf-buildsystem"
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = http://www.netsurf-browser.org/;
+    description = "BMP Decoder for netsurf browser";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/netsurf/libnsfb/default.nix b/nixpkgs/pkgs/applications/misc/netsurf/libnsfb/default.nix
new file mode 100644
index 000000000000..24235f43a114
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/netsurf/libnsfb/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, pkgconfig, uilib? "framebuffer", SDL
+, buildsystem
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "netsurf-${libname}-${version}";
+  libname = "libnsfb";
+  version = "0.1.4";
+
+  src = fetchurl {
+    url = "http://download.netsurf-browser.org/libs/releases/${libname}-${version}-src.tar.gz";
+    sha256 = "176f8why9gzbaca9nnxjqasl02qzc6g507z5w3dzkcjifnkz4mzl";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ buildsystem SDL ];
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "NSSHARED=${buildsystem}/share/netsurf-buildsystem"
+    "TARGET=${uilib}"
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = http://www.netsurf-browser.org/;
+    description = "CSS parser and selection library for netsurf browser";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/netsurf/libnsgif/default.nix b/nixpkgs/pkgs/applications/misc/netsurf/libnsgif/default.nix
new file mode 100644
index 000000000000..836bfd5f3e0a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/netsurf/libnsgif/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pkgconfig
+, buildsystem
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "netsurf-${libname}-${version}";
+  libname = "libnsgif";
+  version = "0.1.3";
+
+  src = fetchurl {
+    url = "http://download.netsurf-browser.org/libs/releases/${libname}-${version}-src.tar.gz";
+    sha256 = "1a4z45gh0fw4iybf34fig725av25h31ffk0azi0snzh4130cklnk";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ buildsystem];
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "NSSHARED=${buildsystem}/share/netsurf-buildsystem"
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = http://www.netsurf-browser.org/;
+    description = "GIF Decoder for netsurf browser";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/netsurf/libnsutils/default.nix b/nixpkgs/pkgs/applications/misc/netsurf/libnsutils/default.nix
new file mode 100644
index 000000000000..1e8dbe271370
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/netsurf/libnsutils/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pkgconfig
+, buildsystem
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "netsurf-${libname}-${version}";
+  libname = "libnsutils";
+  version = "0.0.2";
+
+  src = fetchurl {
+    url = "http://download.netsurf-browser.org/libs/releases/${libname}-${version}-src.tar.gz";
+    sha256 = "03p4xmd08yhj70nyj7acjccmmshs59lv4n4zsqpsn5lgkwa23lzy";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ buildsystem];
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "NSSHARED=${buildsystem}/share/netsurf-buildsystem"
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = http://www.netsurf-browser.org/;
+    description = "Generalised utility library for netsurf browser";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/netsurf/libparserutils/default.nix b/nixpkgs/pkgs/applications/misc/netsurf/libparserutils/default.nix
new file mode 100644
index 000000000000..ed9433b9f570
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/netsurf/libparserutils/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, perl
+, buildsystem
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "netsurf-${libname}-${version}";
+  libname = "libparserutils";
+  version = "0.2.3";
+
+  src = fetchurl {
+    url = "http://download.netsurf-browser.org/libs/releases/${libname}-${version}-src.tar.gz";
+    sha256 = "01gzlsabgl6x0icd8758d9jqs8rrf9574bdkjainn04w3fs3znf5";
+  };
+
+  buildInputs = [ buildsystem perl ];
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "NSSHARED=${buildsystem}/share/netsurf-buildsystem"
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = http://www.netsurf-browser.org/;
+    description = "Parser building library for netsurf browser";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/netsurf/libutf8proc/default.nix b/nixpkgs/pkgs/applications/misc/netsurf/libutf8proc/default.nix
new file mode 100644
index 000000000000..a905f3a12a8f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/netsurf/libutf8proc/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pkgconfig
+, buildsystem
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "netsurf-${libname}-${version}";
+  libname = "libutf8proc";
+  version = "1.3.1";
+
+  src = fetchurl {
+    url = "http://download.netsurf-browser.org/libs/releases/${libname}-${version}-src.tar.gz";
+    sha256 = "0xf659y3c6ikjnip47r30wv796a34d71p6qhc4xjs64iqszm1sbq";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ buildsystem];
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "NSSHARED=${buildsystem}/share/netsurf-buildsystem"
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = http://www.netsurf-browser.org/;
+    description = "UTF8 Processing library for netsurf browser";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/netsurf/libwapcaplet/default.nix b/nixpkgs/pkgs/applications/misc/netsurf/libwapcaplet/default.nix
new file mode 100644
index 000000000000..509cbeb4503f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/netsurf/libwapcaplet/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl
+, buildsystem
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "netsurf-${libname}-${version}";
+  libname = "libwapcaplet";
+  version = "0.3.0";
+
+  src = fetchurl {
+    url = "http://download.netsurf-browser.org/libs/releases/${libname}-${version}-src.tar.gz";
+    sha256 = "0cs1dd2afjgc3wf5gqg434hv6jdabrp9qvlpl4dp53nhkyfywna3";
+  };
+
+  buildInputs = [ buildsystem ];
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "NSSHARED=${buildsystem}/share/netsurf-buildsystem"
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = http://www.netsurf-browser.org/;
+    description = "String internment library for netsurf browser";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/netsurf/nsgenbind/default.nix b/nixpkgs/pkgs/applications/misc/netsurf/nsgenbind/default.nix
new file mode 100644
index 000000000000..971e16848ae7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/netsurf/nsgenbind/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl
+, flex, bison
+, buildsystem
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "netsurf-nsgenbind-${version}";
+  version = "0.3";
+
+  src = fetchurl {
+    url = "http://download.netsurf-browser.org/libs/releases/nsgenbind-${version}-src.tar.gz";
+    sha256 = "16xsazly7gxwywmlkf2xix9b924sj3skhgdak7218l0nc62a08gg";
+  };
+
+  buildInputs = [ buildsystem flex bison ];
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "NSSHARED=${buildsystem}/share/netsurf-buildsystem"
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = http://www.netsurf-browser.org/;
+    description = "Generator for JavaScript bindings for netsurf browser";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/nix-tour/default.nix b/nixpkgs/pkgs/applications/misc/nix-tour/default.nix
new file mode 100644
index 000000000000..1cc7f419aa2e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/nix-tour/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchgit, electron, runtimeShell } :
+
+stdenv.mkDerivation rec {
+  name = "nix-tour-${version}";
+  version = "0.0.1";
+
+  buildInputs = [ electron ];
+
+  src = fetchgit {
+    url = "https://github.com/nixcloud/tour_of_nix";
+    rev = "v${version}";
+    sha256 = "09b1vxli4zv1nhqnj6c0vrrl51gaira94i8l7ww96fixqxjgdwvb";
+  };
+
+  phases = [ "unpackPhase" "installPhase" ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mkdir -p $out/share
+    cp -R * $out/share
+    chmod 0755 $out/share/ -R
+    echo "#!${runtimeShell}" > $out/bin/nix-tour
+    echo "cd $out/share/" >> $out/bin/nix-tour
+    echo "${electron}/bin/electron $out/share/electron-main.js" >> $out/bin/nix-tour
+    chmod 0755 $out/bin/nix-tour
+  '';
+
+  meta = with stdenv.lib; {
+    description = "'the tour of nix' from nixcloud.io/tour as offline version";
+    homepage = https://nixcloud.io/tour;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ qknight ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/nixnote2/default.nix b/nixpkgs/pkgs/applications/misc/nixnote2/default.nix
new file mode 100644
index 000000000000..145abfba5d5c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/nixnote2/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, mkDerivation, fetchFromGitHub, boost
+, qtbase, qtwebkit, poppler, qmake, hunspell, html-tidy}:
+
+mkDerivation rec {
+  name = "nixnote2-${version}";
+  version = "2.0.2";
+
+  src = fetchFromGitHub {
+    owner = "baumgarr";
+    repo = "nixnote2";
+    rev = "v${version}";
+    sha256 = "0cfq95mxvcgby66r61gclm1a2c6zck5aln04xmg2q8kg6p9d31fr";
+  };
+
+  buildInputs = [ boost qtbase qtwebkit poppler hunspell ];
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ qmake ];
+
+  postPatch = ''
+    # Fix location of poppler-qt5.h
+    for f in threads/indexrunner.cpp html/noteformatter.cpp utilities/noteindexer.cpp gui/plugins/popplerviewer.h gui/plugins/pluginfactory.h gui/plugins/popplerviewer.cpp ; do
+      substituteInPlace $f \
+        --replace '#include <poppler-qt5.h>' '#include <poppler/qt5/poppler-qt5.h>'
+    done
+
+    substituteInPlace help/about.html --replace '__VERSION__' '${version}'
+
+    substituteInPlace nixnote.cpp --replace 'tidyProcess.start("tidy' 'tidyProcess.start("${html-tidy}/bin/tidy'
+  '';
+
+  postInstall = ''
+    cp images/windowIcon.png $out/share/pixmaps/nixnote2.png
+    cp theme.ini $out/share/nixnote2/theme.ini
+  '';
+
+  meta = with stdenv.lib; {
+    description = "An unofficial client of Evernote";
+    homepage = http://www.nixnote.org/;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ htr ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/nnn/default.nix b/nixpkgs/pkgs/applications/misc/nnn/default.nix
new file mode 100644
index 000000000000..c38a27d55e63
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/nnn/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, pkgconfig, ncurses, readline, conf ? null }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  pname = "nnn";
+  version = "2.5";
+
+  src = fetchFromGitHub {
+    owner = "jarun";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0hvb0q6jg2nmvb40q43jj7v45afkjgcq6q9ldmmrh5558d0n65cw";
+  };
+
+  configFile = optionalString (conf!=null) (builtins.toFile "nnn.h" conf);
+  preBuild = optionalString (conf!=null) "cp ${configFile} nnn.h";
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ readline ncurses ];
+
+  makeFlags = [ "DESTDIR=${placeholder "out"}" "PREFIX=" ];
+
+  # shell completions
+  postInstall = ''
+    install -Dm555 scripts/auto-completion/bash/nnn-completion.bash $out/share/bash-completion/completions/nnn.bash
+    install -Dm555 scripts/auto-completion/zsh/_nnn -t $out/share/zsh/site-functions
+    install -Dm555 scripts/auto-completion/fish/nnn.fish -t $out/share/fish/vendor_completions.d
+  '';
+
+  meta = {
+    description = "Small ncurses-based file browser forked from noice";
+    homepage = https://github.com/jarun/nnn;
+    license = licenses.bsd2;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ jfrankenau ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/noice/default.nix b/nixpkgs/pkgs/applications/misc/noice/default.nix
new file mode 100644
index 000000000000..bcf2edd8f2f6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/noice/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchgit, ncurses, conf ? null }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "noice-${version}";
+  version = "0.6";
+
+  src = fetchgit {
+    url = "git://git.2f30.org/noice.git";
+    rev = "refs/tags/v${version}";
+    sha256 = "03rwglcy47fh6rb630vws10m95bxpcfv47nxrlws2li2ljam8prw";
+  };
+
+  configFile = optionalString (conf!=null) (builtins.toFile "config.def.h" conf);
+  preBuild = optionalString (conf!=null) "cp ${configFile} config.def.h";
+
+  buildInputs = [ ncurses ];
+
+  buildFlags = [ "LDLIBS=-lncurses" ];
+
+  installFlags = [ "DESTDIR=$(out)" "PREFIX=" ];
+
+  meta = {
+    description = "Small ncurses-based file browser";
+    homepage = https://git.2f30.org/noice/;
+    license = licenses.bsd2;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ jfrankenau ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/notable/default.nix b/nixpkgs/pkgs/applications/misc/notable/default.nix
new file mode 100644
index 000000000000..055728ee046c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/notable/default.nix
@@ -0,0 +1,30 @@
+{ appimageTools, fetchurl, lib, gsettings-desktop-schemas, gtk3 }:
+
+let
+  pname = "notable";
+  version = "1.4.0";
+in
+appimageTools.wrapType2 rec {
+  name = "${pname}-${version}";
+  src = fetchurl {
+    url = "https://github.com/notable/notable/releases/download/v${version}/Notable.${version}.AppImage";
+    sha256 = "0ldmxnhqcphr92rb7imgb1dfx7bb3p515nrdds8jn4b8x6jgmnjr";
+  };
+
+  profile = ''
+    export LC_ALL=C.UTF-8
+    export XDG_DATA_DIRS=${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS
+  '';
+
+  multiPkgs = null; # no 32bit needed
+  extraPkgs = appimageTools.defaultFhsEnvArgs.multiPkgs;
+  extraInstallCommands = "mv $out/bin/{${name},${pname}}";
+
+  meta = with lib; {
+    description = "The markdown-based note-taking app that doesn't suck";
+    homepage = https://github.com/notable/notable;
+    license = licenses.agpl3;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/notejot/default.nix b/nixpkgs/pkgs/applications/misc/notejot/default.nix
new file mode 100644
index 000000000000..a732a5ed536e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/notejot/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchFromGitHub, pkgconfig, meson, ninja, python3, pantheon
+, gtk3, gtksourceview, json-glib, gnome3, wrapGAppsHook }:
+
+stdenv.mkDerivation rec {
+  pname = "notejot";
+  version = "1.5.5";
+
+  src = fetchFromGitHub {
+    owner = "lainsce";
+    repo = pname;
+    rev = version;
+    sha256 = "0khf6mwidybfgnq4zmhf3af4w6aicipmi12fvs722fqlf1lrkdmd";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pantheon.vala
+    pkgconfig
+    python3
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gnome3.libgee
+    gtk3
+    gtksourceview
+    json-glib
+    pantheon.elementary-icon-theme
+    pantheon.granite
+  ];
+
+  postPatch = ''
+    chmod +x meson/post_install.py
+    patchShebangs meson/post_install.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Stupidly-simple sticky notes applet";
+    homepage = https://github.com/lainsce/notejot;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ worldofpeace ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/notify-osd-customizable/default.nix b/nixpkgs/pkgs/applications/misc/notify-osd-customizable/default.nix
new file mode 100644
index 000000000000..d4f3db4ca6f9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/notify-osd-customizable/default.nix
@@ -0,0 +1,48 @@
+{ stdenv
+, dbus-glib
+, fetchurl
+, glib
+, gnome3
+, libnotify
+, libtool
+, libwnck3
+, makeWrapper
+, pkgconfig
+, gsettings-desktop-schemas
+}:
+
+let baseURI = "https://launchpad.net/~leolik/+archive/leolik";
+in stdenv.mkDerivation rec {
+  name = "notify-osd-${version}";
+  version = "0.9.35+16.04.20160415";
+
+  src = fetchurl {
+    url = "${baseURI}/+files/notify-osd_${version}-0ubuntu1-leolik~ppa0.tar.gz";
+    sha256 = "026dr46jh3xc4103wnslzy7pxbxkkpflh52c59j8vzwaa7bvvzkv";
+    name = "notify-osd-customizable.tar.gz";
+  };
+
+  preConfigure = "./autogen.sh --libexecdir=$(out)/bin";
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    glib libwnck3 libnotify dbus-glib makeWrapper
+    gsettings-desktop-schemas gnome3.gnome-common
+    libtool
+  ];
+
+  configureFlags = "--libexecdir=$(out)/bin";
+
+  preFixup = ''
+    wrapProgram "$out/bin/notify-osd" \
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Daemon that displays passive pop-up notifications";
+    homepage = https://launchpad.net/notify-osd;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.imalison ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/notify-osd/default.nix b/nixpkgs/pkgs/applications/misc/notify-osd/default.nix
new file mode 100644
index 000000000000..5c60c7412c4a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/notify-osd/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, pkgconfig, glib, libwnck3, libnotify, dbus-glib, makeWrapper, gsettings-desktop-schemas }:
+
+stdenv.mkDerivation rec {
+  name = "notify-osd-${version}";
+  version = "0.9.34";
+
+  src = fetchurl {
+    url = "https://launchpad.net/notify-osd/precise/${version}/+download/notify-osd-${version}.tar.gz";
+    sha256 = "0g5a7a680b05x27apz0y1ldl5csxpp152wqi42s107jymbp0s20j";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    glib libwnck3 libnotify dbus-glib makeWrapper
+    gsettings-desktop-schemas
+  ];
+
+  configureFlags = [ "--libexecdir=$(out)/bin" ];
+
+  preFixup = ''
+    wrapProgram "$out/bin/notify-osd" \
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Daemon that displays passive pop-up notifications";
+    homepage = https://launchpad.net/notify-osd;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.bodil ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/nrsc5/default.nix b/nixpkgs/pkgs/applications/misc/nrsc5/default.nix
new file mode 100644
index 000000000000..69f74d66dd01
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/nrsc5/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, fetchFromGitHub,
+  autoconf, automake, libtool, cmake,
+  rtl-sdr, libao, fftwFloat
+} :
+let
+  src_faad2 = fetchFromGitHub {
+    owner = "dsvensson";
+    repo = "faad2";
+    rev = "b7aa099fd3220b71180ed2b0bc19dc6209a1b418";
+    sha256 = "0pcw2x9rjgkf5g6irql1j4m5xjb4lxj6468z8v603921bnir71mf";
+  };
+
+  version = "1.0";
+
+in stdenv.mkDerivation {
+  name = "nrsc5-${version}";
+
+  src = fetchFromGitHub {
+    owner = "theori-io";
+    repo = "nrsc5";
+    rev = "v${version}";
+    sha256 = "09zzh3h1zzf2lwrbz3i7rif2hw36d9ska8irvxaa9lz6xc1y68pg";
+  };
+
+  postUnpack = ''
+    export srcRoot=`pwd`
+    export faadSrc="$srcRoot/faad2-prefix/src/faad2_external"
+    mkdir -p $faadSrc
+    cp -r ${src_faad2}/* $faadSrc
+    chmod -R u+w $faadSrc
+  '';
+
+  postPatch = ''
+    sed -i '/GIT_REPOSITORY/d' CMakeLists.txt
+    sed -i '/GIT_TAG/d' CMakeLists.txt
+    sed -i "s:set (FAAD2_PREFIX .*):set (FAAD2_PREFIX \"$srcRoot/faad2-prefix\"):" CMakeLists.txt
+  '';
+
+  nativeBuildInputs = [ cmake autoconf automake libtool ];
+  buildInputs = [ rtl-sdr libao fftwFloat ];
+
+  cmakeFlags = [ "-DUSE_COLOR=ON" "-DUSE_FAAD2=ON" ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/theori-io/nrsc5;
+    description = "HD-Radio decoder for RTL-SDR";
+    platforms = stdenv.lib.platforms.linux;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ markuskowa ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/nut/default.nix b/nixpkgs/pkgs/applications/misc/nut/default.nix
new file mode 100644
index 000000000000..816918ca0638
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/nut/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, pkgconfig, neon, libusb, openssl, udev, avahi, freeipmi
+, libtool, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "nut-2.7.4";
+
+  src = fetchurl {
+    url = "http://www.networkupstools.org/source/2.7/${name}.tar.gz";
+    sha256 = "19r5dm07sfz495ckcgbfy0pasx0zy3faa0q7bih69lsjij8q43lq";
+  };
+
+  buildInputs = [ neon libusb openssl udev avahi freeipmi libtool ];
+
+  nativeBuildInputs = [ pkgconfig makeWrapper ];
+
+  configureFlags =
+    [ "--with-all"
+      "--with-ssl"
+      "--without-snmp" # Until we have it ...
+      "--without-powerman" # Until we have it ...
+      "--without-cgi"
+      "--without-hal"
+      "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
+      "--with-udev-dir=$(out)/etc/udev"
+    ];
+
+  enableParallelBuilding = true;
+
+
+  postInstall = ''
+    wrapProgram $out/bin/nut-scanner --prefix LD_LIBRARY_PATH : \
+      "$out/lib:${neon}/lib:${libusb.out}/lib:${avahi}/lib:${freeipmi}/lib"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Network UPS Tools";
+    longDescription = ''
+      Network UPS Tools is a collection of programs which provide a common
+      interface for monitoring and administering UPS, PDU and SCD hardware.
+      It uses a layered approach to connect all of the parts.
+    '';
+    homepage = http://www.networkupstools.org/;
+    repositories.git = https://github.com/networkupstools/nut.git;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.pierron ];
+    license = with licenses; [ gpl1Plus gpl2Plus gpl3Plus ];
+    priority = 10;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/ocropus/default.nix b/nixpkgs/pkgs/applications/misc/ocropus/default.nix
new file mode 100644
index 000000000000..a604349afb01
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ocropus/default.nix
@@ -0,0 +1,59 @@
+{ stdenv, fetchFromGitHub, fetchurl, pythonPackages, curl }:
+
+let
+  getmodel = name: sha256: {
+    inherit name;
+    src = fetchurl {
+      url = "http://www.tmbdev.net/ocropy/${name}";
+      inherit sha256;
+    };
+  };
+
+  models = [
+    (getmodel "en-default.pyrnn.gz"
+      "1xyi3k3p81mfw0491gb1haisazfyi2i18f1wjs1m34ak39qfqjdp")
+    (getmodel "fraktur.pyrnn.gz"
+      "1wlwvxn91ilgmlri1hj81arl3mbzxc24ycdnkf5icq4hdi4c6y8b")
+  ];
+
+in
+pythonPackages.buildPythonApplication rec {
+  pname = "ocropus";
+  version = "1.3.3";
+
+  src = fetchFromGitHub {
+    sha256 = "02p1334mic5cfhvpfphfrbim4036yfd8s2zzpwm0xmm829z71nr7";
+    rev = "v${version}";
+    repo = "ocropy";
+    owner = "tmbdev";
+  };
+
+  propagatedBuildInputs = with pythonPackages; [ curl numpy scipy pillow
+    matplotlib beautifulsoup4 pygtk lxml ];
+
+  enableParallelBuilding = true;
+
+  preConfigure = with stdenv.lib; ''
+    ${concatStrings (map (x: "cp -R ${x.src} models/`basename ${x.name}`;")
+      models)}
+
+    substituteInPlace ocrolib/common.py --replace /usr/local $out
+    substituteInPlace ocrolib/default.py --replace /usr/local $out
+  '';
+
+  doCheck = false;  # fails
+  checkPhase = ''
+    patchShebangs .
+    substituteInPlace ./run-test \
+      --replace 'ocropus-rpred' 'ocropus-rpred -Q $NIX_BUILD_CORES'
+    PATH=".:$PATH" ./run-test
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Open source document analysis and OCR system";
+    license = licenses.asl20;
+    homepage = https://github.com/tmbdev/ocropy/;
+    maintainers = with maintainers; [ domenkozar ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/octoprint/default.nix b/nixpkgs/pkgs/applications/misc/octoprint/default.nix
new file mode 100644
index 000000000000..c0bacc2c50d2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/octoprint/default.nix
@@ -0,0 +1,101 @@
+{ stdenv, lib, fetchFromGitHub, python2 }:
+
+let
+  mkOverride = attrname: version: sha256:
+    self: super: {
+      ${attrname} = super.${attrname}.overridePythonAttrs (oldAttrs: {
+        inherit version;
+        src = oldAttrs.src.override {
+          inherit version sha256;
+        };
+      });
+    };
+
+  py = python2.override {
+    packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) ([
+      (mkOverride "flask"       "0.10.1" "0wrkavjdjndknhp8ya8j850jq7a1cli4g5a93mg8nh1xz2gq50sc")
+      (mkOverride "flask_login" "0.2.11" "1rg3rsjs1gwi2pw6vr9jmhaqm9b3vc9c4hfcsvp4y8agbh7g3mc3")
+      (mkOverride "tornado"     "4.5.3"  "02jzd23l4r6fswmwxaica9ldlyc2p6q8dk6dyff7j58fmdzf853d")
+
+      # Octoprint holds back jinja2 to 2.8.1 due to breaking changes.
+      # This old version does not have updated test config for pytest 4,
+      # and pypi tarball doesn't contain tests dir anyways.
+      (pself: psuper: {
+        jinja2 = psuper.jinja2.overridePythonAttrs (oldAttrs: rec {
+          version = "2.8.1";
+          src = oldAttrs.src.override {
+            inherit version;
+            sha256 = "14aqmhkc9rw5w0v311jhixdm6ym8vsm29dhyxyrjfqxljwx1yd1m";
+          };
+          doCheck = false;
+        });
+      })
+    ]);
+  };
+
+  ignoreVersionConstraints = [
+    "Click"
+    "Flask-Assets"
+    "Flask-Babel"
+    "Flask-Principal"
+    "emoji"
+    "flask"
+    "future"
+    "futures"
+    "monotonic"
+    "markdown"
+    "pkginfo"
+    "psutil"
+    "pyserial"
+    "requests"
+    "rsa"
+    "sarge"
+    "scandir"
+    "semantic_version"
+    "watchdog"
+    "websocket-client"
+    "wrapt"
+    "sentry-sdk"
+  ];
+
+in py.pkgs.buildPythonApplication rec {
+  pname = "OctoPrint";
+  version = "1.3.11";
+
+  src = fetchFromGitHub {
+    owner  = "foosel";
+    repo   = "OctoPrint";
+    rev    = version;
+    sha256 = "1102ki1819wsmkfg4riz4i0hjlr3w6nsvk8wrzqq0lc0s5ycf4jx";
+  };
+
+  propagatedBuildInputs = with py.pkgs; [
+    awesome-slugify flask_assets rsa requests pkginfo watchdog
+    semantic-version flask_principal werkzeug flaskbabel tornado
+    psutil pyserial flask_login netaddr markdown sockjs-tornado
+    pylru pyyaml sarge feedparser netifaces click websocket_client
+    scandir chainmap future futures wrapt monotonic emoji
+    frozendict cachelib sentry-sdk typing
+  ] ++ lib.optionals stdenv.isDarwin [ py.pkgs.appdirs ];
+
+  checkInputs = with py.pkgs; [ nose mock ddt ];
+
+  postPatch = ''
+    sed -r -i \
+      ${lib.concatStringsSep "\n" (map (e:
+        ''-e 's@${e}[<>=]+.*@${e}",@g' \''
+      ) ignoreVersionConstraints)}
+      setup.py
+  '';
+
+  checkPhase = ''
+    HOME=$(mktemp -d) nosetests ${lib.optionalString stdenv.isDarwin "--exclude=test_set_external_modification"}
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://octoprint.org/;
+    description = "The snappy web interface for your 3D printer";
+    license = licenses.agpl3;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/octoprint/m33-fio-one-library.patch b/nixpkgs/pkgs/applications/misc/octoprint/m33-fio-one-library.patch
new file mode 100644
index 000000000000..24c9c4a80f5d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/octoprint/m33-fio-one-library.patch
@@ -0,0 +1,175 @@
+From 314bcebfcd1759981ce12255be29d8ae68cd400b Mon Sep 17 00:00:00 2001
+From: Nikolay Amiantov <ab@fmap.me>
+Date: Wed, 23 Nov 2016 00:40:48 +0300
+Subject: [PATCH] Build and use one version of preprocessor library
+
+---
+ octoprint_m33fio/__init__.py   | 73 ++----------------------------------------
+ shared library source/Makefile | 62 +++--------------------------------
+ 2 files changed, 6 insertions(+), 129 deletions(-)
+
+diff --git a/octoprint_m33fio/__init__.py b/octoprint_m33fio/__init__.py
+index 054870a..4d5ecc1 100755
+--- a/octoprint_m33fio/__init__.py
++++ b/octoprint_m33fio/__init__.py
+@@ -1189,78 +1189,9 @@ class M33FioPlugin(
+ 		# Check if using shared library or checking if it is usable
+ 		if self._settings.get_boolean(["UseSharedLibrary"]) or isUsable :
+ 	
+-			# Check if running on Linux
+-			if platform.uname()[0].startswith("Linux") :
+-
+-				# Check if running on a Raspberry Pi 1
+-				if platform.uname()[4].startswith("armv6l") and self.getCpuHardware() == "BCM2708" :
+-	
+-					# Set shared library
+-					self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_arm1176jzf-s.so")
+-	
+-				# Otherwise check if running on a Raspberry Pi 2 or Raspberry Pi 3
+-				elif platform.uname()[4].startswith("armv7l") and self.getCpuHardware() == "BCM2709" :
+-	
+-					# Set shared library
+-					self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_arm_cortex-a7.so")
+-	
+-				# Otherwise check if running on an ARM7 device
+-				elif platform.uname()[4].startswith("armv7") :
+-	
+-					# Set shared library
+-					self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_arm7.so")
+-	
+-				# Otherwise check if using an i386 or x86-64 device
+-				elif platform.uname()[4].endswith("86") or platform.uname()[4].endswith("64") :
+-
+-					# Check if Python is running as 32-bit
+-					if platform.architecture()[0].startswith("32") :
+-		
+-						# Set shared library
+-						self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_i386.so")
+-	
+-					# Otherwise check if Python is running as 64-bit
+-					elif platform.architecture()[0].startswith("64") :
+-		
+-						# Set shared library
+-						self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_x86-64.so")
+-
+-			# Otherwise check if running on Windows and using an i386 or x86-64 device
+-			elif platform.uname()[0].startswith("Windows") and (platform.uname()[4].endswith("86") or platform.uname()[4].endswith("64")) :
++			# Set shared library
++			self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace('\\', '/') + "/static/libraries/libpreprocessor.so")
+ 
+-				# Check if Python is running as 32-bit
+-				if platform.architecture()[0].startswith("32") :
+-	
+-					# Set shared library
+-					self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_i386.dll")
+-
+-				# Otherwise check if Python is running as 64-bit
+-				elif platform.architecture()[0].startswith("64") :
+-	
+-					# Set shared library
+-					self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_x86-64.dll")
+-
+-			# Otherwise check if running on macOS and using an i386 or x86-64 device
+-			elif platform.uname()[0].startswith("Darwin") and (platform.uname()[4].endswith("86") or platform.uname()[4].endswith("64")) :
+-
+-				# Check if Python is running as 32-bit
+-				if platform.architecture()[0].startswith("32") :
+-	
+-					# Set shared library
+-					self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_i386.dylib")
+-
+-				# Otherwise check if Python is running as 64-bit
+-				elif platform.architecture()[0].startswith("64") :
+-	
+-					# Set shared library
+-					self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_x86-64.dylib")
+-			
+-			# Otherwise check if running FreeBSD
+-			elif platform.uname()[0].startswith("FreeBSD") :
+-			
+-				# TODO: Compile FreeBSD shared library pre-processors
+-				pass
+-			
+ 			# Check if shared library was set
+ 			if self.sharedLibrary :
+ 
+diff --git a/shared library source/Makefile b/shared library source/Makefile
+index 792b4f4..4c74f5c 100755
+--- a/shared library source/Makefile	
++++ b/shared library source/Makefile	
+@@ -1,68 +1,14 @@
+-# Target platform options: LINUX32, LINUX64, WINDOWS32, WINDOWS64, PI, PI2, ARM7, MACOS32, MACOS64
+-LIBRARY_NAME = preprocessor
+-TARGET_PLATFORM = LINUX64
++LIBRARY_NAME = libpreprocessor
+ VER = .1
+ 
+-ifeq ($(TARGET_PLATFORM), LINUX32)
+-	PROG = $(LIBRARY_NAME)_i386.so
+-	CC = g++
+-	CFLAGS = -fPIC -m32 -static-libgcc -O3 -Wl,-soname,$(PROG)$(VER) -static-libstdc++
+-endif
+-
+-ifeq ($(TARGET_PLATFORM), LINUX64)
+-	PROG = $(LIBRARY_NAME)_x86-64.so
+-	CC = g++
+-	CFLAGS = -fPIC -m64 -static-libgcc -O3 -Wl,-soname,$(PROG)$(VER) -static-libstdc++
+-endif
+-
+-ifeq ($(TARGET_PLATFORM), WINDOWS32)
+-	PROG = $(LIBRARY_NAME)_i386.dll
+-	CC = i686-w64-mingw32-g++
+-	CFLAGS = -static-libgcc -O3 -Wl,-soname,$(PROG)$(VER) -static-libstdc++
+-endif
+-
+-ifeq ($(TARGET_PLATFORM), WINDOWS64)
+-	PROG = $(LIBRARY_NAME)_x86-64.dll
+-	CC = x86_64-w64-mingw32-g++
+-	CFLAGS = -static-libgcc -O3 -Wl,-soname,$(PROG)$(VER) -static-libstdc++
+-endif
+-
+-ifeq ($(TARGET_PLATFORM), PI)
+-	PROG = $(LIBRARY_NAME)_arm1176jzf-s.so
+-	CC = /opt/arm-toolchain/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
+-	CFLAGS = -fPIC -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -static-libgcc -O3 -Wl,-soname,$(PROG)$(VER) -static-libstdc++
+-endif
+-
+-ifeq ($(TARGET_PLATFORM), PI2)
+-	PROG = $(LIBRARY_NAME)_arm_cortex-a7.so
+-	CC = /opt/arm-toolchain/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
+-	CFLAGS = -fPIC -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -static-libgcc -O3 -Wl,-soname,$(PROG)$(VER) -static-libstdc++
+-endif
+-
+-ifeq ($(TARGET_PLATFORM), ARM7)
+-	PROG = $(LIBRARY_NAME)_arm7.so
+-	CC = /opt/arm-toolchain/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++
+-	CFLAGS = -fPIC -mcpu=generic-armv7-a -mfpu=vfp -mfloat-abi=hard -static-libgcc -O3 -Wl,-soname,$(PROG)$(VER) -static-libstdc++
+-endif
+-
+-ifeq ($(TARGET_PLATFORM), MACOS32)
+-	PROG = $(LIBRARY_NAME)_i386.dylib
+-	CC = clang++
+-	CFLAGS = -fPIC -m32 -stdlib=libc++ -O3 -Wl,-install_name,$(PROG)$(VER)
+-
+-endif
+-
+-ifeq ($(TARGET_PLATFORM), MACOS64)
+-	PROG = $(LIBRARY_NAME)_x86-64.dylib
+-	CC = clang++
+-	CFLAGS = -fPIC -m64 -stdlib=libc++ -O3 -Wl,-install_name,$(PROG)$(VER)
+-endif
++PROG = $(LIBRARY_NAME).so
++CFLAGS = -fPIC -O3 -Wl,-soname,$(PROG)$(VER)
+ 
+ SRCS = preprocessor.cpp gcode.cpp vector.cpp
+ CFLAGS += -Wall -std=c++11 -fvisibility=hidden -shared
+ 
+ all:
+-	$(CC) $(CFLAGS) -o ../octoprint_m33fio/static/libraries/$(PROG) $(SRCS)
++	$(CXX) $(CFLAGS) -o ../octoprint_m33fio/static/libraries/$(PROG) $(SRCS)
+ 
+ clean:
+ 	rm -f ../octoprint_m33fio/static/libraries/$(PROG)
+-- 
+2.14.1
+
diff --git a/nixpkgs/pkgs/applications/misc/octoprint/plugins.nix b/nixpkgs/pkgs/applications/misc/octoprint/plugins.nix
new file mode 100644
index 000000000000..d8179e1b402a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/octoprint/plugins.nix
@@ -0,0 +1,196 @@
+{ stdenv, fetchFromGitHub, octoprint, python2Packages, marlin-calc }:
+
+let
+  buildPlugin = args: python2Packages.buildPythonPackage (args // {
+    pname = "OctoPrintPlugin-${args.pname}";
+    inherit (args) version;
+    propagatedBuildInputs = (args.propagatedBuildInputs or []) ++ [ octoprint ];
+    # none of the following have tests
+    doCheck = false;
+  });
+
+  self = {
+
+    # Deprecated alias
+    m3d-fio = self.m33-fio; # added 2016-08-13
+
+    m33-fio = buildPlugin rec {
+      pname = "M33-Fio";
+      version = "1.21";
+
+      src = fetchFromGitHub {
+        owner = "donovan6000";
+        repo = "M33-Fio";
+        rev = "V${version}";
+        sha256 = "1la3611kkqn8yiwjn6cizc45ri8pnk6ckld1na4nk6mqk88jvjq7";
+      };
+
+      patches = [
+        ./m33-fio-one-library.patch
+      ];
+
+      postPatch = ''
+        rm -rf octoprint_m33fio/static/libraries/*
+        (
+          cd 'shared library source'
+          make
+        )
+      '';
+
+      meta = with stdenv.lib; {
+        description = "OctoPrint plugin for the Micro 3D printer";
+        homepage = https://github.com/donovan6000/M33-Fio;
+        license = licenses.gpl3;
+        maintainers = with maintainers; [ abbradar ];
+      };
+    };
+
+    mqtt = buildPlugin rec {
+      pname = "MQTT";
+      version = "0.8.0";
+
+      src = fetchFromGitHub {
+        owner = "OctoPrint";
+        repo = "OctoPrint-MQTT";
+        rev = version;
+        sha256 = "1318pgwy39gkdqgll3q5lwm7avslgdwyiwb5v8m23cgyh5w8cjq7";
+      };
+
+      propagatedBuildInputs = with python2Packages; [ paho-mqtt ];
+
+      meta = with stdenv.lib; {
+        description = "Publish printer status MQTT";
+        homepage = https://github.com/OctoPrint/OctoPrint-MQTT;
+        license = licenses.agpl3;
+        maintainers = with maintainers; [ peterhoeg ];
+      };
+    };
+
+    titlestatus = buildPlugin rec {
+      pname = "TitleStatus";
+      version = "0.0.4";
+
+      src = fetchFromGitHub {
+        owner = "MoonshineSG";
+        repo = "OctoPrint-TitleStatus";
+        rev = version;
+        sha256 = "1l78xrabn5hcly2mgxwi17nwgnp2s6jxi9iy4wnw8k8icv74ag7k";
+      };
+
+      meta = with stdenv.lib; {
+        description = "Show printers status in window title";
+        homepage = https://github.com/MoonshineSG/OctoPrint-TitleStatus;
+        license = licenses.agpl3;
+        maintainers = with maintainers; [ abbradar ];
+      };
+    };
+
+    stlviewer = buildPlugin rec {
+      pname = "STLViewer";
+      version = "0.4.1";
+
+      src = fetchFromGitHub {
+        owner = "jneilliii";
+        repo = "OctoPrint-STLViewer";
+        rev = "v${version}";
+        sha256 = "1f64s37g2d79g76v0vjnjrc2jp2gwrsnfgx7w3n0hkf1lz1pjkm0";
+      };
+
+      meta = with stdenv.lib; {
+        description = "A simple stl viewer tab for OctoPrint";
+        homepage = https://github.com/jneilliii/Octoprint-STLViewer;
+        license = licenses.agpl3;
+        maintainers = with maintainers; [ abbradar ];
+      };
+    };
+
+    curaenginelegacy = buildPlugin rec {
+      pname = "CuraEngineLegacy";
+      version = "1.0.2";
+
+      src = fetchFromGitHub {
+        owner = "OctoPrint";
+        repo = "OctoPrint-${pname}";
+        rev = version;
+        sha256 = "1cdb276wfyf3wcfj5g3migd6b6aqmkrxncrqjfcfx4j4k3xac965";
+      };
+
+      meta = with stdenv.lib; {
+        description = "Plugin for slicing via Cura Legacy from within OctoPrint";
+        homepage = "https://github.com/OctoPrint/OctoPrint-CuraEngineLegacy";
+        license = licenses.agpl3;
+        maintainers = with maintainers; [ gebner ];
+      };
+    };
+
+    touchui = buildPlugin rec {
+      pname = "TouchUI";
+      version = "0.3.13";
+
+      src = fetchFromGitHub {
+        owner = "BillyBlaze";
+        repo = "OctoPrint-${pname}";
+        rev = version;
+        sha256 = "0qk12ysabdzy6cna3l4f8v3qcnppppwxxsjx2i0xn1nd0cv6yzwh";
+      };
+
+      meta = with stdenv.lib; {
+        description = "Touch friendly interface for a small TFT module or phone for OctoPrint";
+        homepage = "https://github.com/BillyBlaze/OctoPrint-TouchUI";
+        license = licenses.agpl3;
+        maintainers = with maintainers; [ gebner ];
+      };
+    };
+
+    psucontrol = buildPlugin rec {
+      pname = "PSUControl";
+      version = "0.1.8";
+
+      src = fetchFromGitHub {
+        owner = "kantlivelong";
+        repo = "OctoPrint-${pname}";
+        rev = version;
+        sha256 = "0aj38d7b7d5pzmzq841pip18cpg18wy2vrxq2nd13875597y54b8";
+      };
+
+      preConfigure = ''
+        # optional; RPi.GPIO is broken on vanilla kernels
+        sed /RPi.GPIO/d -i requirements.txt
+      '';
+
+      meta = with stdenv.lib; {
+        description = "OctoPrint plugin to control ATX/AUX power supply";
+        homepage = "https://github.com/kantlivelong/OctoPrint-PSUControl";
+        license = licenses.agpl3;
+        maintainers = with maintainers; [ gebner ];
+      };
+    };
+
+    printtimegenius = buildPlugin rec {
+      pname = "PrintTimeGenius";
+      version = "1.3.1";
+
+      src = fetchFromGitHub {
+        owner = "eyal0";
+        repo = "OctoPrint-${pname}";
+        rev = version;
+        sha256 = "0ijv1nxmikv06a00hqqkqri6wnydqh6lwcx07pmvw6jy706jhy28";
+      };
+
+      preConfigure = ''
+        # PrintTimeGenius ships with marlin-calc binaries for multiple architectures
+        rm */analyzers/marlin-calc*
+        sed 's@"{}.{}".format(binary_base_name, machine)@"${marlin-calc}/bin/marlin-calc"@' -i */analyzers/analyze_progress.py
+      '';
+
+      meta = with stdenv.lib; {
+        description = "Better print time estimation for OctoPrint";
+        homepage = "https://github.com/eyal0/OctoPrint-PrintTimeGenius";
+        license = licenses.agpl3;
+        maintainers = with maintainers; [ gebner ];
+      };
+    };
+
+  };
+
+in self
diff --git a/nixpkgs/pkgs/applications/misc/ola/default.nix b/nixpkgs/pkgs/applications/misc/ola/default.nix
new file mode 100644
index 000000000000..e16d9354bb43
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ola/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, bison, flex, pkgconfig
+, libuuid, cppunit, protobuf3_1, zlib, avahi, libmicrohttpd
+, perl, python36 # Replace by python3 after the next update
+}:
+
+stdenv.mkDerivation rec {
+  name = "ola-${version}";
+  version = "0.10.7";
+
+  src = fetchFromGitHub {
+    owner = "OpenLightingProject";
+    repo = "ola";
+    rev = version;
+    sha256 = "18krwrw7w1qzwih8gnmv7r4sah5ppvq7ax65r7l5yjxn3ihwp2kf";
+  };
+
+  nativeBuildInputs = [ autoreconfHook bison flex pkgconfig perl ];
+  buildInputs = [ libuuid cppunit protobuf3_1 zlib avahi libmicrohttpd python36 ];
+  propagatedBuildInputs = [
+    (python36.pkgs.protobuf.override { protobuf = protobuf3_1; })
+    python36.pkgs.numpy
+  ];
+
+  configureFlags = [ "--enable-python-libs" ];
+
+  meta = with stdenv.lib; {
+    description = "A framework for controlling entertainment lighting equipment.";
+    maintainers = [ maintainers.globin ];
+    license = with licenses; [ lgpl21 gpl2Plus ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/omegat.nix b/nixpkgs/pkgs/applications/misc/omegat.nix
new file mode 100644
index 000000000000..660b5db61058
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/omegat.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl, unzip, jdk, makeWrapper}:
+
+stdenv.mkDerivation rec {
+  version = "4.1.5.2";
+  pname = "omegat";
+
+  src = fetchurl {  # their zip has repeated files or something, so no fetchzip
+    url = mirror://sourceforge/project/omegat/OmegaT%20-%20Latest/OmegaT%204.1.5%20update%202/OmegaT_4.1.5_02_Beta_Without_JRE.zip;
+    sha256 = "1mdnsvjgsccpd5xwpqzgva5jjp8yd1akq9aqpild4v6k70lqql2b";
+  };
+
+  buildInputs = [ unzip makeWrapper ];
+
+  unpackCmd = "unzip -o $curSrc";  # tries to go interactive without -o
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -r lib docs images plugins scripts *.txt *.html OmegaT.jar $out/
+
+    cat > $out/bin/omegat <<EOF
+    #! $SHELL -e
+    CLASSPATH="$out/lib"
+    exec ${jdk}/bin/java -jar -Xmx1024M $out/OmegaT.jar "\$@"
+    EOF
+    chmod +x $out/bin/omegat
+  '';
+
+  meta = with stdenv.lib; {
+    description = "The free computer aided translation (CAT) tool for professionals";
+    longDescription = ''
+      OmegaT is a free and open source multiplatform Computer Assisted Translation
+      tool with fuzzy matching, translation memory, keyword search, glossaries, and
+      translation leveraging into updated projects.
+    '';
+    homepage = http://www.omegat.org/;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ t184256 ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/onboard/default.nix b/nixpkgs/pkgs/applications/misc/onboard/default.nix
new file mode 100644
index 000000000000..de2f86e9f9a2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/onboard/default.nix
@@ -0,0 +1,164 @@
+{ fetchurl
+, stdenv
+, substituteAll
+, aspellWithDicts
+, at-spi2-core ? null
+, atspiSupport ? true
+, bash
+, glib
+, glibcLocales
+, gnome3
+, gobject-introspection
+, gsettings-desktop-schemas
+, gtk3
+, hunspell
+, hunspellDicts
+, hunspellWithDicts
+, intltool
+, isocodes
+, libcanberra-gtk3
+, mousetweaks
+, udev
+, libxkbcommon
+, pkgconfig
+, procps
+, python3
+, wrapGAppsHook
+, xorg
+, yelp
+}:
+
+let
+  customHunspell = hunspellWithDicts [hunspellDicts.en-us];
+  majorVersion = "1.4";
+  version = "${majorVersion}.1";
+in python3.pkgs.buildPythonApplication rec {
+  name = "onboard-${version}";
+  src = fetchurl {
+    url = "https://launchpad.net/onboard/${majorVersion}/${version}/+download/${name}.tar.gz";
+    sha256 = "01cae1ac5b1ef1ab985bd2d2d79ded6fc99ee04b1535cc1bb191e43a231a3865";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      inherit mousetweaks;
+    })
+    # Allow loading hunspell dictionaries installed in NixOS system path
+    ./hunspell-use-xdg-datadirs.patch
+  ];
+
+  # For tests
+  LC_ALL = "en_US.UTF-8";
+  doCheck = false;
+  checkInputs = [
+    # for Onboard.SpellChecker.aspell_cmd doctests
+    (aspellWithDicts (dicts: with dicts; [ en ]))
+
+    # for Onboard.SpellChecker.hunspell_cmd doctests
+    customHunspell
+
+    # for Onboard.SpellChecker.hunspell doctests
+    hunspellDicts.en-us
+    hunspellDicts.es-es
+    hunspellDicts.it-it
+
+    python3.pkgs.nose
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    python3
+    python3.pkgs.dbus-python
+    python3.pkgs.distutils_extra
+    python3.pkgs.pyatspi
+    python3.pkgs.pycairo
+    python3.pkgs.pygobject3
+    python3.pkgs.systemd
+  ];
+
+  buildInputs = [
+    bash
+    gnome3.dconf
+    gsettings-desktop-schemas
+    gtk3
+    hunspell
+    isocodes
+    libcanberra-gtk3
+    mousetweaks
+    udev
+    libxkbcommon
+    wrapGAppsHook
+    xorg.libXtst
+    xorg.libxkbfile
+  ] ++ stdenv.lib.optional atspiSupport at-spi2-core;
+
+  nativeBuildInputs = [
+    glibcLocales
+    gobject-introspection # populate GI_TYPELIB_PATH
+    intltool
+    pkgconfig
+  ];
+
+  propagatedUserEnvPkgs = [
+    gnome3.dconf
+  ];
+
+  preBuild = ''
+    # Unnecessary file, has been removed upstream
+    # https://github.com/NixOS/nixpkgs/pull/24986#issuecomment-296114062
+    rm -r Onboard/pypredict/attic
+
+    substituteInPlace  ./scripts/sokSettings.py \
+      --replace "#!/usr/bin/python3" "" \
+      --replace "PYTHON_EXECUTABLE," "\"$out/bin/onboard-settings\"" \
+      --replace '"-cfrom Onboard.settings import Settings\ns = Settings(False)"' ""
+
+    chmod -x ./scripts/sokSettings.py
+
+    patchShebangs .
+
+    substituteInPlace  ./Onboard/LanguageSupport.py \
+      --replace "/usr/share/xml/iso-codes" "${isocodes}/share/xml/iso-codes" \
+      --replace "/usr/bin/yelp" "${yelp}/bin/yelp"
+
+    substituteInPlace  ./Onboard/Indicator.py \
+      --replace   "/usr/bin/yelp" "${yelp}/bin/yelp"
+
+    substituteInPlace  ./gnome/Onboard_Indicator@onboard.org/extension.js \
+      --replace "/usr/bin/yelp" "${yelp}/bin/yelp"
+
+    substituteInPlace  ./Onboard/SpellChecker.py \
+      --replace "/usr/lib" "$out/lib"
+
+    substituteInPlace  ./data/org.onboard.Onboard.service  \
+      --replace "/usr/bin" "$out/bin"
+
+    substituteInPlace  ./Onboard/utils.py \
+      --replace "/usr/share" "$out/share"
+    substituteInPlace  ./onboard-defaults.conf.example \
+      --replace "/usr/share" "$out/share"
+    substituteInPlace  ./Onboard/Config.py \
+      --replace "/usr/share/onboard" "$out/share/onboard"
+
+    substituteInPlace  ./Onboard/WordSuggestions.py \
+      --replace "/usr/bin" "$out/bin"
+
+    # killall is dangerous on non-gnu platforms. Use pkill instead.
+    substituteInPlace  ./setup.py \
+      --replace '"killall",' '"${procps}/bin/pkill", "-x",'
+  '';
+
+  postInstall = ''
+    cp onboard-default-settings.gschema.override.example $out/share/glib-2.0/schemas/10_onboard-default-settings.gschema.override
+
+    glib-compile-schemas $out/share/glib-2.0/schemas/
+  '';
+
+  meta = {
+    homepage = https://launchpad.net/onboard;
+    description = "An onscreen keyboard useful for tablet PC users and for mobility impaired users.";
+    maintainers = with stdenv.lib.maintainers; [ johnramsden ];
+    license = stdenv.lib.licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/onboard/fix-paths.patch b/nixpkgs/pkgs/applications/misc/onboard/fix-paths.patch
new file mode 100644
index 000000000000..64acc9b138c4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/onboard/fix-paths.patch
@@ -0,0 +1,11 @@
+--- a/Onboard/ClickSimulator.py
++++ b/Onboard/ClickSimulator.py
+@@ -479,7 +479,7 @@ class CSMousetweaks(ConfigObject, ClickSimulator):
+         self._daemon_running_notify_callbacks = []
+
+     def _launch_daemon(self, delay):
+-        self.launcher.launch_delayed(["mousetweaks"], delay)
++        self.launcher.launch_delayed(["@mousetweaks@/bin/mousetweaks"], delay)
+
+     def _set_connection(self, active):
+         ''' Update interface object, state and notify listeners '''
diff --git a/nixpkgs/pkgs/applications/misc/onboard/hunspell-use-xdg-datadirs.patch b/nixpkgs/pkgs/applications/misc/onboard/hunspell-use-xdg-datadirs.patch
new file mode 100644
index 000000000000..2463c8d5f5ac
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/onboard/hunspell-use-xdg-datadirs.patch
@@ -0,0 +1,20 @@
+diff --git a/Onboard/SpellChecker.py b/Onboard/SpellChecker.py
+index 6a92757..46e755e 100644
+--- a/Onboard/SpellChecker.py
++++ b/Onboard/SpellChecker.py
+@@ -506,6 +506,10 @@ class hunspell(SCBackend):
+         if dicpath:
+             paths.extend(dicpath.split(pathsep))
+ 
++        datadirs = os.getenv("XDG_DATA_DIRS")
++        if datadirs:
++            paths.extend(map(lambda datadir: os.path.join(datadir, 'hunspell'), datadirs.split(pathsep)))
++
+         paths.extend(LIBDIRS)
+ 
+         home = os.getenv("HOME")
+@@ -723,4 +727,3 @@ class aspell_cmd(SCBackend):
+             _logger.error(_format("Failed to execute '{}', {}", \
+                             " ".join(args), e))
+         return [id for id in dict_ids if id]
+-
diff --git a/nixpkgs/pkgs/applications/misc/oneko/default.nix b/nixpkgs/pkgs/applications/misc/oneko/default.nix
new file mode 100644
index 000000000000..b87f11d7b05d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/oneko/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, imake, gccmakedep, xlibsWrapper }:
+
+stdenv.mkDerivation rec {
+  version_name = "1.2.sakura.5";
+  version = "1.2.5";
+  name = "oneko-${version}";
+  src = fetchurl {
+    url = "http://www.daidouji.com/oneko/distfiles/oneko-${version_name}.tar.gz";
+    sha256 = "2c2e05f1241e9b76f54475b5577cd4fb6670de058218d04a741a04ebd4a2b22f";
+  };
+  nativeBuildInputs = [ imake gccmakedep ];
+  buildInputs = [ xlibsWrapper ];
+
+  makeFlags = [ "BINDIR=$(out)/bin" "MANPATH=$(out)/share/man" ];
+  installTargets = "install install.man";
+
+  meta = with stdenv.lib; {
+    description = "Creates a cute cat chasing around your mouse cursor";
+    longDescription = ''
+    Oneko changes your mouse cursor into a mouse
+    and creates a little cute cat, which starts
+    chasing around your mouse cursor.
+    When the cat is done catching the mouse, it starts sleeping.
+    '';
+    homepage = "http://www.daidouji.com/oneko/";
+    license = licenses.publicDomain;
+    maintainers = [ maintainers.xaverdh ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/openbox-menu/default.nix b/nixpkgs/pkgs/applications/misc/openbox-menu/default.nix
new file mode 100644
index 000000000000..8ff9a2f44d55
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/openbox-menu/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pkgconfig, glib, gtk2, menu-cache }:
+
+stdenv.mkDerivation rec {
+  name = "openbox-menu-${version}";
+  version = "0.8.0";
+
+  src = fetchurl {
+    url = "https://bitbucket.org/fabriceT/openbox-menu/downloads/${name}.tar.bz2";
+    sha256 = "1hi4b6mq97y6ajq4hhsikbkk23aha7ikaahm92djw48mgj2f1w8l";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ glib gtk2 menu-cache ];
+
+  patches = [ ./with-svg.patch ];
+
+  installPhase = "make install prefix=$out";
+
+  meta = {
+    homepage = http://fabrice.thiroux.free.fr/openbox-menu_en.html;
+    description = "Dynamic XDG menu generator for Openbox";
+    longDescription = ''
+      Openbox-menu is a pipemenu for Openbox window manager. It provides a
+      dynamic menu listing installed applications. Most of the work is done by
+      the LXDE library menu-cache.
+    '';
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = [ stdenv.lib.maintainers.romildo ];
+    platforms   = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/openbox-menu/with-svg.patch b/nixpkgs/pkgs/applications/misc/openbox-menu/with-svg.patch
new file mode 100644
index 000000000000..dd6710f5cfc9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/openbox-menu/with-svg.patch
@@ -0,0 +1,11 @@
+--- a/Makefile.old	2013-12-11 06:39:44.397358610 +0100
++++ b/Makefile	2013-12-11 06:39:51.082275037 +0100
+@@ -7,7 +7,7 @@
+ CFLAGS+=-DWITH_ICONS
+ # Uncomment this line if Openbox can display SVG icons 
+ # Check SVG support with '$ ldd /usr/bin/openbox | grep svg', librsvg must appear..
+-# CFLAGS+=-DWITH_SVG
++CFLAGS+=-DWITH_SVG
+ 
+ prefix= /usr/local
+ DESTDIR ?= $(prefix)
diff --git a/nixpkgs/pkgs/applications/misc/openbrf/default.nix b/nixpkgs/pkgs/applications/misc/openbrf/default.nix
new file mode 100644
index 000000000000..b8b6e42d5cf5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/openbrf/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchFromGitHub, qtbase, vcg, glew, qmake, libGLU_combined }:
+
+
+stdenv.mkDerivation {
+  name = "openbrf-unstable-2016-01-09";
+
+  src = fetchFromGitHub {
+    owner = "cfcohen";
+    repo = "openbrf";
+    rev = "4bdc66e38def5e5184f5379c84a7558b7484c70a";
+    sha256 = "16254cnr60ihcn7bki7wl1qm6gkvzb99cn66md1pnb7za8nvzf4j";
+  };
+
+  buildInputs = [ qtbase vcg glew ];
+
+  enableParallelBuilding = true;
+  nativeBuildInputs = [ qmake ];
+
+  qmakeFlags = [ "openBrf.pro" ];
+
+  postPatch = ''
+    sed -i 's,^VCGLIB .*,VCGLIB = ${vcg}/include,' openBrf.pro
+  '';
+
+  installPhase = ''
+    install -Dm755 openBrf $out/share/openBrf/openBrf
+    install -Dm644 carry_positions.txt $out/share/openBrf/carry_positions.txt
+    install -Dm644 reference.brf $out/share/openBrf/reference.brf
+
+    patchelf  \
+      --set-rpath "${stdenv.lib.makeLibraryPath [ qtbase glew stdenv.cc.cc libGLU_combined ]}" \
+      $out/share/openBrf/openBrf
+
+    mkdir -p "$out/bin"
+    ln -s "$out/share/openBrf/openBrf" "$out/bin/openBrf"
+  '';
+
+  dontPatchELF = true;
+
+  meta = with stdenv.lib; {
+    description = "A tool to edit resource files (BRF)";
+    homepage = https://github.com/cfcohen/openbrf;
+    maintainers = with stdenv.lib.maintainers; [ abbradar ];
+    license = licenses.free;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/opencpn/default.nix b/nixpkgs/pkgs/applications/misc/opencpn/default.nix
new file mode 100644
index 000000000000..e4f2fd7ce8b9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/opencpn/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, pkgconfig, cmake, gtk2, wxGTK30, libpulseaudio, curl,
+  gettext, glib, portaudio }:
+
+stdenv.mkDerivation rec {
+  name = "opencpn-${version}";
+  version = "5.0.0";
+
+  src = fetchFromGitHub {
+    owner = "OpenCPN";
+    repo = "OpenCPN";
+    rev = "v${version}";
+    sha256 = "1xv3h6svw9aay5ixpql231md3pf00qxvhg62z88daraf18hlkfja";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ cmake gtk2 wxGTK30 libpulseaudio curl gettext
+                  glib portaudio ];
+
+  cmakeFlags = [
+    "-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include"
+    "-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "A concise ChartPlotter/Navigator";
+    maintainers = [ stdenv.lib.maintainers.kragniz ];
+    platforms = [ "x86_64-linux" ];
+    license = stdenv.lib.licenses.gpl2;
+    homepage = https://opencpn.org/;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/openjump/default.nix b/nixpkgs/pkgs/applications/misc/openjump/default.nix
new file mode 100644
index 000000000000..c98defee57a0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/openjump/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, unzip, runtimeShell }:
+
+stdenv.mkDerivation {
+  name = "openjump-1.3.1";
+
+  src = fetchurl {
+    url = mirror://sourceforge/jump-pilot/OpenJUMP/1.3.1/openjump-1.3.1.zip;
+    sha256 = "0y4z53yx0x7rp3c8rnj028ni3gr47r35apgcpqp3jl7r2di6zgqm";
+  };
+
+  # ln jump.log hack: a different user will probably get a permission denied
+  # error. Still this is better than getting it always.
+  # TODO: build from source and patch this
+  unpackPhase = ''
+    mkdir -p $out/bin;
+    cd $out; unzip $src
+    s=$out/bin/OpenJump
+    dir=$(echo $out/openjump-*)
+    cat >> $s << EOF
+    #!${runtimeShell}
+    cd $dir/bin
+    exec ${stdenv.shell} openjump.sh
+    EOF
+    chmod +x $s
+    ln -s /tmp/openjump.log $dir/bin/jump.log
+  '';
+
+  installPhase = ":";
+
+  buildInputs = [unzip];
+
+  meta = {
+    description = "Open source Geographic Information System (GIS) written in the Java programming language";
+    homepage = http://www.openjump.org/index.html;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [stdenv.lib.maintainers.marcweber];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/opentx/default.nix b/nixpkgs/pkgs/applications/misc/opentx/default.nix
new file mode 100644
index 000000000000..cd9a86e7fac7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/opentx/default.nix
@@ -0,0 +1,62 @@
+{ stdenv, fetchFromGitHub
+, cmake, gcc-arm-embedded, binutils-arm-embedded, python
+, qt5, SDL, gtest
+, dfu-util, avrdude
+}:
+
+let
+
+  version = "2.2.1";
+
+in stdenv.mkDerivation {
+
+  name = "opentx-${version}";
+
+  src = fetchFromGitHub {
+    owner = "opentx";
+    repo = "opentx";
+    rev = version;
+    sha256 = "01lnnkrxach21aivnx1k1iqhih02nixh8c4nk6rpw408p13him9g";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [
+    cmake
+    gcc-arm-embedded binutils-arm-embedded
+  ];
+
+  buildInputs = with qt5; [
+    python python.pkgs.pyqt4
+    qtbase qtmultimedia qttranslations
+    SDL
+  ];
+
+  postPatch = ''
+    sed -i companion/src/burnconfigdialog.cpp -e 's|/usr/.*bin/dfu-util|${dfu-util}/bin/dfu-util|'
+    sed -i companion/src/burnconfigdialog.cpp -e 's|/usr/.*bin/avrdude|${avrdude}/bin/avrdude|'
+  '';
+
+  cmakeFlags = [
+    "-DGTEST_ROOT=${gtest.src}/googletest"
+    "-DQT_TRANSLATIONS_DIR=${qt5.qttranslations}/translations"
+    # XXX I would prefer to include these here, though we will need to file a bug upstream to get that changed.
+    #"-DDFU_UTIL_PATH=${dfu-util}/bin/dfu-util"
+    #"-DAVRDUDE_PATH=${avrdude}/bin/avrdude"
+    "-DNANO=NO"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "OpenTX Companion transmitter support software";
+    longDescription = ''
+      OpenTX Companion is used for many different tasks like loading OpenTX
+      firmware to the radio, backing up model settings, editing settings and
+      running radio simulators.
+    '';
+    homepage = https://open-tx.org/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = [ "i686-linux" "x86_64-linux" ];
+    maintainers = with maintainers; [ elitak ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/orca/default.nix b/nixpkgs/pkgs/applications/misc/orca/default.nix
new file mode 100644
index 000000000000..98ebde981c0a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/orca/default.nix
@@ -0,0 +1,75 @@
+{ stdenv, pkgconfig, fetchurl, buildPythonApplication
+, autoreconfHook, wrapGAppsHook, gobject-introspection
+, intltool, yelp-tools, itstool, libxmlxx3
+, python, pygobject3, gtk3, gnome3, substituteAll
+, at-spi2-atk, at-spi2-core, pyatspi, dbus, dbus-python, pyxdg
+, xkbcomp, procps, lsof, coreutils, gsettings-desktop-schemas
+, speechd, brltty, liblouis, setproctitle, gst_all_1, gst-python
+}:
+
+buildPythonApplication rec {
+  pname = "orca";
+  version = "3.32.0";
+
+  format = "other";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "05jqzlg0f1x53hyl0l9282ynmw37159g6dsbrid12b7sjs12cc1i";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      cat = "${coreutils}/bin/cat";
+      lsof = "${lsof}/bin/lsof";
+      pgrep = "${procps}/bin/pgrep";
+      xkbcomp = "${xkbcomp}/bin/xkbcomp";
+    })
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook wrapGAppsHook pkgconfig libxmlxx3
+    intltool yelp-tools itstool gobject-introspection
+  ];
+
+  propagatedBuildInputs = [
+    pygobject3 pyatspi dbus-python pyxdg brltty liblouis speechd gst-python setproctitle
+  ];
+
+  strictDeps = false;
+
+  buildInputs = [
+    python gtk3 at-spi2-atk at-spi2-core dbus gsettings-desktop-schemas
+    gst_all_1.gstreamer gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good
+  ];
+
+  # Run intltoolize to create po/Makefile.in.in
+  preConfigure = ''
+    intltoolize
+  '';
+
+  passthru = {
+    updateScript = gnome3.updateScript {
+      packageName = pname;
+    };
+  };
+
+  meta = with stdenv.lib; {
+    homepage = https://wiki.gnome.org/Projects/Orca;
+    description = "Screen reader";
+    longDescription = ''
+      A free, open source, flexible and extensible screen reader that provides
+      access to the graphical desktop via speech and refreshable braille.
+      It works with applications and toolkits that support the Assistive
+      Technology Service Provider Interface (AT-SPI). That includes the GNOME
+      Gtk+ toolkit, the Java platform's Swing toolkit, LibreOffice, Gecko, and
+      WebKitGtk. AT-SPI support for the KDE Qt toolkit is being pursued.
+
+      Needs `services.gnome3.at-spi2-core.enable = true;` in `configuration.nix`.
+    '';
+    maintainers = with maintainers; [ berce ] ++ gnome3.maintainers;
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/orca/fix-paths.patch b/nixpkgs/pkgs/applications/misc/orca/fix-paths.patch
new file mode 100644
index 000000000000..ffb56dbe239c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/orca/fix-paths.patch
@@ -0,0 +1,78 @@
+--- a/src/orca/debug.py
++++ b/src/orca/debug.py
+@@ -474,7 +474,7 @@
+     return traceit
+ 
+ def getOpenFDCount(pid):
+-    procs = subprocess.check_output([ 'lsof', '-w', '-Ff', '-p', str(pid)])
++    procs = subprocess.check_output([ '@lsof@', '-w', '-Ff', '-p', str(pid)])
+     procs = procs.decode('UTF-8').split('\n')
+     files = list(filter(lambda s: s and s[0] == 'f' and s[1:].isdigit(), procs))
+ 
+@@ -482,7 +482,7 @@
+ 
+ def getCmdline(pid):
+     try:
+-        openFile = os.popen('cat /proc/%s/cmdline' % pid)
++        openFile = os.popen('@cat@ /proc/%s/cmdline' % pid)
+         cmdline = openFile.read()
+         openFile.close()
+     except:
+@@ -492,7 +492,7 @@
+     return cmdline
+ 
+ def pidOf(procName):
+-    openFile = subprocess.Popen('pgrep %s' % procName,
++    openFile = subprocess.Popen('@pgrep@ %s' % procName,
+                                 shell=True,
+                                 stdout=subprocess.PIPE).stdout
+     pids = openFile.read()
+--- a/src/orca/orca.py
++++ b/src/orca/orca.py
+@@ -239,7 +239,7 @@
+ 
+ def _setXmodmap(xkbmap):
+     """Set the keyboard map using xkbcomp."""
+-    p = subprocess.Popen(['xkbcomp', '-w0', '-', os.environ['DISPLAY']],
++    p = subprocess.Popen(['@xkbcomp@', '-w0', '-', os.environ['DISPLAY']],
+         stdin=subprocess.PIPE, stdout=None, stderr=None)
+     p.communicate(xkbmap)
+ 
+@@ -297,7 +297,7 @@
+     """
+ 
+     global _originalXmodmap
+-    _originalXmodmap = subprocess.check_output(['xkbcomp', os.environ['DISPLAY'], '-'])
++    _originalXmodmap = subprocess.check_output(['@xkbcomp@', os.environ['DISPLAY'], '-'])
+ 
+ def _restoreXmodmap(keyList=[]):
+     """Restore the original xmodmap values for the keys in keyList.
+@@ -309,7 +309,7 @@
+ 
+     global _capsLockCleared
+     _capsLockCleared = False
+-    p = subprocess.Popen(['xkbcomp', '-w0', '-', os.environ['DISPLAY']],
++    p = subprocess.Popen(['@xkbcomp@', '-w0', '-', os.environ['DISPLAY']],
+         stdin=subprocess.PIPE, stdout=None, stderr=None)
+     p.communicate(_originalXmodmap)
+ 
+--- a/src/orca/orca_bin.py.in
++++ b/src/orca/orca_bin.py.in
+@@ -59,7 +59,7 @@
+                 name = "[DEAD]"
+ 
+             try:
+-                cmdline = subprocess.getoutput('cat /proc/%s/cmdline' % pid)
++                cmdline = subprocess.getoutput('@cat@ /proc/%s/cmdline' % pid)
+             except:
+                 cmdline = '(exception encountered)'
+             else:
+@@ -192,7 +192,7 @@
+ def otherOrcas():
+     """Returns the pid of any other instances of Orca owned by this user."""
+ 
+-    openFile = subprocess.Popen('pgrep -u %s orca' % os.getuid(),
++    openFile = subprocess.Popen('@pgrep@ -u %s orca' % os.getuid(),
+                                 shell=True,
+                                 stdout=subprocess.PIPE).stdout
+     pids = openFile.read()
diff --git a/nixpkgs/pkgs/applications/misc/orpie/default.nix b/nixpkgs/pkgs/applications/misc/orpie/default.nix
new file mode 100644
index 000000000000..bc6aa242f338
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/orpie/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, ocamlPackages, ncurses, gsl }:
+
+stdenv.mkDerivation rec {
+  name = "orpie-${version}";
+  version = "1.5.2";
+
+  src = fetchurl {
+    url = "http://pessimization.com/software/orpie/${name}.tar.gz";
+    sha256 = "0v9xgpcf186ni55rkmx008msyszw0ypd6rd98hgwpih8yv3pymfy";
+  };
+
+  buildInputs = [ ncurses gsl ] ++ (with ocamlPackages; [ ocaml camlp4 ]);
+
+  meta = {
+    homepage = https://github.com/pelzlpj/orpie;
+    description = "A fullscreen RPN calculator for the console";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.all;
+    maintainers = with stdenv.lib.maintainers; [ obadz ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/osm2xmap/default.nix b/nixpkgs/pkgs/applications/misc/osm2xmap/default.nix
new file mode 100644
index 000000000000..5787adef2a3e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/osm2xmap/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchFromGitHub, libroxml, proj, libyamlcpp, boost } :
+
+stdenv.mkDerivation rec {
+  name = "osm2xmap-${version}";
+  version = "2.0";
+
+  src = fetchFromGitHub {
+    sha256 = "1d3f18wzk240yp0q8i2vskhcfj5ar61s4hw83vgps0wr2aglph3w";
+    repo = "osm2xmap";
+    owner = "sembruk";
+    rev = "v${version}";
+  };
+
+  makeFlags = [
+    "GIT_VERSION=$(version)"
+    "GIT_TIMESTAMP="
+    "SHAREDIR=$(out)/share/"
+    "INSTALL_BINDIR=$(out)/bin"
+    "INSTALL_MANDIR=$(out)/share/man/man1"
+    "INSTALL_SHAREDIR=$(out)/share/"
+  ];
+
+  installFlags = [ "DESTDIR=$(out)" ];
+
+  buildInputs = [ libroxml proj libyamlcpp boost ];
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/sembruk/osm2xmap";
+    description = "Converter from OpenStreetMap data format to OpenOrienteering Mapper format.";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.mpickering ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/osmctools/default.nix b/nixpkgs/pkgs/applications/misc/osmctools/default.nix
new file mode 100644
index 000000000000..bb53782fb7d2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/osmctools/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchurl, zlib } :
+
+let
+
+  convert_src = fetchurl {
+    url = http://m.m.i24.cc/osmconvert.c;
+    sha256 = "1mvmb171c1jqxrm80jc7qicwk4kgg7yq694n7ci65g6i284r984x";
+    # version = 0.8.5
+  };
+
+  filter_src = fetchurl {
+    url = http://m.m.i24.cc/osmfilter.c;
+    sha256 = "0vm3bls9jb2cb5b11dn82sxnc22qzkf4ghmnkivycigrwa74i6xl";
+    # version = 1.4.0
+  };
+
+in
+
+stdenv.mkDerivation rec {
+  name = "osmctools-${version}";
+  version = "0.8.5plus1.4.0";
+
+  buildInputs = [ zlib ];
+
+  phases = [ "buildPhase" "installPhase" ];
+
+  buildPhase = ''
+    cc ${convert_src} -lz -O3 -o osmconvert
+    cc ${filter_src} -O3 -o osmfilter
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mv osmconvert $out/bin
+    mv osmfilter $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Command line tools for transforming Open Street Map files";
+    homepage = [
+      https://wiki.openstreetmap.org/wiki/Osmconvert
+      https://wiki.openstreetmap.org/wiki/Osmfilter
+    ];
+    platforms = platforms.unix;
+    license = licenses.agpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/osmium-tool/default.nix b/nixpkgs/pkgs/applications/misc/osmium-tool/default.nix
new file mode 100644
index 000000000000..2b35cb770389
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/osmium-tool/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchFromGitHub, cmake, libosmium, protozero, boost, bzip2, zlib, expat }:
+
+stdenv.mkDerivation rec {
+  name = "osmium-tool-${version}";
+  version = "1.10.0";
+
+  src = fetchFromGitHub {
+    owner = "osmcode";
+    repo = "osmium-tool";
+    rev = "v${version}";
+    sha256 = "1balhz78nva0agmbp8n9vg8fhmdssnd9fjxj20bpw7b45mxhjc20";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libosmium protozero boost bzip2 zlib expat ];
+
+  meta = with stdenv.lib; {
+    description = "Multipurpose command line tool for working with OpenStreetMap data based on the Osmium library";
+    homepage = "https://osmcode.org/osmium-tool/";
+    license = with licenses; [ gpl3 mit bsd3 ];
+    maintainers = with maintainers; [ das-g ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/overmind/default.nix b/nixpkgs/pkgs/applications/misc/overmind/default.nix
new file mode 100644
index 000000000000..918924df0b97
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/overmind/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildGoPackage, fetchFromGitHub, tmux, which, makeWrapper }:
+
+buildGoPackage rec {
+  pname = "overmind";
+  version = "2.0.2";
+  goPackagePath = "github.com/DarthSim/overmind";
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postInstall = ''
+    wrapProgram "$bin/bin/overmind" --prefix PATH : "${lib.makeBinPath [ tmux which ]}"
+  '';
+
+  src = fetchFromGitHub {
+    owner = "DarthSim";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0cns19gqkfxsiiyfxhb05cjp1iv2fb40x47gp8djrwwzcd1r6zxh";
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/DarthSim/overmind";
+    description = "Process manager for Procfile-based applications and tmux";
+    license = with licenses; [ mit ];
+    maintainers = [ maintainers.adisbladis ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pbpst/default.nix b/nixpkgs/pkgs/applications/misc/pbpst/default.nix
new file mode 100644
index 000000000000..fcf88200133c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pbpst/default.nix
@@ -0,0 +1,49 @@
+{ llvmPackages, stdenv, fetchFromGitHub
+, python36Packages, which, pkgconfig, curl, git, gettext, jansson
+
+# Optional overrides
+, maxFileSize ? 64 # in MB
+, provider ? "https://ptpb.pw/"
+}:
+
+llvmPackages.stdenv.mkDerivation rec {
+  version = "unstable-2018-01-11";
+  name = "pbpst-${version}";
+
+  src = fetchFromGitHub {
+    owner = "HalosGhost";
+    repo = "pbpst";
+    rev = "ecbe08a0b72a6e4212f09fc6cf52a73506992346";
+    sha256 = "0dwhmw1dg4hg75nlvk5kmvv3slz2n3b9x65q4ig16agwqfsp4mdm";
+  };
+
+  nativeBuildInputs = [
+    python36Packages.sphinx
+    which
+    pkgconfig
+    curl
+    git
+    gettext
+  ];
+  buildInputs = [ curl jansson ];
+
+  patchPhase = ''
+    patchShebangs ./configure
+
+    # Remove hardcoded check for libs in /usr/lib/
+    sed -e '64,67d' -i ./configure
+  '';
+
+  configureFlags = [
+    "--file-max=${toString (maxFileSize * 1024 * 1024)}" # convert to bytes
+    "--provider=${provider}"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "A command-line libcurl C client for pb deployments";
+    inherit (src.meta) homepage;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ tmplt ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pcmanfm/default.nix b/nixpkgs/pkgs/applications/misc/pcmanfm/default.nix
new file mode 100644
index 000000000000..633c1d82159a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pcmanfm/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, glib, intltool, libfm, libX11, pango, pkgconfig
+, wrapGAppsHook, gnome3, withGtk3 ? true, gtk2, gtk3 }:
+
+let
+  libfm' = libfm.override { inherit withGtk3; };
+  gtk = if withGtk3 then gtk3 else gtk2;
+  inherit (stdenv.lib) optional;
+in
+stdenv.mkDerivation rec {
+  name = "pcmanfm-1.3.1";
+  src = fetchurl {
+    url = "mirror://sourceforge/pcmanfm/${name}.tar.xz";
+    sha256 = "0mb8hg76x1z0szdyl0w7jpz0bdblc6a29is1vvnh79z37qxh8138";
+  };
+
+  buildInputs = [ glib gtk libfm' libX11 pango gnome3.adwaita-icon-theme ];
+  nativeBuildInputs = [ pkgconfig wrapGAppsHook intltool ];
+
+  configureFlags = optional withGtk3 "--with-gtk=3";
+
+  meta = with stdenv.lib; {
+    homepage = https://blog.lxde.org/category/pcmanfm/;
+    license = licenses.gpl2Plus;
+    description = "File manager with GTK+ interface";
+    maintainers = [ maintainers.ttuegel ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pcmanx-gtk2/default.nix b/nixpkgs/pkgs/applications/misc/pcmanx-gtk2/default.nix
new file mode 100644
index 000000000000..7fdfbd84d2f6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pcmanx-gtk2/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchFromGitHub, gtk2, libXft, intltool, automake, autoconf, libtool, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "pcmanx-gtk2-${version}";
+  version = "1.3";
+
+  src = fetchFromGitHub {
+    owner = "pcman-bbs";
+    repo = "pcmanx";
+    rev = version;
+    sha256 = "0fbwd149wny67rfhczz4cbh713a1qnswjiz7b6c2bxfcwh51f9rc";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ gtk2 libXft intltool automake autoconf libtool ];
+
+  preConfigure = ''
+    ./autogen.sh
+    # libtoolize generates configure script which uses older version of automake, we need to autoreconf it
+    cd libltdl; autoreconf; cd ..
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://pcman.ptt.cc;
+    license = licenses.gpl2;
+    description = "Telnet BBS browser with GTK+ interface";
+    maintainers = [ maintainers.sifmelcara ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pdf-quench/default.nix b/nixpkgs/pkgs/applications/misc/pdf-quench/default.nix
new file mode 100644
index 000000000000..f604684b19a1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pdf-quench/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchFromGitHub, pkgs, pythonPackages, wrapGAppsHook}:
+
+pythonPackages.buildPythonApplication rec {
+  name = "pdf-quench-${version}";
+  version = "1.0.5";
+
+  src = fetchFromGitHub {
+    owner = "linuxerwang";
+    repo = "pdf-quench";
+    rev = "b72b3970b371026f9a7ebe6003581e8a63af98f6";
+    sha256 = "1rp9rlwr6rarcsxygv5x2c5psgwl6r69k0lsgribgyyla9cf2m7n";
+  };
+
+  nativeBuildInputs = [ wrapGAppsHook ];
+  buildInputs = with pkgs; [
+    gtk3
+    gobject-introspection
+    goocanvas2
+    poppler_gi
+  ];
+  propagatedBuildInputs = with pythonPackages; [ pygobject3 pypdf2 ];
+
+  format = "other";
+  doCheck = false;
+
+  installPhase = ''
+    install -D -T -m 755 src/pdf_quench.py $out/bin/pdf-quench
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/linuxerwang/pdf-quench;
+    description = "A visual tool for cropping pdf files";
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ flokli ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pdfdiff/default.nix b/nixpkgs/pkgs/applications/misc/pdfdiff/default.nix
new file mode 100644
index 000000000000..ee54904bfd66
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pdfdiff/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, pythonPackages, fetchurl, xpdf }:
+let
+  py = pythonPackages;
+in
+py.buildPythonApplication rec {
+  name = "pdfdiff-${version}";
+  version = "0.92";
+
+  src = fetchurl {
+    url = "https://www.cs.ox.ac.uk/people/cas.cremers/downloads/software/pdfdiff.py";
+    sha256 = "0zxwjjbklz87wkbhkmsvhc7xmv5php7m2a9vm6ydhmhlxsybf836";
+  };
+
+  buildInputs = [  pythonPackages.wrapPython ];
+
+  doCheck = false;
+
+  phases = [ "unpackPhase" "patchPhase" "installPhase" ];
+
+  unpackPhase = "cp $src pdfdiff.py";
+
+  postPatch = ''
+    sed -i -r 's|pdftotextProgram = "pdftotext"|pdftotextProgram = "${xpdf}/bin/pdftotext"|' pdfdiff.py
+    sed -i -r 's|progName = "pdfdiff.py"|progName = "pdfdiff"|' pdfdiff.py
+    '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp pdfdiff.py $out/bin/pdfdiff
+    chmod +x $out/bin/pdfdiff
+
+    substituteInPlace $out/bin/pdfdiff --replace "#!/usr/bin/python" "#!${pythonPackages.python.interpreter}"
+    '';
+
+  meta = with stdenv.lib; {
+    homepage = http://www.cs.ox.ac.uk/people/cas.cremers/misc/pdfdiff.html;
+    description = "Tool to view the difference between two PDF or PS files";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pdfmod/default.nix b/nixpkgs/pkgs/applications/misc/pdfmod/default.nix
new file mode 100644
index 000000000000..90107be64c72
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pdfmod/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, fetchpatch, pkgconfig, gnome-doc-utils, intltool, lib
+, mono, gtk-sharp-2_0, gnome-sharp, hyena
+, which, makeWrapper, glib, gnome2, poppler, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pdfmod";
+  version = "0.9.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
+    sha256 = "eb7c987514a053106ddf03f26544766c751c801d87762909b36415d46bc425c9";
+  };
+
+  patches = [ (fetchpatch {
+    url = "https://raw.githubusercontent.com/City-busz/Arch-Linux-Repository"
+      + "/master/gnome/pdfmod/pdfmod/pdfmod-mono-2.10.patch";
+    sha256 = "0fpz9ifr6476lqhd5rkb94dm68vlrwdq5w1aaxzgyjgdax9hxx81";
+  }) ];
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    gnome-doc-utils intltool mono gtk-sharp-2_0 gnome-sharp
+    hyena which makeWrapper wrapGAppsHook
+  ];
+
+  preConfigure = ''
+    substituteInPlace lib/poppler-sharp/poppler-sharp/poppler-sharp.dll.config \
+      --replace libpoppler-glib.so.4 libpoppler-glib.so
+  '';
+
+  postInstall = ''
+    makeWrapper "${mono}/bin/mono" "$out/bin/pdfmod" \
+      --add-flags "$out/lib/pdfmod/PdfMod.exe" \
+      --prefix MONO_GAC_PREFIX : ${gtk-sharp-2_0} \
+      --prefix MONO_GAC_PREFIX : ${gnome-sharp} \
+      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ glib gnome-sharp gnome2.GConf gtk-sharp-2_0 gtk-sharp-2_0.gtk poppler ]}
+  '';
+
+  dontStrip = true;
+
+  meta = with stdenv.lib; {
+    homepage = "https://wiki.gnome.org/Attic/PdfMod";
+    description = "A simple application for modifying PDF documents";
+    platforms = platforms.all;
+    maintainers = with maintainers; [ obadz ];
+    license = licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pdfpc/default.nix b/nixpkgs/pkgs/applications/misc/pdfpc/default.nix
new file mode 100644
index 000000000000..c0dca0564768
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pdfpc/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchFromGitHub, cmake, makeWrapper, pkgconfig, vala, gtk3, libgee
+, poppler, libpthreadstubs, gstreamer, gst-plugins-base, librsvg, pcre, gobject-introspection }:
+
+stdenv.mkDerivation rec {
+  name = "${product}-${version}";
+  product = "pdfpc";
+  version = "4.3.4";
+
+  src = fetchFromGitHub {
+    repo = product;
+    owner = product;
+    rev = "v${version}";
+    sha256 = "07aafsm4jzdgpahz83p0ajv40hry7gviyadqi13ahr8xdhhwy2sd";
+  };
+
+  nativeBuildInputs = [
+    cmake pkgconfig vala
+    # For setup hook
+    gobject-introspection
+  ];
+  buildInputs = [ gstreamer gst-plugins-base gtk3 libgee poppler
+    libpthreadstubs makeWrapper librsvg pcre ];
+
+  cmakeFlags = stdenv.lib.optionalString stdenv.isDarwin "-DMOVIES=OFF";
+
+  postInstall = ''
+    wrapProgram $out/bin/pdfpc \
+      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A presenter console with multi-monitor support for PDF files";
+    homepage = https://pdfpc.github.io/;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ pSub ];
+    platforms = platforms.unix;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/pell/default.nix b/nixpkgs/pkgs/applications/misc/pell/default.nix
new file mode 100644
index 000000000000..d55c7a2af12b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pell/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchFromGitHub, scsh, sox, libnotify }:
+
+stdenv.mkDerivation rec {
+  pname = "pell";
+  version = "0.0.4";
+  name = "${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "ebzzry";
+    repo = pname;
+    rev = "f251625ece6bb5517227970287119e7d2dfcea8b";
+    sha256 = "0k8m1lv2kyrs8fylxmbgxg3jn65g57frf2bndc82gkr5svwb554a";
+  };
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mkdir -p $out/share
+    cp pell $out/bin
+    cp resources/online.mp3 $out/share
+    cp resources/offline.mp3 $out/share
+    chmod +x $out/bin/pell
+  '';
+
+  postFixup = ''
+    substituteInPlace $out/bin/pell --replace "/usr/bin/env scsh" "${scsh}/bin/scsh"
+    substituteInPlace $out/bin/pell --replace "(play " "(${sox}/bin/play "
+    substituteInPlace $out/bin/pell --replace "(notify-send " "(${libnotify}/bin/notify-send "
+    substituteInPlace $out/bin/pell --replace "/usr/share/pell/online.mp3" "$out/share/online.mp3"
+    substituteInPlace $out/bin/pell --replace "/usr/share/pell/offline.mp3" "$out/share/offline.mp3"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/ebzzry/pell;
+    description = "A simple host availability monitor";
+    license = licenses.mit;
+    maintainers = [ maintainers.ebzzry ];
+    platforms = platforms.unix;
+  };
+
+  dontBuild = true;
+}
diff --git a/nixpkgs/pkgs/applications/misc/perkeep/default.nix b/nixpkgs/pkgs/applications/misc/perkeep/default.nix
new file mode 100644
index 000000000000..8804e438b7e8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/perkeep/default.nix
@@ -0,0 +1,32 @@
+{ buildGo110Package, fetchzip, lib }:
+
+buildGo110Package rec {
+  name = "perkeep-${version}";
+  version = "0.10.1";
+
+  src = fetchzip {
+    url = "https://perkeep.org/dl/perkeep-${version}-src.zip";
+    sha256 = "0rqibc6w4m1r50i2pjcgz1k9dxh18v7jwj4s29y470bc526wv422";
+  };
+
+  goPackagePath = "perkeep.org";
+
+  buildPhase = ''
+    cd "$NIX_BUILD_TOP/go/src/$goPackagePath"
+    go run make.go
+  '';
+
+  # devcam is only useful when developing perkeep, we should not install it as
+  # part of this derivation.
+  postInstall = ''
+    rm -f $out/bin/devcam
+  '';
+
+  meta = with lib; {
+    description = "A way of storing, syncing, sharing, modelling and backing up content (née Camlistore)";
+    homepage = https://perkeep.org;
+    license = licenses.asl20;
+    maintainers = with maintainers; [ cstrahan kalbasit ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pgadmin/default.nix b/nixpkgs/pkgs/applications/misc/pgadmin/default.nix
new file mode 100644
index 000000000000..7e7850668b84
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pgadmin/default.nix
@@ -0,0 +1,58 @@
+{ stdenv, fetchurl, fetchpatch, postgresql, wxGTK, libxml2, libxslt, openssl, zlib, makeDesktopItem }:
+
+stdenv.mkDerivation rec {
+  name = "pgadmin3-${version}";
+  version = "1.22.2";
+
+  src = fetchurl {
+    url = "https://ftp.postgresql.org/pub/pgadmin/pgadmin3/v${version}/src/pgadmin3-${version}.tar.gz";
+    sha256 = "1b24b356h8z188nci30xrb57l7kxjqjnh6dq9ws638phsgiv0s4v";
+  };
+
+  enableParallelBuilding = true;
+
+  buildInputs = [ postgresql wxGTK openssl zlib ];
+
+  patches = [
+    (fetchpatch {
+      sha256 = "09hp7s3zjz80rpx2j3xyznwswwfxzi70z7c05dzrdk74mqjjpkfk";
+      name = "843344.patch";
+      url = "https://sources.debian.net/data/main/p/pgadmin3/1.22.2-1/debian/patches/843344";
+    })
+  ];
+
+  preConfigure = ''
+    substituteInPlace pgadmin/ver_svn.sh --replace "bin/bash" "$shell"
+  '';
+
+  configureFlags = [
+    "--with-pgsql=${postgresql}"
+    "--with-libxml2=${libxml2.dev}"
+    "--with-libxslt=${libxslt.dev}"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "PostgreSQL administration GUI tool";
+    homepage = https://www.pgadmin.org;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ domenkozar wmertens ];
+    platforms = platforms.unix;
+  };
+
+  postFixup = let
+    desktopItem = makeDesktopItem {
+      name = "pgAdmin";
+      desktopName = "pgAdmin III";
+      genericName = "SQL Administration";
+      exec = "pgadmin3";
+      icon = "pgAdmin3";
+      type = "Application";
+      categories = "Application;Development;";
+      mimeType = "text/html";
+    };
+  in ''
+    mkdir -p $out/share/pixmaps;
+    cp pgadmin/include/images/pgAdmin3.png $out/share/pixmaps/;
+    cp -rv ${desktopItem}/share/applications $out/share/
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/misc/pgmanage/default.nix b/nixpkgs/pkgs/applications/misc/pgmanage/default.nix
new file mode 100644
index 000000000000..113a63f7fe18
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pgmanage/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, postgresql, openssl } :
+
+stdenv.mkDerivation rec {
+  name = "pgmanage-${version}";
+  version = "11.0.1";
+
+  src = fetchFromGitHub {
+    owner  = "pgManage";
+    repo   = "pgManage";
+    rev    = "v${version}";
+    sha256 = "1a1dbc32b3y0ph8ydf800h6pz7dg6g1gxgid4gffk7k58xj0c5yf";
+  };
+
+  patchPhase = ''
+    patchShebangs src/configure
+  '';
+
+  configurePhase = ''
+    ./configure --prefix $out
+  '';
+
+  buildInputs = [ postgresql openssl ];
+
+  meta = with stdenv.lib; {
+    description = "A fast replacement for PGAdmin";
+    longDescription = ''
+      At the heart of pgManage is a modern, fast, event-based C-binary, built in
+      the style of NGINX and Node.js. This heart makes pgManage as fast as any
+      PostgreSQL interface can hope to be. (Note: pgManage replaces Postage,
+      which is no longer maintained.)
+    '';
+    homepage = https://github.com/pgManage/pgManage;
+    license = licenses.postgresql;
+    maintainers = [ maintainers.basvandijk ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/phwmon/default.nix b/nixpkgs/pkgs/applications/misc/phwmon/default.nix
new file mode 100644
index 000000000000..0cee74522ab2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/phwmon/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchFromGitLab, pythonPackages }:
+
+stdenv.mkDerivation rec {
+  name = "phwmon-${version}";
+  version = "2017-04-10";
+
+  src = fetchFromGitLab {
+    owner = "o9000";
+    repo = "phwmon";
+    rev = "b162e53dccc4adf8f11f49408d05fd85d9c6c909";
+    sha256 = "1hqmsq66y8bqkpvszw84jyk8haxq3cjnz105hlkmp7786vfmkisq";
+  };
+
+  nativeBuildInputs = [ pythonPackages.wrapPython ];
+
+  buildInputs = [ pythonPackages.pygtk pythonPackages.psutil ];
+
+  pythonPath = [ pythonPackages.pygtk pythonPackages.psutil ];
+  
+  patchPhase = ''
+    substituteInPlace install.sh --replace "/usr/local" "$out"
+  '';
+    
+  installPhase = ''
+    mkdir -p $out/bin $out/share/applications
+    ./install.sh
+  '';
+
+  postFixup = ''
+    wrapPythonPrograms
+  '';
+
+  meta = {
+    homepage = https://gitlab.com/o9000/phwmon;
+    description = "Hardware monitor (CPU, memory, network and disk I/O) for the system tray";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pinfo/default.nix b/nixpkgs/pkgs/applications/misc/pinfo/default.nix
new file mode 100644
index 000000000000..55093b21f950
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pinfo/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, autoreconfHook, gettext, texinfo, ncurses, readline }:
+
+stdenv.mkDerivation {
+  name = "pinfo-0.6.10";
+
+  src = fetchurl {
+    # homepage needed you to login to download the tarball
+    url = "https://src.fedoraproject.org/repo/pkgs/pinfo/pinfo-0.6.10.tar.bz2"
+      + "/fe3d3da50371b1773dfe29bf870dbc5b/pinfo-0.6.10.tar.bz2";
+    sha256 = "0p8wyrpz9npjcbx6c973jspm4c3xz4zxx939nngbq49xqah8088j";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ gettext texinfo ncurses readline ];
+
+  configureFlags = [ "--with-curses=${ncurses.dev}" "--with-readline=${readline.dev}" ];
+
+  meta = with stdenv.lib; {
+    description = "A viewer for info files";
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/plank/default.nix b/nixpkgs/pkgs/applications/misc/plank/default.nix
new file mode 100644
index 000000000000..8aff573ab839
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/plank/default.nix
@@ -0,0 +1,64 @@
+{ stdenv, fetchurl, vala, atk, cairo, glib, gnome3, gtk3, libwnck3
+, libX11, libXfixes, libXi, pango, intltool, pkgconfig, libxml2
+, bamf, gdk_pixbuf, libdbusmenu-gtk3, file, gnome-menus, libgee
+, wrapGAppsHook, autoreconfHook, pantheon }:
+
+stdenv.mkDerivation rec {
+  pname = "plank";
+  version = "0.11.4";
+
+  src = fetchurl {
+    url = "https://launchpad.net/${pname}/1.0/${version}/+download/${pname}-${version}.tar.xz";
+    sha256 = "1f41i45xpqhjxql9nl4a1sz30s0j46aqdhbwbvgrawz6himcvdc8";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    gnome3.gnome-common
+    intltool
+    libxml2 # xmllint
+    pkgconfig
+    vala
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    atk
+    bamf
+    cairo
+    gdk_pixbuf
+    glib
+    gnome-menus
+    gnome3.dconf
+    gtk3
+    libX11
+    libXfixes
+    libXi
+    libdbusmenu-gtk3
+    libgee
+    libwnck3
+    pango
+  ];
+
+  # fix paths
+  makeFlags = [
+    "INTROSPECTION_GIRDIR=${placeholder ''out''}/share/gir-1.0/"
+    "INTROSPECTION_TYPELIBDIR=${placeholder ''out''}/lib/girepository-1.0"
+  ];
+
+  # Make plank's application launcher hidden in Pantheon
+  patches = [ ./hide-in-pantheon.patch ];
+
+  postPatch = ''
+    substituteInPlace ./configure \
+      --replace "/usr/bin/file" "${file}/bin/file"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Elegant, simple, clean dock";
+    homepage = https://launchpad.net/plank;
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ davidak ] ++ pantheon.maintainers;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/plank/hide-in-pantheon.patch b/nixpkgs/pkgs/applications/misc/plank/hide-in-pantheon.patch
new file mode 100644
index 000000000000..ab8a4c723897
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/plank/hide-in-pantheon.patch
@@ -0,0 +1,9 @@
+diff --git a/data/plank.desktop.in b/data/plank.desktop.in
+index 330c3a4..e1bdf5f 100644
+--- a/data/plank.desktop.in
++++ b/data/plank.desktop.in
+@@ -8,3 +8,4 @@ Exec=plank
+ Icon=plank
+ Terminal=false
+ NoDisplay=false
++NotShowIn=Pantheon;
diff --git a/nixpkgs/pkgs/applications/misc/plasma-applet-volumewin7mixer/cmake.patch b/nixpkgs/pkgs/applications/misc/plasma-applet-volumewin7mixer/cmake.patch
new file mode 100644
index 000000000000..b33a3e174bc4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/plasma-applet-volumewin7mixer/cmake.patch
@@ -0,0 +1,20 @@
+diff -Naur org.kde.plasma.volumewin7mixer/CMakeLists.txt org.kde.plasma.volumewin7mixer.patch/CMakeLists.txt
+--- org.kde.plasma.volumewin7mixer/CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
++++ org.kde.plasma.volumewin7mixer.patch/CMakeLists.txt	2016-04-19 11:23:35.137866949 +0200
+@@ -0,0 +1,15 @@
++# Set minimum CMake version (required for CMake 3.0 or later)
++cmake_minimum_required(VERSION 2.8.12)
++
++# Use Extra CMake Modules (ECM) for common functionality.
++# See http://api.kde.org/ecm/manual/ecm.7.html
++# and http://api.kde.org/ecm/manual/ecm-kde-modules.7.html
++find_package(ECM REQUIRED NO_MODULE)
++# Needed by find_package(KF5Plasma) below.
++set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_MODULE_PATH})
++
++# Locate plasma_install_package macro.
++find_package(KF5Plasma REQUIRED)
++
++# Add installatation target ("make install").
++plasma_install_package(package org.kde.plasma.volumewin7mixer)
+
diff --git a/nixpkgs/pkgs/applications/misc/plasma-applet-volumewin7mixer/default.nix b/nixpkgs/pkgs/applications/misc/plasma-applet-volumewin7mixer/default.nix
new file mode 100644
index 000000000000..b44169adea8d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/plasma-applet-volumewin7mixer/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, cmake, extra-cmake-modules, plasma-framework, kwindowsystem, plasma-pa, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  name = "plasma-applet-volumewin7mixer-${version}";
+  version = "24";
+
+  src = fetchFromGitHub {
+    owner = "Zren";
+    repo = "plasma-applet-volumewin7mixer";
+    rev = "v${version}";
+    sha256 = "1pms71229y7fv3zs38a0l9mdcg5qkcdv9yrcvdm6xqpdyk21jbz2";
+  };
+
+  patches = [ ./cmake.patch ];
+  postPatch = '' rm build '';
+  nativeBuildInputs = [ cmake extra-cmake-modules ];
+  buildInputs = [ plasma-framework kwindowsystem plasma-pa ];
+
+  meta = with stdenv.lib; {
+    description = "A fork of the default volume plasmoid with a Windows 7 theme (vertical sliders).";
+    homepage = "https://github.com/Zren/plasma-applet-volumewin7mixer";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ mdevlamynck ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/playonlinux/default.nix b/nixpkgs/pkgs/applications/misc/playonlinux/default.nix
new file mode 100644
index 000000000000..e5c096fd2ae5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/playonlinux/default.nix
@@ -0,0 +1,110 @@
+{ stdenv
+, makeWrapper
+, fetchurl
+, cabextract
+, gettext
+, glxinfo
+, gnupg
+, icoutils
+, imagemagick
+, netcat-gnu
+, p7zip
+, python2Packages
+, unzip
+, wget
+, wine
+, xdg-user-dirs
+, xterm
+, pkgs
+, pkgsi686Linux
+, which
+, curl
+, jq
+, xorg
+, libGL
+}:
+
+let
+  version = "4.3.4";
+
+  binpath = stdenv.lib.makeBinPath
+    [ cabextract
+      python2Packages.python
+      gettext
+      glxinfo
+      gnupg
+      icoutils
+      imagemagick
+      netcat-gnu
+      p7zip
+      unzip
+      wget
+      wine
+      xdg-user-dirs
+      xterm
+      which
+      curl
+      jq
+    ];
+
+  ld32 =
+    if stdenv.hostPlatform.system == "x86_64-linux" then "${stdenv.cc}/nix-support/dynamic-linker-m32"
+    else if stdenv.hostPlatform.system == "i686-linux" then "${stdenv.cc}/nix-support/dynamic-linker"
+    else throw "Unsupported platform for PlayOnLinux: ${stdenv.hostPlatform.system}";
+  ld64 = "${stdenv.cc}/nix-support/dynamic-linker";
+  libs = pkgs: stdenv.lib.makeLibraryPath [ xorg.libX11 libGL ];
+
+in stdenv.mkDerivation {
+  name = "playonlinux-${version}";
+
+  src = fetchurl {
+    url = "https://www.playonlinux.com/script_files/PlayOnLinux/${version}/PlayOnLinux_${version}.tar.gz";
+    sha256 = "019dvb55zqrhlbx73p6913807ql866rm0j011ix5mkk2g79dzhqp";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  buildInputs =
+    [ python2Packages.python
+      python2Packages.wxPython
+      python2Packages.setuptools
+      xorg.libX11
+      libGL
+    ];
+
+  patchPhase = ''
+    patchShebangs python tests/python
+    sed -i "s/ %F//g" etc/PlayOnLinux.desktop
+  '';
+
+  installPhase = ''
+    install -d $out/share/playonlinux
+    cp -r . $out/share/playonlinux/
+
+    install -D -m644 etc/PlayOnLinux.desktop $out/share/applications/playonlinux.desktop
+
+    makeWrapper $out/share/playonlinux/playonlinux $out/bin/playonlinux \
+      --prefix PYTHONPATH : $PYTHONPATH:$(toPythonPath "$out") \
+      --prefix PATH : ${binpath}
+
+    bunzip2 $out/share/playonlinux/bin/check_dd_x86.bz2
+    patchelf --set-interpreter $(cat ${ld32}) --set-rpath ${libs pkgsi686Linux} $out/share/playonlinux/bin/check_dd_x86
+    ${if stdenv.hostPlatform.system == "x86_64-linux" then ''
+      bunzip2 $out/share/playonlinux/bin/check_dd_amd64.bz2
+      patchelf --set-interpreter $(cat ${ld64}) --set-rpath ${libs pkgs} $out/share/playonlinux/bin/check_dd_amd64
+    '' else ''
+      rm $out/share/playonlinux/bin/check_dd_amd64.bz2
+    ''}
+    for f in $out/share/playonlinux/bin/*; do
+      bzip2 $f
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "GUI for managing Windows programs under linux";
+    homepage = https://www.playonlinux.com/;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.a1russell ];
+    platforms = [ "x86_64-linux" "i686-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/plover/default.nix b/nixpkgs/pkgs/applications/misc/plover/default.nix
new file mode 100644
index 000000000000..0bd28811d55b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/plover/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchurl, python27Packages, python36Packages, wmctrl }:
+
+{
+  stable = with python27Packages; buildPythonPackage rec {
+    name    = "plover-${version}";
+    version = "3.1.1";
+
+    meta = with stdenv.lib; {
+      description = "OpenSteno Plover stenography software";
+      maintainers = with maintainers; [ twey kovirobi ];
+      license     = licenses.gpl2;
+    };
+
+    src = fetchurl {
+      url    = "https://github.com/openstenoproject/plover/archive/v${version}.tar.gz";
+      sha256 = "1hdg5491phx6svrxxsxp8v6n4b25y7y4wxw7x3bxlbyhaskgj53r";
+    };
+
+    nativeBuildInputs     = [ setuptools_scm ];
+    buildInputs           = [ pytest mock ];
+    propagatedBuildInputs = [
+      six setuptools pyserial appdirs hidapi wxPython xlib wmctrl
+    ];
+  };
+
+  dev = with python36Packages; buildPythonPackage rec {
+    name    = "plover-${version}";
+    version = "4.0.0.dev8";
+
+    meta = with stdenv.lib; {
+      description = "OpenSteno Plover stenography software";
+      maintainers = with maintainers; [ twey kovirobi ];
+      license     = licenses.gpl2;
+    };
+
+    src = fetchurl {
+      url    = "https://github.com/openstenoproject/plover/archive/v${version}.tar.gz";
+      sha256 = "1wxkmik1zyw5gqig5r0cas5v6f5408fbnximzw610rdisqy09rxp";
+    };
+
+    # I'm not sure why we don't find PyQt5 here but there's a similar
+    # sed on many of the platforms Plover builds for
+    postPatch = "sed -i /PyQt5/d setup.cfg";
+
+    checkInputs           = [ pytest mock ];
+    propagatedBuildInputs = [ Babel pyqt5 xlib pyserial appdirs wcwidth ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pmenu/default.nix b/nixpkgs/pkgs/applications/misc/pmenu/default.nix
new file mode 100644
index 000000000000..4b39e9291a8a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pmenu/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitLab, python2Packages, gnome-menus }:
+
+stdenv.mkDerivation rec {
+  name = "pmenu-${version}";
+  version = "2018-01-01";
+
+  src = fetchFromGitLab {
+    owner = "o9000";
+    repo = "pmenu";
+    rev = "f98a5bdf20deb0b7f0543e5ce6a8f5574f695e07";
+    sha256 = "131nqafbmbfpgsgss27pz4cyb9fb29m5h1ai1fyvcn286rr9dnp2";
+  };
+
+  nativeBuildInputs = [ python2Packages.wrapPython ];
+
+  buildInputs = [ python2Packages.pygtk gnome-menus ];
+
+  pythonPath = [ python2Packages.pygtk ];
+    
+  installPhase = ''
+    mkdir -p $out/bin $out/share/applications
+    ./install.sh $out
+  '';
+
+  postFixup = ''
+    wrapPythonPrograms
+  '';
+
+  meta = {
+    homepage = https://gitlab.com/o9000/pmenu;
+    description = "Start menu for Linux/BSD";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/polar-bookshelf/default.nix b/nixpkgs/pkgs/applications/misc/polar-bookshelf/default.nix
new file mode 100644
index 000000000000..11c643fac2c3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/polar-bookshelf/default.nix
@@ -0,0 +1,91 @@
+{ stdenv, lib, makeWrapper, fetchurl
+, dpkg, wrapGAppsHook, autoPatchelfHook
+, gtk3, cairo, gnome2, atk, gdk_pixbuf, glib
+, at-spi2-atk, dbus, libX11, libxcb, libXi
+, libXcursor, libXdamage, libXrandr, libXcomposite
+, libXext, libXfixes, libXrender, libXtst, libXScrnSaver
+, nss, nspr, alsaLib, cups, fontconfig, expat
+, libudev0-shim, glibc, curl, openssl, libnghttp2, gnome3 }:
+
+
+stdenv.mkDerivation rec {
+  name = "polar-bookshelf-${version}";
+  version = "1.13.10";
+
+  # fetching a .deb because there's no easy way to package this Electron app
+  src = fetchurl {
+    url = "https://github.com/burtonator/polar-bookshelf/releases/download/v${version}/polar-bookshelf-${version}-amd64.deb";
+    sha256 = "1bxcyf6n2m5x1z8ic6kzskinyyc6lh6nj0bycbwc524n6ms5j99p";
+  };
+
+  buildInputs = [
+    gnome3.gsettings_desktop_schemas
+    glib
+    gtk3
+    cairo
+    gnome2.pango
+    atk
+    gdk_pixbuf
+    at-spi2-atk
+    dbus
+    libX11
+    libxcb
+    libXi
+    libXcursor
+    libXdamage
+    libXrandr
+    libXcomposite
+    libXext
+    libXfixes
+    libXrender
+    libXtst
+    libXScrnSaver
+    nss
+    nspr
+    alsaLib
+    cups
+    fontconfig
+    expat
+  ];
+
+  nativeBuildInputs = [ 
+    wrapGAppsHook
+    autoPatchelfHook
+    makeWrapper 
+    dpkg
+  ];
+
+  runtimeLibs = lib.makeLibraryPath [ libudev0-shim glibc curl openssl libnghttp2 ];
+
+  unpackPhase = "dpkg-deb -x $src .";
+
+  installPhase = ''
+    mkdir -p $out/share/polar-bookshelf
+    mkdir -p $out/bin
+    mkdir -p $out/lib
+
+    mv opt/Polar\ Bookshelf/* $out/share/polar-bookshelf
+    mv $out/share/polar-bookshelf/*.so $out/lib
+
+    mv usr/share/* $out/share/
+
+    ln -s $out/share/polar-bookshelf/polar-bookshelf $out/bin/polar-bookshelf
+    
+    # Correct desktop file `Exec`
+    substituteInPlace $out/share/applications/polar-bookshelf.desktop \
+      --replace "/opt/Polar Bookshelf/polar-bookshelf" "$out/bin/polar-bookshelf"
+  '';
+
+  preFixup = ''
+    gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${runtimeLibs}" )
+  '';
+
+  meta = {
+    homepage = https://getpolarized.io/;
+    description = "Personal knowledge repository for PDF and web content supporting incremental reading and document annotation";
+    license = stdenv.lib.licenses.gpl3;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.noneucat ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/polybar/default.nix b/nixpkgs/pkgs/applications/misc/polybar/default.nix
new file mode 100644
index 000000000000..e6507845d4cc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/polybar/default.nix
@@ -0,0 +1,83 @@
+{ cairo, cmake, fetchFromGitHub, libXdmcp, libpthreadstubs, libxcb, pcre, pkgconfig
+, python2, stdenv, xcbproto, xcbutil, xcbutilcursor, xcbutilimage
+, xcbutilrenderutil, xcbutilwm, xcbutilxrm, makeWrapper
+
+# optional packages-- override the variables ending in 'Support' to enable or
+# disable modules
+, alsaSupport   ? true,  alsaLib       ? null
+, githubSupport ? false, curl          ? null
+, mpdSupport    ? false, mpd_clientlib ? null
+, pulseSupport  ? false, libpulseaudio ? null
+, iwSupport     ? false, wirelesstools ? null
+, nlSupport     ? true,  libnl         ? null
+, i3Support ? false, i3GapsSupport ? false, i3 ? null, i3-gaps ? null, jsoncpp ? null
+}:
+
+assert alsaSupport   -> alsaLib       != null;
+assert githubSupport -> curl          != null;
+assert mpdSupport    -> mpd_clientlib != null;
+assert pulseSupport  -> libpulseaudio != null;
+
+assert iwSupport     -> ! nlSupport && wirelesstools != null;
+assert nlSupport     -> ! iwSupport && libnl         != null;
+
+assert i3Support     -> ! i3GapsSupport && jsoncpp != null && i3      != null;
+assert i3GapsSupport -> ! i3Support     && jsoncpp != null && i3-gaps != null;
+
+stdenv.mkDerivation rec {
+    pname = "polybar";
+    version = "3.3.1";
+
+    src = fetchFromGitHub {
+      owner = "jaagr";
+      repo = pname;
+      rev = version;
+      sha256 = "0qwi6q3qkrz2ip1jd4pxlnsrs2a9ywxyf8rgvbzyilr334rsiywh";
+      fetchSubmodules = true;
+    };
+
+    meta = with stdenv.lib; {
+      description = "A fast and easy-to-use tool for creating status bars";
+      longDescription = ''
+        Polybar aims to help users build beautiful and highly customizable
+        status bars for their desktop environment, without the need of
+        having a black belt in shell scripting.
+      '';
+      license = licenses.mit;
+      maintainers = [ maintainers.afldcr ];
+      platforms = platforms.unix;
+    };
+
+    buildInputs = [
+      cairo libXdmcp libpthreadstubs libxcb pcre python2 xcbproto xcbutil
+      xcbutilcursor xcbutilimage xcbutilrenderutil xcbutilwm xcbutilxrm
+
+      (if alsaSupport   then alsaLib       else null)
+      (if githubSupport then curl          else null)
+      (if mpdSupport    then mpd_clientlib else null)
+      (if pulseSupport  then libpulseaudio else null)
+
+      (if iwSupport     then wirelesstools else null)
+      (if nlSupport     then libnl         else null)
+
+      (if i3Support || i3GapsSupport then jsoncpp else null)
+      (if i3Support then i3 else null)
+      (if i3GapsSupport then i3-gaps else null)
+
+      (if i3Support || i3GapsSupport then makeWrapper else null)
+    ];
+
+    postConfigure = ''
+      substituteInPlace ../include/settings.hpp --replace \
+        "${stdenv.cc}" "${stdenv.cc.name}"
+    '';
+
+    postInstall = if (i3Support || i3GapsSupport) then ''
+      wrapProgram $out/bin/polybar \
+        --prefix PATH : "${if i3Support then i3 else i3-gaps}/bin"
+    '' else "";
+
+    nativeBuildInputs = [
+      cmake pkgconfig
+    ];
+}
diff --git a/nixpkgs/pkgs/applications/misc/posterazor/default.nix b/nixpkgs/pkgs/applications/misc/posterazor/default.nix
new file mode 100644
index 000000000000..45db856dbb9e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/posterazor/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl, cmake, unzip, pkgconfig, libXpm, fltk13, freeimage }:
+
+stdenv.mkDerivation rec {
+  name = "posterazor-1.5.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/posterazor/1.5.1/PosteRazor-1.5.1-Source.zip";
+    sha256 = "1dqpdk8zl0smdg4fganp3hxb943q40619qmxjlga9jhjc01s7fq5";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ cmake unzip libXpm fltk13 freeimage ];
+
+  unpackPhase = ''
+    unzip $src -d posterazor
+    cd posterazor/src
+  '';
+
+  # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667328
+  patchPhase = ''
+    sed "s/\(#define CASESENSITIVESTRCMP strcasecmp\)/#include <unistd.h>\n\1/" -i FlPosteRazorDialog.cpp
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp PosteRazor $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://posterazor.sourceforge.net/;
+    description = "Cuts a raster image into pieces which can afterwards be printed out and assembled to a poster";
+    maintainers = [ maintainers.madjar ];
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/printrun/default.nix b/nixpkgs/pkgs/applications/misc/printrun/default.nix
new file mode 100644
index 000000000000..34144e35bd5a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/printrun/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, python27Packages, fetchFromGitHub }:
+
+python27Packages.buildPythonApplication rec {
+  name = "printrun-20150310";
+
+  src = fetchFromGitHub {
+    owner = "kliment";
+    repo = "Printrun";
+    rev = name;
+    sha256 = "09ijv8h4k5h15swg64s7igamvynawz7gdi7hiymzrzywdvr0zwsa";
+  };
+
+  propagatedBuildInputs = with python27Packages; [
+    wxPython30 pyserial dbus-python psutil numpy pyopengl pyglet cython
+  ];
+
+  doCheck = false;
+
+  setupPyBuildFlags = ["-i"];
+
+  postPatch = ''
+    sed -i -r "s|/usr(/local)?/share/|$out/share/|g" printrun/utils.py
+  '';
+
+  postInstall = ''
+    for f in $out/share/applications/*.desktop; do
+      sed -i -e "s|/usr/|$out/|g" "$f"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Pronterface, Pronsole, and Printcore - Pure Python 3d printing host software";
+    homepage = https://github.com/kliment/Printrun;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/procmail/CVE-2014-3618.patch b/nixpkgs/pkgs/applications/misc/procmail/CVE-2014-3618.patch
new file mode 100644
index 000000000000..e3aa5600e40e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/procmail/CVE-2014-3618.patch
@@ -0,0 +1,18 @@
+From http://seclists.org/oss-sec/2014/q3/495 (with whitespace corrected).
+
+--- a/src/formisc.c 2013-08-04 00:13:33.000000000 -0700
++++ b/src/formisc.c 2014-09-03 11:42:25.986002396 -0700
+@@ -84,12 +84,11 @@
+ 	case '"':*target++=delim='"';start++;
+       }
+      ;{ int i;
+-	do
++	while(*start)
+ 	   if((i= *target++= *start++)==delim)	 /* corresponding delimiter? */
+ 	      break;
+ 	   else if(i=='\\'&&*start)		    /* skip quoted character */
+ 	      *target++= *start++;
+-	while(*start);						/* anything? */
+       }
+      hitspc=2;
+    }
diff --git a/nixpkgs/pkgs/applications/misc/procmail/default.nix b/nixpkgs/pkgs/applications/misc/procmail/default.nix
new file mode 100644
index 000000000000..cd3a46ab09ba
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/procmail/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "procmail-3.22";
+
+  patches = [
+    ./CVE-2014-3618.patch
+    (fetchurl {
+      url = https://sources.debian.org/data/main/p/procmail/3.22-26/debian/patches/30;
+      sha256 = "11zmz1bj0v9pay3ldmyyg7473b80h89gycrhndsgg9q50yhcqaaq";
+      name = "CVE-2017-16844";
+    })
+  ];
+
+  # getline is defined differently in glibc now. So rename it.
+  # Without the .PHONY target "make install" won't install anything on Darwin.
+  postPatch = ''
+    sed -e "s%^RM.*$%#%" -i Makefile
+    sed -e "s%^BASENAME.*%\BASENAME=$out%" -i Makefile
+    sed -e "s%^LIBS=.*%LIBS=-lm%" -i Makefile
+    sed -e "s%getline%thisgetline%g" -i src/*.c src/*.h
+    sed -e "3i\
+.PHONY: install
+" -i Makefile
+  '';
+
+  src = fetchurl {
+    url = ftp://ftp.fu-berlin.de/pub/unix/mail/procmail/procmail-3.22.tar.gz;
+    sha256 = "05z1c803n5cppkcq99vkyd5myff904lf9sdgynfqngfk9nrpaz08";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Mail processing and filtering utility";
+    homepage = http://www.procmail.org/;
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ gebner ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/projectlibre/default.nix b/nixpkgs/pkgs/applications/misc/projectlibre/default.nix
new file mode 100644
index 000000000000..5ba8e1b6e313
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/projectlibre/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchgit, ant, jdk, makeWrapper, jre, coreutils, which }:
+
+stdenv.mkDerivation rec {
+  name = "projectlibre-${version}";
+  version = "1.7.0";
+
+  src = fetchgit {
+    url = "https://git.code.sf.net/p/projectlibre/code";
+    rev = "0c939507cc63e9eaeb855437189cdec79e9386c2"; # version 1.7.0 was not tagged
+    sha256 = "0vy5vgbp45ai957gaby2dj1hvmbxfdlfnwcanwqm9f8q16qipdbq";
+  };
+
+  buildInputs = [ ant jdk makeWrapper ];
+  buildPhase = ''
+    export ANT_OPTS=-Dbuild.sysclasspath=ignore
+    ${ant}/bin/ant -f openproj_build/build.xml
+  '';
+
+  resourcesPath = "openproj_build/resources";
+  desktopItem = "${resourcesPath}/projectlibre.desktop";
+
+  installPhase = ''
+    mkdir -p $out/share/{applications,projectlibre/samples,pixmaps,doc/projectlibre} $out/bin
+
+    substitute $resourcesPath/projectlibre $out/bin/projectlibre \
+      --replace "\"/usr/share/projectlibre\"" "\"$out/share/projectlibre\""
+    chmod +x $out/bin/projectlibre
+    wrapProgram $out/bin/projectlibre \
+     --prefix PATH : "${jre}/bin:${coreutils}/bin:${which}/bin"
+
+    cp -R openproj_build/dist/* $out/share/projectlibre
+    cp -R openproj_build/license $out/share/doc/projectlibre
+    cp $desktopItem $out/share/applications
+    cp $resourcesPath/projectlibre.png $out/share/pixmaps
+    cp -R $resourcesPath/samples/* $out/share/projectlibre/samples
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "http://www.projectlibre.com/";
+    description = "Project-Management Software similar to MS-Project";
+    maintainers = [ maintainers.Mogria ];
+    license = licenses.cpal10;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/prusa-slicer/default.nix b/nixpkgs/pkgs/applications/misc/prusa-slicer/default.nix
new file mode 100644
index 000000000000..cc6f63c0960b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/prusa-slicer/default.nix
@@ -0,0 +1,89 @@
+{ stdenv, lib, fetchFromGitHub, makeWrapper, cmake, pkgconfig
+, boost, curl, expat, glew, libpng, tbb, wxGTK30
+, gtest, nlopt, xorg, makeDesktopItem
+}:
+let
+  nloptVersion = if lib.hasAttr "version" nlopt
+                 then lib.getAttr "version" nlopt
+                 else "2.4";
+in
+stdenv.mkDerivation rec {
+  name = "prusa-slicer-${version}";
+  version = "2.0.0";
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [
+    cmake
+    makeWrapper
+    pkgconfig
+  ];
+
+  # We could add Eigen, but it doesn't currently compile with the version in
+  # nixpkgs.
+  buildInputs = [
+    boost
+    curl
+    expat
+    glew
+    libpng
+    tbb
+    wxGTK30
+    xorg.libX11
+  ] ++ checkInputs;
+
+  checkInputs = [ gtest ];
+
+  # The build system uses custom logic - defined in
+  # xs/src/libnest2d/cmake_modules/FindNLopt.cmake in the package source -
+  # for finding the nlopt library, which doesn't pick up the package in the nix store.
+  # We need to set the path via the NLOPT environment variable instead.
+  NLOPT = "${nlopt}";
+
+  prePatch = ''
+    # In nix ioctls.h isn't available from the standard kernel-headers package
+    # on other distributions. As the copy in glibc seems to be identical to the
+    # one in the kernel, we use that one instead.
+    sed -i 's|"/usr/include/asm-generic/ioctls.h"|<asm-generic/ioctls.h>|g' src/libslic3r/GCodeSender.cpp
+  '' + lib.optionalString (lib.versionOlder "2.5" nloptVersion) ''
+    # Since version 2.5.0 of nlopt we need to link to libnlopt, as libnlopt_cxx
+    # now seems to be integrated into the main lib.
+    sed -i 's|nlopt_cxx|nlopt|g' src/libnest2d/cmake_modules/FindNLopt.cmake
+  '';
+
+  src = fetchFromGitHub {
+    owner = "prusa3d";
+    repo = "PrusaSlicer";
+    sha256 = "135wn2sza2f2kvbja1haxil5kx1b74lc1i7dsa35i1y3phabykhz";
+    rev = "version_${version}";
+  };
+
+  cmakeFlags = [
+    "-DSLIC3R_FHS=1"
+    "-DSLIC3R_WX_STABLE=1"  # necessary when compiling against wxGTK 3.0
+  ];
+
+  postInstall = ''
+    mkdir -p "$out/share/pixmaps/"
+    ln -s "$out/share/PrusaSlicer/icons/PrusaSlicer.png" "$out/share/pixmaps/PrusaSlicer.png"
+    mkdir -p "$out/share/applications"
+    cp "$desktopItem"/share/applications/* "$out/share/applications/"
+  '';
+
+  desktopItem = makeDesktopItem {
+    name = "PrusaSlicer";
+    exec = "prusa-slicer";
+    icon = "PrusaSlicer";
+    comment = "G-code generator for 3D printers";
+    desktopName = "PrusaSlicer";
+    genericName = "3D printer tool";
+    categories = "Application;Development;";
+  };
+
+  meta = with stdenv.lib; {
+    description = "G-code generator for 3D printer";
+    homepage = https://github.com/prusa3d/PrusaSlicer;
+    license = licenses.agpl3;
+    maintainers = with maintainers; [ tweber ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pstree/default.nix b/nixpkgs/pkgs/applications/misc/pstree/default.nix
new file mode 100644
index 000000000000..7aaa8a8c38d2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pstree/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "pstree";
+  version = "2.39";
+
+  src = fetchurl {
+    urls = [
+      "https://distfiles.macports.org/${pname}/${pname}-${version}.tar.gz"
+      "https://fossies.org/linux/misc/${pname}-${version}.tar.gz"
+      "ftp://ftp.thp.uni-duisburg.de/pub/source/${pname}-${version}.tar.gz"
+    ];
+    sha256 = "17s7v15c4gryjpi11y1xq75022nkg4ggzvjlq2dkmyg67ssc76vw";
+  };
+
+  sourceRoot = ".";
+  buildPhase = ''
+    runHook preBuild
+    $CC $NIX_CFLAGS -o pstree pstree.c
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    install -Dm0555 ${pname} -t $out/bin
+    install -Dm0444 ${pname}.1 -t $out/share/man/man1
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Show the set of running processes as a tree";
+    homepage = "http://www.thp.uni-duisburg.de/pstree/";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.c0bw3b ];
+    platforms = platforms.unix;
+    priority = 5; # Lower than psmisc also providing pstree on Linux platforms
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pt/.bundle/config b/nixpkgs/pkgs/applications/misc/pt/.bundle/config
new file mode 100644
index 000000000000..88cb2d529351
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pt/.bundle/config
@@ -0,0 +1,2 @@
+---
+BUNDLE_NO_INSTALL: true
diff --git a/nixpkgs/pkgs/applications/misc/pt/Gemfile b/nixpkgs/pkgs/applications/misc/pt/Gemfile
new file mode 100644
index 000000000000..ed2136ea5b85
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pt/Gemfile
@@ -0,0 +1,3 @@
+source "https://rubygems.org"
+
+gem 'pt'
diff --git a/nixpkgs/pkgs/applications/misc/pt/Gemfile.lock b/nixpkgs/pkgs/applications/misc/pt/Gemfile.lock
new file mode 100644
index 000000000000..501fae0ef0a2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pt/Gemfile.lock
@@ -0,0 +1,69 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    addressable (2.6.0)
+      public_suffix (>= 2.0.2, < 4.0)
+    axiom-types (0.1.1)
+      descendants_tracker (~> 0.0.4)
+      ice_nine (~> 0.11.0)
+      thread_safe (~> 0.3, >= 0.3.1)
+    coercible (1.0.0)
+      descendants_tracker (~> 0.0.1)
+    colored (1.2)
+    declarative (0.0.10)
+    declarative-option (0.1.0)
+    descendants_tracker (0.0.4)
+      thread_safe (~> 0.3, >= 0.3.1)
+    equalizer (0.0.11)
+    excon (0.64.0)
+    faraday (0.9.2)
+      multipart-post (>= 1.2, < 3)
+    faraday_middleware (0.13.1)
+      faraday (>= 0.7.4, < 1.0)
+    highline (2.0.2)
+    hirb (0.7.3)
+    hirb-unicode (0.0.5)
+      hirb (~> 0.5)
+      unicode-display_width (~> 0.1.1)
+    ice_nine (0.11.2)
+    multi_json (1.13.1)
+    multipart-post (2.0.0)
+    pt (0.10.0)
+      colored (~> 1.2)
+      highline
+      hirb (~> 0.7, >= 0.7.3)
+      hirb-unicode (~> 0.0.5, >= 0.0.5)
+      thor
+      tracker_api (~> 1.6.0)
+    public_suffix (3.0.3)
+    representable (3.0.4)
+      declarative (< 0.1.0)
+      declarative-option (< 0.2.0)
+      uber (< 0.2.0)
+    thor (0.20.3)
+    thread_safe (0.3.6)
+    tracker_api (1.6.0)
+      addressable
+      equalizer
+      excon
+      faraday (~> 0.9.0)
+      faraday_middleware
+      multi_json
+      representable
+      virtus
+    uber (0.1.0)
+    unicode-display_width (0.1.1)
+    virtus (1.0.5)
+      axiom-types (~> 0.1)
+      coercible (~> 1.0)
+      descendants_tracker (~> 0.0, >= 0.0.3)
+      equalizer (~> 0.0, >= 0.0.9)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  pt
+
+BUNDLED WITH
+   1.17.2
diff --git a/nixpkgs/pkgs/applications/misc/pt/default.nix b/nixpkgs/pkgs/applications/misc/pt/default.nix
new file mode 100644
index 000000000000..6f9078bb50a7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pt/default.nix
@@ -0,0 +1,15 @@
+{ lib, bundlerApp }:
+
+bundlerApp {
+  pname = "pt";
+  gemdir = ./.;
+  exes = [ "pt" ];
+
+  meta = with lib; {
+    description = "Minimalist command-line Pivotal Tracker client";
+    homepage    = http://www.github.com/raul/pt;
+    license     = licenses.mit;
+    maintainers = with maintainers; [ ebzzry manveru ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pt/gemset.nix b/nixpkgs/pkgs/applications/misc/pt/gemset.nix
new file mode 100644
index 000000000000..f1f69c252142
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pt/gemset.nix
@@ -0,0 +1,273 @@
+{
+  addressable = {
+    dependencies = ["public_suffix"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0bcm2hchn897xjhqj9zzsxf3n9xhddymj4lsclz508f4vw3av46l";
+      type = "gem";
+    };
+    version = "2.6.0";
+  };
+  axiom-types = {
+    dependencies = ["descendants_tracker" "ice_nine" "thread_safe"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "10q3k04pll041mkgy0m5fn2b1lazm6ly1drdbcczl5p57lzi3zy1";
+      type = "gem";
+    };
+    version = "0.1.1";
+  };
+  coercible = {
+    dependencies = ["descendants_tracker"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1p5azydlsz0nkxmcq0i1gzmcfq02lgxc4as7wmf47j1c6ljav0ah";
+      type = "gem";
+    };
+    version = "1.0.0";
+  };
+  colored = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0b0x5jmsyi0z69bm6sij1k89z7h0laag3cb4mdn7zkl9qmxb90lx";
+      type = "gem";
+    };
+    version = "1.2";
+  };
+  declarative = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0642xvwzzbgi3kp1bg467wma4g3xqrrn0sk369hjam7w579gnv5j";
+      type = "gem";
+    };
+    version = "0.0.10";
+  };
+  declarative-option = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1g4ibxq566f1frnhdymzi9hxxcm4g2gw4n21mpjk2mhwym4q6l0p";
+      type = "gem";
+    };
+    version = "0.1.0";
+  };
+  descendants_tracker = {
+    dependencies = ["thread_safe"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "15q8g3fcqyb41qixn6cky0k3p86291y7xsh1jfd851dvrza1vi79";
+      type = "gem";
+    };
+    version = "0.0.4";
+  };
+  equalizer = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1kjmx3fygx8njxfrwcmn7clfhjhb6bvv3scy2lyyi0wqyi3brra4";
+      type = "gem";
+    };
+    version = "0.0.11";
+  };
+  excon = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0vcplvlykirg2vc56jjxavgpkllzq26xgp7ind7wc5ikaqaz64gn";
+      type = "gem";
+    };
+    version = "0.64.0";
+  };
+  faraday = {
+    dependencies = ["multipart-post"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1kplqkpn2s2yl3lxdf6h7sfldqvkbkpxwwxhyk7mdhjplb5faqh6";
+      type = "gem";
+    };
+    version = "0.9.2";
+  };
+  faraday_middleware = {
+    dependencies = ["faraday"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1a93rs58bakqck7bcihasz66a1riy22h2zpwrpmb13gp8mw3wkmr";
+      type = "gem";
+    };
+    version = "0.13.1";
+  };
+  highline = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1g0zpalfj8wvca86hcnirir5py2zyqrhkgdgv9f87fxkjaw815wr";
+      type = "gem";
+    };
+    version = "2.0.2";
+  };
+  hirb = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0mzch3c2lvmf8gskgzlx6j53d10j42ir6ik2dkrl27sblhy76cji";
+      type = "gem";
+    };
+    version = "0.7.3";
+  };
+  hirb-unicode = {
+    dependencies = ["hirb" "unicode-display_width"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1b7hka1p4mkjdy2wr2cxsivnsmnz31zz1bswznmmxnvf5a6c00jk";
+      type = "gem";
+    };
+    version = "0.0.5";
+  };
+  ice_nine = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1nv35qg1rps9fsis28hz2cq2fx1i96795f91q4nmkm934xynll2x";
+      type = "gem";
+    };
+    version = "0.11.2";
+  };
+  multi_json = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1rl0qy4inf1mp8mybfk56dfga0mvx97zwpmq5xmiwl5r770171nv";
+      type = "gem";
+    };
+    version = "1.13.1";
+  };
+  multipart-post = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "09k0b3cybqilk1gwrwwain95rdypixb2q9w65gd44gfzsd84xi1x";
+      type = "gem";
+    };
+    version = "2.0.0";
+  };
+  pt = {
+    dependencies = ["colored" "highline" "hirb" "hirb-unicode" "thor" "tracker_api"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1ypyya7bk0w7zd9c3224zsizhv5wbs1icjpn0023wh3ii1by16a8";
+      type = "gem";
+    };
+    version = "0.10.0";
+  };
+  public_suffix = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "08q64b5br692dd3v0a9wq9q5dvycc6kmiqmjbdxkxbfizggsvx6l";
+      type = "gem";
+    };
+    version = "3.0.3";
+  };
+  representable = {
+    dependencies = ["declarative" "declarative-option" "uber"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0qm9rgi1j5a6nv726ka4mmixivlxfsg91h8rpp72wwd4vqbkkm07";
+      type = "gem";
+    };
+    version = "3.0.4";
+  };
+  thor = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1yhrnp9x8qcy5vc7g438amd5j9sw83ih7c30dr6g6slgw9zj3g29";
+      type = "gem";
+    };
+    version = "0.20.3";
+  };
+  thread_safe = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0nmhcgq6cgz44srylra07bmaw99f5271l0dpsvl5f75m44l0gmwy";
+      type = "gem";
+    };
+    version = "0.3.6";
+  };
+  tracker_api = {
+    dependencies = ["addressable" "equalizer" "excon" "faraday" "faraday_middleware" "multi_json" "representable" "virtus"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0pxwzbjzxign81wynl44napkvkrrhlyl7rm4ywrcdqahmzxmavsp";
+      type = "gem";
+    };
+    version = "1.6.0";
+  };
+  uber = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1p1mm7mngg40x05z52md3mbamkng0zpajbzqjjwmsyw0zw3v9vjv";
+      type = "gem";
+    };
+    version = "0.1.0";
+  };
+  unicode-display_width = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "06dpm3yqc974qfy6nyx7b0w0f6b8k08jadd5l9xnmla3fji6c405";
+      type = "gem";
+    };
+    version = "0.1.1";
+  };
+  virtus = {
+    dependencies = ["axiom-types" "coercible" "descendants_tracker" "equalizer"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "06iphwi3c4f7y9i2rvhvaizfswqbaflilziz4dxqngrdysgkn1fk";
+      type = "gem";
+    };
+    version = "1.0.5";
+  };
+}
\ No newline at end of file
diff --git a/nixpkgs/pkgs/applications/misc/ptask/default.nix b/nixpkgs/pkgs/applications/misc/ptask/default.nix
new file mode 100644
index 000000000000..81e316eb0ee9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ptask/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, pkgconfig, makeWrapper, gtk3, json_c, taskwarrior }:
+
+stdenv.mkDerivation rec {
+  name = "ptask-1.0.0";
+
+  src = fetchurl {
+    url = "https://wpitchoune.net/ptask/files/${name}.tar.gz";
+    sha256 = "13nirr7b29bv3w2zc8zxphhmc9ayhs61i11jl4819nabk7vy1kdq";
+  };
+
+  buildInputs = [ gtk3 json_c ];
+
+  nativeBuildInputs = [ pkgconfig makeWrapper ];
+
+  patches = [ ./tw-version.patch ./json_c_is_error.patch ];
+
+  preFixup = ''
+    wrapProgram "$out/bin/ptask" \
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
+      --prefix PATH : "${taskwarrior}/bin"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://wpitchoune.net/ptask/;
+    description = "GTK-based GUI for taskwarrior";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.spacefrogg ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/ptask/json_c_is_error.patch b/nixpkgs/pkgs/applications/misc/ptask/json_c_is_error.patch
new file mode 100644
index 000000000000..435c8b26e6f7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ptask/json_c_is_error.patch
@@ -0,0 +1,13 @@
+diff --git a/src/tw.c b/src/tw.c
+index 602f7b3..ca601cd 100644
+--- a/src/tw.c
++++ b/src/tw.c
+@@ -163,7 +163,7 @@ static struct json_object *task_exec_json(const char *opts)
+ 
+ 	free(cmd);
+ 
+-	if (o && is_error(o))
++	if (!o)
+ 		return NULL;
+ 
+ 	return o;
diff --git a/nixpkgs/pkgs/applications/misc/ptask/tw-version.patch b/nixpkgs/pkgs/applications/misc/ptask/tw-version.patch
new file mode 100644
index 000000000000..995fffeda2f8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ptask/tw-version.patch
@@ -0,0 +1,11 @@
+--- a/src/tw.c	2017-02-21 22:56:19.289037608 +0100
++++ b/src/tw.c	2017-02-21 22:57:04.726814256 +0100
+@@ -116,7 +116,7 @@
+ 	    || !strcmp(ver, "2.3.0")
+ 	    || !strcmp(ver, "2.4.0")
+ 	    || !strcmp(ver, "2.4.1")
+-	    || !strcmp(ver, "2.5.0"))
++	    || !strcmp(ver, "2.5.1"))
+ 		return 1;
+ 	else
+ 		return 0;
diff --git a/nixpkgs/pkgs/applications/misc/pwsafe/default.nix b/nixpkgs/pkgs/applications/misc/pwsafe/default.nix
new file mode 100644
index 000000000000..1ed54b05ec8c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pwsafe/default.nix
@@ -0,0 +1,68 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, zip, gettext, perl
+, wxGTK31, libXext, libXi, libXt, libXtst, xercesc
+, qrencode, libuuid, libyubikey, yubikey-personalization
+, curl, openssl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pwsafe";
+  version = "1.08.1";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "${version}BETA";
+    sha256 = "0x89pn056h8b4yvxbd6l3qwrghslxc7vlxnblmcmsx7xx4i041ng";
+  };
+
+  nativeBuildInputs = [ 
+    cmake gettext perl pkgconfig zip
+  ];
+  buildInputs = [
+    libXext libXi libXt libXtst wxGTK31
+    curl qrencode libuuid openssl xercesc
+    libyubikey yubikey-personalization
+  ];
+
+  cmakeFlags = [
+    "-DNO_GTEST=ON"
+    "-DCMAKE_CXX_FLAGS=-I${yubikey-personalization}/include/ykpers-1"
+  ];
+  enableParallelBuilding = true;
+
+  postPatch = ''
+    # Fix perl scripts used during the build.
+    for f in `find . -type f -name '*.pl'`; do
+      patchShebangs $f
+    done
+
+    # Fix hard coded paths.
+    for f in `grep -Rl /usr/share/ src`; do
+      substituteInPlace $f --replace /usr/share/ $out/share/
+    done
+
+    # Fix hard coded zip path.
+    substituteInPlace help/Makefile.linux --replace /usr/bin/zip ${zip}/bin/zip
+
+    for f in `grep -Rl /usr/bin/ .`; do
+      substituteInPlace $f --replace /usr/bin/ ""
+    done
+  '';
+
+  installFlags = [ "PREFIX=${placeholder "out"}" ];
+
+  meta = with stdenv.lib; {
+    description = "A password database utility";
+    longDescription = ''
+      Password Safe is a password database utility. Like many other
+      such products, commercial and otherwise, it stores your
+      passwords in an encrypted file, allowing you to remember only
+      one password (the "safe combination"), instead of all the
+      username/password combinations that you use.
+    '';
+    homepage = "https://pwsafe.org/";
+    maintainers = with maintainers; [ c0bw3b pjones ];
+    platforms = platforms.linux;
+    license = licenses.artistic2;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pydf/default.nix b/nixpkgs/pkgs/applications/misc/pydf/default.nix
new file mode 100644
index 000000000000..bfbee1bea24d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pydf/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, python3Packages }:
+
+python3Packages.buildPythonPackage rec {
+  pname = "pydf";
+  version = "12";
+
+  src = python3Packages.fetchPypi {
+    inherit pname version;
+    sha256 = "7f47a7c3abfceb1ac04fc009ded538df1ae449c31203962a1471a4eb3bf21439";
+  };
+
+  meta = with stdenv.lib; {
+    description = "colourised df(1)-clone";
+    homepage = http://kassiopeia.juls.savba.sk/~garabik/software/pydf/;
+    license = licenses.publicDomain;
+    maintainers = with maintainers; [ monsieurp ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pytrainer/default.nix b/nixpkgs/pkgs/applications/misc/pytrainer/default.nix
new file mode 100644
index 000000000000..cdeca96568df
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pytrainer/default.nix
@@ -0,0 +1,64 @@
+{ stdenv, fetchFromGitHub, perl, python, sqlite, gpsbabel
+, withWebKit ? false }:
+
+let
+
+  # Pytrainer needs a matplotlib with GTK backend. Also ensure we are
+  # using the pygtk with glade support as needed by pytrainer.
+  matplotlibGtk = python.pkgs.matplotlib.override {
+    enableGtk2 = true;
+    pygtk = python.pkgs.pyGtkGlade;
+  };
+
+in
+
+python.pkgs.buildPythonApplication rec {
+  name = "pytrainer-${version}";
+  version = "1.12.1";
+
+  src = fetchFromGitHub {
+    owner = "pytrainer";
+    repo = "pytrainer";
+    rev = "v${version}";
+    sha256 = "0rzf8kks96qzlknh6g3b9pjq04j7qk6rmz58scp7sck8xz9rjbwx";
+  };
+
+  namePrefix = "";
+
+  patches = [
+    # The test fails in the UTC timezone and C locale.
+    ./fix-test-tz.patch
+
+    # The existing use of pywebkitgtk shows raw HTML text instead of
+    # map. This patch solves the problems by showing the file from a
+    # string, which allows setting an explicit MIME type.
+    ./pytrainer-webkit.patch
+  ];
+
+  postPatch = ''
+    substituteInPlace ./setup.py \
+      --replace "'mysqlclient'," ""
+  '';
+
+  propagatedBuildInputs = with python.pkgs; [
+    dateutil lxml matplotlibGtk pyGtkGlade sqlalchemy sqlalchemy_migrate psycopg2
+  ] ++ stdenv.lib.optional withWebKit [ pywebkitgtk ];
+
+  buildInputs = [ perl gpsbabel sqlite ];
+
+  # This package contains no binaries to patch or strip.
+  dontPatchELF = true;
+  dontStrip = true;
+
+  checkPhase = ''
+    ${python.interpreter} -m unittest discover
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/pytrainer/pytrainer/wiki;
+    description = "Application for logging and graphing sporting excursions";
+    maintainers = [ maintainers.rycee ];
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/pytrainer/fix-test-tz.patch b/nixpkgs/pkgs/applications/misc/pytrainer/fix-test-tz.patch
new file mode 100644
index 000000000000..ca4875769013
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pytrainer/fix-test-tz.patch
@@ -0,0 +1,45 @@
+diff -Nurp source.orig/pytrainer/test/core/test_activity.py source/pytrainer/test/core/test_activity.py
+--- source.orig/pytrainer/test/core/test_activity.py	2018-02-27 22:15:32.078243354 +0100
++++ source/pytrainer/test/core/test_activity.py	2018-02-27 22:16:33.936867052 +0100
+@@ -92,7 +92,7 @@ class ActivityTest(unittest.TestCase):
+         self.assertEquals(self.activity.time, self.activity.duration)
+ 
+     def test_activity_starttime(self):
+-        self.assertEquals(self.activity.starttime, '12:58:23 PM')
++        self.assertEquals(self.activity.starttime, '12:58:23')
+ 
+     def test_activity_time_tuple(self):
+         self.assertEquals(self.activity.time_tuple, (2, 3, 46))
+diff -Nurp source.orig/pytrainer/test/imports/test_garmintcxv2.py source/pytrainer/test/imports/test_garmintcxv2.py
+--- source.orig/pytrainer/test/imports/test_garmintcxv2.py	2018-02-27 22:15:32.079243364 +0100
++++ source/pytrainer/test/imports/test_garmintcxv2.py	2018-02-27 22:17:10.778333751 +0100
+@@ -39,7 +39,7 @@ class GarminTCXv2Test(unittest.TestCase)
+             self.fail()
+ 
+     def test_workout_summary(self):
+-        summary = [(0, False, '2012-10-14T12:02:42', '10.12', '00:39:51', 'Running')]
++        summary = [(0, False, '2012-10-14T10:02:42', '10.12', '00:39:51', 'Running')]
+         try:
+             current_path = os.path.dirname(os.path.abspath(__file__))
+             data_path = os.path.dirname(os.path.dirname(os.path.dirname(current_path))) + "/"
+@@ -52,7 +52,7 @@ class GarminTCXv2Test(unittest.TestCase)
+             self.fail()
+ 
+     def test_summary_in_database(self):
+-        summary = [(0, True, '2012-10-14T12:02:42', '10.12', '00:39:51', 'Running')]
++        summary = [(0, True, '2012-10-14T10:02:42', '10.12', '00:39:51', 'Running')]
+         activity = Activity(date_time_utc='2012-10-14T10:02:42Z', sport_id='1')
+         self.ddbb.session.add(activity)
+         self.ddbb.session.commit(
+diff -Nurp source.orig/pytrainer/test/lib/test_date.py source/pytrainer/test/lib/test_date.py
+--- source.orig/pytrainer/test/lib/test_date.py	2018-05-10 21:15:22.196275555 +0200
++++ source/pytrainer/test/lib/test_date.py	2018-05-10 21:22:43.647870401 +0200
+@@ -47,7 +47,7 @@ class DateFunctionTest(unittest.TestCase
+     def test_getDateTime(self):
+         utctime, localtime = getDateTime('Tue Nov 24 17:29:05 UTC 2015')
+         self.assertEqual(datetime.datetime(2015, 11, 24, 17, 29, 5, tzinfo=tzutc()), utctime)
+-        self.assertEqual(datetime.datetime(2015, 11, 24, 19, 29, 5, tzinfo=tzlocal()), localtime)
++        self.assertEqual(datetime.datetime(2015, 11, 24, 17, 29, 5, tzinfo=tzlocal()), localtime)
+ 
+ class DateRangeTest(unittest.TestCase):
+ 
diff --git a/nixpkgs/pkgs/applications/misc/pytrainer/pytrainer-webkit.patch b/nixpkgs/pkgs/applications/misc/pytrainer/pytrainer-webkit.patch
new file mode 100644
index 000000000000..0f894c46a53b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/pytrainer/pytrainer-webkit.patch
@@ -0,0 +1,14 @@
+diff -Nurp pytrainer-1.10.0-orig/pytrainer/extensions/mapviewer.py pytrainer-1.10.0/pytrainer/extensions/mapviewer.py
+--- pytrainer-1.10.0-orig/pytrainer/extensions/mapviewer.py	2013-03-31 12:28:29.000000000 +0200
++++ pytrainer-1.10.0/pytrainer/extensions/mapviewer.py	2014-12-22 11:44:44.367032126 +0100
+@@ -46,7 +46,9 @@ class MapViewer:
+ 		logging.debug(">>")
+ 		if htmlfile is None:
+ 			htmlfile = self.createErrorHtml()
+-		self.wkview.load_uri("file://%s" % (htmlfile))
++		content = open(htmlfile, 'r').read()
++		self.wkview.load_string(content, 'text/html', 'UTF-8', 'file:///')
++		#self.wkview.load_uri("file://%s" % (htmlfile))
+ 		#self.box.show_all()
+ 		logging.debug("<<")
+ 
diff --git a/nixpkgs/pkgs/applications/misc/qMasterPassword/default.nix b/nixpkgs/pkgs/applications/misc/qMasterPassword/default.nix
new file mode 100644
index 000000000000..e0a1e33dc628
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/qMasterPassword/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchFromGitHub, qtbase, qmake, libX11, libXtst, openssl, libscrypt }:
+
+stdenv.mkDerivation rec {
+  name = "qMasterPassword";
+  version = "1.2.2";
+
+  src = fetchFromGitHub {
+    owner = "bkueng";
+    repo = name;
+    rev = "v${version}";
+    sha256 = "0l0jarvfdc69rcjl2wa0ixq8gp3fmjsy9n84m38sxf3n9j2bh13c";
+  };
+
+  buildInputs = [ qtbase libX11 libXtst openssl libscrypt ];
+  nativeBuildInputs = [ qmake ];
+
+  # Upstream install is mostly defunct. It hardcodes target.path and doesn't
+  # install anything but the binary.
+  installPhase = if stdenv.isDarwin then ''
+    mkdir -p "$out"/{Applications,bin}
+    mv qMasterPassword.app "$out"/Applications/
+    ln -s ../Applications/qMasterPassword.app/Contents/MacOS/qMasterPassword "$out"/bin/qMasterPassword
+  '' else ''
+    mkdir -p $out/bin
+    mkdir -p $out/share/{applications,doc/qMasterPassword,icons/qmasterpassword,icons/hicolor/512x512/apps}
+    mv qMasterPassword $out/bin
+    mv data/qMasterPassword.desktop $out/share/applications
+    mv LICENSE README.md $out/share/doc/qMasterPassword
+    mv data/icons/app_icon.png $out/share/icons/hicolor/512x512/apps/qmasterpassword.png
+    mv data/icons/* $out/share/icons/qmasterpassword
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Stateless Master Password Manager";
+    longDescription = ''
+      Access all your passwords using only a single master password. But in
+      contrast to other managers it does not store any passwords: Unique
+      passwords are generated from the master password and a site name. This
+      means you automatically get different passwords for each account and
+      there is no password file that can be lost or get stolen. There is also
+      no need to trust any online password service.
+    '';
+    homepage = https://github.com/bkueng/qMasterPassword;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.tadeokondrak ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/qdirstat/default.nix b/nixpkgs/pkgs/applications/misc/qdirstat/default.nix
new file mode 100644
index 000000000000..abf4bb054621
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/qdirstat/default.nix
@@ -0,0 +1,55 @@
+{ stdenv, fetchFromGitHub, qmake
+, coreutils, xdg_utils, bash
+, makeWrapper, perlPackages }:
+
+let
+  version = "1.5";
+in stdenv.mkDerivation rec {
+  name = "qdirstat-${version}";
+
+  src = fetchFromGitHub {
+    owner = "shundhammer";
+    repo = "qdirstat";
+    rev = "${version}";
+    sha256 = "1v879kd7zahalb2qazq61wzi364k5cy3lgy6c8wj6mclwxjws1vc";
+  };
+
+  nativeBuildInputs = [ qmake makeWrapper ];
+
+  buildInputs = [ perlPackages.perl ];
+
+  preBuild = ''
+    substituteInPlace scripts/scripts.pro \
+      --replace /bin/true ${coreutils}/bin/true
+
+    for i in src/SysUtil.cpp src/FileSizeStatsWindow.cpp
+    do
+      substituteInPlace $i \
+        --replace /usr/bin/xdg-open ${xdg_utils}/bin/xdg-open
+    done
+    for i in src/Cleanup.cpp src/cleanup-config-page.ui
+    do
+      substituteInPlace $i \
+        --replace /bin/bash ${bash}/bin/bash \
+        --replace /bin/sh ${bash}/bin/sh
+    done
+    substituteInPlace src/StdCleanup.cpp \
+      --replace /bin/bash ${bash}/bin/bash
+  '';
+  postPatch = ''
+    export qmakeFlags="$qmakeFlags INSTALL_PREFIX=$out"
+  '';
+
+  postInstall = ''
+    wrapProgram $out/bin/qdirstat-cache-writer \
+      --set PERL5LIB "${perlPackages.makePerlPath [ perlPackages.URI ]}"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Graphical disk usage analyzer";
+    homepage = src.meta.homepage;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ gnidorah ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/qlcplus/default.nix b/nixpkgs/pkgs/applications/misc/qlcplus/default.nix
new file mode 100644
index 000000000000..df5f35102e01
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/qlcplus/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, mkDerivation, fetchFromGitHub, qmake, pkgconfig, udev
+, qtmultimedia, qtscript, alsaLib, ola, libftdi1, libusb
+, libsndfile, libmad
+}:
+
+mkDerivation rec {
+  name = "qlcplus-${version}";
+  version = "4.12.1";
+
+  src = fetchFromGitHub {
+    owner = "mcallegari";
+    repo = "qlcplus";
+    rev = "QLC+_${version}";
+    sha256 = "1kz2zbz7blnm91dysn949bjsy4xqxg658k47p3gbl0pjl58c44hp";
+  };
+
+  nativeBuildInputs = [ qmake pkgconfig ];
+  buildInputs = [
+    udev qtmultimedia qtscript alsaLib ola libftdi1 libusb libsndfile libmad
+  ];
+
+  qmakeFlags = [ "INSTALLROOT=$(out)" ];
+
+  postPatch = ''
+    patchShebangs .
+    sed -i -e '/unix:!macx:INSTALLROOT += \/usr/d' \
+            -e "s@\$\$LIBSDIR/qt4/plugins@''${qtPluginPrefix}@" \
+            -e "s@/etc/udev/rules.d@''${out}/lib/udev/rules.d@" \
+      variables.pri
+  '';
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    ln -sf $out/lib/*/libqlcplus* $out/lib
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A free and cross-platform software to control DMX or analog lighting systems like moving heads, dimmers, scanners etc.";
+    maintainers = [ maintainers.globin ];
+    license = licenses.asl20;
+    platforms = platforms.all;
+    homepage = "http://www.qlcplus.org/";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/qmapshack/default.nix b/nixpkgs/pkgs/applications/misc/qmapshack/default.nix
new file mode 100644
index 000000000000..b38369babe8c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/qmapshack/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, fetchpatch, cmake, qtscript, qtwebengine, gdal, proj, routino, quazip }:
+
+stdenv.mkDerivation rec {
+  name = "qmapshack-${version}";
+  version = "1.13.0";
+
+  src = fetchurl {
+    url = "https://bitbucket.org/maproom/qmapshack/downloads/${name}.tar.gz";
+    sha256 = "1cv1f718r8vqyk2l6w3alz2aqjvb4msz8705pm9yr5ndi28qyrba";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ qtscript qtwebengine gdal proj routino quazip ];
+
+  cmakeFlags = [
+    "-DROUTINO_XML_PATH=${routino}/share/routino"
+    "-DQUAZIP_INCLUDE_DIR=${quazip}/include/quazip5"
+    "-DLIBQUAZIP_LIBRARY=${quazip}/lib/libquazip.so"
+  ];
+
+  enableParallelBuilding = true;
+
+  patches = [
+    (fetchpatch {
+      url = "https://bitbucket.org/maproom/qmapshack/raw/d0b1b595578a83fda981ccc1ff24166fa636ba1d/FindPROJ4.patch";
+      sha256 = "1nx4ax233bnnj478cmjpm5c1qqmyn1navlihf10q6hhbanay9n99";
+    })
+    (fetchpatch {
+      url = "https://bitbucket.org/maproom/qmapshack/raw/d0b1b595578a83fda981ccc1ff24166fa636ba1d/FindQuaZip5.patch";
+      sha256 = "0z1b2dz2zlz685mxgn8bmh1fyhxpf6dzd6jvkkjyk2kvnrdxv3b9";
+    })
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = https://bitbucket.org/maproom/qmapshack/wiki/Home;
+    description = "Plan your next outdoor trip";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ dotlambda ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/qmetro/default.nix b/nixpkgs/pkgs/applications/misc/qmetro/default.nix
new file mode 100644
index 000000000000..49993f2f7ea7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/qmetro/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, qmake4Hook, unzip, qt4 }:
+
+stdenv.mkDerivation rec {
+  name = "${project}-${version}";
+  project = "qmetro";
+  version = "0.7.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${project}/${name}.zip";
+    sha256 = "1zdj87lzcr43gr2h05g17z31pd22n5kxdwbvx7rx656rmhv0sjq5";
+  };
+
+  nativeBuildInputs = [ qmake4Hook unzip ];
+
+  buildInputs = [ qt4 ];
+
+  postPatch = ''
+    sed -e 's#Exec=/usr/bin/qmetro#Exec=qmetro#' -i rc/qmetro.desktop
+    echo 'LIBS += -lz' >> qmetro.pro
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = https://sourceforge.net/projects/qmetro/;
+    description = "Worldwide transit maps viewer";
+    license = licenses.gpl3;
+
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/qolibri/default.nix b/nixpkgs/pkgs/applications/misc/qolibri/default.nix
new file mode 100644
index 000000000000..e395ae9c070d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/qolibri/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchFromGitHub, pkgconfig, cmake, libeb, lzo, qtbase
+, qtmultimedia, qttools, qtwebengine }:
+
+stdenv.mkDerivation rec {
+  name = "qolibri-${version}";
+  version = "2018-11-14";
+
+  src = fetchFromGitHub {
+    owner = "ludios";
+    repo = "qolibri";
+    rev = "133a1c33e74d931ad54407f70d84a0016d96981f";
+    sha256 = "16ifix0q8ww4l3xflgxr9j81c0lzlnkjr8fj961x3nxz7288pdg2";
+  };
+
+  nativeBuildInputs = [ pkgconfig cmake ];
+  buildInputs = [
+    libeb lzo qtbase qtmultimedia qttools qtwebengine
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/ludios/qolibri;
+    description = "EPWING reader for viewing Japanese dictionaries";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ivan ];
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/qpdfview/default.nix b/nixpkgs/pkgs/applications/misc/qpdfview/default.nix
new file mode 100644
index 000000000000..263bc37660c9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/qpdfview/default.nix
@@ -0,0 +1,44 @@
+{stdenv, fetchurl, qmake, qtbase, qtsvg, pkgconfig, poppler, djvulibre, libspectre, cups
+, file, ghostscript
+}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="qpdfview";
+    version = "0.4.16";
+    name="${baseName}-${version}";
+    url="https://launchpad.net/qpdfview/trunk/${version}/+download/qpdfview-${version}.tar.gz";
+    sha256 = "0zysjhr58nnmx7ba01q3zvgidkgcqxjdj4ld3gx5fc7wzvl1dm7s";
+  };
+  nativeBuildInputs = [ qmake pkgconfig ];
+  buildInputs = [
+    qtbase qtsvg poppler djvulibre libspectre cups file ghostscript
+  ];
+in
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit nativeBuildInputs buildInputs;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  qmakeFlags = [
+    "*.pro"
+    "TARGET_INSTALL_PATH=${placeholder "out"}/bin"
+    "PLUGIN_INSTALL_PATH=${placeholder "out"}/lib/qpdfview"
+    "DATA_INSTALL_PATH=${placeholder "out"}/share/qpdfview"
+    "MANUAL_INSTALL_PATH=${placeholder "out"}/share/man/man1"
+    "ICON_INSTALL_PATH=${placeholder "out"}/share/icons/hicolor/scalable/apps"
+    "LAUNCHER_INSTALL_PATH=${placeholder "out"}/share/applications"
+    "APPDATA_INSTALL_PATH=${placeholder "out"}/share/appdata"
+  ];
+
+  meta = {
+    inherit (s) version;
+    description = "A tabbed document viewer";
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+    homepage = https://launchpad.net/qpdfview;
+    updateWalker = true;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/qsyncthingtray/default.nix b/nixpkgs/pkgs/applications/misc/qsyncthingtray/default.nix
new file mode 100644
index 000000000000..6ae8f380fe28
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/qsyncthingtray/default.nix
@@ -0,0 +1,74 @@
+{ mkDerivation, stdenv, lib, fetchFromGitHub, fetchpatch, procps
+, qtbase, qtwebengine, qtwebkit
+, cmake
+, syncthing
+, preferQWebView ? false
+, preferNative   ? true }:
+
+mkDerivation rec {
+  version = "0.5.8";
+  name = "qsyncthingtray-${version}";
+
+  src = fetchFromGitHub {
+    owner  = "sieren";
+    repo   = "QSyncthingTray";
+    rev    = "${version}";
+    sha256 = "1n9g4j7qznvg9zl6x163pi9f7wsc3x6q76i33psnm7x2v1i22x5w";
+  };
+
+  buildInputs = [ qtbase qtwebengine ] ++ lib.optional preferQWebView qtwebkit;
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [ ]
+    ++ lib.optional preferQWebView "-DQST_BUILD_WEBKIT=1"
+    ++ lib.optional preferNative   "-DQST_BUILD_NATIVEBROWSER=1";
+
+  patches = [ (fetchpatch {
+    name = "support_native_browser.patch";
+    url = "https://patch-diff.githubusercontent.com/raw/sieren/QSyncthingTray/pull/225.patch";
+    sha256 = "0w665xdlsbjxs977pdpzaclxpswf7xys1q3rxriz181lhk2y66yy";
+  }) ] ++ lib.optional (!preferQWebView && !preferNative) ./qsyncthingtray-0.5.8-qt-5.6.3.patch;
+
+  postPatch = ''
+    ${lib.optionalString stdenv.isLinux ''
+      substituteInPlace includes/platforms/linux/posixUtils.hpp \
+        --replace '"/usr/local/bin/syncthing"'         '"${syncthing}/bin/syncthing"' \
+        --replace '"pgrep -x'                          '"${procps}/bin/pgrep -x'
+    ''}
+
+    ${lib.optionalString stdenv.isDarwin ''
+      substituteInPlace includes/platforms/darwin/macUtils.hpp \
+        --replace '"/usr/local/bin/syncthing"'         '"${syncthing}/bin/syncthing"'
+    ''}
+  '';
+
+  installPhase = let qst = "qsyncthingtray"; in ''
+    runHook preInstall
+
+    mkdir -p $out/bin
+    install -m755 QSyncthingTray $out/bin/${qst}
+    ln -s $out/bin/${qst} $out/bin/QSyncthingTray
+
+    runHook postInstall
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = https://github.com/sieren/QSyncthingTray/;
+    description = "A Traybar Application for Syncthing written in C++";
+    longDescription = ''
+        A cross-platform status bar for Syncthing.
+        Currently supports macOS, Windows and Linux.
+        Written in C++ with Qt.
+    '';
+    license = licenses.lgpl3;
+    maintainers = with maintainers; [ zraexy peterhoeg ];
+    platforms = platforms.all;
+    # 0.5.7 segfaults when opening the main panel with qt 5.7 and fails to compile with qt 5.8
+    # but qt > 5.6 works when only using the native browser
+    # https://github.com/sieren/QSyncthingTray/issues/223
+    broken = (builtins.compareVersions qtbase.version "5.7.0" >= 0 && !preferNative);
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/qsyncthingtray/qsyncthingtray-0.5.8-qt-5.6.3.patch b/nixpkgs/pkgs/applications/misc/qsyncthingtray/qsyncthingtray-0.5.8-qt-5.6.3.patch
new file mode 100644
index 000000000000..424bbe171779
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/qsyncthingtray/qsyncthingtray-0.5.8-qt-5.6.3.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b778d09..247b606 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -12,7 +12,7 @@ set(CMAKE_AUTOMOC ON)
+ 
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ 
+-find_package(Qt5 5.6 COMPONENTS Widgets Network PrintSupport)
++find_package(Qt5 5.6 COMPONENTS Widgets Network PrintSupport WebEngineWidgets)
+ if (NOT Qt5_FOUND)
+   message(FATAL_ERROR
+     "Some components of Qt5 not found (see above messages for details. "
diff --git a/nixpkgs/pkgs/applications/misc/qtbitcointrader/default.nix b/nixpkgs/pkgs/applications/misc/qtbitcointrader/default.nix
new file mode 100644
index 000000000000..7586669218da
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/qtbitcointrader/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchzip, qt5 }:
+
+let
+  version = "1.40.41";
+in
+stdenv.mkDerivation {
+  name = "qtbitcointrader-${version}";
+
+  src = fetchzip {
+    url = "https://github.com/JulyIGHOR/QtBitcoinTrader/archive/v${version}.tar.gz";
+    sha256 = "0v2rqzswqxfhxvkj1i7b48sd6kbj3w9issvn05yhp7bx75gwns4p";
+  };
+
+  buildInputs = [ qt5.qtbase qt5.qtmultimedia qt5.qtscript ];
+
+  postUnpack = "sourceRoot=\${sourceRoot}/src";
+
+  configurePhase = ''
+    runHook preConfigure
+    qmake $qmakeFlags \
+      PREFIX=$out \
+      DESKTOPDIR=$out/share/applications \
+      ICONDIR=$out/share/pixmaps \
+      QtBitcoinTrader_Desktop.pro
+    runHook postConfigure
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Bitcoin trading client";
+    homepage = https://centrabit.com/;
+    license = licenses.gpl3;
+    platforms = qt5.qtbase.meta.platforms;
+    maintainers = [ maintainers.ehmry ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/qtpass/default.nix b/nixpkgs/pkgs/applications/misc/qtpass/default.nix
new file mode 100644
index 000000000000..15cd426f1b3f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/qtpass/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, git, gnupg, pass, qtbase, qtsvg, qttools, qmake, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "qtpass";
+  version = "1.2.3";
+
+  src = fetchFromGitHub {
+    owner  = "IJHack";
+    repo   = "QtPass";
+    rev    = "v${version}";
+    sha256 = "1vfhfyccrxq9snyvayqfzm5rqik8ny2gysyv7nipc91kvhq3bhky";
+  };
+
+  buildInputs = [ git gnupg pass qtbase qtsvg qttools ];
+
+  nativeBuildInputs = [ makeWrapper qmake ];
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    install -D qtpass.desktop $out/share/applications/qtpass.desktop
+    install -D artwork/icon.svg $out/share/icons/hicolor/scalable/apps/qtpass-icon.svg
+    wrapProgram $out/bin/qtpass \
+      --suffix PATH : ${git}/bin \
+      --suffix PATH : ${gnupg}/bin \
+      --suffix PATH : ${pass}/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A multi-platform GUI for pass, the standard unix password manager";
+    homepage = https://qtpass.org;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.hrdinka ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/quicksynergy/default.nix b/nixpkgs/pkgs/applications/misc/quicksynergy/default.nix
new file mode 100644
index 000000000000..b2616bf7b778
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/quicksynergy/default.nix
@@ -0,0 +1,37 @@
+{stdenv, fetchurl, pkgconfig, gtk2, synergy}:
+
+stdenv.mkDerivation rec {
+  name = "quicksynergy-${version}";
+  version = "0.9.0";
+  src = fetchurl {
+    url = "mirror://sourceforge/project/quicksynergy/Linux/${version}/quicksynergy-${version}.tar.gz";
+    sha256 = "1pi8503bg8q1psw50y6d780i33nnvfjqiy9vnr3v52pdcfip8pix";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    gtk2
+    synergy
+  ];
+  preBuild = "
+    sed -i 's@/usr/bin@${synergy.out}/bin@' src/synergy_config.c
+  ";
+  meta = {
+    description = "GUI application to share mouse and keyboard between computers";
+    longDescription = "
+      QuickSynergy is a graphical interface (GUI) for easily configuring
+      Synergy2, an application that allows the user to share his mouse and
+      keyboard between two or more computers.
+
+      Without the need for any external hardware, Synergy2 uses the TCP-IP
+      protocol to share the resources, even between machines with diferent
+      operating systems, such as Mac OS, Linux and Windows.
+
+      Remember to open port 24800 (used by synergys program) if you want to
+      host mouse and keyboard.";
+    homepage = https://sourceforge.net/projects/quicksynergy/;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [ stdenv.lib.maintainers.spinus ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/ranger/default.nix b/nixpkgs/pkgs/applications/misc/ranger/default.nix
new file mode 100644
index 000000000000..7045228d6a2f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ranger/default.nix
@@ -0,0 +1,64 @@
+{ stdenv, lib, fetchFromGitHub, python3Packages, file, less, highlight
+, imagePreviewSupport ? true, w3m ? null}:
+
+with stdenv.lib;
+
+assert imagePreviewSupport -> w3m != null;
+
+python3Packages.buildPythonApplication rec {
+  name = "ranger-${version}";
+  version = "1.9.2";
+
+  src = fetchFromGitHub {
+    owner = "ranger";
+    repo = "ranger";
+    rev = "v${version}";
+    sha256= "1ws6g8z1m1hfp8bv4msvbaa9f7948p687jmc8h69yib4jkv3qyax";
+  };
+
+  LC_ALL = "en_US.UTF-8";
+
+  checkInputs = with python3Packages; [ pytest ];
+  propagatedBuildInputs = [ file ]
+    ++ lib.optional (imagePreviewSupport) [ python3Packages.pillow ];
+
+  checkPhase = ''
+    py.test tests
+  '';
+
+  preConfigure = ''
+    ${lib.optionalString (highlight != null) ''
+      sed -i -e 's|^\s*highlight\b|${highlight}/bin/highlight|' \
+        ranger/data/scope.sh
+    ''}
+
+    substituteInPlace ranger/data/scope.sh \
+      --replace "/bin/echo" "echo"
+
+    substituteInPlace ranger/__init__.py \
+      --replace "DEFAULT_PAGER = 'less'" "DEFAULT_PAGER = '${stdenv.lib.getBin less}/bin/less'"
+
+    for i in ranger/config/rc.conf doc/config/rc.conf ; do
+      substituteInPlace $i --replace /usr/share $out/share
+    done
+
+    # give file previews out of the box
+    substituteInPlace ranger/config/rc.conf \
+      --replace "#set preview_script ~/.config/ranger/scope.sh" "set preview_script $out/share/doc/ranger/config/scope.sh"
+  '' + optionalString imagePreviewSupport ''
+    substituteInPlace ranger/ext/img_display.py \
+      --replace /usr/lib/w3m ${w3m}/libexec/w3m
+
+    # give image previews out of the box when building with w3m
+    substituteInPlace ranger/config/rc.conf \
+      --replace "set preview_images false" "set preview_images true"
+  '';
+
+  meta =  with lib; {
+    description = "File manager with minimalistic curses interface";
+    homepage = http://ranger.github.io/;
+    license = licenses.gpl3;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.toonn maintainers.magnetophon ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/redis-desktop-manager/default.nix b/nixpkgs/pkgs/applications/misc/redis-desktop-manager/default.nix
new file mode 100644
index 000000000000..bf4559e91178
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/redis-desktop-manager/default.nix
@@ -0,0 +1,80 @@
+{ stdenv, lib, fetchgit, pkgconfig, libssh2
+, qtbase, qtdeclarative, qtgraphicaleffects, qtimageformats, qtquickcontrols
+, qtsvg, qttools, qtquick1, qtcharts
+, qmake
+}:
+
+let
+  breakpad_lss = fetchgit {
+    url = "https://chromium.googlesource.com/linux-syscall-support";
+    rev = "08056836f2b4a5747daff75435d10d649bed22f6";
+    sha256 = "1ryshs2nyxwa0kn3rlbnd5b3fhna9vqm560yviddcfgdm2jyg0hz";
+  };
+
+in
+
+stdenv.mkDerivation rec {
+  name = "redis-desktop-manager-${version}";
+  version = "0.9.1";
+
+  src = fetchgit {
+    url = "https://github.com/uglide/RedisDesktopManager.git";
+    fetchSubmodules = true;
+    rev = "refs/tags/${version}";
+    sha256 = "0yd4i944d4blw8jky0nxl7sfkkj975q4d328rdcbhizwvf6dx81f";
+  };
+
+  nativeBuildInputs = [ pkgconfig qmake ];
+  buildInputs = [
+    libssh2 qtbase qtdeclarative qtgraphicaleffects qtimageformats
+    qtquick1 qtquickcontrols qtsvg qttools qtcharts
+  ];
+
+  dontUseQmakeConfigure = true;
+
+  # Disable annoying update reminder
+  postPatch = ''
+    sed -i s/'^\s*initUpdater();'/'\/\/initUpdater():'/ src/app/app.cpp
+  '';
+
+  buildPhase = ''
+    srcdir=$PWD
+
+    cat <<EOF > src/version.h
+#ifndef RDM_VERSION
+    #define RDM_VERSION "${version}-120"
+#endif // !RDM_VERSION
+EOF
+
+    cd $srcdir/3rdparty/gbreakpad
+    cp -r ${breakpad_lss} src/third_party/lss
+    chmod +w -R src/third_party/lss
+    touch README
+
+    cd $srcdir/3rdparty/crashreporter
+    qmake CONFIG+=release DESTDIR="$srcdir/rdm/bin/linux/release" QMAKE_LFLAGS_RPATH=""
+    make
+
+    cd $srcdir/3rdparty/gbreakpad
+    ./configure
+    make
+
+    cd $srcdir/src
+    qmake
+    make
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    instdir="$srcdir/bin/linux/release"
+    cp $instdir/rdm $out/bin
+  '';
+
+  meta = with lib; {
+    description = "Cross-platform open source Redis DB management tool";
+    homepage = https://redisdesktop.com/;
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ cstrahan ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/redshift-plasma-applet/default.nix b/nixpkgs/pkgs/applications/misc/redshift-plasma-applet/default.nix
new file mode 100644
index 000000000000..03b8d709fce2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/redshift-plasma-applet/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, cmake, extra-cmake-modules, plasma-framework, kwindowsystem, redshift, fetchFromGitHub, }:
+
+let version = "1.0.18"; in
+
+stdenv.mkDerivation {
+  name = "redshift-plasma-applet-${version}";
+
+  src = fetchFromGitHub {
+    owner = "kotelnik";
+    repo = "plasma-applet-redshift-control";
+    rev = "v${version}";
+    sha256 = "122nnbafa596rxdxlfshxk45lzch8c9342bzj7kzrsjkjg0xr9pq";
+  };
+
+  patchPhase = ''
+    substituteInPlace package/contents/ui/main.qml \
+      --replace "redshiftCommand: 'redshift'" \
+                "redshiftCommand: '${redshift}/bin/redshift'" \
+      --replace "redshiftOneTimeCommand: 'redshift -O " \
+                "redshiftOneTimeCommand: '${redshift}/bin/redshift -O "
+
+    substituteInPlace package/contents/ui/config/ConfigAdvanced.qml \
+      --replace "'redshift -V'" \
+                "'${redshift}/bin/redshift -V'"
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+  ];
+
+  buildInputs = [
+    plasma-framework
+    kwindowsystem
+  ];
+
+  meta = with stdenv.lib; {
+    description = "KDE Plasma 5 widget for controlling Redshift";
+    homepage = https://github.com/kotelnik/plasma-applet-redshift-control;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ benley zraexy ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/redshift/575.patch b/nixpkgs/pkgs/applications/misc/redshift/575.patch
new file mode 100644
index 000000000000..d731d8ec43ad
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/redshift/575.patch
@@ -0,0 +1,51 @@
+From 467156efccc5e36a36bec8c0b64cc5a70f14d5ed Mon Sep 17 00:00:00 2001
+From: Yegor Timoshenko <yegortimoshenko@riseup.net>
+Date: Tue, 16 Jan 2018 11:43:46 +0000
+Subject: [PATCH] Fix Autoconf script
+
+gettext/intltool macros are not used correctly, see:
+https://bugs.launchpad.net/inkscape/+bug/1418943
+---
+ bootstrap    | 6 +-----
+ configure.ac | 5 +----
+ 2 files changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/bootstrap b/bootstrap
+index 0599cf5..40b1dca 100755
+--- a/bootstrap
++++ b/bootstrap
+@@ -1,7 +1,3 @@
+ #!/bin/sh
+ 
+-# change to root directory
+-cd $(dirname "$0")
+-
+-autopoint --force && \
+-	AUTOPOINT="intltoolize --automake --copy" autoreconf --force --install --verbose
++autoreconf --force --install && intltoolize
+diff --git a/configure.ac b/configure.ac
+index be0b51a..a2e7c42 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -17,6 +17,7 @@ AC_PROG_OBJC # For macOS support modules
+ AC_LANG([C])
+ 
+ AC_PROG_INTLTOOL([0.50])
++AC_SUBST(LIBINTL)
+ 
+ AC_CANONICAL_HOST
+ 
+@@ -51,10 +52,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [
+ ])
+ AC_LANG_POP([Objective C])
+ 
+-# Checks for libraries.
+-AM_GNU_GETTEXT_VERSION([0.17])
+-AM_GNU_GETTEXT([external])
+-
+ GETTEXT_PACKAGE=redshift
+ AC_SUBST(GETTEXT_PACKAGE)
+ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
+-- 
+2.15.1
+
diff --git a/nixpkgs/pkgs/applications/misc/redshift/default.nix b/nixpkgs/pkgs/applications/misc/redshift/default.nix
new file mode 100644
index 000000000000..d8512754f6a7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/redshift/default.nix
@@ -0,0 +1,93 @@
+{ stdenv, fetchFromGitHub, autoconf, automake, gettext, intltool
+, libtool, pkgconfig, wrapGAppsHook, wrapPython, gobject-introspection
+, gtk3, python, pygobject3, hicolor-icon-theme, pyxdg
+
+, withQuartz ? stdenv.isDarwin, ApplicationServices
+, withRandr ? stdenv.isLinux, libxcb
+, withDrm ? stdenv.isLinux, libdrm
+
+, withGeolocation ? true
+, withCoreLocation ? withGeolocation && stdenv.isDarwin, CoreLocation, Foundation, Cocoa
+, withGeoclue ? withGeolocation && stdenv.isLinux, geoclue
+}:
+
+stdenv.mkDerivation rec {
+  name = "redshift-${version}";
+  version = "1.12";
+
+  src = fetchFromGitHub {
+    owner = "jonls";
+    repo = "redshift";
+    rev = "v${version}";
+    sha256 = "12cb4gaqkybp4bkkns8pam378izr2mwhr2iy04wkprs2v92j7bz6";
+  };
+
+  patches = [
+    # https://github.com/jonls/redshift/pull/575
+    ./575.patch
+  ];
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    gettext
+    intltool
+    libtool
+    pkgconfig
+    wrapGAppsHook
+    wrapPython
+  ];
+
+  configureFlags = [
+    "--enable-randr=${if withRandr then "yes" else "no"}"
+    "--enable-geoclue2=${if withGeoclue then "yes" else "no"}"
+    "--enable-drm=${if withDrm then "yes" else "no"}"
+    "--enable-quartz=${if withQuartz then "yes" else "no"}"
+    "--enable-corelocation=${if withCoreLocation then "yes" else "no"}"
+  ];
+
+  buildInputs = [
+    gobject-introspection
+    gtk3
+    python
+    hicolor-icon-theme
+  ] ++ stdenv.lib.optional  withRandr        libxcb
+    ++ stdenv.lib.optional  withGeoclue      geoclue
+    ++ stdenv.lib.optional  withDrm          libdrm
+    ++ stdenv.lib.optional  withQuartz       ApplicationServices
+    ++ stdenv.lib.optionals withCoreLocation [ CoreLocation Foundation Cocoa ]
+    ;
+
+  pythonPath = [ pygobject3 pyxdg ];
+
+  preConfigure = "./bootstrap";
+
+  postFixup = "wrapPythonPrograms";
+
+  # the geoclue agent may inspect these paths and expect them to be
+  # valid without having the correct $PATH set
+  postInstall = ''
+    substituteInPlace $out/share/applications/redshift.desktop \
+      --replace 'Exec=redshift' "Exec=$out/bin/redshift"
+    substituteInPlace $out/share/applications/redshift.desktop \
+      --replace 'Exec=redshift-gtk' "Exec=$out/bin/redshift-gtk"
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Screen color temperature manager";
+    longDescription = ''
+      Redshift adjusts the color temperature according to the position
+      of the sun. A different color temperature is set during night and
+      daytime. During twilight and early morning, the color temperature
+      transitions smoothly from night to daytime temperature to allow
+      your eyes to slowly adapt. At night the color temperature should
+      be set to match the lamps in your room.
+    '';
+    license = licenses.gpl3Plus;
+    homepage = http://jonls.dk/redshift;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ yegortimoshenko ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/regextester/default.nix b/nixpkgs/pkgs/applications/misc/regextester/default.nix
new file mode 100644
index 000000000000..703d78621249
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/regextester/default.nix
@@ -0,0 +1,58 @@
+{ stdenv
+, fetchFromGitHub
+, gettext
+, libxml2
+, pkgconfig
+, glib
+, gtk3
+, gnome3
+, meson
+, ninja
+, gobject-introspection
+, gsettings-desktop-schemas
+, pantheon
+, wrapGAppsHook }:
+
+stdenv.mkDerivation rec {
+  name = "regextester-${version}";
+  version = "1.0.1";
+
+  src = fetchFromGitHub {
+    owner = "artemanufrij";
+    repo = "regextester";
+    rev = version;
+    sha256 = "1xwwv1hccni1mrbl58f7ly4qfq6738vn24bcbl2q346633cd7kx3";
+  };
+
+  nativeBuildInputs = [
+    pantheon.vala
+    gettext
+    gobject-introspection
+    libxml2
+    meson
+    ninja
+    pkgconfig
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    pantheon.elementary-icon-theme
+    pantheon.granite
+    glib
+    gnome3.libgee
+    gsettings-desktop-schemas
+    gtk3
+  ];
+
+  postInstall = ''
+    ${glib.dev}/bin/glib-compile-schemas $out/share/glib-2.0/schemas
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A desktop application to test regular expressions interactively";
+    homepage = https://github.com/artemanufrij/regextester;
+    maintainers = with maintainers; [ samdroid-apps ];
+    platforms = platforms.linux;
+    license = licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/rescuetime/default.nix b/nixpkgs/pkgs/applications/misc/rescuetime/default.nix
new file mode 100644
index 000000000000..b934788cdbeb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rescuetime/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, lib, fetchurl, dpkg, patchelf, qt5, libXtst, libXext, libX11, makeWrapper, libXScrnSaver }:
+
+let
+  src =
+    if stdenv.hostPlatform.system == "i686-linux" then fetchurl {
+      name = "rescuetime-installer.deb";
+      url = "https://www.rescuetime.com/installers/rescuetime_current_i386.deb";
+      sha256 = "136ci4q0ns0qzikndlkbab947m47zv2nmnn8mda2374ip43kn6ri";
+    } else fetchurl {
+      name = "rescuetime-installer.deb";
+      url = "https://www.rescuetime.com/installers/rescuetime_current_amd64.deb";
+      sha256 = "1cw10lr7hrsr9xvq3wv1wkyk7jqsgfnnlkq4km9kxr39f51hv6na";
+    };
+in stdenv.mkDerivation {
+  # https://www.rescuetime.com/updates/linux_release_notes.html
+  name = "rescuetime-2.14.2.1";
+  inherit src;
+  buildInputs = [ dpkg makeWrapper ];
+  # avoid https://github.com/NixOS/patchelf/issues/99
+  dontStrip = true;
+  unpackPhase = ''
+    mkdir pkg
+    dpkg-deb -x $src pkg
+    sourceRoot=pkg
+  '';
+  installPhase = ''
+    mkdir -p $out/bin
+    cp usr/bin/rescuetime $out/bin
+
+    ${patchelf}/bin/patchelf \
+      --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath "${lib.makeLibraryPath [ qt5.qtbase libXtst libXext libX11 libXScrnSaver ]}" \
+      $out/bin/rescuetime
+  '';
+  meta = with lib; {
+    description = "Helps you understand your daily habits so you can focus and be more productive";
+    homepage    = "https://www.rescuetime.com";
+    maintainers = with maintainers; [ cstrahan ];
+    license     = licenses.unfree;
+    platforms   = [ "i686-linux" "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/robo3t/default.nix b/nixpkgs/pkgs/applications/misc/robo3t/default.nix
new file mode 100644
index 000000000000..be365cb94e4e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/robo3t/default.nix
@@ -0,0 +1,78 @@
+{ stdenv, fetchurl, zlib, glib, xorg, dbus, fontconfig, libGL,
+  freetype, xkeyboard_config, makeDesktopItem, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "robo3t-${version}";
+  version = "1.1.1";
+
+  src = fetchurl {
+    url = "https://download.robomongo.org/1.1.1/linux/robo3t-${version}-linux-x86_64-c93c6b0.tar.gz";
+    sha256 = "140cn80vg7c8vpdjasqi4b3kyqj4n033lcm3ikz5674x3jr7r5zs";
+  };
+
+  icon = fetchurl {
+    url = "https://github.com/Studio3T/robomongo/raw/${version}/trash/install/linux/robomongo.png";
+    sha256 = "15li8536x600kkfkb3h6mw7y0f2ljkv951pc45dpiw036vldibv2";
+  };
+
+  desktopItem = makeDesktopItem {
+    name = "robo3t";
+    exec = "robo3t";
+    icon = icon;
+    comment = "Query GUI for mongodb";
+    desktopName = "Robo3T";
+    genericName = "MongoDB management tool";
+    categories = "Development;IDE;mongodb;";
+  };
+
+  nativeBuildInputs = [makeWrapper];
+
+  ldLibraryPath = stdenv.lib.makeLibraryPath [
+    stdenv.cc.cc
+    zlib
+    glib
+    xorg.libXi
+    xorg.libxcb
+    xorg.libXrender
+    xorg.libX11
+    xorg.libSM
+    xorg.libICE
+    xorg.libXext
+    dbus
+    fontconfig
+    freetype
+    libGL
+  ];
+
+  installPhase = ''
+    BASEDIR=$out/lib/robo3t
+
+    mkdir -p $BASEDIR/bin
+    cp bin/* $BASEDIR/bin
+
+    mkdir -p $BASEDIR/lib
+    cp -r lib/* $BASEDIR/lib
+
+    mkdir -p $out/share/applications
+    cp $desktopItem/share/applications/* $out/share/applications
+
+    mkdir -p $out/share/icons
+    cp ${icon} $out/share/icons/robomongo.png
+
+    patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 $BASEDIR/bin/robo3t
+
+    mkdir $out/bin
+
+    makeWrapper $BASEDIR/bin/robo3t $out/bin/robo3t \
+      --suffix LD_LIBRARY_PATH : ${ldLibraryPath} \
+      --suffix QT_XKB_CONFIG_ROOT : ${xkeyboard_config}/share/X11/xkb
+  '';
+
+  meta = {
+    homepage = https://robomongo.org/;
+    description = "Query GUI for mongodb";
+    platforms = [ "x86_64-linux" ];
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = [ stdenv.lib.maintainers.eperuffo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/robomongo/default.nix b/nixpkgs/pkgs/applications/misc/robomongo/default.nix
new file mode 100644
index 000000000000..76593eba5fc4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/robomongo/default.nix
@@ -0,0 +1,77 @@
+{ stdenv, fetchurl, zlib, glib, xorg, dbus, fontconfig,
+  freetype, xkeyboard_config, makeDesktopItem, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "robomongo-${version}";
+  version = "0.9.0";
+
+  src = fetchurl {
+    url = "https://download.robomongo.org/${version}/linux/robomongo-${version}-linux-x86_64-0786489.tar.gz";
+    sha256 = "1q8ahdz3afcw002p8dl2pybzkq4srk6bnikrz216yx1gswivdcad";
+  };
+
+  icon = fetchurl {
+    url = "https://github.com/Studio3T/robomongo/raw/${version}/trash/install/linux/robomongo.png";
+    sha256 = "15li8536x600kkfkb3h6mw7y0f2ljkv951pc45dpiw036vldibv2";
+  };
+
+  desktopItem = makeDesktopItem {
+    name = "robomongo";
+    exec = "robomongo";
+    icon = icon;
+    comment = "Query GUI for mongodb";
+    desktopName = "Robomongo";
+    genericName = "MongoDB management tool";
+    categories = "Development;IDE;mongodb;";
+  };
+
+  nativeBuildInputs = [makeWrapper];
+
+  ldLibraryPath = stdenv.lib.makeLibraryPath [
+    stdenv.cc.cc
+    zlib
+    glib
+    xorg.libXi
+    xorg.libxcb
+    xorg.libXrender
+    xorg.libX11
+    xorg.libSM
+    xorg.libICE
+    xorg.libXext
+    dbus
+    fontconfig
+    freetype
+  ];
+
+  installPhase = ''
+    BASEDIR=$out/lib/robomongo
+
+    mkdir -p $BASEDIR/bin
+    cp bin/* $BASEDIR/bin
+
+    mkdir -p $BASEDIR/lib
+    cp -r lib/* $BASEDIR/lib
+
+    mkdir -p $out/share/applications
+    cp $desktopItem/share/applications/* $out/share/applications
+
+    mkdir -p $out/share/icons
+    cp ${icon} $out/share/icons/robomongo.png
+
+    patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 $BASEDIR/bin/robomongo
+
+    mkdir $out/bin
+
+    makeWrapper $BASEDIR/bin/robomongo $out/bin/robomongo \
+      --suffix LD_LIBRARY_PATH : ${ldLibraryPath} \
+      --suffix QT_XKB_CONFIG_ROOT : ${xkeyboard_config}/share/X11/xkb
+  '';
+
+  meta = {
+    homepage = https://robomongo.org/;
+    description = "Query GUI for mongodb";
+    platforms = stdenv.lib.intersectLists stdenv.lib.platforms.linux stdenv.lib.platforms.x86_64;
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = [ stdenv.lib.maintainers.eperuffo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/rofi-menugen/default.nix b/nixpkgs/pkgs/applications/misc/rofi-menugen/default.nix
new file mode 100644
index 000000000000..2255089ab7e2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rofi-menugen/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchFromGitHub, rofi, gnused }:
+
+stdenv.mkDerivation rec {
+  rev = "168efd2608fdb88b1aff3e0244bda8402169f207";
+  name = "rofi-menugen-2015-12-28-${builtins.substring 0 7 rev}";
+  src = fetchFromGitHub {
+    owner = "octotep";
+    repo = "menugen";
+    inherit rev;
+    sha256 = "09fk9i6crw772qlc5zld35pcff1jq4jcag0syial2q000fbpjx5m";
+  };
+  patchPhase = ''
+    sed -i -e "s|menugenbase|$out/bin/rofi-menugenbase|" menugen
+    sed -i -e "s|rofi |${rofi}/bin/rofi |" menugen
+    sed -i -e "s|sed |${gnused}/bin/sed |" menugenbase
+  '';
+  installPhase = ''
+    mkdir -p $out/bin
+    cp menugen $out/bin/rofi-menugen
+    cp menugenbase $out/bin/rofi-menugenbase
+  '';
+  meta = with stdenv.lib; {
+    description = "Generates menu based applications using rofi";
+    homepage = https://github.com/octotep/menugen;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/rofi/default.nix b/nixpkgs/pkgs/applications/misc/rofi/default.nix
new file mode 100644
index 000000000000..94381d4f6f96
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rofi/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, lib, fetchurl
+, autoreconfHook, pkgconfig, libxkbcommon, pango, which, git
+, cairo, libxcb, xcbutil, xcbutilwm, xcbutilxrm, libstartup_notification
+, bison, flex, librsvg, check
+}:
+
+stdenv.mkDerivation rec {
+  pname = "rofi-unwrapped";
+  version = "1.5.4";
+
+  src = fetchurl {
+    url = "https://github.com/davatorium/rofi/releases/download/${version}/rofi-${version}.tar.gz";
+    sha256 = "1g1170zmh5v7slnm1sm2d08jgz6icikf8rm17apm1bjzzyw1lhk7";
+  };
+
+  preConfigure = ''
+    patchShebangs "script"
+    # root not present in build /etc/passwd
+    sed -i 's/~root/~nobody/g' test/helper-expand.c
+  '';
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  buildInputs = [ libxkbcommon pango cairo git bison flex librsvg check
+    libstartup_notification libxcb xcbutil xcbutilwm xcbutilxrm which
+  ];
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Window switcher, run dialog and dmenu replacement";
+    homepage = "https://github.com/davatorium/rofi";
+    license = licenses.mit;
+    maintainers = with maintainers; [ mbakke ma27 ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/rofi/wrapper.nix b/nixpkgs/pkgs/applications/misc/rofi/wrapper.nix
new file mode 100644
index 000000000000..8c24d27f0752
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rofi/wrapper.nix
@@ -0,0 +1,24 @@
+{ stdenv, rofi-unwrapped, makeWrapper, theme ? null }:
+
+if theme == null then rofi-unwrapped else
+stdenv.mkDerivation {
+  pname = "rofi";
+  version = rofi-unwrapped.version;
+
+  buildInputs = [ makeWrapper ];
+  preferLocalBuild = true;
+  passthru.unwrapped = rofi-unwrapped;
+  buildCommand = ''
+    mkdir $out
+    ln -s ${rofi-unwrapped}/* $out
+    rm $out/bin
+    mkdir $out/bin
+    ln -s ${rofi-unwrapped}/bin/* $out/bin
+    rm $out/bin/rofi
+    makeWrapper ${rofi-unwrapped}/bin/rofi $out/bin/rofi --add-flags "-theme ${theme}"
+  '';
+
+  meta = rofi-unwrapped.meta // {
+    priority = (rofi-unwrapped.meta.priority or 0) - 1;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/roxterm/default.nix b/nixpkgs/pkgs/applications/misc/roxterm/default.nix
new file mode 100644
index 000000000000..11a75e4064f4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/roxterm/default.nix
@@ -0,0 +1,61 @@
+{ stdenv, fetchurl, docbook_xsl, dbus, dbus-glib, expat
+, gsettings-desktop-schemas, gdk_pixbuf, gtk3, hicolor-icon-theme
+, imagemagick, itstool, librsvg, libtool, libxslt, makeWrapper
+, pkgconfig, python, pythonPackages, vte
+, wrapGAppsHook}:
+
+# TODO: Still getting following warning.
+# WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
+# Seems related to this:
+# https://forums.gentoo.org/viewtopic-t-947210-start-0.html
+
+let version = "3.3.2";
+in stdenv.mkDerivation rec {
+  name = "roxterm-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/roxterm/${name}.tar.xz";
+    sha256 = "0vjh7k4jm4bd01j88w9bmvq27zqsajjzy131fpi81zkii5lisl1k";
+  };
+
+  nativeBuildInputs = [ pkgconfig wrapGAppsHook ];
+
+  buildInputs =
+    [ docbook_xsl expat imagemagick itstool librsvg libtool libxslt
+      makeWrapper python pythonPackages.lockfile dbus dbus-glib
+      gdk_pixbuf gsettings-desktop-schemas gtk3
+      hicolor-icon-theme vte ];
+
+  NIX_CFLAGS_COMPILE = [ "-I${dbus-glib.dev}/include/dbus-1.0"
+                         "-I${dbus.dev}/include/dbus-1.0"
+                         "-I${dbus.lib}/lib/dbus-1.0/include" ];
+
+  # Fix up python path so the lockfile library is on it.
+  PYTHONPATH = stdenv.lib.makeSearchPathOutput "lib" python.sitePackages [
+    pythonPackages.lockfile
+  ];
+
+  buildPhase = ''
+    # Fix up the LD_LIBRARY_PATH so that expat is on it
+    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${expat.out}/lib"
+
+    python mscript.py configure --prefix="$out" --disable-nls --disable-translations
+    python mscript.py build
+  '';
+
+  installPhase = ''
+    python mscript.py install
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://roxterm.sourceforge.net/;
+    license = licenses.gpl3;
+    description = "Tabbed, VTE-based terminal emulator";
+    longDescription = ''
+      Tabbed, VTE-based terminal emulator. Similar to gnome-terminal without
+      the dependencies on Gnome.
+    '';
+    maintainers = with maintainers; [ cdepillabout ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/rsibreak/default.nix b/nixpkgs/pkgs/applications/misc/rsibreak/default.nix
new file mode 100644
index 000000000000..6ee9966401b5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rsibreak/default.nix
@@ -0,0 +1,28 @@
+{
+  mkDerivation, fetchurl, lib,
+  extra-cmake-modules, kdoctools,
+  knotifyconfig, kidletime, kwindowsystem, ktextwidgets, kcrash
+}:
+
+let
+  pname = "rsibreak";
+  version = "0.12";
+  revision = ".8";
+in mkDerivation rec {
+  name = "rsibreak-${version}${revision}";
+
+  src = fetchurl {
+    url = "https://download.kde.org/stable/${pname}/${version}/${name}.tar.xz";
+    sha256 = "1qn9xdjx9zzw47jsj7f4nkqmrangfhdgafm2jxm7cm6z6kcvzr28";
+  };
+
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  propagatedBuildInputs = [ knotifyconfig kidletime kwindowsystem ktextwidgets kcrash ];
+
+  meta = with lib; {
+    description = "RSIBreak takes care of your health and regularly breaks your work to avoid repetitive strain injury (RSI)";
+    license = licenses.gpl2;
+    homepage = https://www.kde.org/applications/utilities/rsibreak/;
+    maintainers = with maintainers; [ vandenoever ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/rtv/default.nix b/nixpkgs/pkgs/applications/misc/rtv/default.nix
new file mode 100644
index 000000000000..20211ecb53b1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rtv/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchFromGitHub, python3Packages }:
+
+with python3Packages;
+buildPythonApplication rec {
+  version = "1.27.0";
+  pname = "rtv";
+
+  src = fetchFromGitHub {
+    owner = "michael-lazar";
+    repo = "rtv";
+    rev = "v${version}";
+    sha256 = "1hw7xy2kjxq7y3wcibcz4l7zj8icvigialqr17l362xry0y17y5j";
+  };
+
+  # Tests try to access network
+  doCheck = false;
+
+  checkPhase = ''
+    py.test
+  '';
+
+  checkInputs = [
+    coverage
+    coveralls
+    docopt
+    mock
+    pylint
+    pytest
+    vcrpy
+  ];
+
+  propagatedBuildInputs = [
+    beautifulsoup4
+    decorator
+    kitchen
+    requests
+    six
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/michael-lazar/rtv;
+    description = "Browse Reddit from your Terminal";
+    license = licenses.mit;
+    maintainers = with maintainers; [ matthiasbeyer wedens ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/rxvt/default.nix b/nixpkgs/pkgs/applications/misc/rxvt/default.nix
new file mode 100644
index 000000000000..8e63cdb6d16c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rxvt/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl
+, pkgconfig, libtool
+, libX11, libXt, libXpm }:
+
+stdenv.mkDerivation rec {
+  name = "rxvt-${version}";
+  version = "2.7.10";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/rxvt/${name}.tar.gz";
+    sha256 = "0jfl71gz3k7zh3kxdb8lxi06kajjnx7bq1rxjgk680l209jxask1";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ libtool libX11 libXt libXpm ];
+
+  configurePhase = ''
+    LIBTOOL=${libtool}/bin/libtool ./configure --prefix=$out --enable-everything --enable-smart-resize --enable-256-color
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://rxvt.sourceforge.net/;
+    description = "Colour vt102 terminal emulator with less features and lower memory consumption";
+    longDescription = ''
+      rxvt (acronym for our extended virtual terminal) is a terminal
+      emulator for the X Window System, originally written by Rob Nation
+      as an extended version of the older xvt terminal by John Bovey of
+      University of Kent. Mark Olesen extensively modified it later and
+      took over maintenance for several years.
+
+      rxvt is intended to be a slimmed-down alternate for xterm,
+      omitting some of its little-used features, like Tektronix 4014
+      emulation and toolkit-style configurability.
+    '';
+    maintainers = with maintainers; [ AndersonTorres ];
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-autocomplete-all-the-things/default.nix b/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-autocomplete-all-the-things/default.nix
new file mode 100644
index 000000000000..f872e8008363
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-autocomplete-all-the-things/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  name = "urxvt-autocomplete-all-the-things-${version}";
+  version = "1.6.0";
+
+  src = fetchFromGitHub {
+    owner = "Vifon";
+    repo = "autocomplete-ALL-the-things";
+    rev = version;
+    sha256 = "06xd59c6gd9rglwq4km93n2p078k7v4x300lqrg1f32vvnjvs7sr";
+  };
+
+  installPhase = ''
+    mkdir -p $out/lib/urxvt/perl
+    cp autocomplete-ALL-the-things $out/lib/urxvt/perl
+  '';
+
+  meta = with stdenv.lib; {
+    description = "urxvt plugin allowing user to easily complete arbitrary text";
+    homepage = "https://github.com/Vifon/autocomplete-ALL-the-things";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ nickhu ];
+    platforms = with platforms; unix;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-font-size/default.nix b/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-font-size/default.nix
new file mode 100644
index 000000000000..4f4319af6cbd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-font-size/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchFromGitHub, xrdb, xlsfonts }:
+
+stdenv.mkDerivation {
+  name = "urxvt-font-size-2015-05-22";
+  dontPatchShebangs = true;
+
+  src = fetchFromGitHub {
+    owner = "majutsushi";
+    repo = "urxvt-font-size";
+    rev = "fd5b09c10798c6723bbf771d4d8881cf6563bc69";
+    sha256 = "16m3kkypg3y00x597zx05zy167a0kaqpawz0l591wzb2bv1dz55z";
+  };
+
+  installPhase = ''
+    substituteInPlace font-size \
+      --replace "xrdb -merge" "${xrdb}/bin/xrdb -merge" \
+      --replace "xlsfonts" "${xlsfonts}/bin/xlsfonts"
+
+    mkdir -p $out/lib/urxvt/perl
+    cp font-size $out/lib/urxvt/perl
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Change the urxvt font size on the fly";
+    homepage = https://github.com/majutsushi/urxvt-font-size;
+    license = licenses.mit;
+    maintainers = with maintainers; [ cstrahan ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-perl/default.nix b/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-perl/default.nix
new file mode 100644
index 000000000000..13e005014f10
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-perl/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchFromGitHub, wmctrl }:
+
+stdenv.mkDerivation {
+  name = "urxvt-perl-2015-01-16";
+
+  src = fetchFromGitHub {
+    owner = "effigies";
+    repo = "urxvt-perl";
+    rev = "c3beb9ff09a7139591416c61f8e9458c8a23bea5";
+    sha256 = "1w1p8ng7bwq5hnaprjl1zf073y5l3hdsj7sz7cll6isjswcm6r0s";
+  };
+
+  installPhase = ''
+    substituteInPlace fullscreen \
+      --replace "wmctrl" "${wmctrl}/bin/wmctrl"
+
+    mkdir -p $out/lib/urxvt/perl
+    cp fullscreen $out/lib/urxvt/perl
+    cp newterm $out/lib/urxvt/perl
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Perl extensions for the rxvt-unicode terminal emulator";
+    homepage = https://github.com/effigies/urxvt-perl;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ cstrahan ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-perls/default.nix b/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-perls/default.nix
new file mode 100644
index 000000000000..544789e865b5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-perls/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  name = "urxvt-perls-${version}";
+  version = "2.2";
+
+  src = fetchFromGitHub {
+    owner = "muennich";
+    repo = "urxvt-perls";
+    rev = version;
+    sha256 = "1cb0jbjmwfy2dlq2ny8wpc04k79jp3pz9qhbmgagsxs3sp1jg2hz";
+  };
+
+  installPhase = ''
+    mkdir -p $out/lib/urxvt/perl
+    cp clipboard \
+       keyboard-select \
+       url-select \
+    $out/lib/urxvt/perl
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Perl extensions for the rxvt-unicode terminal emulator";
+    homepage = https://github.com/muennich/urxvt-perls;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ abbradar ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-tabbedex/default.nix b/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-tabbedex/default.nix
new file mode 100644
index 000000000000..e8e5c524a35c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-tabbedex/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchFromGitHub, perl }:
+
+stdenv.mkDerivation rec {
+  name = "urxvt-tabbedex-${version}";
+  version = "19.21";
+
+  src = fetchFromGitHub {
+    owner = "mina86";
+    repo = "urxvt-tabbedex";
+    rev = "v${version}";
+    sha256 = "06msd156h6r8ss7qg66sjz5jz8613qfq2yvp0pc24i6mxzj8vl77";
+  };
+
+  nativeBuildInputs = [ perl ];
+
+  installFlags = [ "PREFIX=$(out)" ];
+
+  meta = with stdenv.lib; {
+    description = "Tabbed plugin for rxvt-unicode with many enhancements (mina86's fork)";
+    homepage = https://github.com/mina86/urxvt-tabbedex;
+    maintainers = with maintainers; [ abbradar ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-theme-switch/default.nix b/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-theme-switch/default.nix
new file mode 100644
index 000000000000..ba8ec3a6e72a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-theme-switch/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  rev = "cfcbcc3dd5a5b09a3fec0f6a1fea95f4a36a48c4";
+  name = "urxvt-theme-switch-2014-12-21_rev${builtins.substring 0 1 rev}";
+  dontPatchShebangs = true;
+
+  src = fetchFromGitHub {
+    owner = "felixr";
+    repo = "urxvt-theme-switch";
+    inherit rev;
+    sha256 = "0x27m1vdqprn3lqpwgxvffill7prmaj6j9rhgvkvi13mzl5wmlli";
+  };
+
+  installPhase = ''
+    mkdir -p $out/lib/urxvt/perl
+    sed -i -e "s|/usr/bin/env||" color-themes
+    cp color-themes $out/lib/urxvt/perl
+  '';
+
+  meta = with stdenv.lib; {
+    description = "urxvt plugin that allows to switch color themes during runtime";
+    homepage = https://github.com/felixr/urxvt-theme-switch;
+    license = "CCBYNC";
+    maintainers = with maintainers; [ ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-vtwheel.nix b/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-vtwheel.nix
new file mode 100644
index 000000000000..2f2c20558031
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rxvt_unicode-plugins/urxvt-vtwheel.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchgit, perl }:
+
+stdenv.mkDerivation {
+
+  name = "rxvt_unicode-vtwheel-0.3.2";
+
+  src = fetchgit {
+   url = "https://aur.archlinux.org/urxvt-vtwheel.git";
+   rev = "36d3e861664aeae36a45f96100f10f8fe2218035";
+   sha256 = "1h3vrsbli5q9kr84j5ijbivlhpwlh3l8cv233pg362v2zz4ja8i7";
+  };
+  
+  installPhase = ''
+    sed -i 's|#! perl|#! ${perl}/bin/perl|g' vtwheel
+    mkdir -p $out/lib/urxvt/perl
+    cp vtwheel $out/lib/urxvt/perl
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Pass mouse wheel commands to secondary screens (screen, less, nano, etc)";
+    homepage = https://aur.archlinux.org/packages/urxvt-vtwheel;
+    license = licenses.mit;
+    maintainers = with maintainers; [ danbst ];
+    platforms = with platforms; unix;
+  };
+  
+}
\ No newline at end of file
diff --git a/nixpkgs/pkgs/applications/misc/rxvt_unicode/default.nix b/nixpkgs/pkgs/applications/misc/rxvt_unicode/default.nix
new file mode 100644
index 000000000000..d198c5951359
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rxvt_unicode/default.nix
@@ -0,0 +1,72 @@
+{ stdenv, fetchurl, makeDesktopItem, perlSupport ? true, libX11, libXt, libXft,
+  ncurses, perl, fontconfig, freetype, pkgconfig, libXrender,
+  gdkPixbufSupport ? true, gdk_pixbuf, unicode3Support ? true }:
+
+let
+  pname = "rxvt-unicode";
+  version = "9.22";
+  description = "A clone of the well-known terminal emulator rxvt";
+
+  desktopItem = makeDesktopItem {
+    name = "${pname}";
+    exec = "urxvt";
+    icon = "utilities-terminal";
+    comment = description;
+    desktopName = "URxvt";
+    genericName = "${pname}";
+    categories = "System;TerminalEmulator;";
+  };
+in
+
+stdenv.mkDerivation (rec {
+
+  name = "${pname}${if perlSupport then "-with-perl" else ""}${if unicode3Support then "-with-unicode3" else ""}-${version}";
+
+  src = fetchurl {
+    url = "http://dist.schmorp.de/rxvt-unicode/Attic/rxvt-unicode-${version}.tar.bz2";
+    sha256 = "1pddjn5ynblwfrdmskylrsxb9vfnk3w4jdnq2l8xn2pspkljhip9";
+  };
+
+  buildInputs =
+    [ libX11 libXt libXft ncurses /* required to build the terminfo file */
+      fontconfig freetype pkgconfig libXrender ]
+    ++ stdenv.lib.optional perlSupport perl
+    ++ stdenv.lib.optional gdkPixbufSupport gdk_pixbuf;
+
+  outputs = [ "out" "terminfo" ];
+
+  patches = [
+    ./rxvt-unicode-9.06-font-width.patch
+    ./rxvt-unicode-256-color-resources.patch
+  ]
+  ++ stdenv.lib.optional stdenv.isDarwin ./rxvt-unicode-makefile-phony.patch;
+
+  preConfigure =
+    ''
+      mkdir -p $terminfo/share/terminfo
+      configureFlags="--with-terminfo=$terminfo/share/terminfo --enable-256-color ${if perlSupport then "--enable-perl" else "--disable-perl"} ${if unicode3Support then "--enable-unicode3" else "--disable-unicode3"}";
+      export TERMINFO=$terminfo/share/terminfo # without this the terminfo won't be compiled by tic, see man tic
+      NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype.dev}/include/freetype2"
+      NIX_LDFLAGS="$NIX_LDFLAGS -lfontconfig -lXrender -lpthread "
+    ''
+    # make urxvt find its perl file lib/perl5/site_perl is added to PERL5LIB automatically
+    + stdenv.lib.optionalString perlSupport ''
+      mkdir -p $out/$(dirname ${perl.libPrefix})
+      ln -s $out/lib/urxvt $out/${perl.libPrefix}
+    '';
+
+  postInstall = ''
+    mkdir -p $out/nix-support
+    echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
+    cp -r ${desktopItem}/share/applications/ $out/share/
+  '';
+
+  meta = with stdenv.lib; {
+    inherit description;
+    homepage = http://software.schmorp.de/pkg/rxvt-unicode.html;
+    downloadPage = "http://dist.schmorp.de/rxvt-unicode/Attic/";
+    maintainers = [ ];
+    platforms = platforms.unix;
+    license = licenses.gpl3;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-256-color-resources.patch b/nixpkgs/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-256-color-resources.patch
new file mode 100644
index 000000000000..c8d2acfbdc51
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-256-color-resources.patch
@@ -0,0 +1,255 @@
+diff --git a/src/xdefaults.C b/src/xdefaults.C
+index 23b6822..382f3b1 100644
+--- a/src/xdefaults.C
++++ b/src/xdefaults.C
+@@ -155,6 +155,250 @@ optList[] = {
+               RSTRG (Rs_color + minCOLOR + 5, "color5", "color"),
+               RSTRG (Rs_color + minCOLOR + 6, "color6", "color"),
+               RSTRG (Rs_color + minCOLOR + 7, "color7", "color"),
++              // 88 xterm colors
++              RSTRG (Rs_color + minCOLOR + 16, "color16", "color"),
++              RSTRG (Rs_color + minCOLOR + 17, "color17", "color"),
++              RSTRG (Rs_color + minCOLOR + 18, "color18", "color"),
++              RSTRG (Rs_color + minCOLOR + 19, "color19", "color"),
++              RSTRG (Rs_color + minCOLOR + 20, "color20", "color"),
++              RSTRG (Rs_color + minCOLOR + 21, "color21", "color"),
++              RSTRG (Rs_color + minCOLOR + 22, "color22", "color"),
++              RSTRG (Rs_color + minCOLOR + 23, "color23", "color"),
++              RSTRG (Rs_color + minCOLOR + 24, "color24", "color"),
++              RSTRG (Rs_color + minCOLOR + 25, "color25", "color"),
++              RSTRG (Rs_color + minCOLOR + 26, "color26", "color"),
++              RSTRG (Rs_color + minCOLOR + 27, "color27", "color"),
++              RSTRG (Rs_color + minCOLOR + 28, "color28", "color"),
++              RSTRG (Rs_color + minCOLOR + 29, "color29", "color"),
++              RSTRG (Rs_color + minCOLOR + 30, "color30", "color"),
++              RSTRG (Rs_color + minCOLOR + 31, "color31", "color"),
++              RSTRG (Rs_color + minCOLOR + 32, "color32", "color"),
++              RSTRG (Rs_color + minCOLOR + 33, "color33", "color"),
++              RSTRG (Rs_color + minCOLOR + 34, "color34", "color"),
++              RSTRG (Rs_color + minCOLOR + 35, "color35", "color"),
++              RSTRG (Rs_color + minCOLOR + 36, "color36", "color"),
++              RSTRG (Rs_color + minCOLOR + 37, "color37", "color"),
++              RSTRG (Rs_color + minCOLOR + 38, "color38", "color"),
++              RSTRG (Rs_color + minCOLOR + 39, "color39", "color"),
++              RSTRG (Rs_color + minCOLOR + 40, "color40", "color"),
++              RSTRG (Rs_color + minCOLOR + 41, "color41", "color"),
++              RSTRG (Rs_color + minCOLOR + 42, "color42", "color"),
++              RSTRG (Rs_color + minCOLOR + 43, "color43", "color"),
++              RSTRG (Rs_color + minCOLOR + 44, "color44", "color"),
++              RSTRG (Rs_color + minCOLOR + 45, "color45", "color"),
++              RSTRG (Rs_color + minCOLOR + 46, "color46", "color"),
++              RSTRG (Rs_color + minCOLOR + 47, "color47", "color"),
++              RSTRG (Rs_color + minCOLOR + 48, "color48", "color"),
++              RSTRG (Rs_color + minCOLOR + 49, "color49", "color"),
++              RSTRG (Rs_color + minCOLOR + 50, "color50", "color"),
++              RSTRG (Rs_color + minCOLOR + 51, "color51", "color"),
++              RSTRG (Rs_color + minCOLOR + 52, "color52", "color"),
++              RSTRG (Rs_color + minCOLOR + 53, "color53", "color"),
++              RSTRG (Rs_color + minCOLOR + 54, "color54", "color"),
++              RSTRG (Rs_color + minCOLOR + 55, "color55", "color"),
++              RSTRG (Rs_color + minCOLOR + 56, "color56", "color"),
++              RSTRG (Rs_color + minCOLOR + 57, "color57", "color"),
++              RSTRG (Rs_color + minCOLOR + 58, "color58", "color"),
++              RSTRG (Rs_color + minCOLOR + 59, "color59", "color"),
++              RSTRG (Rs_color + minCOLOR + 60, "color60", "color"),
++              RSTRG (Rs_color + minCOLOR + 61, "color61", "color"),
++              RSTRG (Rs_color + minCOLOR + 62, "color62", "color"),
++              RSTRG (Rs_color + minCOLOR + 63, "color63", "color"),
++              RSTRG (Rs_color + minCOLOR + 64, "color64", "color"),
++              RSTRG (Rs_color + minCOLOR + 65, "color65", "color"),
++              RSTRG (Rs_color + minCOLOR + 66, "color66", "color"),
++              RSTRG (Rs_color + minCOLOR + 67, "color67", "color"),
++              RSTRG (Rs_color + minCOLOR + 68, "color68", "color"),
++              RSTRG (Rs_color + minCOLOR + 69, "color69", "color"),
++              RSTRG (Rs_color + minCOLOR + 70, "color70", "color"),
++              RSTRG (Rs_color + minCOLOR + 71, "color71", "color"),
++              RSTRG (Rs_color + minCOLOR + 72, "color72", "color"),
++              RSTRG (Rs_color + minCOLOR + 73, "color73", "color"),
++              RSTRG (Rs_color + minCOLOR + 74, "color74", "color"),
++              RSTRG (Rs_color + minCOLOR + 75, "color75", "color"),
++              RSTRG (Rs_color + minCOLOR + 76, "color76", "color"),
++              RSTRG (Rs_color + minCOLOR + 77, "color77", "color"),
++              RSTRG (Rs_color + minCOLOR + 78, "color78", "color"),
++              RSTRG (Rs_color + minCOLOR + 79, "color79", "color"),
++              RSTRG (Rs_color + minCOLOR + 80, "color80", "color"),
++              RSTRG (Rs_color + minCOLOR + 81, "color81", "color"),
++              RSTRG (Rs_color + minCOLOR + 82, "color82", "color"),
++              RSTRG (Rs_color + minCOLOR + 83, "color83", "color"),
++              RSTRG (Rs_color + minCOLOR + 84, "color84", "color"),
++              RSTRG (Rs_color + minCOLOR + 85, "color85", "color"),
++              RSTRG (Rs_color + minCOLOR + 86, "color86", "color"),
++              RSTRG (Rs_color + minCOLOR + 87, "color87", "color"),
++#if USE_256_COLORS
++              // 256 xterm colors
++              RSTRG (Rs_color + minCOLOR + 88, "color88", "color"),
++              RSTRG (Rs_color + minCOLOR + 89, "color89", "color"),
++              RSTRG (Rs_color + minCOLOR + 90, "color90", "color"),
++              RSTRG (Rs_color + minCOLOR + 91, "color91", "color"),
++              RSTRG (Rs_color + minCOLOR + 92, "color92", "color"),
++              RSTRG (Rs_color + minCOLOR + 93, "color93", "color"),
++              RSTRG (Rs_color + minCOLOR + 94, "color94", "color"),
++              RSTRG (Rs_color + minCOLOR + 95, "color95", "color"),
++              RSTRG (Rs_color + minCOLOR + 96, "color96", "color"),
++              RSTRG (Rs_color + minCOLOR + 97, "color97", "color"),
++              RSTRG (Rs_color + minCOLOR + 98, "color98", "color"),
++              RSTRG (Rs_color + minCOLOR + 99, "color99", "color"),
++              RSTRG (Rs_color + minCOLOR + 100, "color100", "color"),
++              RSTRG (Rs_color + minCOLOR + 101, "color101", "color"),
++              RSTRG (Rs_color + minCOLOR + 102, "color102", "color"),
++              RSTRG (Rs_color + minCOLOR + 103, "color103", "color"),
++              RSTRG (Rs_color + minCOLOR + 104, "color104", "color"),
++              RSTRG (Rs_color + minCOLOR + 105, "color105", "color"),
++              RSTRG (Rs_color + minCOLOR + 106, "color106", "color"),
++              RSTRG (Rs_color + minCOLOR + 107, "color107", "color"),
++              RSTRG (Rs_color + minCOLOR + 108, "color108", "color"),
++              RSTRG (Rs_color + minCOLOR + 109, "color109", "color"),
++              RSTRG (Rs_color + minCOLOR + 110, "color110", "color"),
++              RSTRG (Rs_color + minCOLOR + 111, "color111", "color"),
++              RSTRG (Rs_color + minCOLOR + 112, "color112", "color"),
++              RSTRG (Rs_color + minCOLOR + 113, "color113", "color"),
++              RSTRG (Rs_color + minCOLOR + 114, "color114", "color"),
++              RSTRG (Rs_color + minCOLOR + 115, "color115", "color"),
++              RSTRG (Rs_color + minCOLOR + 116, "color116", "color"),
++              RSTRG (Rs_color + minCOLOR + 117, "color117", "color"),
++              RSTRG (Rs_color + minCOLOR + 118, "color118", "color"),
++              RSTRG (Rs_color + minCOLOR + 119, "color119", "color"),
++              RSTRG (Rs_color + minCOLOR + 120, "color120", "color"),
++              RSTRG (Rs_color + minCOLOR + 121, "color121", "color"),
++              RSTRG (Rs_color + minCOLOR + 122, "color122", "color"),
++              RSTRG (Rs_color + minCOLOR + 123, "color123", "color"),
++              RSTRG (Rs_color + minCOLOR + 124, "color124", "color"),
++              RSTRG (Rs_color + minCOLOR + 125, "color125", "color"),
++              RSTRG (Rs_color + minCOLOR + 126, "color126", "color"),
++              RSTRG (Rs_color + minCOLOR + 127, "color127", "color"),
++              RSTRG (Rs_color + minCOLOR + 128, "color128", "color"),
++              RSTRG (Rs_color + minCOLOR + 129, "color129", "color"),
++              RSTRG (Rs_color + minCOLOR + 130, "color130", "color"),
++              RSTRG (Rs_color + minCOLOR + 131, "color131", "color"),
++              RSTRG (Rs_color + minCOLOR + 132, "color132", "color"),
++              RSTRG (Rs_color + minCOLOR + 133, "color133", "color"),
++              RSTRG (Rs_color + minCOLOR + 134, "color134", "color"),
++              RSTRG (Rs_color + minCOLOR + 135, "color135", "color"),
++              RSTRG (Rs_color + minCOLOR + 136, "color136", "color"),
++              RSTRG (Rs_color + minCOLOR + 137, "color137", "color"),
++              RSTRG (Rs_color + minCOLOR + 138, "color138", "color"),
++              RSTRG (Rs_color + minCOLOR + 139, "color139", "color"),
++              RSTRG (Rs_color + minCOLOR + 140, "color140", "color"),
++              RSTRG (Rs_color + minCOLOR + 141, "color141", "color"),
++              RSTRG (Rs_color + minCOLOR + 142, "color142", "color"),
++              RSTRG (Rs_color + minCOLOR + 143, "color143", "color"),
++              RSTRG (Rs_color + minCOLOR + 144, "color144", "color"),
++              RSTRG (Rs_color + minCOLOR + 145, "color145", "color"),
++              RSTRG (Rs_color + minCOLOR + 146, "color146", "color"),
++              RSTRG (Rs_color + minCOLOR + 147, "color147", "color"),
++              RSTRG (Rs_color + minCOLOR + 148, "color148", "color"),
++              RSTRG (Rs_color + minCOLOR + 149, "color149", "color"),
++              RSTRG (Rs_color + minCOLOR + 150, "color150", "color"),
++              RSTRG (Rs_color + minCOLOR + 151, "color151", "color"),
++              RSTRG (Rs_color + minCOLOR + 152, "color152", "color"),
++              RSTRG (Rs_color + minCOLOR + 153, "color153", "color"),
++              RSTRG (Rs_color + minCOLOR + 154, "color154", "color"),
++              RSTRG (Rs_color + minCOLOR + 155, "color155", "color"),
++              RSTRG (Rs_color + minCOLOR + 156, "color156", "color"),
++              RSTRG (Rs_color + minCOLOR + 157, "color157", "color"),
++              RSTRG (Rs_color + minCOLOR + 158, "color158", "color"),
++              RSTRG (Rs_color + minCOLOR + 159, "color159", "color"),
++              RSTRG (Rs_color + minCOLOR + 160, "color160", "color"),
++              RSTRG (Rs_color + minCOLOR + 161, "color161", "color"),
++              RSTRG (Rs_color + minCOLOR + 162, "color162", "color"),
++              RSTRG (Rs_color + minCOLOR + 163, "color163", "color"),
++              RSTRG (Rs_color + minCOLOR + 164, "color164", "color"),
++              RSTRG (Rs_color + minCOLOR + 165, "color165", "color"),
++              RSTRG (Rs_color + minCOLOR + 166, "color166", "color"),
++              RSTRG (Rs_color + minCOLOR + 167, "color167", "color"),
++              RSTRG (Rs_color + minCOLOR + 168, "color168", "color"),
++              RSTRG (Rs_color + minCOLOR + 169, "color169", "color"),
++              RSTRG (Rs_color + minCOLOR + 170, "color170", "color"),
++              RSTRG (Rs_color + minCOLOR + 171, "color171", "color"),
++              RSTRG (Rs_color + minCOLOR + 172, "color172", "color"),
++              RSTRG (Rs_color + minCOLOR + 173, "color173", "color"),
++              RSTRG (Rs_color + minCOLOR + 174, "color174", "color"),
++              RSTRG (Rs_color + minCOLOR + 175, "color175", "color"),
++              RSTRG (Rs_color + minCOLOR + 176, "color176", "color"),
++              RSTRG (Rs_color + minCOLOR + 177, "color177", "color"),
++              RSTRG (Rs_color + minCOLOR + 178, "color178", "color"),
++              RSTRG (Rs_color + minCOLOR + 179, "color179", "color"),
++              RSTRG (Rs_color + minCOLOR + 180, "color180", "color"),
++              RSTRG (Rs_color + minCOLOR + 181, "color181", "color"),
++              RSTRG (Rs_color + minCOLOR + 182, "color182", "color"),
++              RSTRG (Rs_color + minCOLOR + 183, "color183", "color"),
++              RSTRG (Rs_color + minCOLOR + 184, "color184", "color"),
++              RSTRG (Rs_color + minCOLOR + 185, "color185", "color"),
++              RSTRG (Rs_color + minCOLOR + 186, "color186", "color"),
++              RSTRG (Rs_color + minCOLOR + 187, "color187", "color"),
++              RSTRG (Rs_color + minCOLOR + 188, "color188", "color"),
++              RSTRG (Rs_color + minCOLOR + 189, "color189", "color"),
++              RSTRG (Rs_color + minCOLOR + 190, "color190", "color"),
++              RSTRG (Rs_color + minCOLOR + 191, "color191", "color"),
++              RSTRG (Rs_color + minCOLOR + 192, "color192", "color"),
++              RSTRG (Rs_color + minCOLOR + 193, "color193", "color"),
++              RSTRG (Rs_color + minCOLOR + 194, "color194", "color"),
++              RSTRG (Rs_color + minCOLOR + 195, "color195", "color"),
++              RSTRG (Rs_color + minCOLOR + 196, "color196", "color"),
++              RSTRG (Rs_color + minCOLOR + 197, "color197", "color"),
++              RSTRG (Rs_color + minCOLOR + 198, "color198", "color"),
++              RSTRG (Rs_color + minCOLOR + 199, "color199", "color"),
++              RSTRG (Rs_color + minCOLOR + 200, "color200", "color"),
++              RSTRG (Rs_color + minCOLOR + 201, "color201", "color"),
++              RSTRG (Rs_color + minCOLOR + 202, "color202", "color"),
++              RSTRG (Rs_color + minCOLOR + 203, "color203", "color"),
++              RSTRG (Rs_color + minCOLOR + 204, "color204", "color"),
++              RSTRG (Rs_color + minCOLOR + 205, "color205", "color"),
++              RSTRG (Rs_color + minCOLOR + 206, "color206", "color"),
++              RSTRG (Rs_color + minCOLOR + 207, "color207", "color"),
++              RSTRG (Rs_color + minCOLOR + 208, "color208", "color"),
++              RSTRG (Rs_color + minCOLOR + 209, "color209", "color"),
++              RSTRG (Rs_color + minCOLOR + 210, "color210", "color"),
++              RSTRG (Rs_color + minCOLOR + 211, "color211", "color"),
++              RSTRG (Rs_color + minCOLOR + 212, "color212", "color"),
++              RSTRG (Rs_color + minCOLOR + 213, "color213", "color"),
++              RSTRG (Rs_color + minCOLOR + 214, "color214", "color"),
++              RSTRG (Rs_color + minCOLOR + 215, "color215", "color"),
++              RSTRG (Rs_color + minCOLOR + 216, "color216", "color"),
++              RSTRG (Rs_color + minCOLOR + 217, "color217", "color"),
++              RSTRG (Rs_color + minCOLOR + 218, "color218", "color"),
++              RSTRG (Rs_color + minCOLOR + 219, "color219", "color"),
++              RSTRG (Rs_color + minCOLOR + 220, "color220", "color"),
++              RSTRG (Rs_color + minCOLOR + 221, "color221", "color"),
++              RSTRG (Rs_color + minCOLOR + 222, "color222", "color"),
++              RSTRG (Rs_color + minCOLOR + 223, "color223", "color"),
++              RSTRG (Rs_color + minCOLOR + 224, "color224", "color"),
++              RSTRG (Rs_color + minCOLOR + 225, "color225", "color"),
++              RSTRG (Rs_color + minCOLOR + 226, "color226", "color"),
++              RSTRG (Rs_color + minCOLOR + 227, "color227", "color"),
++              RSTRG (Rs_color + minCOLOR + 228, "color228", "color"),
++              RSTRG (Rs_color + minCOLOR + 229, "color229", "color"),
++              RSTRG (Rs_color + minCOLOR + 230, "color230", "color"),
++              RSTRG (Rs_color + minCOLOR + 231, "color231", "color"),
++              RSTRG (Rs_color + minCOLOR + 232, "color232", "color"),
++              RSTRG (Rs_color + minCOLOR + 233, "color233", "color"),
++              RSTRG (Rs_color + minCOLOR + 234, "color234", "color"),
++              RSTRG (Rs_color + minCOLOR + 235, "color235", "color"),
++              RSTRG (Rs_color + minCOLOR + 236, "color236", "color"),
++              RSTRG (Rs_color + minCOLOR + 237, "color237", "color"),
++              RSTRG (Rs_color + minCOLOR + 238, "color238", "color"),
++              RSTRG (Rs_color + minCOLOR + 239, "color239", "color"),
++              RSTRG (Rs_color + minCOLOR + 240, "color240", "color"),
++              RSTRG (Rs_color + minCOLOR + 241, "color241", "color"),
++              RSTRG (Rs_color + minCOLOR + 242, "color242", "color"),
++              RSTRG (Rs_color + minCOLOR + 243, "color243", "color"),
++              RSTRG (Rs_color + minCOLOR + 244, "color244", "color"),
++              RSTRG (Rs_color + minCOLOR + 245, "color245", "color"),
++              RSTRG (Rs_color + minCOLOR + 246, "color246", "color"),
++              RSTRG (Rs_color + minCOLOR + 247, "color247", "color"),
++              RSTRG (Rs_color + minCOLOR + 248, "color248", "color"),
++              RSTRG (Rs_color + minCOLOR + 249, "color249", "color"),
++              RSTRG (Rs_color + minCOLOR + 250, "color250", "color"),
++              RSTRG (Rs_color + minCOLOR + 251, "color251", "color"),
++              RSTRG (Rs_color + minCOLOR + 252, "color252", "color"),
++              RSTRG (Rs_color + minCOLOR + 253, "color253", "color"),
++              RSTRG (Rs_color + minCOLOR + 254, "color254", "color"),
++              RSTRG (Rs_color + minCOLOR + 255, "color255", "color"),
++#endif
+               RSTRG (Rs_color + minBrightCOLOR + 0, "color8", "color"),
+               RSTRG (Rs_color + minBrightCOLOR + 1, "color9", "color"),
+               RSTRG (Rs_color + minBrightCOLOR + 2, "color10", "color"),
diff --git a/nixpkgs/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-9.06-font-width.patch b/nixpkgs/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-9.06-font-width.patch
new file mode 100644
index 000000000000..636083218fa5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-9.06-font-width.patch
@@ -0,0 +1,21 @@
+--- a/src/rxvtfont.C	2008-07-09 12:21:45.000000000 +0400
++++ b/src/rxvtfont.C	2009-10-30 14:32:53.000000000 +0300
+@@ -1195,12 +1195,14 @@
+           XGlyphInfo g;
+           XftTextExtents16 (disp, f, &ch, 1, &g);
+ 
+-          g.width -= g.x;
+-
++/*
++ * bukind: don't use g.width as a width of a character!
++ * instead use g.xOff, see e.g.: http://keithp.com/~keithp/render/Xft.tutorial
++ */
+           int wcw = WCWIDTH (ch);
+-          if (wcw > 0) g.width = (g.width + wcw - 1) / wcw;
++          if (wcw > 1) g.xOff = g.xOff / wcw;
++          if (width < g.xOff) width = g.xOff;
+ 
+-          if (width    < g.width       ) width    = g.width;
+           if (height   < g.height      ) height   = g.height;
+           if (glheight < g.height - g.y) glheight = g.height - g.y;
+         }
\ No newline at end of file
diff --git a/nixpkgs/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-makefile-phony.patch b/nixpkgs/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-makefile-phony.patch
new file mode 100644
index 000000000000..5e42e17c156a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-makefile-phony.patch
@@ -0,0 +1,10 @@
+--- a/Makefile.in	2015-01-13 08:52:30.000000000 +0100
++++ b/Makefile.in	2015-01-13 08:52:58.000000000 +0100
+@@ -30,6 +30,7 @@
+ subdirs = src doc
+ 
+ RECURSIVE_TARGETS = all allbin alldoc tags clean distclean realclean install
++.PHONY: $(RECURSIVE_TARGETS)
+ 
+ #-------------------------------------------------------------------------
+ 
diff --git a/nixpkgs/pkgs/applications/misc/rxvt_unicode/wrapper.nix b/nixpkgs/pkgs/applications/misc/rxvt_unicode/wrapper.nix
new file mode 100644
index 000000000000..fd0860b3aaef
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/rxvt_unicode/wrapper.nix
@@ -0,0 +1,23 @@
+{ symlinkJoin, rxvt_unicode, makeWrapper, plugins, perlPackages, perlDeps ? []}:
+
+let
+  rxvt_name = builtins.parseDrvName rxvt_unicode.name;
+
+in symlinkJoin {
+  name = "${rxvt_name.name}-with-plugins-${rxvt_name.version}";
+
+  paths = [ rxvt_unicode ] ++ plugins;
+
+  buildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    wrapProgram $out/bin/urxvt \
+      --prefix PERL5LIB : "${perlPackages.makePerlPath perlDeps}" \
+      --suffix-each URXVT_PERL_LIB ':' "$out/lib/urxvt/perl"
+    wrapProgram $out/bin/urxvtd \
+      --prefix PERL5LIB : "${perlPackages.makePerlPath perlDeps}" \
+      --suffix-each URXVT_PERL_LIB ':' "$out/lib/urxvt/perl"
+  '';
+
+  passthru.plugins = plugins;
+}
diff --git a/nixpkgs/pkgs/applications/misc/safeeyes/default.nix b/nixpkgs/pkgs/applications/misc/safeeyes/default.nix
new file mode 100644
index 000000000000..de1e7a093d5a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/safeeyes/default.nix
@@ -0,0 +1,71 @@
+{ lib, python3Packages, gobject-introspection, libappindicator-gtk3, libnotify, gtk3, gnome3, xprintidle-ng, wrapGAppsHook, gdk_pixbuf, shared-mime-info, librsvg
+}:
+
+let inherit (python3Packages) python buildPythonApplication fetchPypi;
+
+in buildPythonApplication rec {
+  name = "${pname}-${version}";
+  pname = "safeeyes";
+  version = "2.0.9";
+  namePrefix = "";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "13q06jv8hm0dynmr3g5pf1m4j3w9iabrpz1nhpl02f7x0d90whg2";
+  };
+
+  buildInputs = [
+    gtk3
+    gobject-introspection
+    gnome3.adwaita-icon-theme
+    gnome3.adwaita-icon-theme
+  ];
+
+  nativeBuildInputs = [
+    wrapGAppsHook
+  ];
+
+  propagatedBuildInputs = with python3Packages; [
+    Babel
+    psutil
+    xlib
+    pygobject3
+    dbus-python
+
+    libappindicator-gtk3
+    libnotify
+    xprintidle-ng
+  ];
+
+  # patch smartpause plugin
+  postPatch = ''
+    sed -i \
+      -e 's!xprintidle!xprintidle-ng!g' \
+      safeeyes/plugins/smartpause/plugin.py
+
+    sed -i \
+      -e 's!xprintidle!xprintidle-ng!g' \
+      safeeyes/plugins/smartpause/config.json
+  '';
+
+  preFixup = ''
+    gappsWrapperArgs+=(
+      --prefix XDG_DATA_DIRS : "${gdk_pixbuf}/share"
+      --prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
+      --prefix XDG_DATA_DIRS : "${librsvg}/share"
+
+      # safeeyes images
+      --prefix XDG_DATA_DIRS : "$out/lib/${python.libPrefix}/site-packages/usr/share"
+    )
+  '';
+
+  doCheck = false; # no tests
+
+  meta = {
+    homepage = http://slgobinath.github.io/SafeEyes;
+    description = "Protect your eyes from eye strain using this simple and beautiful, yet extensible break reminder. A Free and Open Source Linux alternative to EyeLeo";
+    license = lib.licenses.gpl3;
+    maintainers = with lib.maintainers; [ srghma ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/sakura/default.nix b/nixpkgs/pkgs/applications/misc/sakura/default.nix
new file mode 100644
index 000000000000..33df8e8f0a27
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/sakura/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchurl, cmake, pkgconfig, gtk3, perl, vte, pcre, glib , makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "sakura-${version}";
+  version = "3.6.0";
+
+  src = fetchurl {
+    url = "https://launchpad.net/sakura/trunk/${version}/+download/${name}.tar.bz2";
+    sha256 = "1q463qm41ym7jb3kbzjz7b6x549vmgkb70arpkhsf86yxly1y5m1";
+  };
+
+  nativeBuildInputs = [ cmake perl pkgconfig ];
+
+  buildInputs = [ makeWrapper gtk3 vte pcre glib ];
+
+  # Wrapper sets path to gsettings-schemata so sakura knows where to find colorchooser, fontchooser ...
+  postInstall = "wrapProgram $out/bin/sakura --suffix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}/";
+
+  meta = with stdenv.lib; {
+    description = "A terminal emulator based on GTK and VTE";
+    homepage    = http://www.pleyades.net/david/projects/sakura;
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ astsmtl codyopel ];
+    platforms   = platforms.linux;
+    longDescription = ''
+      sakura is a terminal emulator based on GTK and VTE. It's a terminal
+      emulator with few dependencies, so you don't need a full GNOME desktop
+      installed to have a decent terminal emulator. Current terminal emulators
+      based on VTE are gnome-terminal, XFCE Terminal, TermIt and a small
+      sample program included in the vte sources. The differences between
+      sakura and the last one are that it uses a notebook to provide several
+      terminals in one window and adds a contextual menu with some basic
+      options. No more no less.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/sbagen/default.nix b/nixpkgs/pkgs/applications/misc/sbagen/default.nix
new file mode 100644
index 000000000000..6f38ba5662b5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/sbagen/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "sbagen-1.4.4";
+
+  src = fetchurl {
+    url = "https://uazu.net/sbagen/${name}.tgz";
+    sha256 = "0w62yk1b0hq79kl0angma897yqa8p1ww0dwydf3zlwav333prkd2";
+  };
+
+  postPatch = ''
+    patchShebangs ./mk
+  '';
+
+  buildPhase = "./mk";
+
+  installPhase = ''
+    mkdir -p $out/{bin,share/sbagen/doc}
+    cp -r --target-directory=$out/share/sbagen examples scripts river1.ogg river2.ogg
+    cp sbagen $out/bin
+    cp --target-directory=$out/share/sbagen/doc README.txt SBAGEN.txt theory{,2}.txt {wave,holosync,focus,TODO}.txt
+  '';
+
+  meta = {
+    description = "Binaural sound generator";
+    homepage = http://uazu.net/sbagen;
+    license = "GPL";
+    platforms = [ "i686-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/sc-im/default.nix b/nixpkgs/pkgs/applications/misc/sc-im/default.nix
new file mode 100644
index 000000000000..280a42fde14c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/sc-im/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchFromGitHub, yacc, ncurses, libxml2, libzip, libxls, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  version = "0.7.0";
+  name = "sc-im-${version}";
+
+  src = fetchFromGitHub {
+    owner = "andmarti1424";
+    repo = "sc-im";
+    rev = "v${version}";
+    sha256 = "0xi0n9qzby012y2j7hg4fgcwyly698sfi4i9gkvy0q682jihprbk";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ yacc ncurses libxml2 libzip libxls ];
+
+  buildPhase = ''
+    cd src
+
+    sed 's/LDLIBS += -lm/& -lncurses/' -i Makefile
+
+    sed -e "\|^prefix  = /usr/local|   s|/usr/local|$out|" \
+        -e "\|^#LDLIBS += -lxlsreader| s|^#||            " \
+        -e "\|^#CFLAGS += -DXLS|       s|^#||            " \
+        -i Makefile
+
+    make
+    export DESTDIR=$out
+  '';
+
+  installPhase = ''
+    make install prefix=
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/andmarti1424/sc-im;
+    description = "SC-IM - Spreadsheet Calculator Improvised - SC fork";
+    license = licenses.bsdOriginal;
+    maintainers = [ ];
+    platforms = platforms.unix;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/sdcv/default.nix b/nixpkgs/pkgs/applications/misc/sdcv/default.nix
new file mode 100644
index 000000000000..cc8c30043b29
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/sdcv/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, glib, gettext, readline }:
+
+stdenv.mkDerivation rec {
+  name = "sdcv-${version}";
+  version = "0.5.2";
+
+  src = fetchFromGitHub {
+    owner = "Dushistov";
+    repo = "sdcv";
+    rev = "v${version}";
+    sha256 = "1b67s4nj0s5fh3cjk7858qvhiisc557xx72xwzrb8hq6ijpwx5k0";
+  };
+
+  hardeningDisable = [ "format" ];
+  nativeBuildInputs = [ cmake pkgconfig ];
+  buildInputs = [ glib gettext readline ];
+
+  preInstall = ''
+    mkdir locale
+  '';
+
+  NIX_CFLAGS_COMPILE = "-D__GNU_LIBRARY__";
+
+  meta = with stdenv.lib; {
+    homepage = https://dushistov.github.io/sdcv/;
+    description = "Console version of StarDict";
+    maintainers = with maintainers; [ lovek323 ];
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/sent/default.nix b/nixpkgs/pkgs/applications/misc/sent/default.nix
new file mode 100644
index 000000000000..9bbae33b3e41
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/sent/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, farbfeld, libX11, libXft, makeWrapper
+, patches ? [] }:
+
+stdenv.mkDerivation rec {
+  name = "sent-1";
+
+  src = fetchurl {
+    url = "https://dl.suckless.org/tools/${name}.tar.gz";
+    sha256 = "0cxysz5lp25mgww73jl0mgip68x7iyvialyzdbriyaff269xxwvv";
+  };
+
+  buildInputs = [ libX11 libXft ];
+  nativeBuildInputs = [ makeWrapper ];
+
+  # unpacking doesn't create a directory
+  sourceRoot = ".";
+
+  inherit patches;
+
+  installFlags = [ "PREFIX=$(out)" ];
+  postInstall = ''
+    wrapProgram "$out/bin/sent" --prefix PATH : "${farbfeld}/bin"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A simple plaintext presentation tool";
+    homepage = https://tools.suckless.org/sent/;
+    license = licenses.isc;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ pSub ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/sequeler/default.nix b/nixpkgs/pkgs/applications/misc/sequeler/default.nix
new file mode 100644
index 000000000000..4947bcf60bd9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/sequeler/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig, pantheon, gettext, wrapGAppsHook, python3, desktop-file-utils
+, gtk3, glib, libgee, libgda, gtksourceview, libxml2, libsecret, libssh2 }:
+
+
+let
+  sqlGda = libgda.override {
+    mysqlSupport = true;
+    postgresSupport = true;
+  };
+
+in stdenv.mkDerivation rec {
+  pname = "sequeler";
+  version = "0.7.0";
+
+  src = fetchFromGitHub {
+    owner = "Alecaddd";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1x2ikagjsgnhhhwkj09ihln17mq4wjq3wwbnf02j2p3jpp4i8w1i";
+  };
+
+  nativeBuildInputs = [ meson ninja pkgconfig pantheon.vala gettext wrapGAppsHook python3 desktop-file-utils ];
+
+  buildInputs = [ gtk3 glib pantheon.granite libgee sqlGda gtksourceview libxml2 libsecret libssh2 ];
+
+  postPatch = ''
+    chmod +x build-aux/meson_post_install.py
+    patchShebangs build-aux/meson_post_install.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Friendly SQL Client";
+    longDescription = ''
+      Sequeler is a native Linux SQL client built in Vala and Gtk. It allows you
+      to connect to your local and remote databases, write SQL in a handy text
+      editor with language recognition, and visualize SELECT results in a
+      Gtk.Grid Widget.
+    '';
+    homepage = https://github.com/Alecaddd/sequeler;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.etu ] ++ pantheon.maintainers;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/sequelpro/default.nix b/nixpkgs/pkgs/applications/misc/sequelpro/default.nix
new file mode 100644
index 000000000000..fc63745ebb84
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/sequelpro/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, undmg }:
+
+stdenv.mkDerivation rec {
+  name = "sequel-pro-${version}";
+  version = "1.1.2";
+
+  src = fetchurl {
+    url = "https://github.com/sequelpro/sequelpro/releases/download/release-1.1.2/sequel-pro-1.1.2.dmg";
+    sha256 = "1il7yc3f0yzxkra27bslnmka5ycxzx0q4m3xz2j9r7iyq5izsd3v";
+  };
+
+  buildInputs = [ undmg ];
+  installPhase = ''
+    mkdir -p "$out/Applications/Sequel Pro.app"
+    cp -R . "$out/Applications/Sequel Pro.app"
+    chmod +x "$out/Applications/Sequel Pro.app/Contents/MacOS/Sequel Pro"
+  '';
+
+  meta = {
+    description = "MySQL database management for macOS";
+    homepage = http://www.sequelpro.com/;
+    license = stdenv.lib.licenses.mit;
+    platforms = stdenv.lib.platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/sigal/default.nix b/nixpkgs/pkgs/applications/misc/sigal/default.nix
new file mode 100644
index 000000000000..2b44b0398b55
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/sigal/default.nix
@@ -0,0 +1,34 @@
+{ lib, python3Packages, ffmpeg }:
+
+python3Packages.buildPythonApplication rec {
+  version = "2.0";
+  pname   = "sigal";
+
+  src = python3Packages.fetchPypi {
+    inherit version pname;
+    sha256 = "0ff8hpihbd30xjy155ksfpypjskilqg4zmyavgvpri8jaf1qpv89";
+  };
+
+  checkInputs = with python3Packages; [ pytest ];
+  propagatedBuildInputs = with python3Packages; [
+    jinja2
+    markdown
+    pillow
+    pilkit
+    clint
+    click
+    blinker
+  ];
+
+  makeWrapperArgs = [ "--prefix PATH : ${ffmpeg}/bin" ];
+
+  # No tests included
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Yet another simple static gallery generator";
+    homepage    = http://sigal.saimon.org/en/latest/index.html;
+    license     = licenses.mit;
+    maintainers = with maintainers; [ domenkozar matthiasbeyer ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/simplenote/default.nix b/nixpkgs/pkgs/applications/misc/simplenote/default.nix
new file mode 100644
index 000000000000..719b8d32b330
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/simplenote/default.nix
@@ -0,0 +1,64 @@
+{ fetchurl, stdenv, lib, zlib, glib, alsaLib, dbus, gtk2, atk, pango, freetype, fontconfig
+, libgnome-keyring3, gdk_pixbuf, cairo, cups, expat, libgpgerror, nspr
+, nss, xorg, libcap, systemd, libnotify ,libXScrnSaver, gnome2 }:
+
+stdenv.mkDerivation rec {
+
+  name = "simplenote-${pkgver}";
+  pkgver = "1.1.3";
+
+  src = fetchurl {
+    url = "https://github.com/Automattic/simplenote-electron/releases/download/v${pkgver}/Simplenote-linux-${pkgver}.tar.gz";
+    sha256 = "1z92yyjmg3bgfqfdpnysf98h9hhhnqzdqqigwlmdmn3d7fy49kcf";
+  };
+
+  buildCommand = let
+
+    packages = [
+      stdenv.cc.cc zlib glib dbus gtk2 atk pango freetype libgnome-keyring3
+      fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr nss
+      xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst
+      xorg.libXcomposite xorg.libXi xorg.libXfixes xorg.libXrandr
+      xorg.libXcursor libcap systemd libnotify libXScrnSaver gnome2.GConf
+      xorg.libxcb
+    ];
+
+    libPathNative = lib.makeLibraryPath packages;
+    libPath64 = lib.makeSearchPathOutput "lib" "lib64" packages;
+    libPath = "${libPathNative}:${libPath64}";
+
+  in ''
+    mkdir -p $out/share/
+    mkdir -p $out/bin
+    tar xvzf $src -C $out/share/
+    mv $out/share/Simplenote-linux-x64 $out/share/simplenote
+    mv $out/share/simplenote/Simplenote $out/share/simplenote/simplenote
+    mkdir -p $out/share/applications
+
+    cat > $out/share/applications/simplenote.desktop << EOF
+    [Desktop Entry]
+    Name=Simplenote
+    Comment=Simplenote for Linux
+    Exec=$out/bin/simplenote
+    Icon=$out/share/simplenote/Simplenote.png
+    Type=Application
+    StartupNotify=true
+    Categories=Development;
+    EOF
+
+    fixupPhase
+
+    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath "${libPath}:$out/share/simplenote" \
+      $out/share/simplenote/simplenote
+
+    ln -s $out/share/simplenote/simplenote $out/bin/simplenote
+  '';
+
+  meta = with stdenv.lib; {
+    description = "The simplest way to keep notes";
+    homepage = https://github.com/Automattic/simplenote-electron;
+    license = licenses.lgpl2;
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/slade/default.nix b/nixpkgs/pkgs/applications/misc/slade/default.nix
new file mode 100644
index 000000000000..fc6be074a079
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/slade/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, wxGTK, gtk2, sfml, fluidsynth, curl, freeimage, ftgl, glew, zip }:
+
+stdenv.mkDerivation rec {
+  name = "slade-${version}";
+  version = "3.1.1.5";
+
+  src = fetchFromGitHub {
+    owner = "sirjuddington";
+    repo = "SLADE";
+    rev = version;
+    sha256 = "0mdn59jm6ab4cdh99bgvadif3wdlqmk5mq635gg7krq35njgw6f6";
+  };
+
+  nativeBuildInputs = [ cmake pkgconfig zip ];
+  buildInputs = [ wxGTK gtk2 sfml fluidsynth curl freeimage ftgl glew ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Doom editor";
+    homepage = http://slade.mancubus.net/;
+    license = licenses.gpl2;
+    platforms = [ "x86_64-linux" "i686-linux" ];
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/slade/git.nix b/nixpkgs/pkgs/applications/misc/slade/git.nix
new file mode 100644
index 000000000000..9ee30d347b0a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/slade/git.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, wxGTK, gtk2, sfml, fluidsynth, curl, freeimage, ftgl, glew, zip }:
+
+stdenv.mkDerivation {
+  name = "slade-git-3.1.2.2018.01.29";
+
+  src = fetchFromGitHub {
+    owner = "sirjuddington";
+    repo = "SLADE";
+    rev = "f7409c504b40c4962f419038db934c32688ddd2e";
+    sha256 = "14icxiy0r9rlcc10skqs1ylnxm1f0f3irhzfmx4sazq0pjv5ivld";
+  };
+
+  cmakeFlags = ["-DNO_WEBVIEW=1"];
+  nativeBuildInputs = [ cmake pkgconfig zip ];
+  buildInputs = [ wxGTK gtk2 sfml fluidsynth curl freeimage ftgl glew ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Doom editor";
+    homepage = http://slade.mancubus.net/;
+    license = licenses.gpl2Plus;
+    platforms = [ "x86_64-linux" "i686-linux" ];
+    maintainers = with maintainers; [ ertes ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/sleepyhead/default.nix b/nixpkgs/pkgs/applications/misc/sleepyhead/default.nix
new file mode 100644
index 000000000000..cf5c4625c952
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/sleepyhead/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchgit, qt5, zlib, libGLU, libX11 }:
+
+let
+  name = "sleepyhead-${version}";
+  version = "1.0.0-beta-git";
+in stdenv.mkDerivation {
+  inherit name;
+
+  src = fetchgit {
+    url = https://gitlab.com/sleepyhead/sleepyhead-code.git;
+    rev = "9e2329d8bca45693231b5e3dae80063717c24578";
+    sha256 = "0448z8gyaxpgpnksg34lzmffj36jdpm0ir4xxa5gvzagkx0wk07h";
+  };
+
+  buildInputs = [
+    qt5.qtbase qt5.qtwebkit qt5.qtserialport
+    zlib
+    libGLU
+    libX11
+  ];
+
+  patchPhase = ''
+    patchShebangs configure
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp sleepyhead/SleepyHead $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://sleepyhead.jedimark.net/;
+    description = "Review and explore data produced by CPAP and related machines";
+    longDescription = ''
+      SleepyHead is cross platform, opensource sleep tracking program for reviewing CPAP and Oximetry data, which are devices used in the treatment of Sleep Disorders like Obstructive Sleep Apnea.
+    '';
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = [ maintainers.krav ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/slic3r/default.nix b/nixpkgs/pkgs/applications/misc/slic3r/default.nix
new file mode 100644
index 000000000000..e012c3763b34
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/slic3r/default.nix
@@ -0,0 +1,85 @@
+{ stdenv, fetchgit, perl, makeWrapper, makeDesktopItem
+, which, perlPackages, boost
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.3.0";
+  name = "slic3r-${version}";
+
+  src = fetchgit {
+    url = "git://github.com/alexrj/Slic3r";
+    rev = version;
+    sha256 = "1pg4jxzb7f58ls5s8mygza8kqdap2c50kwlsdkf28bz1xi611zbi";
+  };
+
+  buildInputs =
+  [boost] ++
+  (with perlPackages; [ perl makeWrapper which
+    EncodeLocale MathClipper ExtUtilsXSpp
+    MathConvexHullMonotoneChain MathGeometryVoronoi MathPlanePath Moo
+    IOStringy ClassXSAccessor Wx GrowlGNTP NetDBus ImportInto XMLSAX
+    ExtUtilsMakeMaker OpenGL WxGLCanvas ModuleBuild LWP
+    ExtUtilsCppGuess ModuleBuildWithXSpp ExtUtilsTypemapsDefault
+    DevelChecklib locallib
+  ]);
+
+  desktopItem = makeDesktopItem {
+    name = "slic3r";
+    exec = "slic3r";
+    icon = "slic3r";
+    comment = "G-code generator for 3D printers";
+    desktopName = "Slic3r";
+    genericName = "3D printer tool";
+    categories = "Application;Development;";
+  };
+
+  prePatch = ''
+    # In nix ioctls.h isn't available from the standard kernel-headers package
+    # on other distributions. As the copy in glibc seems to be identical to the
+    # one in the kernel, we use that one instead.
+    sed -i 's|"/usr/include/asm-generic/ioctls.h"|<asm-generic/ioctls.h>|g' xs/src/libslic3r/GCodeSender.cpp
+  '';
+
+  buildPhase = ''
+    export SLIC3R_NO_AUTO=true
+    export LD=$CXX
+    export PERL5LIB="./xs/blib/arch/:./xs/blib/lib:$PERL5LIB"
+
+    substituteInPlace Build.PL \
+      --replace "0.9918" "0.9923" \
+      --replace "eval" ""
+
+    pushd xs
+      perl Build.PL
+      perl Build
+    popd
+
+    perl Build.PL --gui
+  '';
+
+  installPhase = ''
+    mkdir -p "$out/share/slic3r/"
+    cp -r * "$out/share/slic3r/"
+    wrapProgram "$out/share/slic3r/slic3r.pl" \
+      --prefix PERL5LIB : "$out/share/slic3r/xs/blib/arch:$out/share/slic3r/xs/blib/lib:$PERL5LIB"
+    mkdir -p "$out/bin"
+    ln -s "$out/share/slic3r/slic3r.pl" "$out/bin/slic3r"
+    mkdir -p "$out/share/pixmaps/"
+    ln -s "$out/share/slic3r/var/Slic3r.png" "$out/share/pixmaps/slic3r.png"
+    mkdir -p "$out/share/applications"
+    cp "$desktopItem"/share/applications/* "$out/share/applications/"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "G-code generator for 3D printers";
+    longDescription = ''
+      Slic3r is the tool you need to convert a digital 3D model into printing
+      instructions for your 3D printer. It cuts the model into horizontal
+      slices (layers), generates toolpaths to fill them and calculates the
+      amount of material to be extruded.'';
+    homepage = http://slic3r.org/;
+    license = licenses.agpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ bjornfor the-kenny ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/slmenu/default.nix b/nixpkgs/pkgs/applications/misc/slmenu/default.nix
new file mode 100644
index 000000000000..193bcf205f5b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/slmenu/default.nix
@@ -0,0 +1,30 @@
+{stdenv, fetchhg}:
+let
+  s = 
+  rec {
+    baseName = "slmenu";
+    version = "hg-${date}";
+    date = "2012-02-01";
+    name = "${baseName}-${version}";
+    url = "https://bitbucket.org/rafaelgg/slmenu/";
+    rev = "7e74fa5db73e8b018da48d50dbbaf11cb5c62d13";
+    sha256 = "0zb7mm8344d3xmvrl62psazcabfk75pp083jqkmywdsrikgjagv6";
+  };
+  buildInputs = [
+  ];
+in
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit buildInputs;
+  src = fetchhg {
+    inherit (s) url sha256;
+  };
+  makeFlags = ''PREFIX=$(out)'';
+  meta = {
+    inherit (s) version;
+    description = ''A console dmenu-like tool'';
+    license = stdenv.lib.licenses.mit;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/slstatus/default.nix b/nixpkgs/pkgs/applications/misc/slstatus/default.nix
new file mode 100644
index 000000000000..f4a2e889cd43
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/slstatus/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchgit, pkgconfig, writeText, libX11, conf ? null }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "slstatus-${version}";
+  version = "unstable-2018-04-16";
+
+  src = fetchgit {
+    url = https://git.suckless.org/slstatus;
+    rev = "97ef7c2a1d67bb2c9c379e657fbc8e35acd6aafb";
+    sha256 = "1777hgl10imk0l2sgnqgbkfchv1mpxrd82ninzwp7f1rgwchz36v";
+  };
+
+  configFile = optionalString (conf!=null) (writeText "config.def.h" conf);
+  preBuild = optionalString (conf!=null) "cp ${configFile} config.def.h";
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ libX11 ];
+
+  installFlags = [ "PREFIX=$(out)" ];
+
+  meta = {
+    homepage = https://tools.suckless.org/slstatus/;
+    description = "status monitor for window managers that use WM_NAME like dwm";
+    license = licenses.isc;
+    maintainers = with maintainers; [ geistesk ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/solaar/default.nix b/nixpkgs/pkgs/applications/misc/solaar/default.nix
new file mode 100644
index 000000000000..cb2cd3f1e62f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/solaar/default.nix
@@ -0,0 +1,50 @@
+{ fetchFromGitHub, lib, gobject-introspection, gtk3, python3Packages }:
+
+# Although we copy in the udev rules here, you probably just want to use logitech-udev-rules instead of
+# adding this to services.udev.packages on NixOS
+
+python3Packages.buildPythonApplication rec {
+  pname = "solaar-unstable";
+  version = "2019-01-30";
+
+  src = fetchFromGitHub {
+    owner = "pwr";
+    repo = "Solaar";
+    rev = "c07c115ee379e82db84283aaa29dc53df033a8c8";
+    sha256 = "0xg181xcwzzs8pdqvjrkjyaaga7ir93hzjvd17j9g3ns8xfj2mvr";
+  };
+
+  propagatedBuildInputs = with python3Packages; [ gobject-introspection gtk3 pygobject3 pyudev ];
+
+  postInstall = ''
+    wrapProgram "$out/bin/solaar" \
+      --prefix PYTHONPATH : "$PYTHONPATH" \
+      --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH"
+    wrapProgram "$out/bin/solaar-cli" \
+      --prefix PYTHONPATH : "$PYTHONPATH" \
+      --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH"
+
+    install -Dm644 -t $out/etc/udev/rules.d rules.d/*.rules
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Linux devices manager for the Logitech Unifying Receiver";
+    longDescription = ''
+      Solaar is a Linux device manager for Logitech’s Unifying Receiver
+      peripherals. It is able to pair/unpair devices to the receiver, and for
+      most devices read battery status.
+
+      It comes in two flavors, command-line and GUI. Both are able to list the
+      devices paired to a Unifying Receiver, show detailed info for each
+      device, and also pair/unpair supported devices with the receiver.
+
+      To be able to use it, make sure you have access to /dev/hidraw* files.
+    '';
+    license = licenses.gpl2;
+    homepage = https://pwr.github.io/Solaar/;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ spinus ysndr ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/spacefm/default.nix b/nixpkgs/pkgs/applications/misc/spacefm/default.nix
new file mode 100644
index 000000000000..9f20b20f7f3a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/spacefm/default.nix
@@ -0,0 +1,53 @@
+{ pkgs, fetchFromGitHub, stdenv, gtk3, udev, desktop-file-utils
+, shared-mime-info, intltool, pkgconfig, wrapGAppsHook, ffmpegthumbnailer
+, jmtpfs, ifuseSupport ? false, ifuse ? null, lsof, udisks2 }:
+
+stdenv.mkDerivation rec {
+  name = "spacefm-${version}";
+  version = "1.0.6";
+
+  src = fetchFromGitHub {
+    owner = "IgnorantGuru";
+    repo = "spacefm";
+    rev = "${version}";
+    sha256 = "089r6i40lxcwzp60553b18f130asspnzqldlpii53smz52kvpirx";
+  };
+
+  configureFlags = [
+    "--with-bash-path=${pkgs.bash}/bin/bash"
+  ];
+
+  preConfigure = ''
+    configureFlags="$configureFlags --sysconfdir=$out/etc"
+  '';
+
+  postInstall = ''
+    rm -f $out/etc/spacefm/spacefm.conf
+    ln -s /etc/spacefm/spacefm.conf $out/etc/spacefm/spacefm.conf
+  '';
+
+  preFixup = ''
+    gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "${shared-mime-info}/share")
+  '';
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    gtk3 udev desktop-file-utils shared-mime-info intltool
+    wrapGAppsHook ffmpegthumbnailer jmtpfs lsof udisks2
+  ] ++ (if ifuseSupport then [ ifuse ] else []);
+  # Introduced because ifuse doesn't build due to CVEs in libplist
+  # Revert when libplist builds again…
+
+  meta = with stdenv.lib;  {
+    description = "A multi-panel tabbed file manager";
+    longDescription = ''
+      Multi-panel tabbed file and desktop manager for Linux
+      with built-in VFS, udev- or HAL-based device manager,
+      customizable menu system, and bash integration
+    '';
+    homepage = http://ignorantguru.github.io/spacefm/;
+    platforms = platforms.linux;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ jagajaga obadz ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/speedread/default.nix b/nixpkgs/pkgs/applications/misc/speedread/default.nix
new file mode 100644
index 000000000000..180b66fda8ce
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/speedread/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, perl }:
+
+stdenv.mkDerivation rec {
+  name = "speedread-unstable-2016-09-21";
+
+  src = fetchFromGitHub {
+    owner  = "pasky";
+    repo   = "speedread";
+    rev    = "93acfd61a1bf4482537ce5d71b9164b8446cb6bd";
+    sha256 = "1h94jx3v18fdlc64lfmj2g5x63fjyqb8c56k5lihl7bva0xgdkxd";
+  };
+
+  buildInputs = [ perl ];
+
+  installPhase = ''
+    install -m755 -D speedread $out/bin/speedread
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A simple terminal-based open source Spritz-alike";
+    longDescription = ''
+      Speedread is a command line filter that shows input text as a
+      per-word rapid serial visual presentation aligned on optimal
+      reading points. This allows reading text at a much more rapid
+      pace than usual as the eye can stay fixed on a single place.
+    '';
+    homepage = src.meta.homepage;
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.oxij ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/sqliteman/default.nix b/nixpkgs/pkgs/applications/misc/sqliteman/default.nix
new file mode 100644
index 000000000000..a1d5ef153bbd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/sqliteman/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, cmake, qt4, qscintilla }:
+
+stdenv.mkDerivation rec {
+  name = "sqliteman-${version}";
+  version = "1.2.0";
+
+  src = fetchFromGitHub {
+    repo = "sqliteman";
+    owner = "pvanek";
+    rev = version;
+    sha256 = "1blzyh1646955d580f71slgdvz0nqx0qacryx0jc9w02yrag17cs";
+  };
+
+  buildInputs = [ cmake qt4 qscintilla ];
+
+  prePatch = ''
+    sed -i 's,m_file(0),m_file(QString()),' Sqliteman/sqliteman/main.cpp
+  '';
+
+  preConfigure = ''
+    cd Sqliteman
+    sed -i 's,/usr/include/Qsci,${qscintilla}/include/Qsci,' cmake/modules/FindQScintilla.cmake
+    sed -i 's,PATHS ''${QT_LIBRARY_DIR},PATHS ${qscintilla}/libs,' cmake/modules/FindQScintilla.cmake
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A simple but powerful Sqlite3 GUI database manager";
+    homepage = http://sqliteman.yarpen.cz/;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.eikek ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/ssocr/default.nix b/nixpkgs/pkgs/applications/misc/ssocr/default.nix
new file mode 100644
index 000000000000..aee486ddf0c2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ssocr/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchFromGitHub, imlib2, libX11 }:
+
+stdenv.mkDerivation rec {
+  name = "ssocr-${version}";
+  version = "unstable-2018-08-11";
+
+  src = fetchFromGitHub {
+    owner = "auerswal";
+    repo = "ssocr";
+    rev = "5e47e26b125a1a13bc79de93a5e87dd0b51354ca";
+    sha256 = "0yzprwflky9a7zxa3zic7gvdwqg0zy49zvrqkdxng2k1ng78k3s7";
+  };
+
+  nativeBuildInputs = [ imlib2 libX11 ]; 
+
+  installFlags = [ "PREFIX=$(out)" ];
+
+  meta = with stdenv.lib; {
+    description = "Seven Segment Optical Character Recognition";
+    homepage = https://github.com/auerswal/ssocr;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.kroell ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/st/default.nix b/nixpkgs/pkgs/applications/misc/st/default.nix
new file mode 100644
index 000000000000..47d7279a47fa
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/st/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, pkgconfig, writeText, libX11, ncurses
+, libXft, conf ? null, patches ? [], extraLibs ? []}:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "st-0.8.2";
+
+  src = fetchurl {
+    url = "https://dl.suckless.org/st/${name}.tar.gz";
+    sha256 = "0ddz2mdp1c7q67rd5vrvws9r0493ln0mlqyc3d73dv8im884xdxf";
+  };
+
+  inherit patches;
+
+  configFile = optionalString (conf!=null) (writeText "config.def.h" conf);
+  preBuild = optionalString (conf!=null) "cp ${configFile} config.def.h";
+
+  nativeBuildInputs = [ pkgconfig ncurses ];
+  buildInputs = [ libX11 libXft ] ++ extraLibs;
+
+  installPhase = ''
+    TERMINFO=$out/share/terminfo make install PREFIX=$out
+  '';
+
+  meta = {
+    homepage = https://st.suckless.org/;
+    description = "Simple Terminal for X from Suckless.org Community";
+    license = licenses.mit;
+    maintainers = with maintainers; [andsild];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/st/xst.nix b/nixpkgs/pkgs/applications/misc/st/xst.nix
new file mode 100644
index 000000000000..b63a41bb9156
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/st/xst.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, pkgconfig, libX11, ncurses, libXext, libXft, fontconfig }:
+
+with stdenv.lib;
+
+let
+  version = "0.7.1";
+  name = "xst-${version}";
+in stdenv.mkDerivation {
+  inherit name;
+
+  src = fetchFromGitHub {
+    owner = "neeasade";
+    repo = "xst";
+    rev = "v${version}";
+    sha256 = "1fh4y2w0icaij99kihl3w8j5d5b38d72afp17c81pi57f43ss6pc";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ libX11 ncurses libXext libXft fontconfig ];
+
+  installPhase = ''
+    TERMINFO=$out/share/terminfo make install PREFIX=$out
+  '';
+
+  meta = {
+    homepage = https://github.com/neeasade/xst;
+    description = "Simple terminal fork that can load config from Xresources";
+    license = licenses.mit;
+    maintainers = [ maintainers.vyp ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/stag/default.nix b/nixpkgs/pkgs/applications/misc/stag/default.nix
new file mode 100644
index 000000000000..ebb50e685da7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/stag/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchgit, curses }:
+
+stdenv.mkDerivation {
+  name = "stag-1.0";
+
+  src = fetchgit {
+    url = https://github.com/seenaburns/stag.git;
+    rev = "90e2964959ea8242349250640d24cee3d1966ad6";
+    sha256 = "1yrzjhcwrxrxq5jj695wvpgb0pz047m88yq5n5ymkcw5qr78fy1v";
+  };
+
+  buildInputs = [ stdenv curses ];
+
+  installPhase = ''
+    make install PREFIX=$out
+  '';
+
+  meta = {
+    homepage = https://github.com/seenaburns/stag;
+    description = "Terminal streaming bar graph passed through stdin";
+    license = stdenv.lib.licenses.bsdOriginal;
+    maintainers = [ stdenv.lib.maintainers.matthiasbeyer ];
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/stog/default.nix b/nixpkgs/pkgs/applications/misc/stog/default.nix
new file mode 100644
index 000000000000..d3cd81f7f13a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/stog/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitLab, ocaml, findlib, ocf, ptime,
+  uutf, uri, ppx_blob, xtmpl, ocaml_lwt, higlo, omd
+}:
+
+stdenv.mkDerivation rec {
+  name = "stog-${version}";
+  version = "0.18.0";
+  src = fetchFromGitLab {
+    domain = "framagit.org";
+    owner = "zoggy";
+    repo = "stog";
+    rev = version;
+    sha256 = "154gl3ljxqlw8wz1vmsyv8180igrl5bjq0wir7ybrnzq2cdflkv0";
+  };
+
+  buildInputs = [ ocaml uutf ];
+  propagatedBuildInputs = [ findlib omd ppx_blob ocf ptime uri xtmpl ocaml_lwt higlo ];
+
+  createFindlibDestdir = true;
+
+  patches = [ ./install.patch ];
+
+  meta = with stdenv.lib; {
+    description = "XML documents and web site compiler";
+    homepage = https://www.good-eris.net/stog;
+    license = licenses.lgpl3;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = with maintainers; [ regnat ];
+  };
+}
+
+
diff --git a/nixpkgs/pkgs/applications/misc/stog/install.patch b/nixpkgs/pkgs/applications/misc/stog/install.patch
new file mode 100644
index 000000000000..a2407d3079f5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/stog/install.patch
@@ -0,0 +1,18 @@
+diff --git a/src/Makefile b/src/Makefile
+index 736dd037..79a85b9c 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -431,11 +431,12 @@ install-lib:
+ install-share:
+ 
+ install-bin:
++	mkdir $(out)/bin
+ 	$(CP) $(MAIN) $(MAIN_BYTE) $(TMPL) $(TMPL_BYTE) \
+ 		$(SERVER) $(SERVER_BYTE) $(OCAML_SESSION) \
+ 	  $(MK_STOG) $(MK_STOG_BYTE) $(MK_STOG_OCAML) \
+ 	  $(LATEX2STOG) $(LATEX2STOG_BYTE) \
+-		`dirname \`which $(OCAMLC)\``/
++	  $(out)/bin
+ 
+ uninstall: uninstall-lib uninstall-share uninstall-bin
+ 
diff --git a/nixpkgs/pkgs/applications/misc/stretchly/default.nix b/nixpkgs/pkgs/applications/misc/stretchly/default.nix
new file mode 100644
index 000000000000..8f26ee99e227
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/stretchly/default.nix
@@ -0,0 +1,139 @@
+{ GConf
+, alsaLib
+, at-spi2-atk
+, atk
+, cairo
+, cups
+, dbus
+, expat
+, fetchurl
+, fontconfig
+, gdk_pixbuf
+, glib
+, gtk2
+, gtk3
+, lib
+, libX11
+, libXScrnSaver
+, libXcomposite
+, libXcursor
+, libXdamage
+, libXext
+, libXfixes
+, libXi
+, libXrandr
+, libXrender
+, libXtst
+, libappindicator
+, libdrm
+, libnotify
+, libpciaccess
+, libpng12
+, libxcb
+, nspr
+, nss
+, pango
+, pciutils
+, pulseaudio
+, stdenv
+, udev
+, wrapGAppsHook
+}:
+
+let
+  libs = [
+    GConf
+    alsaLib
+    at-spi2-atk
+    atk
+    cairo
+    cups
+    dbus
+    expat
+    fontconfig
+    gdk_pixbuf
+    glib
+    gtk2
+    gtk3
+    libX11
+    libXScrnSaver
+    libXcomposite
+    libXcursor
+    libXdamage
+    libXext
+    libXfixes
+    libXi
+    libXrandr
+    libXrender
+    libXtst
+    libappindicator
+    libdrm
+    libnotify
+    libpciaccess
+    libpng12
+    libxcb
+    nspr
+    nss
+    pango
+    pciutils
+    pulseaudio
+    stdenv.cc.cc.lib
+    udev
+  ];
+
+  libPath = lib.makeLibraryPath libs;
+in
+
+stdenv.mkDerivation rec {
+  pname = "stretchly";
+  version = "0.19.1";
+
+  src = fetchurl {
+    url = "https://github.com/hovancik/stretchly/releases/download/v${version}/stretchly-${version}.tar.xz";
+    sha256 = "1q2wxfqs8qv9b1rfh5lhmyp3rrgdl05m6ihsgkxlgp0yzi07afz8";
+  };
+
+  nativeBuildInputs = [
+    wrapGAppsHook
+  ];
+
+  buildInputs = libs;
+
+  dontPatchELF = true;
+  dontBuild = true;
+  dontConfigure = true;
+
+  installPhase = ''
+    mkdir -p $out/bin $out/lib/stretchly
+    cp -r ./* $out/lib/stretchly/
+    ln -s $out/lib/stretchly/libffmpeg.so $out/lib/
+    ln -s $out/lib/stretchly/libnode.so $out/lib/
+    ln -s $out/lib/stretchly/stretchly $out/bin/
+  '';
+
+  preFixup = ''
+    patchelf --set-rpath "${libPath}" $out/lib/stretchly/libffmpeg.so
+    patchelf --set-rpath "${libPath}" $out/lib/stretchly/libnode.so
+
+    patchelf \
+      --set-rpath "$out/lib/stretchly:${libPath}" \
+      --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      $out/lib/stretchly/stretchly
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A break time reminder app";
+    longDescription = ''
+      stretchly is a cross-platform electron app that reminds you to take
+      breaks when working on your computer. By default, it runs in your tray
+      and displays a reminder window containing an idea for a microbreak for 20
+      seconds every 10 minutes. Every 30 minutes, it displays a window
+      containing an idea for a longer 5 minute break.
+    '';
+    homepage = https://hovancik.net/stretchly;
+    downloadPage = https://hovancik.net/stretchly/downloads/;
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ cdepillabout ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/stupidterm/default.nix b/nixpkgs/pkgs/applications/misc/stupidterm/default.nix
new file mode 100644
index 000000000000..1fc96e551ac7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/stupidterm/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchFromGitHub, pkgconfig, vte, gtk }:
+
+stdenv.mkDerivation rec {
+  pname = "stupidterm";
+  version = "2019-03-26";
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  buildInputs = [ vte gtk ];
+
+  src = fetchFromGitHub {
+    owner = "esmil";
+    repo = "stupidterm";
+    rev = "f824e41c2ca9016db73556c5d2f5a2861e235c8e";
+    sha256 = "1f73wvqqvj5pr3fvb7jjc4bi1iwgkkknz24k8n69mdb75jnfjipp";
+  };
+
+  makeFlags = "PKGCONFIG=${pkgconfig}/bin/pkg-config binary=stupidterm";
+
+  installPhase = ''
+    install -D stupidterm $out/bin/stupidterm
+    install -D -m 644 stupidterm.desktop $out/share/applications/stupidterm.desktop
+    install -D -m 644 stupidterm.ini $out/share/stupidterm/stupidterm.ini
+
+    substituteInPlace $out/share/applications/stupidterm.desktop \
+      --replace "Exec=st" "Exec=$out/bin/stupidterm"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Simple wrapper around the VTE terminal emulator widget for GTK+";
+    longDescription = ''
+      Simple wrapper around the VTE terminal emulator widget for GTK+
+    '';
+    homepage = https://github.com/esmil/stupidterm;
+    license = licenses.lgpl3Plus;
+    maintainers = [ maintainers.etu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/styx/default.nix b/nixpkgs/pkgs/applications/misc/styx/default.nix
new file mode 100644
index 000000000000..d545447cb130
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/styx/default.nix
@@ -0,0 +1,71 @@
+{ stdenv, fetchFromGitHub, caddy, asciidoctor
+, file, lessc, sass, multimarkdown, linkchecker
+, perlPackages, python27 }:
+
+stdenv.mkDerivation rec {
+  name    = "styx-${version}";
+  version = "0.7.1";
+
+  src = fetchFromGitHub {
+    owner  = "styx-static";
+    repo   = "styx";
+    rev    = "v${version}";
+    sha256 = "01lklz7l9klqmmsncikwjnk3glzyz15c30118s82yd1chwpwhpfl";
+  };
+
+  server = "${caddy}/bin/caddy";
+  linkcheck = "${linkchecker}/bin/linkchecker";
+
+  nativeBuildInputs = [ asciidoctor ];
+
+  outputs = [ "out" "lib" "themes" ];
+
+  propagatedBuildInputs = [
+    file
+    lessc
+    sass
+    asciidoctor
+    multimarkdown
+    perlPackages.ImageExifTool
+    (python27.withPackages (ps: [ ps.parsimonious ]))
+  ];
+
+  installPhase = ''
+    mkdir $out
+    install -D -m 777 src/styx.sh $out/bin/styx
+
+    mkdir -p $out/share/styx-src
+    cp -r ./* $out/share/styx-src
+
+    mkdir -p $out/share/doc/styx
+    asciidoctor src/doc/index.adoc       -o $out/share/doc/styx/index.html
+    asciidoctor src/doc/styx-themes.adoc -o $out/share/doc/styx/styx-themes.html
+    asciidoctor src/doc/library.adoc     -o $out/share/doc/styx/library.html
+    cp -r src/doc/highlight $out/share/doc/styx/
+    cp -r src/doc/imgs $out/share/doc/styx/
+
+    substituteAllInPlace $out/bin/styx
+    substituteAllInPlace $out/share/doc/styx/index.html
+    substituteAllInPlace $out/share/doc/styx/styx-themes.html
+    substituteAllInPlace $out/share/doc/styx/library.html
+
+    mkdir -p $out/share/styx/scaffold
+    cp -r src/scaffold $out/share/styx
+    cp -r src/tools $out/share/styx
+
+    mkdir $lib
+    cp -r src/lib/* $lib
+
+    mkdir $themes
+    cp -r themes/* $themes
+  '';
+
+  meta = with stdenv.lib; {
+    description  = "Nix based static site generator";
+    maintainers  = with maintainers; [ ericsagnes ];
+    homepage     = https://styx-static.github.io/styx-site/;
+    downloadPage = https://github.com/styx-static/styx/;
+    platforms    = platforms.all;
+    license      = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/subsurface/default.nix b/nixpkgs/pkgs/applications/misc/subsurface/default.nix
new file mode 100644
index 000000000000..50bb1df2eef2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/subsurface/default.nix
@@ -0,0 +1,111 @@
+{ stdenv, fetchurl, fetchFromGitHub, autoreconfHook, cmake, makeWrapper, pkgconfig, qmake
+, curl, grantlee, libgit2, libusb, libssh2, libxml2, libxslt, libzip, zlib
+, qtbase, qtconnectivity, qtlocation, qtsvg, qttools, qtwebkit, libXcomposite
+}:
+
+let
+  version = "4.8.2";
+
+  libdc = stdenv.mkDerivation rec {
+    name = "libdivecomputer-ssrf-${version}";
+
+    src = fetchurl {
+      url = "https://subsurface-divelog.org/downloads/libdivecomputer-subsurface-branch-${version}.tgz";
+      sha256 = "167qan59raibmilkc574gdqxfjg2f5ww2frn86xzk2kn4qg8190w";
+    };
+
+    nativeBuildInputs = [ autoreconfHook ];
+
+    buildInputs = [ zlib ];
+
+    enableParallelBuilding = true;
+
+    meta = with stdenv.lib; {
+      homepage = http://www.libdivecomputer.org;
+      description = "A cross-platform and open source library for communication with dive computers from various manufacturers";
+      maintainers = with maintainers; [ mguentner ];
+      license = licenses.lgpl21;
+      platforms = platforms.all;
+    };
+  };
+
+  googlemaps = stdenv.mkDerivation rec {
+    name = "googlemaps-${version}";
+
+    version = "2017-12-18";
+
+    src = fetchFromGitHub {
+      owner = "vladest";
+      repo = "googlemaps";
+      rev = "79f3511d60dc9640de02a5f24656094c8982b26d";
+      sha256 = "11334w0bnfb97sv23vvj2b5hcwvr0171hxldn91jms9y12l5j15d";
+    };
+
+    nativeBuildInputs = [ qmake ];
+
+    buildInputs = [ qtbase qtlocation libXcomposite ];
+
+    pluginsSubdir = "lib/qt-${qtbase.qtCompatVersion}/plugins";
+
+    installPhase = ''
+      mkdir -p $out $(dirname ${pluginsSubdir}/geoservices)
+      mkdir -p ${pluginsSubdir}/geoservices
+      mv *.so ${pluginsSubdir}/geoservices
+      mv lib $out/
+    '';
+
+    enableParallelBuilding = true;
+
+    meta = with stdenv.lib; {
+      inherit (src.meta) homepage;
+      description = "QtLocation plugin for Google maps tile API";
+      maintainers = with maintainers; [ orivej ];
+      license = licenses.mit;
+      platforms = platforms.all;
+    };
+  };
+
+in stdenv.mkDerivation rec {
+  name = "subsurface-${version}";
+
+  src = fetchurl {
+    url = "https://subsurface-divelog.org/downloads/Subsurface-${version}.tgz";
+    sha256 = "1fzrq6rqb6pzs36wxar2453cl509dqpcy9w7nq4gw7b1v2331wfy";
+  };
+
+  buildInputs = [
+    libdc googlemaps
+    curl grantlee libgit2 libssh2 libusb libxml2 libxslt libzip
+    qtbase qtconnectivity qtsvg qttools qtwebkit
+  ];
+
+  nativeBuildInputs = [ cmake makeWrapper pkgconfig ];
+
+  cmakeFlags = [
+    "-DLIBDC_FROM_PKGCONFIG=ON"
+    "-DNO_PRINTING=OFF"
+  ];
+
+  postInstall = ''
+    wrapProgram $out/bin/subsurface \
+      --prefix QT_PLUGIN_PATH : "${googlemaps}/${googlemaps.pluginsSubdir}"
+  '';
+
+  enableParallelBuilding = true;
+
+  passthru = { inherit version libdc googlemaps; };
+
+  meta = with stdenv.lib; {
+    description = "A divelog program";
+    longDescription = ''
+      Subsurface can track single- and multi-tank dives using air, Nitrox or TriMix.
+      It allows tracking of dive locations including GPS coordinates (which can also
+      conveniently be entered using a map interface), logging of equipment used and
+      names of other divers, and lets users rate dives and provide additional notes.
+    '';
+    homepage = https://subsurface-divelog.org;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ mguentner ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/super_user_spark/default.nix b/nixpkgs/pkgs/applications/misc/super_user_spark/default.nix
new file mode 100644
index 000000000000..8102375479be
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/super_user_spark/default.nix
@@ -0,0 +1,32 @@
+{ mkDerivation, fetchgit, aeson, aeson-pretty, base, bytestring, directory
+, filepath, hspec, hspec-core, HUnit, mtl, optparse-applicative
+, parsec, process, pureMD5, QuickCheck, shelly, stdenv, text
+, transformers, unix
+}:
+mkDerivation {
+  pname = "super-user-spark";
+  version = "0.3.2.0-dev";
+  src = fetchgit {
+    url = "https://github.com/NorfairKing/super-user-spark";
+    sha256 = "0akyc51bghzkk8j75n0i8v8rrsklidwvljhx3aibxfbkqp33372g";
+    rev = "ab8635682d67842b9e6d909cf3c618014e4157f2";
+  };
+  isLibrary = true;
+  isExecutable = true;
+  libraryHaskellDepends = [
+    aeson aeson-pretty base bytestring directory filepath mtl
+    optparse-applicative parsec process pureMD5 shelly text
+    transformers unix
+  ];
+  executableHaskellDepends = [ base ];
+  testHaskellDepends = [
+    aeson aeson-pretty base bytestring directory filepath hspec
+    hspec-core HUnit mtl optparse-applicative parsec process pureMD5
+    QuickCheck shelly text transformers unix
+  ];
+  jailbreak = true;
+  description = "Configure your dotfile deployment with a DSL";
+  license = stdenv.lib.licenses.mit;
+  homepage = https://github.com/NorfairKing/super-user-spark;
+  maintainers = [ stdenv.lib.maintainers.badi ];
+}
diff --git a/nixpkgs/pkgs/applications/misc/sweethome3d/default.nix b/nixpkgs/pkgs/applications/misc/sweethome3d/default.nix
new file mode 100644
index 000000000000..293f6aaa3c6f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/sweethome3d/default.nix
@@ -0,0 +1,100 @@
+{ lib, stdenv, fetchurl, fetchsvn, makeWrapper, makeDesktopItem, jdk, jre, ant
+, gtk3, gsettings-desktop-schemas, p7zip, libXxf86vm }:
+
+let
+
+  getDesktopFileName = drvName: (builtins.parseDrvName drvName).name;
+
+  # TODO: Should we move this to `lib`? Seems like its would be useful in many cases.
+  extensionOf = filePath:
+    lib.concatStringsSep "." (lib.tail (lib.splitString "." (builtins.baseNameOf filePath)));
+
+  installIcons = iconName: icons: lib.concatStringsSep "\n" (lib.mapAttrsToList (size: iconFile: ''
+    mkdir -p "$out/share/icons/hicolor/${size}/apps"
+    ln -s -T "${iconFile}" "$out/share/icons/hicolor/${size}/apps/${iconName}.${extensionOf iconFile}"
+  '') icons);
+
+  mkSweetHome3D =
+  { name, module, version, src, license, description, desktopName, icons }:
+
+  stdenv.mkDerivation rec {
+    inherit name version src description;
+    exec = stdenv.lib.toLower module;
+    sweethome3dItem = makeDesktopItem {
+      inherit exec desktopName;
+      name = getDesktopFileName name;
+      icon = getDesktopFileName name;
+      comment =  description;
+      genericName = "Computer Aided (Interior) Design";
+      categories = "Application;Graphics;2DGraphics;3DGraphics;";
+    };
+
+    patchPhase = ''
+      patchelf --set-rpath ${libXxf86vm}/lib lib/java3d-1.6/linux/amd64/libnativewindow_awt.so
+      patchelf --set-rpath ${libXxf86vm}/lib lib/java3d-1.6/linux/amd64/libnativewindow_x11.so
+      patchelf --set-rpath ${libXxf86vm}/lib lib/java3d-1.6/linux/i586/libnativewindow_awt.so
+      patchelf --set-rpath ${libXxf86vm}/lib lib/java3d-1.6/linux/i586/libnativewindow_x11.so
+    '';
+
+    buildInputs = [ ant jdk jre makeWrapper p7zip gtk3 gsettings-desktop-schemas ];
+
+    buildPhase = ''
+      ant furniture textures help
+      mkdir -p $out/share/{java,applications}
+      mv "build/"*.jar $out/share/java/.
+      ant
+    '';
+
+    installPhase = ''
+      mkdir -p $out/bin
+      cp install/${module}-${version}.jar $out/share/java/.
+
+      ${installIcons (getDesktopFileName name) icons}
+
+      cp "${sweethome3dItem}/share/applications/"* $out/share/applications
+
+      makeWrapper ${jre}/bin/java $out/bin/$exec \
+        --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gtk3.out}/share:${gsettings-desktop-schemas}/share:$out/share:$GSETTINGS_SCHEMAS_PATH" \
+        --add-flags "-jar $out/share/java/${module}-${version}.jar -cp $out/share/java/Furniture.jar:$out/share/java/Textures.jar:$out/share/java/Help.jar -d${toString stdenv.hostPlatform.parsed.cpu.bits}"
+    '';
+
+    dontStrip = true;
+
+    meta = {
+      homepage = http://www.sweethome3d.com/index.jsp;
+      inherit description;
+      inherit license;
+      maintainers = [ stdenv.lib.maintainers.edwtjo ];
+      platforms = stdenv.lib.platforms.linux;
+    };
+  };
+
+  d2u = stdenv.lib.replaceChars ["."] ["_"];
+
+in rec {
+
+  application = mkSweetHome3D rec {
+    version = "6.1.2";
+    module = "SweetHome3D";
+    name = stdenv.lib.toLower module + "-application-" + version;
+    description = "Design and visualize your future home";
+    license = stdenv.lib.licenses.gpl2Plus;
+    src = fetchsvn {
+      url = "https://svn.code.sf.net/p/sweethome3d/code/tags/V_" + d2u version + "/SweetHome3D/";
+      sha256 = "14svi112kml175dblzcdjzhlfwbp1cy6rki49mqb3632hwmif6ya";
+      rev = "6750";
+    };
+    desktopName = "Sweet Home 3D";
+    icons = {
+      "32x32" = fetchurl {
+        url = "http://sweethome3d.cvs.sourceforge.net/viewvc/sweethome3d/SweetHome3D/deploy/SweetHome3DIcon32x32.png";
+        sha256 = "1r2fhfg27mx00nfv0qj66rhf719s2g1vhdis7bdc9mqk9x0mb0ir";
+      };
+      "48x48" = fetchurl {
+        url = "http://sweethome3d.cvs.sourceforge.net/viewvc/sweethome3d/SweetHome3D/deploy/SweetHome3DIcon48x48.png";
+        sha256 = "1ap6d75dyqqvx21wddvn8vw2apq3v803vmbxdriwd0dw9rq3zn4g";
+      };
+    };
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/sweethome3d/editors.nix b/nixpkgs/pkgs/applications/misc/sweethome3d/editors.nix
new file mode 100644
index 000000000000..eef5185aaeed
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/sweethome3d/editors.nix
@@ -0,0 +1,96 @@
+{ stdenv, fetchcvs, makeWrapper, makeDesktopItem, jdk, jre, ant
+, gtk3, gsettings-desktop-schemas, sweethome3dApp }:
+
+let
+
+  sweetExec = with stdenv.lib;
+    m: "sweethome3d-"
+    + removeSuffix "libraryeditor" (toLower m)
+    + "-editor";
+  sweetName = m: v: sweetExec m + "-" + v;
+
+  getDesktopFileName = drvName: (builtins.parseDrvName drvName).name;
+
+  mkEditorProject =
+  { name, module, version, src, license, description, desktopName }:
+
+  stdenv.mkDerivation rec {
+    application = sweethome3dApp;
+    inherit name module version src description;
+    exec = sweetExec module;
+    editorItem = makeDesktopItem {
+      inherit exec desktopName;
+      name = getDesktopFileName name;
+      comment =  description;
+      genericName = "Computer Aided (Interior) Design";
+      categories = "Application;Graphics;2DGraphics;3DGraphics;";
+    };
+
+    buildInputs = [ ant jre jdk makeWrapper gtk3 gsettings-desktop-schemas ];
+
+    patchPhase = ''
+      sed -i -e 's,../SweetHome3D,${application.src},g' build.xml
+      sed -i -e 's,lib/macosx/java3d-1.6/jogl-all.jar,lib/java3d-1.6/jogl-all.jar,g' build.xml
+    '';
+
+    buildPhase = ''
+      ant -lib ${application.src}/libtest -lib ${application.src}/lib -lib ${jdk}/lib
+    '';
+
+    installPhase = ''
+      mkdir -p $out/bin
+      mkdir -p $out/share/{java,applications}
+      cp ${module}-${version}.jar $out/share/java/.
+      cp "${editorItem}/share/applications/"* $out/share/applications
+      makeWrapper ${jre}/bin/java $out/bin/$exec \
+        --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gtk3.out}/share:${gsettings-desktop-schemas}/share:$out/share:$GSETTINGS_SCHEMAS_PATH" \
+        --add-flags "-jar $out/share/java/${module}-${version}.jar -d${toString stdenv.hostPlatform.parsed.cpu.bits}"
+    '';
+
+    dontStrip = true;
+
+    meta = {
+      homepage = http://www.sweethome3d.com/index.jsp;
+      inherit description;
+      inherit license;
+      maintainers = [ stdenv.lib.maintainers.edwtjo ];
+      platforms = stdenv.lib.platforms.linux;
+    };
+
+  };
+
+  d2u = stdenv.lib.replaceChars ["."] ["_"];
+
+in {
+
+  textures-editor = mkEditorProject rec {
+    version = "1.5";
+    module = "TexturesLibraryEditor";
+    name = sweetName module version;
+    description = "Easily create SH3T files and edit the properties of the texture images it contain";
+    license = stdenv.lib.licenses.gpl2Plus;
+    src = fetchcvs {
+      cvsRoot = ":pserver:anonymous@sweethome3d.cvs.sourceforge.net:/cvsroot/sweethome3d";
+      sha256 = "15wxdns3hc8yq362x0rj53bcxran2iynxznfcb9js85psd94zq7h";
+      module = module;
+      tag = "V_" + d2u version;
+    };
+    desktopName = "Sweet Home 3D - Textures Library Editor";
+  };
+
+  furniture-editor = mkEditorProject rec {
+    version = "1.19";
+    module = "FurnitureLibraryEditor";
+    name = sweetName module version;
+    description = "Quickly create SH3F files and edit the properties of the 3D models it contain";
+    license = stdenv.lib.licenses.gpl2;
+    src = fetchcvs {
+      cvsRoot = ":pserver:anonymous@sweethome3d.cvs.sourceforge.net:/cvsroot/sweethome3d";
+      sha256 = "0rr4nqil1mngak3ds5vz7f1whrgcgzpk6fb0qcr5ljms0jx0ylvs";
+      module = module;
+      tag = "V_" + d2u version;
+    };
+    desktopName = "Sweet Home 3D - Furniture Library Editor";
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/synapse/default.nix b/nixpkgs/pkgs/applications/misc/synapse/default.nix
new file mode 100644
index 000000000000..3e7983c667f2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/synapse/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchurl, gettext, pkgconfig, glib, libnotify, gtk3, libgee
+, keybinder3, json-glib, zeitgeist, vala, hicolor-icon-theme, gobject-introspection
+}:
+
+let
+  version = "0.2.99.4";
+in stdenv.mkDerivation rec {
+  name = "synapse-${version}";
+
+  src = fetchurl {
+    url = "https://launchpad.net/synapse-project/0.3/${version}/+download/${name}.tar.xz";
+    sha256 = "1g6x9knb4jy1d8zgssjhzkgac583137pibisy9whjs8mckaj4k1j";
+  };
+
+  nativeBuildInputs = [
+    pkgconfig gettext vala
+    # For setup hook
+    gobject-introspection
+  ];
+  buildInputs = [
+    glib libnotify gtk3 libgee keybinder3 json-glib zeitgeist
+    hicolor-icon-theme
+  ];
+
+  meta = with stdenv.lib; {
+    longDescription = ''
+      Semantic launcher written in Vala that you can use to start applications
+      as well as find and access relevant documents and files by making use of
+      the Zeitgeist engine
+    '';
+    description = "Semantic launcher to start applications and find relevant files";
+    homepage = https://launchpad.net/synapse-project;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ mahe ];
+    platforms = with platforms; all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/syncthing-tray/default.nix b/nixpkgs/pkgs/applications/misc/syncthing-tray/default.nix
new file mode 100644
index 000000000000..f16a0d29c40d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/syncthing-tray/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchFromGitHub, buildGoPackage, pkgconfig, libappindicator-gtk3 }:
+
+buildGoPackage rec {
+  name = "syncthing-tray-${version}";
+  version = "0.7";
+
+  goPackagePath = "github.com/alex2108/syncthing-tray";
+
+  src = fetchFromGitHub {
+    owner = "alex2108";
+    repo = "syncthing-tray";
+    rev = "v${version}";
+    sha256 = "0869kinnsfzb8ydd0sv9fgqsi1sy5rhqg4whfdnrv82xjc71xyw3";
+  };
+
+  goDeps = ./deps.nix;
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ libappindicator-gtk3 ];
+
+  meta = with stdenv.lib; {
+    description = "Simple application tray for syncthing";
+    homepage = https://github.com/alex2108/syncthing-tray;
+    license = licenses.mit;
+    maintainers = with maintainers; [ nickhu ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/syncthing-tray/deps.nix b/nixpkgs/pkgs/applications/misc/syncthing-tray/deps.nix
new file mode 100644
index 000000000000..1103146ed1b7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/syncthing-tray/deps.nix
@@ -0,0 +1,93 @@
+# This file was generated by https://github.com/kamilchm/go2nix v1.2.1
+[
+  {
+    goPackagePath = "github.com/alex2108/systray";
+    fetch = {
+      type = "git";
+      url = "https://github.com/alex2108/systray";
+      rev = "40e874866be2dc2c57ab031bcbde27a76b90721a";
+      sha256 = "1bxnb6skb9ss0lwlwswql07ardkhm28nxglvlsxkdlmzv1dcwy1q";
+    };
+  }
+  {
+    goPackagePath = "github.com/getlantern/context";
+    fetch = {
+      type = "git";
+      url = "https://github.com/getlantern/context";
+      rev = "624d99b1798d7c5375ea1d3ca4c5b04d58f7c775";
+      sha256 = "09yf9x6478a5z01hybr98zwa8ax3fx7l6wwsvdkxp3fdg9dqm13b";
+    };
+  }
+  {
+    goPackagePath = "github.com/getlantern/errors";
+    fetch = {
+      type = "git";
+      url = "https://github.com/getlantern/errors";
+      rev = "99fa440517e8f3d1e4cd8d6dbed6b41f4c1ed3d6";
+      sha256 = "08rl32l5ks67hcgjxik62nd5g558mv4101kmz1ak7d3vfgg3m6i3";
+    };
+  }
+  {
+    goPackagePath = "github.com/getlantern/golog";
+    fetch = {
+      type = "git";
+      url = "https://github.com/getlantern/golog";
+      rev = "cca714f7feb5df8e455f409b549d384441ac4578";
+      sha256 = "0gnf30n38zkx356cqc6jdv1kbzy59ddqhqndwrxsm2n2zc3b5p7q";
+    };
+  }
+  {
+    goPackagePath = "github.com/getlantern/hex";
+    fetch = {
+      type = "git";
+      url = "https://github.com/getlantern/hex";
+      rev = "083fba3033ad473db3dd31c9bb368473d37581a7";
+      sha256 = "18q6rypmcqmcwlfzrrdcz08nff0a289saplvd9y3ifnfcqdw3j77";
+    };
+  }
+  {
+    goPackagePath = "github.com/getlantern/hidden";
+    fetch = {
+      type = "git";
+      url = "https://github.com/getlantern/hidden";
+      rev = "d52a649ab33af200943bb599898dbdcfdbc94cb7";
+      sha256 = "0133qmp4sjq8da5di3459vc5g5nqbpqra0f558zd95js3fdmkmsi";
+    };
+  }
+  {
+    goPackagePath = "github.com/getlantern/ops";
+    fetch = {
+      type = "git";
+      url = "https://github.com/getlantern/ops";
+      rev = "b70875f5d689a9438bca72aefd7142a2af889b18";
+      sha256 = "0cfa2bbkykbzbskmgd2an34him72z6f3y88ag1v5ffpb0d6bnar7";
+    };
+  }
+  {
+    goPackagePath = "github.com/getlantern/stack";
+    fetch = {
+      type = "git";
+      url = "https://github.com/getlantern/stack";
+      rev = "02f928aad224fbccd50d66edd776fc9d1e9f2f2b";
+      sha256 = "0ddl5r4iw3c7p4drh4d8phl7d0ssdddsnd3xjm1lzgxylqq6r568";
+    };
+  }
+  {
+    goPackagePath = "github.com/oxtoacart/bpool";
+    fetch = {
+      type = "git";
+      url = "https://github.com/oxtoacart/bpool";
+      rev = "4e1c5567d7c2dd59fa4c7c83d34c2f3528b025d6";
+      sha256 = "01kk6dhkz96yhp3p5v2rjwq8mbrwrdsn6glqw7jp4h7g5za7yi95";
+    };
+  }
+  {
+    goPackagePath = "github.com/toqueteos/webbrowser";
+    fetch = {
+      type = "git";
+      url = "https://github.com/toqueteos/webbrowser";
+      rev = "e2ebfdc6cb1a3fdc4fc4dbd20a0cae0c2e406792";
+      sha256 = "0sgjnxrq0jgipkij8b6xiy4am9bv9zziqxxdhw15rdjc5piyk3a2";
+    };
+  }
+]
diff --git a/nixpkgs/pkgs/applications/misc/synergy/default.nix b/nixpkgs/pkgs/applications/misc/synergy/default.nix
new file mode 100644
index 000000000000..25855c2a6130
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/synergy/default.nix
@@ -0,0 +1,87 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch, fetchurl, cmake, xlibsWrapper
+, ApplicationServices, Carbon, Cocoa, CoreServices, ScreenSaver, cf-private
+, libX11, libXi, libXtst, libXrandr, xinput, curl, openssl, unzip }:
+
+stdenv.mkDerivation rec {
+  name = "synergy-${version}";
+  version = "1.8.8";
+
+  src = fetchFromGitHub {
+    owner = "symless";
+    repo = "synergy-core";
+    rev = "v${version}-stable";
+    sha256 = "0ksgr9hkf09h54572p7k7b9zkfhcdb2g2d5x7ixxn028y8i3jyp3";
+  };
+
+  patches = [./openssl-1.1.patch ./update_gtest_gmock.patch
+  ] ++ lib.optional stdenv.isDarwin ./respect_macos_arch.patch;
+
+  patch_gcc6 = fetchpatch {
+    url = https://raw.githubusercontent.com/gentoo/gentoo/20e2bff3697ebf5f291e9907b34aae3074a36b53/dev-cpp/gmock/files/gmock-1.7.0-gcc6.patch;
+    sha256 = "0j3f381x1lf8qci9pfv6mliggl8qs2w05v5lw3rs3gn7aibg174d";
+  };
+
+  # Due to the included gtest and gmock not supporting clang
+  # we replace it with 1.7.0 for synergy-1.8.8. This should
+  # become unnecessary when we update to a newer version of Synergy.
+  gmock_zip = fetchurl {
+    url = https://github.com/google/googlemock/archive/release-1.7.0.zip;
+    sha256 = "11bd04098rzamv7f9y01zaf9c8zrmzdk6g1qrlwq780pxzlr4ya0";
+  };
+
+  gtest_zip = fetchurl {
+    url = https://github.com/google/googletest/archive/release-1.7.0.zip;
+    sha256 = "1l5n6kzdypjzjrz2jh14ylzrx735lccfx2p3s4ccgci8g9abg35m";
+  };
+
+  postPatch = ''
+    ${unzip}/bin/unzip -d ext/ ${gmock_zip}
+    ${unzip}/bin/unzip -d ext/ ${gtest_zip}
+    mv ext/googlemock-release-1.7.0 ext/gmock-1.7.0
+    mv ext/googletest-release-1.7.0 ext/gtest-1.7.0
+    patch -d ext/gmock-1.7.0 -p1 -i ${patch_gcc6}
+  ''
+    # We have XRRNotifyEvent (libXrandr), but with the upstream CMakeLists.txt
+    # it's not able to find it (it's trying to search the store path of libX11
+    # instead) and we don't get XRandR support, even though the CMake output
+    # _seems_ to say so:
+    #
+    #   Looking for XRRQueryExtension in Xrandr - found
+    #
+    # The relevant part however is:
+    #
+    #   Looking for XRRNotifyEvent - not found
+    #
+    # So let's force it:
+  + lib.optionalString stdenv.isLinux ''
+    sed -i -e '/HAVE_X11_EXTENSIONS_XRANDR_H/c \
+      set(HAVE_X11_EXTENSIONS_XRANDR_H true)
+    ' CMakeLists.txt
+  '';
+
+  cmakeFlags = lib.optionals stdenv.isDarwin [ "-DOSX_TARGET_MAJOR=10" "-DOSX_TARGET_MINOR=7" ];
+
+  buildInputs = [
+    cmake curl openssl
+  ] ++ lib.optionals stdenv.isDarwin [
+    ApplicationServices Carbon Cocoa CoreServices ScreenSaver cf-private
+  ] ++ lib.optionals stdenv.isLinux [ xlibsWrapper libX11 libXi libXtst libXrandr xinput ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp ../bin/synergyc $out/bin
+    cp ../bin/synergys $out/bin
+    cp ../bin/synergyd $out/bin
+  '';
+
+  doCheck = true;
+  checkPhase = "../bin/unittests";
+
+  meta = with lib; {
+    description = "Share one mouse and keyboard between multiple computers";
+    homepage = http://synergy-project.org/;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ aszlig enzime ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/synergy/openssl-1.1.patch b/nixpkgs/pkgs/applications/misc/synergy/openssl-1.1.patch
new file mode 100644
index 000000000000..56dc6112844e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/synergy/openssl-1.1.patch
@@ -0,0 +1,18 @@
+--- a/src/lib/net/SecureSocket.cpp	2017-07-22 19:33:22.442645291 +0200
++++ b/src/lib/net/SecureSocket.cpp	2017-07-22 19:36:25.632595581 +0200
+@@ -805,9 +805,14 @@
+ 		showCipherStackDesc(sStack);
+ 	}
+ 
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ 	// m_ssl->m_ssl->session->ciphers is not forward compatable, In future release
+-	// of OpenSSL, it's not visible, need to use SSL_get_client_ciphers() instead
++	// of OpenSSL, it's not visible
+ 	STACK_OF(SSL_CIPHER) * cStack = m_ssl->m_ssl->session->ciphers;
++#else
++	// Use SSL_get_client_ciphers() for newer versions
++	STACK_OF(SSL_CIPHER) * cStack = SSL_get_client_ciphers(m_ssl->m_ssl);
++#endif
+ 		if (cStack == NULL) {
+ 		LOG((CLOG_DEBUG1 "remote cipher list not available"));
+ 	}
diff --git a/nixpkgs/pkgs/applications/misc/synergy/respect_macos_arch.patch b/nixpkgs/pkgs/applications/misc/synergy/respect_macos_arch.patch
new file mode 100644
index 000000000000..003d7d22421a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/synergy/respect_macos_arch.patch
@@ -0,0 +1,61 @@
+From 944177c76d4c7ff5ef3460eab28286a45344a0e7 Mon Sep 17 00:00:00 2001
+From: Michael Hoang <enzime@users.noreply.github.com>
+Date: Sat, 14 Jul 2018 21:56:59 +1000
+Subject: [PATCH 2/2] Make sure CMake respects the current arch on macOS
+
+Only set the macOS architecture if not defined by the user. Use the
+OpenSSL libraries and headers from Nix on macOS to prevent architecture
+mismatches.
+---
+ CMakeLists.txt     |  2 +-
+ src/CMakeLists.txt | 14 +-------------
+ 2 files changed, 2 insertions(+), 14 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2f37424d..c7217e28 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -172,7 +172,7 @@ if (UNIX)
+ 			# <= 10.5: 32-bit Intel and PowerPC
+ 			set(CMAKE_OSX_ARCHITECTURES "ppc;i386"
+ 				CACHE STRING "" FORCE)
+-		else()
++		elseif (NOT CMAKE_OSX_ARCHITECTURES)
+ 			# >= 10.6: Intel only
+ 			set(CMAKE_OSX_ARCHITECTURES "i386"
+ 				CACHE STRING "" FORCE)
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 237ba484..04428636 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -23,11 +23,6 @@ if (WIN32)
+ 	set(OPENSSL_INCLUDE ${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/inc32)
+ endif()
+ 
+-if (APPLE)
+-	set(OPENSSL_PLAT_DIR openssl-osx)
+-	set(OPENSSL_INCLUDE ${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/include)
+-endif()
+-
+ if (WIN32)
+ 	set(OPENSSL_LIBS
+ 		${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/out32dll/libeay32.lib
+@@ -36,14 +31,7 @@ if (WIN32)
+ endif()
+ 
+ if (UNIX)
+-	if (APPLE)
+-		set(OPENSSL_LIBS
+-		${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/libssl.a
+-		${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/libcrypto.a
+-		)
+-	else()
+-		set(OPENSSL_LIBS ssl crypto)
+-	endif()
++	set(OPENSSL_LIBS ssl crypto)
+ endif()
+ 
+ add_subdirectory(lib)
+-- 
+2.17.1
+
diff --git a/nixpkgs/pkgs/applications/misc/synergy/update_gtest_gmock.patch b/nixpkgs/pkgs/applications/misc/synergy/update_gtest_gmock.patch
new file mode 100644
index 000000000000..87b53e78585b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/synergy/update_gtest_gmock.patch
@@ -0,0 +1,158 @@
+From eea85dbf4bbde545d8cb07d7ee9fbdca3dcf48fd Mon Sep 17 00:00:00 2001
+From: Michael Hoang <enzime@users.noreply.github.com>
+Date: Sat, 14 Jul 2018 22:07:39 +1000
+Subject: [PATCH 1/2] Update gtest and gmock to version 1.7.0
+
+Fixes compilation under clang on macOS as <tr1/tuple> is now found under
+<tuple>.
+---
+ CMakeLists.txt                     |  2 +-
+ ext/toolchain/commands1.py         |  4 ++--
+ src/lib/platform/CMakeLists.txt    |  2 +-
+ src/lib/server/CMakeLists.txt      |  2 +-
+ src/lib/shared/CMakeLists.txt      |  2 +-
+ src/lib/synergy/CMakeLists.txt     |  2 +-
+ src/test/CMakeLists.txt            | 12 ++++++------
+ src/test/integtests/CMakeLists.txt |  4 ++--
+ src/test/unittests/CMakeLists.txt  |  4 ++--
+ 9 files changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 94c474e8..2f37424d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -178,7 +178,7 @@ if (UNIX)
+ 				CACHE STRING "" FORCE)
+ 		endif()
+ 		
+-		set(CMAKE_CXX_FLAGS "--sysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1")
++		set(CMAKE_CXX_FLAGS "--sysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CXX_FLAGS}")
+ 
+ 		find_library(lib_ScreenSaver ScreenSaver)
+ 		find_library(lib_IOKit IOKit)
+diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py
+index f32ec483..bf997cf6 100644
+--- a/ext/toolchain/commands1.py
++++ b/ext/toolchain/commands1.py
+@@ -251,10 +251,10 @@ class InternalCommands:
+ 	macIdentity = None
+ 	
+ 	# gtest dir with version number
+-	gtestDir = 'gtest-1.6.0'
++	gtestDir = 'gtest-1.7.0'
+ 	
+ 	# gmock dir with version number
+-	gmockDir = 'gmock-1.6.0'
++	gmockDir = 'gmock-1.7.0'
+ 
+ 	win32_generators = {
+ 		1 : VisualStudioGenerator('10'),
+diff --git a/src/lib/platform/CMakeLists.txt b/src/lib/platform/CMakeLists.txt
+index 481d8ef9..1ce67eca 100644
+--- a/src/lib/platform/CMakeLists.txt
++++ b/src/lib/platform/CMakeLists.txt
+@@ -31,7 +31,7 @@ endif()
+ 
+ include_directories(
+ 	../
+-	../../../ext/gtest-1.6.0/include
++	../../../ext/gtest-1.7.0/include
+ )
+ 
+ if (UNIX)
+diff --git a/src/lib/server/CMakeLists.txt b/src/lib/server/CMakeLists.txt
+index 3cb582ec..0525d627 100644
+--- a/src/lib/server/CMakeLists.txt
++++ b/src/lib/server/CMakeLists.txt
+@@ -24,7 +24,7 @@ endif()
+ include_directories(
+ 	../
+ 	../../../ext
+-	../../../ext/gtest-1.6.0/include
++	../../../ext/gtest-1.7.0/include
+ )
+ 
+ if (UNIX)
+diff --git a/src/lib/shared/CMakeLists.txt b/src/lib/shared/CMakeLists.txt
+index 891f4aa7..16c8b04a 100644
+--- a/src/lib/shared/CMakeLists.txt
++++ b/src/lib/shared/CMakeLists.txt
+@@ -25,7 +25,7 @@ add_library(shared STATIC ${sources})
+ include_directories(
+ 	../
+ 	../../../ext
+-	../../../ext/gtest-1.6.0/include
++	../../../ext/gtest-1.7.0/include
+ )
+ 
+ target_link_libraries(shared arch base)
+diff --git a/src/lib/synergy/CMakeLists.txt b/src/lib/synergy/CMakeLists.txt
+index 0972be8c..e19fcce5 100644
+--- a/src/lib/synergy/CMakeLists.txt
++++ b/src/lib/synergy/CMakeLists.txt
+@@ -36,7 +36,7 @@ endif()
+ include_directories(
+ 	../
+ 	../../../ext
+-	../../../ext/gtest-1.6.0/include
++	../../../ext/gtest-1.7.0/include
+ )
+ 
+ if (UNIX)
+diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt
+index 8812150a..04cdfc50 100644
+--- a/src/test/CMakeLists.txt
++++ b/src/test/CMakeLists.txt
+@@ -15,13 +15,13 @@
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ 
+ include_directories(
+-	../../ext/gtest-1.6.0
+-	../../ext/gtest-1.6.0/include
+-	../../ext/gmock-1.6.0
+-	../../ext/gmock-1.6.0/include)
++	../../ext/gtest-1.7.0
++	../../ext/gtest-1.7.0/include
++	../../ext/gmock-1.7.0
++	../../ext/gmock-1.7.0/include)
+ 	
+-add_library(gtest STATIC ../../ext/gtest-1.6.0/src/gtest-all.cc)
+-add_library(gmock STATIC ../../ext/gmock-1.6.0/src/gmock-all.cc)
++add_library(gtest STATIC ../../ext/gtest-1.7.0/src/gtest-all.cc)
++add_library(gmock STATIC ../../ext/gmock-1.7.0/src/gmock-all.cc)
+ 
+ if (UNIX)
+ 	# ignore warnings in gtest and gmock
+diff --git a/src/test/integtests/CMakeLists.txt b/src/test/integtests/CMakeLists.txt
+index 2f1ca7f3..6ddbd29a 100644
+--- a/src/test/integtests/CMakeLists.txt
++++ b/src/test/integtests/CMakeLists.txt
+@@ -56,8 +56,8 @@ endif()
+ include_directories(
+ 	../../
+ 	../../lib/
+-	../../../ext/gtest-1.6.0/include
+-	../../../ext/gmock-1.6.0/include
++	../../../ext/gtest-1.7.0/include
++	../../../ext/gmock-1.7.0/include
+ )
+ 
+ if (UNIX)
+diff --git a/src/test/unittests/CMakeLists.txt b/src/test/unittests/CMakeLists.txt
+index 3e49dc3c..5f6c4fac 100644
+--- a/src/test/unittests/CMakeLists.txt
++++ b/src/test/unittests/CMakeLists.txt
+@@ -51,8 +51,8 @@ list(APPEND headers ${platform_sources})
+ include_directories(
+ 	../../
+ 	../../lib/
+-	../../../ext/gtest-1.6.0/include
+-	../../../ext/gmock-1.6.0/include
++	../../../ext/gtest-1.7.0/include
++	../../../ext/gmock-1.7.0/include
+ 	../../../ext
+ )
+ 
+-- 
+2.17.1
+
diff --git a/nixpkgs/pkgs/applications/misc/tabula/default.nix b/nixpkgs/pkgs/applications/misc/tabula/default.nix
new file mode 100644
index 000000000000..52e39b98a3b6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tabula/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchzip, jre, makeWrapper }:
+
+
+stdenv.mkDerivation rec {
+  name = "tabula-${version}";
+  version = "1.2.1";
+
+
+  src = fetchzip {
+    url = "https://github.com/tabulapdf/tabula/releases/download/v${version}/tabula-jar-${version}.zip";
+    sha256 = "0lkpv8hkji81fanyxm7ph8421fr9a6phqc3pbhw2bc4gljg7sgxi";
+  };
+
+
+  buildInputs = [ makeWrapper ];
+
+
+  installPhase = ''
+    mkdir -pv $out/share/tabula
+    cp -v * $out/share/tabula
+
+    makeWrapper ${jre}/bin/java $out/bin/tabula --add-flags "-jar $out/share/tabula/tabula.jar"
+  '';
+
+
+  meta = with stdenv.lib; {
+    description = "A tool for liberating data tables locked inside PDF files";
+    longDescription = ''
+      If you’ve ever tried to do anything with data provided to you in PDFs, you
+      know how painful it is — there's no easy way to copy-and-paste rows of data
+      out of PDF files. Tabula allows you to extract that data into a CSV or
+      Microsoft Excel spreadsheet using a simple, easy-to-use interface.
+    '';
+    homepage = https://tabula.technology/;
+    license = licenses.mit;
+    maintainers = [ maintainers.dpaetzel ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/tangogps/default.nix b/nixpkgs/pkgs/applications/misc/tangogps/default.nix
new file mode 100644
index 000000000000..08bea18d8e9a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tangogps/default.nix
@@ -0,0 +1,46 @@
+{ fetchurl, stdenv, pkgconfig, gettext, gtk2, gconf
+, curl, libexif, sqlite, libxml2 }:
+
+stdenv.mkDerivation rec {
+  name = "tangogps-0.99.2";
+
+  src = fetchurl {
+    url = "http://www.tangogps.org/downloads/${name}.tar.gz";
+    sha256 = "15q2kkrv4mfsivfdzjgpxr7s2amw7d501q2ayjl3ff4vmvfn5516";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ gettext gtk2 gconf curl libexif sqlite libxml2 ];
+  NIX_LDFLAGS = [ "-lm" ];
+
+  # bogus includes fail with newer library version
+  postPatch = ''
+    sed -i -e 's,#include <glib/.*>,#include <glib.h>,g' src/*.c
+    sed -i -e 's,#include <curl/.*>,#include <curl/curl.h>,g' src/*.c src/*.h
+  '';
+
+  meta = {
+    description = "User friendly map and GPS user interface";
+
+    longDescription = ''
+      tangoGPS is an easy to use, fast and lightweight mapping
+      application for use with or without GPS.
+
+      It runs on any Linux platform from the desktop over eeePC down
+      to phones like the Openmoko Neo.
+
+      By default tangoGPS uses map data from the OpenStreetMap
+      project.  Additionally a variety of other repositories can be
+      easily added.
+
+      The maps are automagically downloaded and cached for offline use
+      while you drag or zoom the map.  Furthermore you can
+      conveniently pre-cache areas with tangoGPS.
+    '';
+
+    #homepage = http://www.tangogps.org/; # no longer valid, I couldn't find any other
+
+    license = stdenv.lib.licenses.gpl2Plus;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/taskell/default.nix b/nixpkgs/pkgs/applications/misc/taskell/default.nix
new file mode 100644
index 000000000000..1a1ea3102afd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/taskell/default.nix
@@ -0,0 +1,65 @@
+{ lib, haskellPackages, fetchFromGitHub }:
+
+let
+  version = "1.4.3";
+  sha256  = "0i12x7qzfmmdvi09k96x53zzzrva2w3zbl2f6dkxb8kk5scqqa4v";
+
+in (haskellPackages.mkDerivation {
+  pname = "taskell";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "smallhadroncollider";
+    repo = "taskell";
+    rev = version;
+    inherit sha256;
+  };
+
+  postPatch = ''${haskellPackages.hpack}/bin/hpack'';
+
+  # basically justStaticExecutables; TODO: use justStaticExecutables
+  enableSharedExecutables = false;
+  enableLibraryProfiling = false;
+  isExecutable = true;
+  doHaddock = false;
+  postFixup = "rm -rf $out/lib $out/nix-support $out/share/doc";
+
+  # copied from packages.yaml
+  libraryHaskellDepends = with haskellPackages; [
+    classy-prelude
+    # base <=5
+    aeson
+    brick
+    # bytestring
+    config-ini
+    # containers
+    # directory
+    file-embed
+    fold-debounce
+    http-conduit
+    http-client
+    http-types
+    lens
+    raw-strings-qq
+    # mtl
+    # template-haskell
+    # text
+    time
+    vty
+  ];
+
+  executableHaskellDepends = [];
+
+  testHaskellDepends = with haskellPackages; [
+    tasty
+    tasty-discover
+    tasty-expected-failure
+    tasty-hunit
+  ];
+
+  description = "Command-line Kanban board/task manager with support for Trello boards and GitHub projects";
+  homepage    = "https://taskell.app";
+  license     = lib.licenses.bsd3;
+  maintainers = with lib.maintainers; [ matthiasbeyer ];
+  platforms   = with lib.platforms; unix ++ darwin;
+})
diff --git a/nixpkgs/pkgs/applications/misc/taskjuggler/2.x/default.nix b/nixpkgs/pkgs/applications/misc/taskjuggler/2.x/default.nix
new file mode 100644
index 000000000000..6b38c3d59c29
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/taskjuggler/2.x/default.nix
@@ -0,0 +1,76 @@
+{stdenv, fetchurl,
+zlib, libpng, libjpeg, perl, expat, qt3,
+libX11, libXext, libSM, libICE,
+}:
+
+stdenv.mkDerivation rec {
+  name = "taskjuggler-2.4.3";
+  src = fetchurl {
+    url = "http://www.taskjuggler.org/download/${name}.tar.bz2";
+    sha256 = "14gkxa2vwfih5z7fffbavps7m44z5bq950qndigw2icam5ks83jl";
+  };
+
+  buildInputs =
+    [zlib libpng libX11 libXext libSM libICE perl expat libjpeg]
+    ;
+
+  patches = [ ./timezone-glibc.patch ];
+
+  preConfigure = ''
+    for i in $(grep -R "/bin/bash" .  | sed 's/:.*//'); do
+      substituteInPlace $i --replace /bin/bash $(type -Pp bash)
+    done
+    for i in $(grep -R "/usr/bin/perl" .  | sed 's/:.*//'); do
+      substituteInPlace $i --replace /usr/bin/perl ${perl}/bin/perl
+    done
+
+    # Fix install
+    for i in docs/en/Makefile.in Examples/BigProject/Common/Makefile.in Examples/BigProject/Makefile.in Examples/BigProject/Project1/Makefile.in Examples/BigProject/Project2/Makefile.in Examples/FirstProject/Makefile.in Examples/ShiftSchedule/Makefile.in; do
+      # Do not use variable substitution because there is some text after the last '@'
+      substituteInPlace $i --replace 'docprefix = @PACKAGES_DIR@' 'docprefix = $(docdir)/'
+    done
+
+    # Comment because the ical export need the KDE support.
+    for i in Examples/FirstProject/AccountingSoftware.tjp; do
+      substituteInPlace $i --replace "icalreport" "# icalreport"
+    done
+
+    for i in TestSuite/testdir TestSuite/createrefs \
+      TestSuite/Scheduler/Correct/Expression.sh; do
+      substituteInPlace $i --replace '/bin/rm' 'rm'
+    done
+
+    # Some tests require writing at $HOME
+    HOME=$TMPDIR
+  '';
+
+  configureFlags = [
+    "--without-arts" "--disable-docs"
+    "--x-includes=${libX11.dev}/include"
+    "--x-libraries=${libX11.out}/lib"
+    "--with-qt-dir=${qt3}"
+  ];
+
+  preInstall = ''
+    mkdir -p $out/share/emacs/site-lisp/
+    cp Contrib/emacs/taskjug.el $out/share/emacs/site-lisp/
+  '';
+
+  installFlags =
+    # kde_locale is not defined when installing without kde.
+    "kde_locale=\${out}/share/locale";
+
+  meta = {
+    homepage = http://www.taskjuggler.org;
+    license = stdenv.lib.licenses.gpl2;
+    description = "Project management tool";
+    longDescription = ''
+      TaskJuggler is a modern and powerful, Open Source project management
+      tool. Its new approach to project planing and tracking is more
+      flexible and superior to the commonly used Gantt chart editing
+      tools. It has already been successfully used in many projects and
+      scales easily to projects with hundreds of resources and thousands of
+      tasks.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/taskjuggler/2.x/timezone-glibc.patch b/nixpkgs/pkgs/applications/misc/taskjuggler/2.x/timezone-glibc.patch
new file mode 100644
index 000000000000..f599e8a1730c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/taskjuggler/2.x/timezone-glibc.patch
@@ -0,0 +1,48 @@
+From the discussion in http://groups.google.com/group/taskjuggler-users/browse_thread/thread/f65a3efd4dcae2fc/a44c711a9d28ebee?show_docid=a44c711a9d28ebee
+
+From: Chris Schlaeger <cs@kde.org>
+Date: Sat, 27 Feb 2010 06:33:35 +0000 (+0100)
+Subject: Try to fix time zone check for glibc 2.11.
+X-Git-Url: http://www.taskjuggler.org/cgi-bin/gitweb.cgi?p=taskjuggler.git;a=commitdiff_plain;h=2382ed54f90c3c899badb3f56aaa2b3b5dba361e;hp=c666c5068312fec7db75e17d1c567d94127d1dda
+
+Try to fix time zone check for glibc 2.11.
+
+Reported-by: Lee <pFQh8RQn4fqB@dyweni.com>
+---
+
+diff --git a/taskjuggler/Utility.cpp b/taskjuggler/Utility.cpp
+index 5e2bf21..9b7fce2 100644
+--- a/taskjuggler/Utility.cpp
++++ b/taskjuggler/Utility.cpp
+@@ -206,16 +206,28 @@ setTimezone(const char* tZone)
+ 
+     /* To validate the tZone value we call tzset(). It will convert the zone
+      * into a three-letter acronym in case the tZone value is good. If not, it
+-     * will just copy the wrong value to tzname[0] (glibc < 2.5) or fall back
+-     * to UTC. */
++     * will
++     * - copy the wrong value to tzname[0] (glibc < 2.5)
++     * - or fall back to UTC (glibc >= 2.5 && < 2.11)
++     * - copy the part before the '/' to tzname[0] (glibc >= 2.11).
++     */
+     tzset();
++    char* region = new(char[strlen(tZone) + 1]);
++    region[0] = 0;
++    if (strchr(tZone, '/'))
++    {
++        strcpy(region, tZone);
++        *strchr(region, '/') = 0;
++    }
+     if (timezone2tz(tZone) == 0 &&
+-        (strcmp(tzname[0], tZone) == 0 ||
++        (strcmp(tzname[0], tZone) == 0 || strcmp(tzname[0], region) == 0 ||
+          (strcmp(tZone, "UTC") != 0 && strcmp(tzname[0], "UTC") == 0)))
+     {
+         UtilityError = QString(i18n("Illegal timezone '%1'")).arg(tZone);
++        delete region;
+         return false;
+     }
++    delete region;
+ 
+     if (!LtHashTab)
+         return true;
diff --git a/nixpkgs/pkgs/applications/misc/taskjuggler/3.x/Gemfile b/nixpkgs/pkgs/applications/misc/taskjuggler/3.x/Gemfile
new file mode 100644
index 000000000000..77cbaeeed793
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/taskjuggler/3.x/Gemfile
@@ -0,0 +1,2 @@
+source 'http://rubygems.org'
+gem 'taskjuggler'
diff --git a/nixpkgs/pkgs/applications/misc/taskjuggler/3.x/Gemfile.lock b/nixpkgs/pkgs/applications/misc/taskjuggler/3.x/Gemfile.lock
new file mode 100644
index 000000000000..d1642e76fa65
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/taskjuggler/3.x/Gemfile.lock
@@ -0,0 +1,21 @@
+GEM
+  remote: http://rubygems.org/
+  specs:
+    mail (2.6.3)
+      mime-types (>= 1.16, < 3)
+    mime-types (2.6.1)
+    taskjuggler (3.5.0)
+      mail (>= 2.4.3)
+      term-ansicolor (>= 1.0.7)
+    term-ansicolor (1.3.2)
+      tins (~> 1.0)
+    tins (1.6.0)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  taskjuggler
+
+BUNDLED WITH
+   1.10.5
diff --git a/nixpkgs/pkgs/applications/misc/taskjuggler/3.x/default.nix b/nixpkgs/pkgs/applications/misc/taskjuggler/3.x/default.nix
new file mode 100644
index 000000000000..23252d0c4807
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/taskjuggler/3.x/default.nix
@@ -0,0 +1,15 @@
+{ lib, bundlerEnv, ruby }:
+
+bundlerEnv {
+  name = "taskjuggler-3.5.0";
+
+  inherit ruby;
+  gemdir = ./.;
+
+  meta = {
+    description = "A modern and powerful project management tool";
+    homepage    = http://taskjuggler.org/;
+    license     = lib.licenses.gpl2;
+    platforms   = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/taskjuggler/3.x/gemset.nix b/nixpkgs/pkgs/applications/misc/taskjuggler/3.x/gemset.nix
new file mode 100644
index 000000000000..e65ab3451a62
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/taskjuggler/3.x/gemset.nix
@@ -0,0 +1,47 @@
+{
+  "mail" = {
+    version = "2.6.3";
+    source = {
+      type = "gem";
+      sha256 = "1nbg60h3cpnys45h7zydxwrl200p7ksvmrbxnwwbpaaf9vnf3znp";
+    };
+    dependencies = [
+      "mime-types"
+    ];
+  };
+  "mime-types" = {
+    version = "2.6.1";
+    source = {
+      type = "gem";
+      sha256 = "1vnrvf245ijfyxzjbj9dr6i1hkjbyrh4yj88865wv9bs75axc5jv";
+    };
+  };
+  "taskjuggler" = {
+    version = "3.5.0";
+    source = {
+      type = "gem";
+      sha256 = "0r84rlc7a6w7p9nc9mgycbs5h0hq0kzscjq7zj3296xyf0afiwj2";
+    };
+    dependencies = [
+      "mail"
+      "term-ansicolor"
+    ];
+  };
+  "term-ansicolor" = {
+    version = "1.3.2";
+    source = {
+      type = "gem";
+      sha256 = "0ydbbyjmk5p7fsi55ffnkq79jnfqx65c3nj8d9rpgl6sw85ahyys";
+    };
+    dependencies = [
+      "tins"
+    ];
+  };
+  "tins" = {
+    version = "1.6.0";
+    source = {
+      type = "gem";
+      sha256 = "02qarvy17nbwvslfgqam8y6y7479cwmb1a6di9z18hzka4cf90hz";
+    };
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/taskjuggler/Gemfile b/nixpkgs/pkgs/applications/misc/taskjuggler/Gemfile
new file mode 100644
index 000000000000..ab9f5a354646
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/taskjuggler/Gemfile
@@ -0,0 +1,2 @@
+source 'https://rubygems.org'
+gem 'taskjuggler'
diff --git a/nixpkgs/pkgs/applications/misc/taskjuggler/Gemfile.lock b/nixpkgs/pkgs/applications/misc/taskjuggler/Gemfile.lock
new file mode 100644
index 000000000000..dcc46e370e71
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/taskjuggler/Gemfile.lock
@@ -0,0 +1,21 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    mail (2.7.1)
+      mini_mime (>= 0.1.1)
+    mini_mime (1.0.1)
+    taskjuggler (3.6.0)
+      mail (>= 2.4.3)
+      term-ansicolor (>= 1.0.7)
+    term-ansicolor (1.7.1)
+      tins (~> 1.0)
+    tins (1.20.2)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  taskjuggler
+
+BUNDLED WITH
+   1.17.2
diff --git a/nixpkgs/pkgs/applications/misc/taskjuggler/default.nix b/nixpkgs/pkgs/applications/misc/taskjuggler/default.nix
new file mode 100644
index 000000000000..1b3bacf71df8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/taskjuggler/default.nix
@@ -0,0 +1,19 @@
+{ lib, bundlerApp }:
+
+bundlerApp {
+  pname = "taskjuggler";
+  gemdir = ./.;
+
+  exes = [
+    "tj3" "tj3client" "tj3d" "tj3man" "tj3ss_receiver" "tj3ss_sender"
+    "tj3ts_receiver" "tj3ts_sender" "tj3ts_summary" "tj3webd"
+  ];
+
+  meta = with lib; {
+    description = "A modern and powerful project management tool";
+    homepage    = http://taskjuggler.org/;
+    license     = licenses.gpl2;
+    platforms   = platforms.unix;
+    maintainers = [ maintainers.manveru ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/taskjuggler/gemset.nix b/nixpkgs/pkgs/applications/misc/taskjuggler/gemset.nix
new file mode 100644
index 000000000000..fcf607de8157
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/taskjuggler/gemset.nix
@@ -0,0 +1,55 @@
+{
+  mail = {
+    dependencies = ["mini_mime"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "00wwz6ys0502dpk8xprwcqfwyf3hmnx6lgxaiq6vj43mkx43sapc";
+      type = "gem";
+    };
+    version = "2.7.1";
+  };
+  mini_mime = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1q4pshq387lzv9m39jv32vwb8wrq3wc4jwgl4jk209r4l33v09d3";
+      type = "gem";
+    };
+    version = "1.0.1";
+  };
+  taskjuggler = {
+    dependencies = ["mail" "term-ansicolor"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0ky3cydl3szhdyxsy4k6zxzjlbll7mlq025aj6xd5jmh49k3pfbp";
+      type = "gem";
+    };
+    version = "3.6.0";
+  };
+  term-ansicolor = {
+    dependencies = ["tins"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1xq5kci9215skdh27npyd3y55p812v4qb4x2hv3xsjvwqzz9ycwj";
+      type = "gem";
+    };
+    version = "1.7.1";
+  };
+  tins = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1pqj45n216zrz7yckdbdknlmhh187iqzx8fp76y2h0jrgqjfkxmj";
+      type = "gem";
+    };
+    version = "1.20.2";
+  };
+}
\ No newline at end of file
diff --git a/nixpkgs/pkgs/applications/misc/tasknc/default.nix b/nixpkgs/pkgs/applications/misc/tasknc/default.nix
new file mode 100644
index 000000000000..7ca421b49a35
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tasknc/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchFromGitHub, makeWrapper, perl, ncurses5, taskwarrior }:
+
+stdenv.mkDerivation rec {
+  version = "2017-05-15";
+  name = "tasknc-${version}";
+
+  src = fetchFromGitHub {
+    owner = "lharding";
+    repo = "tasknc";
+    rev = "c41d0240e9b848e432f01de735f28de93b934ae7";
+    sha256 = "0f7l7fy06p33vw6f6sjnjxfhw951664pmwhjl573jvmh6gi2h1yr";
+  };
+
+  nativeBuildInputs = [
+    makeWrapper
+    perl # For generating the man pages with pod2man
+  ];
+
+  buildInputs = [ ncurses5 ];
+
+  hardeningDisable = [ "format" ];
+
+  buildFlags = [ "VERSION=${version}" ];
+
+  installPhase = ''
+    mkdir -p $out/bin/
+    mkdir -p $out/share/man/man1
+    mkdir -p $out/share/tasknc
+
+    DESTDIR=$out PREFIX= MANPREFIX=/share/man make install
+
+    wrapProgram $out/bin/tasknc --prefix PATH : ${taskwarrior}/bin
+  '';
+
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/lharding/tasknc;
+    description = "A ncurses wrapper around taskwarrior";
+    maintainers = with maintainers; [ matthiasbeyer infinisil ];
+    platforms = platforms.linux; # Cannot test others
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/taskopen/default.nix b/nixpkgs/pkgs/applications/misc/taskopen/default.nix
new file mode 100644
index 000000000000..9f1773b191d2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/taskopen/default.nix
@@ -0,0 +1,34 @@
+{ fetchurl, stdenv, makeWrapper, which, perl, perlPackages }:
+
+stdenv.mkDerivation rec {
+  name = "taskopen-1.1.4";
+  src = fetchurl {
+    url = "https://github.com/ValiValpas/taskopen/archive/v1.1.4.tar.gz";
+    sha256 = "774dd89f5c92462098dd6227e181268e5ec9930bbc569f25784000df185c71ba";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ which perl ] ++ (with perlPackages; [ JSON ]);
+
+  installPhase = ''
+    # We don't need a DESTDIR and an empty string results in an absolute path
+    # (due to the trailing slash) which breaks the build.
+    sed 's|$(DESTDIR)/||' -i Makefile
+
+    make PREFIX=$out
+    make PREFIX=$out install
+  '';
+
+  postFixup = ''
+    wrapProgram $out/bin/taskopen \
+         --set PERL5LIB "$PERL5LIB"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Script for taking notes and open urls with taskwarrior";
+    homepage = https://github.com/ValiValpas/taskopen;
+    platforms = platforms.linux;
+    license = stdenv.lib.licenses.free ;
+    maintainers = [ maintainers.winpat ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/tasksh/default.nix b/nixpkgs/pkgs/applications/misc/tasksh/default.nix
new file mode 100644
index 000000000000..6a30adb23da2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tasksh/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, cmake, readline }:
+
+stdenv.mkDerivation rec {
+  name = "tasksh-${version}";
+  version = "1.2.0";
+
+  enableParallelBuilding = true;
+
+  src = fetchurl {
+    url = "https://taskwarrior.org/download/${name}.tar.gz";
+    sha256 = "1z8zw8lld62fjafjvy248dncjk0i4fwygw0ahzjdvyyppx4zjhkf";
+  };
+
+  buildInputs = [ readline ];
+  nativeBuildInputs = [ cmake ];
+
+  meta = with stdenv.lib; {
+    description = "REPL for taskwarrior";
+    homepage = http://tasktools.org;
+    license = licenses.mit;
+    maintainers = with maintainers; [ matthiasbeyer ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/taskwarrior/0001-bash-completion-quote-pattern-argument-to-grep.patch b/nixpkgs/pkgs/applications/misc/taskwarrior/0001-bash-completion-quote-pattern-argument-to-grep.patch
new file mode 100644
index 000000000000..8e5c0139e555
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/taskwarrior/0001-bash-completion-quote-pattern-argument-to-grep.patch
@@ -0,0 +1,28 @@
+From 0d677475b710b9bb61d4b3ac5435c36b47d3a155 Mon Sep 17 00:00:00 2001
+From: Peter Simons <simons@cryp.to>
+Date: Wed, 8 Feb 2017 11:28:42 +0100
+Subject: [PATCH] bash-completion: quote pattern argument to grep
+
+Without the quotes, bash might expand that pattern based on the contents of the
+current working directory or -- if nullglob is set -- the argument disappears
+outright if no directory entry matches.
+---
+ scripts/bash/task.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/bash/task.sh b/scripts/bash/task.sh
+index e0c7fb03..d15ed3eb 100644
+--- a/scripts/bash/task.sh
++++ b/scripts/bash/task.sh
+@@ -72,7 +72,7 @@ _task_offer_contexts() {
+     COMPREPLY=( $(compgen -W "$($taskcommand _context) define delete list none show" -- $cur) )
+ }
+ 
+-_task_context_alias=$($taskcommand show | grep alias.*context | cut -d' ' -f1 | cut -d. -f2)
++_task_context_alias=$($taskcommand show | grep "alias.*context" | cut -d' ' -f1 | cut -d. -f2)
+ 
+ _task()
+ {
+-- 
+2.11.1
+
diff --git a/nixpkgs/pkgs/applications/misc/taskwarrior/default.nix b/nixpkgs/pkgs/applications/misc/taskwarrior/default.nix
new file mode 100644
index 000000000000..dc632f3ed757
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/taskwarrior/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, cmake, libuuid, gnutls }:
+
+stdenv.mkDerivation rec {
+  name = "taskwarrior-${version}";
+  version = "2.5.1";
+
+  src = fetchurl {
+    url = "https://taskwarrior.org/download/task-${version}.tar.gz";
+    sha256 = "059a9yc58wcicc6xxsjh1ph7k2yrag0spsahp1wqmsq6h7jwwyyq";
+  };
+
+  patches = [ ./0001-bash-completion-quote-pattern-argument-to-grep.patch ];
+
+  nativeBuildInputs = [ cmake libuuid gnutls ];
+
+  postInstall = ''
+    mkdir -p "$out/share/bash-completion/completions"
+    ln -s "../../doc/task/scripts/bash/task.sh" "$out/share/bash-completion/completions/task.bash"
+    mkdir -p "$out/share/fish/vendor_completions.d"
+    ln -s "../../../share/doc/task/scripts/fish/task.fish" "$out/share/fish/vendor_completions.d/"
+    mkdir -p "$out/share/zsh/site-functions"
+    ln -s "../../../share/doc/task/scripts/zsh/_task" "$out/share/zsh/site-functions/"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Highly flexible command-line tool to manage TODO lists";
+    homepage = https://taskwarrior.org;
+    license = licenses.mit;
+    maintainers = with maintainers; [ marcweber ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/tdrop/default.nix b/nixpkgs/pkgs/applications/misc/tdrop/default.nix
new file mode 100644
index 000000000000..15ee275c0e19
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tdrop/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, lib, fetchFromGitHub, makeWrapper
+, xwininfo, xdotool, xprop }:
+
+stdenv.mkDerivation rec {
+  pname = "tdrop";
+  version = "unstable-2018-11-13";
+
+  src = fetchFromGitHub {
+    owner = "noctuid";
+    repo = "tdrop";
+    rev = "198795c0d2573a31979330d6a2ae946eb81deebf";
+    sha256 = "1fhibqgmls64mylcb6q46ipmg1q6pvaqm26vz933gqav6cqsbdzs";
+  };
+
+  dontBuild = true;
+
+  installFlags = [ "PREFIX=$(out)" ];
+
+  postInstall = ''
+    wrapProgram $out/bin/tdrop \
+      --prefix PATH : ${lib.makeBinPath [ xwininfo xdotool xprop ]}
+  '';
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  meta = with stdenv.lib; {
+    description = "A Glorified WM-Independent Dropdown Creator";
+    homepage = https://github.com/noctuid/tdrop;
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ wedens ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/termdown/default.nix b/nixpkgs/pkgs/applications/misc/termdown/default.nix
new file mode 100644
index 000000000000..dc23443489ff
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/termdown/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchFromGitHub, buildPythonApplication,
+click, pyfiglet, dateutil}:
+
+with stdenv.lib;
+
+buildPythonApplication rec {
+
+  name    = "termdown-${version}";
+  version = "1.15.0";
+
+  src = fetchFromGitHub {
+    rev    = version;
+    sha256 = "08l03yk5jc1g0gps789q1s2knnaqzlidy4s5q5nhwg9g25la19nr";
+    repo   = "termdown";
+    owner  = "trehn";
+  };
+
+  propagatedBuildInputs = [ dateutil click pyfiglet ];
+
+  meta = with stdenv.lib; {
+    description     = "Starts a countdown to or from TIMESPEC";
+    longDescription = "Countdown timer and stopwatch in your terminal";
+    homepage        = https://github.com/trehn/termdown;
+    license         = licenses.gpl3;
+    platforms       = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/terminal-notifier/default.nix b/nixpkgs/pkgs/applications/misc/terminal-notifier/default.nix
new file mode 100644
index 000000000000..3599bd0030b9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/terminal-notifier/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, runtimeShell, lib, fetchzip }:
+
+stdenv.mkDerivation rec {
+  name = "terminal-notifier-${version}";
+
+  version = "2.0.0";
+
+  src = fetchzip {
+    url = "https://github.com/alloy/terminal-notifier/releases/download/${version}/terminal-notifier-${version}.zip";
+    sha256 = "0gi54v92hi1fkryxlz3k5s5d8h0s66cc57ds0vbm1m1qk3z4xhb0";
+    stripRoot = false;
+  };
+
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir -p $out/Applications
+    mkdir -p $out/bin
+    cp -r terminal-notifier.app $out/Applications
+    cat >$out/bin/terminal-notifier <<EOF
+    #!${runtimeShell}
+    cd $out/Applications/terminal-notifier.app
+    exec ./Contents/MacOS/terminal-notifier "\$@"
+    EOF
+    chmod +x $out/bin/terminal-notifier
+  '';
+
+  meta = with lib; {
+    maintainers = with maintainers; [ cstrahan ];
+    homepage = https://github.com/julienXX/terminal-notifier;
+    license = licenses.mit;
+    platforms  = platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/terminal-parrot/default.nix b/nixpkgs/pkgs/applications/misc/terminal-parrot/default.nix
new file mode 100644
index 000000000000..bdbea571790e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/terminal-parrot/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  name = "terminal-parrot-${version}";
+  version = "1.1.1";
+
+  src = fetchFromGitHub {
+    owner = "jmhobbs";
+    repo = "terminal-parrot";
+    rev = "${version}";
+    sha256 = "1b4vr4s1zpkpf5kc1r2kdlp3hf88qp1f7h05g8kd62zf4sfbj722";
+  };
+
+  modSha256 = "01i8fim9z2l8rpdgfaih9ldvbap7gcx5767a15miv8q7sxpr90cp";
+
+  meta = with stdenv.lib; {
+    description = "Shows colorful, animated party parrot in your terminial";
+    homepage = https://github.com/jmhobbs/terminal-parrot;
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = [ maintainers.heel ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/terminator/default.nix b/nixpkgs/pkgs/applications/misc/terminator/default.nix
new file mode 100644
index 000000000000..80dffe6d93f2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/terminator/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, python2, keybinder3, intltool, file, gtk3, gobject-introspection
+, libnotify, wrapGAppsHook, vte
+}:
+
+python2.pkgs.buildPythonApplication rec {
+  name = "terminator-${version}";
+  version = "1.91";
+
+  src = fetchurl {
+    url = "https://launchpad.net/terminator/gtk3/${version}/+download/${name}.tar.gz";
+    sha256 = "95f76e3c0253956d19ceab2f8da709a496f1b9cf9b1c5b8d3cd0b6da3cc7be69";
+  };
+
+  nativeBuildInputs = [ file intltool wrapGAppsHook gobject-introspection ];
+  buildInputs = [ gtk3 vte libnotify keybinder3
+    gobject-introspection # Temporary fix, see https://github.com/NixOS/nixpkgs/issues/56943
+  ];
+  propagatedBuildInputs = with python2.pkgs; [ pygobject3 psutil pycairo ];
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  checkPhase = ''
+    ./run_tests
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Terminal emulator with support for tiling and tabs";
+    longDescription = ''
+      The goal of this project is to produce a useful tool for arranging
+      terminals. It is inspired by programs such as gnome-multi-term,
+      quadkonsole, etc. in that the main focus is arranging terminals in grids
+      (tabs is the most common default method, which Terminator also supports).
+    '';
+    homepage = https://gnometerminator.blogspot.no/p/introduction.html;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ bjornfor globin ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/terminus/default.nix b/nixpkgs/pkgs/applications/misc/terminus/default.nix
new file mode 100644
index 000000000000..c12a4c9f8da6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/terminus/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, lib, fetchurl, dpkg, gnome2, gtk2, atk, glib, pango, gdk_pixbuf, cairo
+, freetype, fontconfig, dbus, libXi, libXcursor, libXdamage, libXrandr
+, libXcomposite, libXext, libXfixes, libXrender, libX11, libXtst, libXScrnSaver
+, libxcb, makeWrapper, nodejs
+, nss, nspr, alsaLib, cups, expat, systemd, libpulseaudio }:
+
+let
+  libPath = stdenv.lib.makeLibraryPath [
+    stdenv.cc.cc gtk2 atk glib pango gdk_pixbuf cairo freetype fontconfig dbus
+    libXi libXcursor libXdamage libXrandr libXcomposite libXext libXfixes libxcb
+    libXrender libX11 libXtst libXScrnSaver gnome2.GConf nss nspr alsaLib cups expat systemd libpulseaudio
+  ];
+in
+stdenv.mkDerivation rec {
+  version = "1.0.0-alpha.42";
+  name = "terminus-${version}";
+  src = fetchurl {
+    url = "https://github.com/Eugeny/terminus/releases/download/v${version}/terminus_${version}_amd64.deb";
+    sha256 = "1r5n75n71zwahg4rxlnf9qzrb0651gxv0987m6bykqmfpnw91nmb";
+  };
+  buildInputs = [ dpkg makeWrapper ];
+  unpackPhase = ''
+    mkdir pkg
+    dpkg-deb -x $src pkg
+    sourceRoot=pkg
+  '';
+  installPhase = ''
+    mkdir -p "$out/bin"
+    mv opt "$out/"
+    ln -s "$out/opt/Terminus/terminus" "$out/bin/terminus"
+    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath "${libPath}:\$ORIGIN" "$out/opt/Terminus/terminus"
+    mv usr/* "$out/"
+    wrapProgram $out/bin/terminus --prefix PATH : ${lib.makeBinPath [ nodejs ]}
+  '';
+  dontPatchELF = true;
+  meta = with lib; {
+    description = "A terminal for a more modern age";
+    homepage    = https://eugeny.github.io/terminus/;
+    maintainers = with maintainers; [ jlesquembre ];
+    license     = licenses.mit;
+    platforms   = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/termite/add_errno_header.patch b/nixpkgs/pkgs/applications/misc/termite/add_errno_header.patch
new file mode 100644
index 000000000000..81283f86a21d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/termite/add_errno_header.patch
@@ -0,0 +1,24 @@
+From 95c90f302c384f410dc92e64468ac7061b57fe2d Mon Sep 17 00:00:00 2001
+From: Michael Hoang <enzime@users.noreply.github.com>
+Date: Fri, 13 Jul 2018 19:03:09 +1000
+Subject: [PATCH] Add errno.h header which isn't always included automatically.
+
+---
+ termite.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/termite.cc b/termite.cc
+index 160fe82..13e2572 100644
+--- a/termite.cc
++++ b/termite.cc
+@@ -21,6 +21,7 @@
+ #include <cstdlib>
+ #include <cstring>
+ #include <cmath>
++#include <errno.h>
+ #include <functional>
+ #include <limits>
+ #include <map>
+-- 
+2.17.1
+
diff --git a/nixpkgs/pkgs/applications/misc/termite/default.nix b/nixpkgs/pkgs/applications/misc/termite/default.nix
new file mode 100644
index 000000000000..d4191a875bdd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/termite/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchFromGitHub, fetchpatch, pkgconfig, vte-ng, gtk3, ncurses, wrapGAppsHook }:
+
+stdenv.mkDerivation rec {
+  name = "termite-${version}";
+  version = "15";
+
+  src = fetchFromGitHub {
+    owner = "thestinger";
+    repo = "termite";
+    rev = "v${version}";
+    sha256 = "0hp1x6lj098m3jgna274wv5dv60lnzg22297di68g4hw9djjyd2k";
+    fetchSubmodules = true;
+  };
+
+  # https://github.com/thestinger/termite/pull/516
+  patches = [ ./url_regexp_trailing.patch ./add_errno_header.patch
+    # Fix off-by-one in select_text() on libvte >= 0.55.0
+    # Expected to be included in next release (16).
+    (fetchpatch {
+      url = "https://github.com/thestinger/termite/commit/7e9a93b421b9596f8980645a46ac2ad5468dac06.patch";
+      sha256 = "0vph2m5919f7w1xnc8i6z0j44clsm1chxkfg7l71nahxyfw5yh4j";
+    })
+  ] ++ stdenv.lib.optional stdenv.isDarwin ./remove_ldflags_macos.patch;
+
+  makeFlags = [ "VERSION=v${version}" "PREFIX=" "DESTDIR=$(out)" ];
+
+  buildInputs = [ vte-ng gtk3 ncurses ];
+
+  nativeBuildInputs = [ wrapGAppsHook pkgconfig ];
+
+  outputs = [ "out" "terminfo" ];
+
+  postInstall = ''
+    mkdir -p $terminfo/share
+    mv $out/share/terminfo $terminfo/share/terminfo
+
+    mkdir -p $out/nix-support
+    echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A simple VTE-based terminal";
+    license = licenses.lgpl2Plus;
+    homepage = https://github.com/thestinger/termite/;
+    maintainers = with maintainers; [ koral ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/termite/remove_ldflags_macos.patch b/nixpkgs/pkgs/applications/misc/termite/remove_ldflags_macos.patch
new file mode 100644
index 000000000000..f8c68518bb4d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/termite/remove_ldflags_macos.patch
@@ -0,0 +1,25 @@
+From 1b5a6934635c55472eb7949bd87ab3f45fa1b2f3 Mon Sep 17 00:00:00 2001
+From: Michael Hoang <enzime@users.noreply.github.com>
+Date: Fri, 13 Jul 2018 19:01:51 +1000
+Subject: [PATCH] Remove --as-needed flag from ld to fix compilation on macOS.
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index b115f42..ab301ba 100644
+--- a/Makefile
++++ b/Makefile
+@@ -29,7 +29,7 @@ ifeq (${CXX}, clang++)
+ 	CXXFLAGS += -Wimplicit-fallthrough
+ endif
+ 
+-LDFLAGS := -s -Wl,--as-needed ${LDFLAGS}
++LDFLAGS := -s -Wl ${LDFLAGS}
+ LDLIBS := ${shell pkg-config --libs ${GTK} ${VTE}}
+ 
+ termite: termite.cc url_regex.hh util/clamp.hh util/maybe.hh util/memory.hh
+-- 
+2.17.1
+
diff --git a/nixpkgs/pkgs/applications/misc/termite/url_regexp_trailing.patch b/nixpkgs/pkgs/applications/misc/termite/url_regexp_trailing.patch
new file mode 100644
index 000000000000..96deaa073d71
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/termite/url_regexp_trailing.patch
@@ -0,0 +1,27 @@
+Based on https://github.com/thestinger/termite/pull/516
+Modified to apply to v13
+
+From 65a454ffa8e681f3f14729cba7c42e1570a85e8a Mon Sep 17 00:00:00 2001
+From: Paul Baecher <pbaecher@gmail.com>
+Date: Thu, 7 Sep 2017 22:58:51 +0200
+Subject: [PATCH] Do not match punctuation at the end of URLs
+
+Punctuation at the end of URLs is most likely part of natural language
+or markup (for example in Markdown). Do not match it as part of the URL.
+---
+ url_regex.hh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/url_regex.hh b/url_regex.hh
+index 2ec6be8..3039b53 100644
+--- a/url_regex.hh
++++ b/url_regex.hh
+@@ -9,7 +9,7 @@
+ #define PORT            "(?:\\:[[:digit:]]{1,5})?"
+ #define SCHEME          "(?:[[:alpha:]][+-.[:alnum:]]*:)"
+ #define USERPASS        USERCHARS_CLASS "+(?:\\:" PASSCHARS_CLASS "+)?"
+-#define URLPATH         "(?:/[[:alnum:]\\Q-_.!~*'();/?:@&=+$,#%\\E]*)?"
++#define URLPATH         "(?:/[[:alnum:]\\Q-_.!~*'();/?:@&=+$,#%\\E]*(?<![\\Q.,:;()!?\\E]))?"
+ 
+ const char * const url_regex = SCHEME "//(?:" USERPASS "\\@)?" HOST PORT URLPATH;
+ 
diff --git a/nixpkgs/pkgs/applications/misc/termite/wrapper.nix b/nixpkgs/pkgs/applications/misc/termite/wrapper.nix
new file mode 100644
index 000000000000..379223d9076d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/termite/wrapper.nix
@@ -0,0 +1,15 @@
+{  makeWrapper, symlinkJoin, configFile ? null, termite }:
+
+if configFile == null then termite else symlinkJoin {
+  name = "termite-with-config-${termite.version}";
+
+  paths = [ termite ];
+  nativeBuildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    wrapProgram $out/bin/termite \
+      --add-flags "--config ${configFile}"
+  '';
+
+  passthru.terminfo = termite.terminfo;
+}
diff --git a/nixpkgs/pkgs/applications/misc/termonad/default.nix b/nixpkgs/pkgs/applications/misc/termonad/default.nix
new file mode 100644
index 000000000000..4388cbcfb441
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/termonad/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, ghcWithPackages, makeWrapper, packages ? (pkgSet: []) }:
+
+let
+  termonadEnv = ghcWithPackages (self: [ self.termonad ] ++ packages self);
+in stdenv.mkDerivation {
+  name = "termonad-with-packages-${termonadEnv.version}";
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  buildCommand = ''
+    mkdir -p $out/bin $out/share
+    makeWrapper ${termonadEnv}/bin/termonad $out/bin/termonad \
+      --set NIX_GHC "${termonadEnv}/bin/ghc"
+  '';
+
+  # trivial derivation
+  preferLocalBuild = true;
+  allowSubstitutes = false;
+}
diff --git a/nixpkgs/pkgs/applications/misc/teseq/default.nix b/nixpkgs/pkgs/applications/misc/teseq/default.nix
new file mode 100644
index 000000000000..9502b3a0abe7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/teseq/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl }:
+
+let
+  version = "1.1.1";
+in
+stdenv.mkDerivation {
+  name = "teseq-${version}";
+
+  src = fetchurl {
+    url = "mirror://gnu/teseq/teseq-${version}.tar.gz";
+    sha256 = "08ln005qciy7f3jhv980kfhhfmh155naq59r5ah9crz1q4mx5yrj";
+  };
+
+  meta = {
+    homepage = https://www.gnu.org/software/teseq/;
+    description = "Escape sequence illuminator";
+    license = stdenv.lib.licenses.gpl3;
+
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.vaibhavsagar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/thinking-rock/default.nix b/nixpkgs/pkgs/applications/misc/thinking-rock/default.nix
new file mode 100644
index 000000000000..c057fde95d7f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/thinking-rock/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, runtimeShell }:
+
+stdenv.mkDerivation {
+  name = "thinkingrock-binary-2.2.1";
+
+  src = fetchurl {
+    url = mirror://sourceforge/thinkingrock/ThinkingRock/TR%202.2.1/tr-2.2.1.tar.gz;
+    sha256 = "0hnwvvyc8miiz8w2g4iy7s4rgfy0kfbncgbgfzpsq6nrzq334kgm";
+  };
+
+  /* it would be a really bad idea to put thinkingrock tr executable in PATH!
+     the tr.sh script does use the coreutils tr itself
+     That's why I've renamed the wrapper and called it thinkingrock
+     However you may not rename the bin/tr script cause it will notice and throw an
+     "java.lang.IllegalArgumentException: Malformed branding token: thinkingrock"
+     exception. I hope that's fine
+  */
+
+  buildPhase = ''
+    # only keep /bin/tr
+    ls -1 bin/* | grep -ve  'bin/tr''$' | xargs rm
+    # don't keep the other .exe file either
+    find . -iname "*.exe" | xargs -n1 rm
+    mkdir -p $out/{nix-support/tr-files,bin}
+    cp -r . $out/nix-support/tr-files
+    cat >> $out/bin/thinkingrock << EOF
+    #!${runtimeShell}
+    exec $out/nix-support/tr-files/bin/tr "$@"
+    EOF
+    chmod +x $out/bin/thinkingrock
+  '';
+
+  installPhase = ":";
+
+  meta = {
+    description = "Task management system";
+    homepage = http://www.thinkingrock.com.au/;
+    license = "CDDL"; # Common Development and Distribution License
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/tilda/default.nix b/nixpkgs/pkgs/applications/misc/tilda/default.nix
new file mode 100644
index 000000000000..4172660182df
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tilda/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchzip, pkgconfig
+, autoreconfHook, gettext, expat
+, libconfuse, vte, gtk
+, makeWrapper }:
+
+stdenv.mkDerivation rec {
+
+  name = "tilda-${version}";
+  version = "1.4.1";
+
+  src = fetchzip {
+    url = "https://github.com/lanoxx/tilda/archive/${name}.tar.gz";
+    sha256 = "154rsldqjv2m1bddisb930qicb0y35kx7bxq392n2hn68jr2pxkj";
+  };
+
+  nativeBuildInputs = [ autoreconfHook makeWrapper pkgconfig ];
+  buildInputs = [ gettext libconfuse vte gtk ];
+
+  LD_LIBRARY_PATH = "${expat.out}/lib"; # ugly hack for xgettext to work during build
+
+  # The config locking scheme relies on the binary being called "tilda",
+  # (`pgrep -C tilda`), so a simple `wrapProgram` won't suffice:
+  postInstall = ''
+    mkdir $out/bin/wrapped
+    mv "$out/bin/tilda" "$out/bin/wrapped/tilda"
+    makeWrapper "$out/bin/wrapped/tilda" "$out/bin/tilda" \
+        --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A Gtk based drop down terminal for Linux and Unix";
+    homepage = https://github.com/lanoxx/tilda/;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.linux;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/tilix/default.nix b/nixpkgs/pkgs/applications/misc/tilix/default.nix
new file mode 100644
index 000000000000..342eca0a6fdc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tilix/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, dmd, gnome3, dbus
+, gsettings-desktop-schemas, desktop-file-utils, gettext, gtkd, libsecret
+, glib, perlPackages, wrapGAppsHook, xdg_utils }:
+
+stdenv.mkDerivation rec {
+  pname = "tilix";
+  version = "1.9.3";
+
+  src = fetchFromGitHub {
+    owner = "gnunn1";
+    repo = "tilix";
+    rev = version;
+    sha256 = "0mg9y4xd2pnv0smibg7dyy733jarvx6qpdqap3sj7fpyni0jvpph";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook dmd desktop-file-utils perlPackages.Po4a pkgconfig xdg_utils
+    wrapGAppsHook
+  ];
+
+  buildInputs = [ gnome3.dconf gettext gsettings-desktop-schemas gtkd dbus libsecret ];
+
+  preBuild = ''
+    makeFlagsArray=(
+      DCFLAGS='-O -inline -release -version=StdLoggerDisableTrace'
+    )
+  '';
+
+  postInstall = ''
+    ${glib.dev}/bin/glib-compile-schemas $out/share/glib-2.0/schemas
+  '';
+
+  preFixup = ''
+    gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH ":" "${libsecret}/lib")
+
+    substituteInPlace $out/share/applications/com.gexperts.Tilix.desktop \
+      --replace "Exec=tilix" "Exec=$out/bin/tilix"
+
+    # TODO: Won't be needed after the switch to Meson
+    substituteInPlace $out/share/dbus-1/services/com.gexperts.Tilix.service \
+     --replace "/usr/bin/tilix" "$out/bin/tilix"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Tiling terminal emulator following the Gnome Human Interface Guidelines";
+    homepage = https://gnunn1.github.io/tilix-web;
+    license = licenses.mpl20;
+    maintainers = with maintainers; [ midchildan ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/timewarrior/default.nix b/nixpkgs/pkgs/applications/misc/timewarrior/default.nix
new file mode 100644
index 000000000000..ca049ba04c91
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/timewarrior/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  name = "timewarrior-${version}";
+  version = "1.1.1";
+
+  enableParallelBuilding = true;
+
+  src = fetchurl {
+    url = "https://taskwarrior.org/download/timew-${version}.tar.gz";
+    sha256 = "1jfcfzdwk5qqhxznj1bgy0sx3lnp3z5lqr9kch9a7iazwmi9lz8z";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with stdenv.lib; {
+    description = "A command-line time tracker";
+    homepage = https://taskwarrior.org/docs/timewarrior;
+    license = licenses.mit;
+    maintainers = with maintainers; [ matthiasbeyer mrVanDalo ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/tint2/default.nix b/nixpkgs/pkgs/applications/misc/tint2/default.nix
new file mode 100644
index 000000000000..c70503cbff2f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tint2/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchFromGitLab, pkgconfig, cmake, gettext, cairo, pango, pcre
+, glib, imlib2, gtk2, libXinerama, libXrender, libXcomposite, libXdamage
+, libX11, libXrandr, librsvg, libpthreadstubs, libXdmcp
+, libstartup_notification, hicolor-icon-theme, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  name = "tint2-${version}";
+  version = "16.6.1";
+
+  src = fetchFromGitLab {
+    owner = "o9000";
+    repo = "tint2";
+    rev = version;
+    sha256 = "1h5bn4vi7gffwi4mpwpn0s6vxvl44rn3m9b23w8q9zyz9v24flz7";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ pkgconfig cmake gettext wrapGAppsHook ];
+
+  buildInputs = [ cairo pango pcre glib imlib2 gtk2 libXinerama libXrender
+    libXcomposite libXdamage libX11 libXrandr librsvg libpthreadstubs
+    libXdmcp libstartup_notification hicolor-icon-theme ];
+
+  postPatch = ''
+    for f in ./src/launcher/apps-common.c \
+             ./src/launcher/icon-theme-common.c
+    do
+      substituteInPlace $f --replace /usr/share/ /run/current-system/sw/share/
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://gitlab.com/o9000/tint2;
+    description = "Simple panel/taskbar unintrusive and light (memory, cpu, aestetic)";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/tmatrix/default.nix b/nixpkgs/pkgs/applications/misc/tmatrix/default.nix
new file mode 100644
index 000000000000..3ef0eac2417a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tmatrix/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, lib, fetchFromGitHub, cmake, ncurses }:
+
+stdenv.mkDerivation rec {
+  pname = "tmatrix";
+  version = "1.0";
+
+  src = fetchFromGitHub {
+    owner = "M4444";
+    repo = "TMatrix";
+    rev = "v${version}";
+    sha256 = "1g0gn4p02vjc6l8lc78wlx4xkd74ha7ybx9fvvdr6mizk0cyjili";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ ncurses ];
+
+  postInstall = ''
+    mkdir -p $out/share/man/man6
+    install -m 0644 ../tmatrix.6 $out/share/man/man6
+  '';
+
+  meta = with lib; {
+    description = "Terminal based replica of the digital rain from The Matrix";
+    longDescription = ''
+      TMatrix is a program that simulates the digital rain form The Matrix.
+      It's focused on being the most accurate replica of the digital rain effect
+      achievable on a typical terminal, while also being customizable and
+      performant.
+    '';
+    homepage = "https://github.com/M4444/TMatrix";
+    license = licenses.gpl2;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ infinisil ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/tnef/default.nix b/nixpkgs/pkgs/applications/misc/tnef/default.nix
new file mode 100644
index 000000000000..6cf1f27a104b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tnef/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  version = "1.4.17";
+  name = "tnef-${version}";
+
+  src = fetchFromGitHub {
+    owner  = "verdammelt";
+    repo   = "tnef";
+    rev    = version;
+    sha256 = "0cq2xh5wd74qn6k2nnw5rayxgqhjl3jbzf4zlc4babcwxrv32ldh";
+  };
+
+  doCheck = true;
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with stdenv.lib; {
+    description = "Unpacks MIME attachments of type application/ms-tnef";
+    longDescription = ''
+      TNEF is a program for unpacking MIME attachments of type "application/ms-tnef". This is a Microsoft only attachment.
+
+      Due to the proliferation of Microsoft Outlook and Exchange mail servers, more and more mail is encapsulated into this format.
+
+      The TNEF program allows one to unpack the attachments which were encapsulated into the TNEF attachment. Thus alleviating the need to use Microsoft Outlook to view the attachment.
+    '';
+    homepage = https://github.com/verdammelt/tnef;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ peterhoeg ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/todiff/default.nix b/nixpkgs/pkgs/applications/misc/todiff/default.nix
new file mode 100644
index 000000000000..5bb2b5b94616
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/todiff/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, rustPlatform, fetchFromGitHub }:
+
+rustPlatform.buildRustPackage rec {
+  name = "todiff-${version}";
+  version = "0.6.1";
+
+  src = fetchFromGitHub {
+    owner = "Ekleog";
+    repo = "todiff";
+    rev = version;
+    sha256 = "1y0v8nkaqb8kn61xwarpbyrq019gxx1f5f5p1hzw73nqxadc1rcm";
+  };
+
+  cargoSha256 = "0xn5p71qk0ahd2drklja16xwv7zw0797kkzpiv563kffzvd1p8id";
+
+  checkPhase = "cargo test --features=integration_tests";
+
+  meta = with stdenv.lib; {
+    description = "Human-readable diff for todo.txt files";
+    homepage = "https://github.com/Ekleog/todiff";
+    maintainers = with maintainers; [ ekleog ];
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/todoist/default.nix b/nixpkgs/pkgs/applications/misc/todoist/default.nix
new file mode 100644
index 000000000000..d4735c0baf5f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/todoist/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  name = "todoist-${version}";
+  version = "0.13.1";
+
+  src = fetchFromGitHub {
+    owner = "sachaos";
+    repo = "todoist";
+    rev = "v${version}";
+    sha256 = "1kwvlsjr2a7wdhlwpxxpdh87wz8k9yjwl59vl2g7ya6m0rvhd3mc";
+  };
+
+  modSha256 = "09n6abyaqwz4zcdz8934rvpbxhp4v2nmm5v739kkcc98c3h93i64";
+
+  meta = {
+    homepage = https://github.com/sachaos/todoist;
+    description = "Todoist CLI Client";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/todolist/default.nix b/nixpkgs/pkgs/applications/misc/todolist/default.nix
new file mode 100644
index 000000000000..122567de2e1e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/todolist/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, buildGoPackage, fetchFromGitHub }:
+
+buildGoPackage rec {
+  name = "todolist-${version}";
+  version = "v0.8.1";
+
+  goPackagePath = "github.com/gammons/todolist";
+
+  src = fetchFromGitHub {
+    owner = "gammons";
+    repo = "todolist";
+    rev = "${version}";
+    sha256 = "0dazfymby5xm4482p9cyj23djmkz5q7g79cqm2d85mczvz7vks8p";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Simple GTD-style todo list for the command line";
+    homepage = "http://todolist.site";
+    license = licenses.mit;
+    maintainers = with maintainers; [ uvnikita ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/toggldesktop/TogglDesktop.pro b/nixpkgs/pkgs/applications/misc/toggldesktop/TogglDesktop.pro
new file mode 100644
index 000000000000..e86156313d1f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/toggldesktop/TogglDesktop.pro
@@ -0,0 +1,19 @@
+QT += core network widgets
+
+DEFINES += APP_ENVIRONMENT=\\\"production\\\"
+DEFINES += APP_VERSION=\\\"@version@\\\"
+
+TARGET = toggldesktop
+TEMPLATE = app
+
+SOURCES += *.cpp
+HEADERS += *.h
+FORMS += *.ui
+RESOURCES += *.qrc
+
+target.path = $$PREFIX
+
+INSTALLS += target
+
+CONFIG += link_pkgconfig
+PKGCONFIG += bugsnag-qt qxtglobalshortcut qt-oauth-lib toggl x11 xscrnsaver
diff --git a/nixpkgs/pkgs/applications/misc/toggldesktop/default.nix b/nixpkgs/pkgs/applications/misc/toggldesktop/default.nix
new file mode 100644
index 000000000000..b268bdd0962e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/toggldesktop/default.nix
@@ -0,0 +1,148 @@
+{ stdenv, fetchzip, buildEnv, makeDesktopItem, runCommand, writeText, pkgconfig
+, cmake, qmake, cacert, jsoncpp, libX11, libXScrnSaver, lua, openssl, poco
+, qtbase, qtwebengine, qtx11extras, sqlite }:
+
+let
+  name = "toggldesktop-${version}";
+  version = "7.4.231";
+
+  src = fetchzip {
+    url = "https://github.com/toggl/toggldesktop/archive/v${version}.tar.gz";
+    sha256 = "01hqkx9dljnhwnyqi6mmzfp02hnbi2j50rsfiasniqrkbi99x9v1";
+  };
+
+  bugsnag-qt = stdenv.mkDerivation rec {
+    name = "bugsnag-qt-${version}";
+    version = "20180522.005732";
+
+    src = fetchzip {
+      url = "https://github.com/yegortimoshenko/bugsnag-qt/archive/${version}.tar.gz";
+      sha256 = "02s6mlggh0i4a856md46dipy6mh47isap82jlwmjr7hfsk2ykgnq";
+    };
+
+    nativeBuildInputs = [ qmake ];
+    buildInputs = [ qtbase ];
+  };
+
+  qxtglobalshortcut = stdenv.mkDerivation rec {
+    name = "qxtglobalshortcut-${version}";
+    version = "f584471dada2099ba06c574bdfdd8b078c2e3550";
+
+    src = fetchzip {
+      url = "https://github.com/hluk/qxtglobalshortcut/archive/${version}.tar.gz";
+      sha256 = "1iy17gypav10z8aa62s5jb6mq9y4kb9ms4l61ydmk3xwlap7igw1";
+    };
+
+    nativeBuildInputs = [ cmake ];
+    buildInputs = [ qtbase qtx11extras ];
+  };
+
+  qt-oauth-lib = stdenv.mkDerivation rec {
+    name = "qt-oauth-lib-${version}";
+    version = "20190125.190943";
+
+    src = fetchzip {
+      url = "https://github.com/yegortimoshenko/qt-oauth-lib/archive/${version}.tar.gz";
+      sha256 = "0zmfgvdf6n79mgfvbda7lkdxxlzjmy86436gqi2r5x05vq04sfrj";
+    };
+
+    nativeBuildInputs = [ qmake ];
+    buildInputs = [ qtbase qtwebengine ];
+  };
+
+  poco-pc = writeText "poco.pc" ''
+    Name: Poco
+    Description: ${poco.meta.description}
+    Version: ${poco.version}
+    Libs: -L${poco}/lib -lPocoDataSQLite -lPocoData -lPocoNet -lPocoNetSSL -lPocoCrypto -lPocoUtil -lPocoXML -lPocoFoundation
+    Cflags: -I${poco}/include/Poco
+  '';
+
+  poco-pc-wrapped = runCommand "poco-pc-wrapped" {} ''
+    mkdir -p $out/lib/pkgconfig && ln -s ${poco-pc} $_/poco.pc
+  '';
+
+  libtoggl = stdenv.mkDerivation {
+    name = "libtoggl-${version}";
+    inherit src version;
+
+    sourceRoot = "source/src";
+
+    nativeBuildInputs = [ qmake pkgconfig ];
+    buildInputs = [ jsoncpp lua openssl poco poco-pc-wrapped sqlite libX11 ];
+
+    postPatch = ''
+      cat ${./libtoggl.pro} > libtoggl.pro
+      rm get_focused_window_{mac,windows}.cc
+    '';
+  };
+
+  toggldesktop = stdenv.mkDerivation {
+    name = "${name}-unwrapped";
+    inherit src version;
+
+    sourceRoot = "source/src/ui/linux/TogglDesktop";
+
+    postPatch = ''
+      substituteAll ${./TogglDesktop.pro} TogglDesktop.pro
+      substituteInPlace toggl.cpp \
+        --replace ./../../../toggl_api.h toggl_api.h
+    '';
+
+    postInstall = ''
+      ln -s ${cacert}/etc/ssl/certs/ca-bundle.crt $out/cacert.pem
+    '';
+
+    nativeBuildInputs = [ qmake pkgconfig ];
+
+    buildInputs = [
+      bugsnag-qt
+      libtoggl
+      qxtglobalshortcut
+      qtbase
+      qtwebengine
+      qt-oauth-lib
+      qtx11extras
+      libX11
+      libXScrnSaver
+    ];
+  };
+
+  toggldesktop-icons = stdenv.mkDerivation {
+    name = "${name}-icons";
+    inherit (toggldesktop) src sourceRoot;
+
+    installPhase = ''
+      for f in icons/*; do
+        mkdir -p $out/share/icons/hicolor/$(basename $f)/apps
+        mv $f/toggldesktop.png $_
+      done
+    '';
+  };
+
+  toggldesktop-wrapped = runCommand "toggldesktop-wrapped" {} ''
+    mkdir -p $out/bin && ln -s ${toggldesktop}/toggldesktop $_
+  '';
+
+  desktopItem = makeDesktopItem rec {
+    categories = "Utility;";
+    desktopName = "Toggl";
+    genericName = desktopName;
+    name = "toggldesktop";
+    exec = "${toggldesktop-wrapped}/bin/toggldesktop";
+    icon = "toggldesktop";
+  };
+in
+
+buildEnv {
+  inherit name;
+  paths = [ desktopItem toggldesktop-icons toggldesktop-wrapped ];
+
+  meta = with stdenv.lib; {
+    description = "Client for Toggl time tracking service";
+    homepage = https://github.com/toggl/toggldesktop;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ yegortimoshenko ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/toggldesktop/libtoggl.pro b/nixpkgs/pkgs/applications/misc/toggldesktop/libtoggl.pro
new file mode 100644
index 000000000000..c8303440fe67
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/toggldesktop/libtoggl.pro
@@ -0,0 +1,20 @@
+TARGET = toggl
+TEMPLATE = lib
+
+SOURCES += *.cc
+HEADERS += *.h
+
+headers.files = $$HEADERS
+headers.path = $$PREFIX/include
+target.path = $$PREFIX/lib
+
+INSTALLS += headers target
+
+CONFIG += create_prl create_pc link_pkgconfig
+PKGCONFIG += jsoncpp openssl lua poco sqlite3 x11
+
+QMAKE_PKGCONFIG_NAME = $$TARGET
+QMAKE_PKGCONFIG_PREFIX = $$PREFIX
+QMAKE_PKGCONFIG_LIBDIR = $$target.path
+QMAKE_PKGCONFIG_INCDIR = $$headers.path
+QMAKE_PKGCONFIG_DESTDIR = pkgconfig
diff --git a/nixpkgs/pkgs/applications/misc/tomboy/default.nix b/nixpkgs/pkgs/applications/misc/tomboy/default.nix
new file mode 100644
index 000000000000..ba6e97d61fb3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tomboy/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, itstool, intltool, pkgconfig
+, libxml2, gnome2, atk, gtk2, glib
+, mono, mono-addins, dbus-sharp-2_0, dbus-sharp-glib-2_0, gnome-sharp, gtk-sharp-2_0
+, makeWrapper, lib}:
+
+let
+  version = "1.15.9";
+in
+
+stdenv.mkDerivation {
+  name = "tomboy-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/tomboy-notes/tomboy/releases/download/${version}/tomboy-${version}.tar.xz";
+    sha256 = "0j5jmd079bm2fydqaic5ymbfdxna3qlx6fkp2mqhgcdr7prsbl3q";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ itstool intltool
+    libxml2 gnome2.GConf atk gtk2
+    mono mono-addins dbus-sharp-2_0 dbus-sharp-glib-2_0 gnome-sharp gtk-sharp-2_0
+    makeWrapper ];
+
+  postInstall = ''
+    makeWrapper "${mono}/bin/mono" "$out/bin/tomboy" \
+      --add-flags "$out/lib/tomboy/Tomboy.exe" \
+      --prefix MONO_GAC_PREFIX : ${dbus-sharp-2_0} \
+      --prefix MONO_GAC_PREFIX : ${dbus-sharp-glib-2_0} \
+      --prefix MONO_GAC_PREFIX : ${gtk-sharp-2_0} \
+      --prefix MONO_GAC_PREFIX : ${gnome-sharp} \
+      --prefix MONO_GAC_PREFIX : ${mono-addins} \
+      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ glib gtk-sharp-2_0 gtk-sharp-2_0.gtk gnome2.GConf ]}
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://wiki.gnome.org/Apps/Tomboy;
+    description = "A simple note-taking application with synchronization";
+    platforms = platforms.linux;
+    license = stdenv.lib.licenses.lgpl2;
+    maintainers = with maintainers; [ stesie ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/toot/default.nix b/nixpkgs/pkgs/applications/misc/toot/default.nix
new file mode 100644
index 000000000000..6079c8807dc1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/toot/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub, python3Packages }:
+
+python3Packages.buildPythonApplication rec {
+  version = "0.21.0";
+  name    = "toot-${version}";
+
+  src = fetchFromGitHub {
+    owner  = "ihabunek";
+    repo   = "toot";
+    rev    = "${version}";
+    sha256 = "03s81i9rz7dn33r13p7j2c7yw874hkm64x7myddiqw9lc21fyzql";
+  };
+
+  checkInputs = with python3Packages; [ pytest ];
+
+  propagatedBuildInputs = with python3Packages;
+    [ requests beautifulsoup4 future wcwidth ];
+
+  checkPhase = ''
+    py.test
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Mastodon CLI interface";
+    homepage    = "https://github.com/ihabunek/toot";
+    license     = licenses.mit;
+    maintainers = [ maintainers.matthiasbeyer ];
+  };
+
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/tootle/default.nix b/nixpkgs/pkgs/applications/misc/tootle/default.nix
new file mode 100644
index 000000000000..413f082fb22a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tootle/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchFromGitHub
+, meson, ninja, pkgconfig, python3, libgee, gsettings-desktop-schemas
+, gnome3, pantheon, gobject-introspection, wrapGAppsHook
+, gtk3, json-glib, glib, glib-networking, hicolor-icon-theme
+}:
+
+let
+  pname = "tootle";
+  version = "0.2.0";
+in stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "bleakgrey";
+    repo = pname;
+    rev = version;
+    sha256 = "1z3wyx316nns6gi7vlvcfmalhvxncmvcmmlgclbv6b6hwl5x2ysi";
+  };
+
+  nativeBuildInputs = [
+    gobject-introspection
+    meson
+    ninja
+    pkgconfig
+    python3
+    pantheon.vala
+    wrapGAppsHook
+  ];
+  buildInputs = [
+    gtk3 pantheon.granite json-glib glib glib-networking hicolor-icon-theme
+    libgee gnome3.libsoup gsettings-desktop-schemas
+  ];
+
+  postPatch = ''
+    chmod +x ./meson/post_install.py
+    patchShebangs ./meson/post_install.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Simple Mastodon client designed for elementary OS";
+    homepage    = https://github.com/bleakgrey/tootle;
+    license     = licenses.gpl3;
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/topydo/default.nix b/nixpkgs/pkgs/applications/misc/topydo/default.nix
new file mode 100644
index 000000000000..34952b9c0f4d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/topydo/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, python3Packages, fetchFromGitHub, glibcLocales }:
+
+with python3Packages;
+
+buildPythonApplication rec {
+  pname = "topydo";
+  version = "0.13";
+  name  = "${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "bram85";
+    repo = pname;
+    rev = version;
+    sha256 = "0b3dz137lpbvpjvfy42ibqvj3yk526x4bpn819fd11lagn77w69r";
+  };
+
+  propagatedBuildInputs = [
+    arrow
+    icalendar
+    glibcLocales
+    prompt_toolkit
+    urwid
+    watchdog
+  ];
+
+  checkInputs = [ mock freezegun coverage green pylint ];
+
+  LC_ALL="en_US.UTF-8";
+
+  meta = with stdenv.lib; {
+    description = "A cli todo application compatible with the todo.txt format";
+    homepage = "https://github.com/bram85/topydo";
+    license = licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/tpmmanager/default.nix b/nixpkgs/pkgs/applications/misc/tpmmanager/default.nix
new file mode 100644
index 000000000000..09322b47506b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tpmmanager/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchgit, qt4, qmake4Hook, trousers }:
+
+stdenv.mkDerivation rec {
+  version = "0.8.1";
+  name = "tpmmanager-${version}";
+
+  src = fetchgit {
+    url = "https://github.com/Sirrix-AG/TPMManager";
+    rev = "9f989206635a6d2c1342576c90fa73eb239519cd";
+    sha256 = "24a606f88fed67ed0d0e61dc220295e9e1ab8db3ef3d028fa34b04ff30652d8e";
+  };
+
+  nativeBuildInputs = [ qmake4Hook ];
+
+  buildInputs = [ qt4 trousers ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    install -Dpm755 -D bin/tpmmanager $out/bin/tpmmanager
+
+    mkdir -p $out/share/applications
+    cat > $out/share/applications/tpmmanager.desktop <<EOF
+    [Desktop Entry]
+    Type=Application
+    Version=1.0
+    Name=tpmmanager
+    Comment=TPM manager
+    Exec=$out/bin/tpmmanager
+    Terminal=false
+    EOF
+    '';
+
+  meta = {
+    homepage = https://projects.sirrix.com/trac/tpmmanager;
+    description = "Tool for managing the TPM";
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = with stdenv.lib.maintainers; [ tstrobel ];
+    platforms = with stdenv.lib.platforms; linux;
+    inherit version;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/translate-shell/default.nix b/nixpkgs/pkgs/applications/misc/translate-shell/default.nix
new file mode 100644
index 000000000000..9fb8469cf27a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/translate-shell/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, makeWrapper, curl, fribidi, rlwrap, gawk, groff, ncurses }:
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "translate-shell";
+  version = "0.9.6.10";
+
+  src = fetchFromGitHub {
+    owner = "soimort";
+    repo = "translate-shell";
+    rev = "v${version}";
+    sha256 = "1dmh3flldfhnqfay3a6c5hanqcjwrmbly1bq8mlk022qfi1fv33y";
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  installFlags = [ "PREFIX=$(out)" ];
+
+  postInstall = ''
+    wrapProgram $out/bin/trans \
+      --prefix PATH : ${stdenv.lib.makeBinPath [
+        gawk
+        curl
+        ncurses
+        rlwrap
+        groff
+        fribidi
+      ]}
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://www.soimort.org/translate-shell;
+    description = "Command-line translator using Google Translate, Bing Translator, Yandex.Translate, and Apertium";
+    license = licenses.unlicense;
+    maintainers = with maintainers; [ ebzzry infinisil ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/tthsum/default.nix b/nixpkgs/pkgs/applications/misc/tthsum/default.nix
new file mode 100644
index 000000000000..dbac56abaa1d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tthsum/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "tthsum-${version}";
+  version = "1.3.2";
+
+  src = fetchurl {
+    url = "http://tthsum.devs.nu/pkg/tthsum-${version}.tar.bz2";
+    sha256 = "0z6jq8lbg9rasv98kxfs56936dgpgzsg3yc9k52878qfw1l2bp59";
+  };
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/man/man1
+    cp share/tthsum.1.gz $out/share/man/man1
+    cp obj-unix/tthsum $out/bin
+  '';
+
+  doCheck = !stdenv.isDarwin;
+
+  meta = with stdenv.lib; {
+    description = "An md5sum-alike program that works with Tiger/THEX hashes";
+    longDescription = ''
+      tthsum generates or checks TTH checksums (root of the THEX hash
+      tree). The Merkle Hash Tree, invented by Ralph Merkle, is a hash
+      construct that exhibits desirable properties for verifying the
+      integrity of files and file subranges in an incremental or
+      out-of-order fashion. tthsum uses the Tiger hash algorithm for
+      both the internal and the leaf nodes.
+
+      The specification of the Tiger hash algorithm is at:
+      http://www.cs.technion.ac.il/~biham/Reports/Tiger/
+
+      The specification of the THEX algorithm is at:
+      http://adc.sourceforge.net/draft-jchapweske-thex-02.html
+    '';
+    homepage = http://tthsum.devs.nu/;
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.ebzzry ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/tvbrowser/bin.nix b/nixpkgs/pkgs/applications/misc/tvbrowser/bin.nix
new file mode 100644
index 000000000000..38865ca4f3d9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tvbrowser/bin.nix
@@ -0,0 +1,56 @@
+{ stdenv, fetchurl, makeWrapper, jre, makeDesktopItem }:
+
+let
+  desktopItem = makeDesktopItem {
+    name = "tvbrowser";
+    exec = "tvbrowser";
+    icon = "tvbrowser";
+    comment = "Themeable and easy to use TV Guide";
+    desktopName = "TV-Browser";
+    genericName = "Electronic TV Program Guide";
+    categories = "AudioVideo;TV;Java;";
+    startupNotify = "true";
+    extraEntries = ''
+      StartupWMClass=tvbrowser-TVBrowser
+    '';
+  };
+
+in stdenv.mkDerivation rec {
+  pname = "tvbrowser";
+  version = "4.0.1";
+  name = "${pname}-bin-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/TV-Browser%20Releases%20%28Java%208%20and%20higher%29/${version}/${pname}_${version}_bin.tar.gz";
+    sha256 = "0ahsirf6cazs5wykgbwsc6n35w6jprxyphzqmm7d370n37sb07pm";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out/share/java/${pname}
+    cp -R * $out/share/java/${pname}
+    rm $out/share/java/${pname}/${pname}.{sh,desktop}
+
+    mkdir -p $out/share/applications
+    ln -s ${desktopItem}/share/applications/* $out/share/applications/
+
+    for i in 16 32 48 128; do
+      mkdir -p $out/share/icons/hicolor/''${i}x''${i}/apps
+      ln -s $out/share/java/${pname}/imgs/${pname}$i.png $out/share/icons/hicolor/''${i}x''${i}/apps/${pname}.png
+    done
+
+    mkdir -p $out/bin
+    makeWrapper ${jre}/bin/java $out/bin/${pname} \
+      --add-flags "-jar $out/share/java/${pname}/${pname}.jar" \
+      --run "cd $out/share/java/${pname}"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Electronic TV Program Guide";
+    homepage = https://www.tvbrowser.org/;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ jfrankenau ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/twmn/default.nix b/nixpkgs/pkgs/applications/misc/twmn/default.nix
new file mode 100644
index 000000000000..04c6cc3606e3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/twmn/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, qtbase, qtx11extras, qmake, pkgconfig, boost }:
+
+stdenv.mkDerivation rec {
+  name = "twmn-git-2018-10-01";
+
+  src = fetchFromGitHub {
+    owner = "sboli";
+    repo = "twmn";
+    rev = "80f48834ef1a07087505b82358308ee2374b6dfb";
+    sha256 = "0mpjvp800x07lp9i3hfcc5f4bqj1fj4w3dyr0zwaxc6wqmm0fdqz";
+  };
+
+  nativeBuildInputs = [ pkgconfig qmake ];
+  buildInputs = [ qtbase qtx11extras boost ];
+
+  postPatch = ''
+    sed -i s/-Werror// twmnd/twmnd.pro
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p "$out/bin"
+    cp bin/* "$out/bin"
+
+    runHook postInstall
+  '';
+
+  meta = {
+    description = "A notification system for tiling window managers";
+    homepage = https://github.com/sboli/twmn;
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = [ stdenv.lib.maintainers.matejc ];
+    license = stdenv.lib.licenses.lgpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/tzupdate/default.nix b/nixpkgs/pkgs/applications/misc/tzupdate/default.nix
new file mode 100644
index 000000000000..c887876634f5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/tzupdate/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, python }:
+
+let
+  inherit (python.pkgs) buildPythonApplication fetchPypi requests;
+in
+buildPythonApplication rec {
+  pname = "tzupdate";
+  version = "1.4.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1sc3z2bx2nhnxg82x0jy19pr8lw56chbr90c2lr11w495csqwhz7";
+  };
+
+  propagatedBuildInputs = [ requests ];
+
+  meta = with stdenv.lib; {
+    description = "Update timezone information based on geoip.";
+    homepage = https://github.com/cdown/tzupdate;
+    maintainers = [ maintainers.michaelpj ];
+    license = licenses.unlicense;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/udevil/default.nix b/nixpkgs/pkgs/applications/misc/udevil/default.nix
new file mode 100644
index 000000000000..3cc4fcc1517b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/udevil/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, intltool, glib, pkgconfig, udev, utillinux, acl }:
+stdenv.mkDerivation {
+  name = "udevil-0.4.4";
+  src = fetchurl {
+    url = https://github.com/IgnorantGuru/udevil/archive/0.4.4.tar.gz;
+    sha256 = "0z1bhaayambrcn7bgnrqk445k50ifabmw8q4i9qj49nnbcvxhbxd";
+  };
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ intltool glib udev ];
+  configurePhase = ''
+    substituteInPlace src/Makefile.in --replace "-o root -g root" ""
+    # do not set setuid bit in nix store
+    substituteInPlace src/Makefile.in --replace 4755 0755
+    ./configure \
+      --prefix=$out \
+      --with-mount-prog=${utillinux}/bin/mount \
+      --with-umount-prog=${utillinux}/bin/umount \
+      --with-losetup-prog=${utillinux}/bin/losetup \
+      --with-setfacl-prog=${acl.bin}/bin/setfacl \
+      --sysconfdir=$prefix/etc
+  '';
+  patches = [ ./device-info-sys-stat.patch ];
+  meta = {
+    description = "A command line Linux program which mounts and unmounts removable devices without a password, shows device info, and monitors device changes";
+    homepage = https://ignorantguru.github.io/udevil/;
+    platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/udevil/device-info-sys-stat.patch b/nixpkgs/pkgs/applications/misc/udevil/device-info-sys-stat.patch
new file mode 100644
index 000000000000..554682108e39
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/udevil/device-info-sys-stat.patch
@@ -0,0 +1,14 @@
+diff --git a/src/device-info.h b/src/device-info.h
+index 6cb3683..ddac24c 100644
+--- a/src/device-info.h
++++ b/src/device-info.h
+@@ -18,7 +18,8 @@
+ // intltool
+ #include <glib/gi18n.h>
+ 
+-
++// stat
++#include <sys/stat.h>
+ 
+ typedef struct device_t  {
+     struct udev_device *udevice;
diff --git a/nixpkgs/pkgs/applications/misc/udiskie/default.nix b/nixpkgs/pkgs/applications/misc/udiskie/default.nix
new file mode 100644
index 000000000000..459104aba638
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/udiskie/default.nix
@@ -0,0 +1,63 @@
+{ stdenv, fetchFromGitHub, asciidoc-full, gettext
+, gobject-introspection, gtk3, hicolor-icon-theme, libappindicator-gtk3, libnotify, librsvg
+, udisks2, wrapGAppsHook
+, python3Packages
+}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "udiskie";
+  version = "1.7.7";
+
+  src = fetchFromGitHub {
+    owner = "coldfix";
+    repo = "udiskie";
+    rev = version;
+    sha256 = "1j17z26vy44il2s9zgchvhq280vq8ag64ddi35f35b444wz2azlb";
+  };
+
+  nativeBuildInputs = [
+    gettext
+    asciidoc-full        # For building man page.
+    gobject-introspection
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    hicolor-icon-theme
+    librsvg              # required for loading svg icons (udiskie uses svg icons)
+    gobject-introspection
+    libnotify
+    gtk3
+    udisks2
+    libappindicator-gtk3
+  ];
+
+  propagatedBuildInputs = with python3Packages; [
+    docopt
+    pygobject3
+    pyyaml
+  ];
+
+  postBuild = "make -C doc";
+
+  postInstall = ''
+    mkdir -p $out/share/man/man8
+    cp -v doc/udiskie.8 $out/share/man/man8/
+  '';
+
+  checkInputs = with python3Packages; [
+    nose
+    keyutils
+  ];
+
+  checkPhase = ''
+    nosetests
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Removable disk automounter for udisks";
+    license = licenses.mit;
+    homepage = https://github.com/coldfix/udiskie;
+    maintainers = with maintainers; [ AndersonTorres ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/ulauncher/default.nix b/nixpkgs/pkgs/applications/misc/ulauncher/default.nix
new file mode 100644
index 000000000000..12cf96580f74
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ulauncher/default.nix
@@ -0,0 +1,105 @@
+{ stdenv
+, fetchurl
+, python27Packages
+, gnome3
+, gobject-introspection
+, wrapGAppsHook
+, webkitgtk
+, libnotify
+, keybinder3
+, libappindicator
+, intltool
+, wmctrl
+, hicolor-icon-theme
+, xvfb_run
+}:
+
+python27Packages.buildPythonApplication rec  {
+  pname = "ulauncher";
+  version = "4.4.0.r1";
+
+  # Python 3 support is currently in development
+  # on the dev branch and 5.x.x releases
+  disabled = ! python27Packages.isPy27;
+
+  src = fetchurl {
+    url = "https://github.com/Ulauncher/Ulauncher/releases/download/${version}/ulauncher_${version}.tar.gz";
+    sha256 = "12v7qpjhf0842ivsfflsl2zlvhiaw25f9ffv7vhnkvrhrmksim9f";
+  };
+
+  nativeBuildInputs = with python27Packages;  [
+    distutils_extra
+    intltool
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gnome3.adwaita-icon-theme
+    gobject-introspection
+    hicolor-icon-theme
+    keybinder3
+    libappindicator
+    libnotify
+    webkitgtk
+    wmctrl
+  ];
+
+  propagatedBuildInputs = with python27Packages; [
+    dbus-python
+    notify
+    pygobject3
+    pyinotify
+    pysqlite
+    python-Levenshtein
+    pyxdg
+    websocket_client
+  ];
+
+  checkInputs = with python27Packages; [
+    mock
+    pytest_3
+    pytest-mock
+    pytestpep8
+    xvfb_run
+  ];
+
+  patches = [
+    ./fix-path.patch
+  ];
+
+  postPatch = ''
+    substituteInPlace setup.py --subst-var out
+  '';
+
+  # https://github.com/Ulauncher/Ulauncher/issues/390
+  doCheck = false;
+
+  preCheck = ''
+    export PYTHONPATH=$PYTHONPATH:$out/${python27Packages.python.sitePackages}
+  '';
+
+  # Simple translation of
+  # - https://github.com/Ulauncher/Ulauncher/blob/f5a601bdca75198a6a31b9d84433496b63530e74/test
+  checkPhase = ''
+    runHook preCheck
+
+    # skip tests in invocation that handle paths that
+    # aren't nix friendly (i think)
+    xvfb-run -s '-screen 0 1024x768x16' \
+      pytest -k 'not TestPath and not test_handle_key_press_event' --pep8 tests
+
+    runHook postCheck
+  '';
+
+  preFixup = ''
+    gappsWrapperArgs+=(--prefix PATH : "${stdenv.lib.makeBinPath [ wmctrl ]}")
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A fast application launcher for Linux, written in Python, using GTK";
+    homepage = https://ulauncher.io/;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ aaronjanse worldofpeace ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/ulauncher/fix-path.patch b/nixpkgs/pkgs/applications/misc/ulauncher/fix-path.patch
new file mode 100644
index 000000000000..2936df65194e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/ulauncher/fix-path.patch
@@ -0,0 +1,13 @@
+diff --git a/setup.py b/setup.py
+index 3616104..e9bbfda 100755
+--- a/setup.py
++++ b/setup.py
+@@ -112,7 +112,7 @@ class InstallAndUpdateDataDirectory(DistUtilsExtra.auto.install_auto):
+         DistUtilsExtra.auto.install_auto.run(self)
+ 
+         target_data = '/' + os.path.relpath(self.install_data, self.root) + '/'
+-        target_pkgdata = target_data + 'share/ulauncher/'
++        target_pkgdata = '@out@/share/ulauncher/'
+         target_scripts = '/' + os.path.relpath(self.install_scripts,
+                                                self.root) + '/'
+ 
diff --git a/nixpkgs/pkgs/applications/misc/urlscan/default.nix b/nixpkgs/pkgs/applications/misc/urlscan/default.nix
new file mode 100644
index 000000000000..87800cf90d6d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/urlscan/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, python3Packages, fetchFromGitHub }:
+
+python3Packages.buildPythonApplication rec {
+  pname = "urlscan";
+  version = "0.9.3";
+
+  src = fetchFromGitHub {
+    owner = "firecat53";
+    repo = pname;
+    rev = version;
+    sha256 = "0z24k8sk2zfp2pwysyp844vmhr5vbkj74frwy4i0v5pj60i9jl0v";
+  };
+
+  propagatedBuildInputs = [ python3Packages.urwid ];
+
+  doCheck = false; # No tests available
+
+  meta = with stdenv.lib; {
+    description = "Mutt and terminal url selector (similar to urlview)";
+    homepage = https://github.com/firecat53/urlscan;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ dpaetzel jfrankenau ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/urlview/default.nix b/nixpkgs/pkgs/applications/misc/urlview/default.nix
new file mode 100644
index 000000000000..8764c41c8a4c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/urlview/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl, ncurses, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  version    = "0.9";
+  patchLevel = "19";
+
+  name = "urlview-${version}-${patchLevel}";
+
+  urlBase = "mirror://debian/pool/main/u/urlview/";
+
+  src = fetchurl {
+    url = urlBase + "urlview_${version}.orig.tar.gz";
+    sha256 = "746ff540ccf601645f500ee7743f443caf987d6380e61e5249fc15f7a455ed42";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ ncurses ];
+
+  preAutoreconf = ''
+    touch NEWS
+  '';
+
+  preConfigure = ''
+    mkdir -p $out/share/man/man1
+  '';
+
+  debianPatches = fetchurl {
+    url = urlBase + "urlview_${version}-${patchLevel}.diff.gz";
+    sha256 = "056883c17756f849fb9235596d274fbc5bc0d944fcc072bdbb13d1e828301585";
+  };
+
+  patches = debianPatches;
+
+  meta = {
+    description = "Extract URLs from text";
+    homepage = https://packages.qa.debian.org/u/urlview.html;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = with stdenv.lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/usync/default.nix b/nixpkgs/pkgs/applications/misc/usync/default.nix
new file mode 100644
index 000000000000..d12120ca2f11
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/usync/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchFromGitHub, scsh, rsync, unison }:
+
+stdenv.mkDerivation rec {
+  pname = "usync";
+  version = "0.0.3";
+  name = "${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "ebzzry";
+    repo = pname;
+    rev = "9c87ea8a707a47c3d7f6ef94d07591c5ab594282";
+    sha256 = "1r05gw041fz9dkkb70zd6kqw9dd8dhpv87407qxqg43pd7x47kf4";
+  };
+
+  installPhase = ''
+    install -m 555 -Dt $out/bin $pname
+  '';
+
+  postFixup = ''
+    substituteInPlace $out/bin/$pname --replace "/usr/bin/env scsh" "${scsh}/bin/scsh"
+    substituteInPlace $out/bin/$pname --replace "(rsync " "(${rsync}/bin/rsync "
+    substituteInPlace $out/bin/$pname --replace "(unison " "(${unison}/bin/unison "
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/ebzzry/usync;
+    description = "A simple site-to-site synchronization tool";
+    license = licenses.mit;
+    maintainers = [ maintainers.ebzzry ];
+    platforms = platforms.unix;
+  };
+
+  dontBuild = true;
+}
diff --git a/nixpkgs/pkgs/applications/misc/valentina/default.nix b/nixpkgs/pkgs/applications/misc/valentina/default.nix
new file mode 100644
index 000000000000..6752b0182fea
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/valentina/default.nix
@@ -0,0 +1,66 @@
+{ stdenv, fetchhg
+, qmake, qttools
+, qtbase, qtsvg, qtxmlpatterns
+, poppler_utils
+}:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "valentina-${version}";
+  version = "0.6.1";
+
+  src = fetchhg {
+    url = "https://bitbucket.org/dismine/valentina";
+    rev = "v${version}";
+    sha256 = "0dxk2av7xbsd233sr9wa1hamzb7pp8yx6p5b43rsnvnzchkqf423";
+  };
+
+  postPatch = ''
+    substituteInPlace common.pri \
+      --replace '$$[QT_INSTALL_HEADERS]/QtXmlPatterns' '${getDev qtxmlpatterns}/include/QtXmlPatterns' \
+      --replace '$$[QT_INSTALL_HEADERS]/QtSvg' '${getDev qtsvg}/include/QtSvg' \
+      --replace '$$[QT_INSTALL_HEADERS]/' '${getDev qtbase}/include/' \
+      --replace '$$[QT_INSTALL_HEADERS]' '${getDev qtbase}'
+    substituteInPlace src/app/tape/tape.pro \
+      --replace '$$[QT_INSTALL_BINS]/rcc' '${getDev qtbase}/bin/rcc'
+    substituteInPlace src/app/translations.pri \
+      --replace '$$[QT_INSTALL_BINS]/$$LRELEASE' '${getDev qttools}/bin/lrelease'
+    substituteInPlace src/app/valentina/mainwindowsnogui.cpp \
+      --replace 'define PDFTOPS "pdftops"' 'define PDFTOPS "${getBin poppler_utils}/bin/pdftops"'
+    substituteInPlace src/app/valentina/dialogs/dialogsavelayout.h \
+      --replace 'define PDFTOPS "pdftops"' 'define PDFTOPS "${getBin poppler_utils}/bin/pdftops"'
+  '';
+
+  nativeBuildInputs = [ qmake qttools ];
+
+  buildInputs = [ qtbase qtsvg qtxmlpatterns poppler_utils ];
+
+  configurePhase = ''
+    qmake PREFIX=/ Valentina.pro -r "CONFIG += noTests noRunPath no_ccache noDebugSymbols"
+  '';
+
+  installFlags = [ "INSTALL_ROOT=$(out)" ];
+
+  postInstall = ''
+    mv $out/usr/share $out/
+    rmdir $out/usr
+
+    mkdir -p $out/share/man/man1
+    gzip -9c dist/debian/valentina.1 > $out/share/man/man1/valentina.1.gz
+    gzip -9c dist/debian/tape.1 > $out/share/man/man1/tape.1.gz
+
+    mkdir -p $out/share/mime/packages
+    cp dist/debian/valentina.sharedmimeinfo $out/share/mime/packages/valentina.xml
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "An open source sewing pattern drafting software";
+    homepage = https://valentinaproject.bitbucket.io/;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ jfrankenau ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/vcal/default.nix b/nixpkgs/pkgs/applications/misc/vcal/default.nix
new file mode 100644
index 000000000000..5cd8de43729b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/vcal/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, lib, fetchurl, perl }:
+
+stdenv.mkDerivation rec {
+  name = "vcal-${version}";
+  version = "2.8";
+
+  src = fetchurl {
+    url    = "https://waynemorrison.com/software/vcal";
+    sha256 = "0jrm0jzqxb1xjp24hwbzlxsh22gjssay9gj4zszljzdm68r5afvc";
+  };
+
+  nativeBuildInputs = [ perl ]; # for pod2man
+
+  dontUnpack = true;
+  dontBuild = true;
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/{bin,share/man/man1}
+    substitute ${src} $out/bin/vcal \
+      --replace /usr/bin/perl ${perl}/bin/perl
+    chmod 0755 $out/bin/*
+    pod2man --name=vcal --release=${version} ${src} > $out/share/man/man1/vcal.1
+
+    runHook postInstall
+  '';
+
+  # There are no tests
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Parser for VCalendar and ICalendar files, usable from the command line";
+    homepage = https://waynemorrison.com/software/;
+    license = licenses.asl20;
+    maintainers = with maintainers; [ peterhoeg ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/veracrypt/default.nix b/nixpkgs/pkgs/applications/misc/veracrypt/default.nix
new file mode 100644
index 000000000000..8b64bcca667d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/veracrypt/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, pkgconfig, makeself, yasm, fuse, wxGTK, lvm2 }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  pname = "veracrypt";
+  name = "${pname}-${version}";
+  version = "1.23";
+
+  src = fetchurl {
+    url = "https://launchpad.net/${pname}/trunk/${version}/+download/VeraCrypt_${version}_Source.tar.bz2";
+    sha256 = "009lqi43n2w272sxv7y7dz9sqx15qkx6lszkswr8mwmkpgkm0px1";
+  };
+
+  sourceRoot = "src";
+
+  nativeBuildInputs = [ makeself pkgconfig yasm ];
+  buildInputs = [ fuse lvm2 wxGTK ];
+
+  enableParallelBuilding = true;
+
+  installPhase = ''
+    install -Dm 755 Main/${pname} "$out/bin/${pname}"
+    install -Dm 444 Resources/Icons/VeraCrypt-256x256.xpm "$out/share/pixmaps/${pname}.xpm"
+    install -Dm 444 License.txt -t "$out/share/doc/${pname}/"
+    install -d $out/share/applications
+    substitute Setup/Linux/${pname}.desktop $out/share/applications/${pname}.desktop \
+      --replace "Exec=/usr/bin/veracrypt" "Exec=$out/bin/veracrypt" \
+      --replace "Icon=veracrypt" "Icon=veracrypt.xpm"
+  '';
+
+  meta = {
+    description = "Free Open-Source filesystem on-the-fly encryption";
+    homepage = https://www.veracrypt.fr/;
+    license = [ licenses.asl20 /* or */ "TrueCrypt License version 3.0" ];
+    maintainers = with maintainers; [ dsferruzza ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/verbiste/default.nix b/nixpkgs/pkgs/applications/misc/verbiste/default.nix
new file mode 100644
index 000000000000..f23862c63cd4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/verbiste/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, pkgconfig, libgnomeui, libxml2 }:
+
+stdenv.mkDerivation rec {
+  name = "verbiste-${version}";
+
+  version = "0.1.45";
+
+  src = fetchurl {
+    url = "https://perso.b2b2c.ca/~sarrazip/dev/${name}.tar.gz";
+    sha256 = "180zyhdjspp7lk2291wsqs6bm7y27r7bd00447iimmjpx372s22c";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  buildInputs = [ libgnomeui libxml2 ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = http://sarrazip.com/dev/verbiste.html;
+    description = "French and Italian verb conjugator";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/vifm/default.nix b/nixpkgs/pkgs/applications/misc/vifm/default.nix
new file mode 100644
index 000000000000..9696ebac98bc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/vifm/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl
+, pkgconfig
+, ncurses, libX11
+, utillinux, file, which, groff
+}:
+
+stdenv.mkDerivation rec {
+  name = "vifm-${version}";
+  version = "0.10";
+
+  src = fetchurl {
+    url = "https://github.com/vifm/vifm/releases/download/v${version}/vifm-${version}.tar.bz2";
+    sha256 = "1f380xcyjnm4xmcdazs6dj064bwddhywvn3mgm36k7r7b2gnjnp0";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ ncurses libX11 utillinux file which groff ];
+
+  meta = with stdenv.lib; {
+    description = "A vi-like file manager";
+    maintainers = with maintainers; [ raskin ];
+    platforms = platforms.unix;
+    license = licenses.gpl2;
+    downloadPage = "https://vifm.info/downloads.shtml";
+    homepage = https://vifm.info/;
+    inherit version;
+    updateWalker = true;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/viking/default.nix b/nixpkgs/pkgs/applications/misc/viking/default.nix
new file mode 100644
index 000000000000..50f2012d34ab
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/viking/default.nix
@@ -0,0 +1,51 @@
+{ fetchurl, stdenv, makeWrapper, pkgconfig, intltool, gettext, gtk2, expat, curl
+, gpsd, bc, file, gnome-doc-utils, libexif, libxml2, libxslt, scrollkeeper
+, docbook_xml_dtd_412, gexiv2, sqlite, gpsbabel, expect, hicolor-icon-theme
+, geoclue2, liboauth }:
+
+stdenv.mkDerivation rec {
+  name = "viking-${version}";
+  version = "1.7";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/viking/viking/viking-${version}.tar.bz2";
+    sha256 = "092q2dv0rcz12nh2js1z1ralib1553dmzy9pdrvz9nv2vf61wybw";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ makeWrapper intltool gettext gtk2 expat curl gpsd bc file gnome-doc-utils
+    libexif libxml2 libxslt scrollkeeper docbook_xml_dtd_412 gexiv2 sqlite hicolor-icon-theme
+    geoclue2 liboauth
+  ];
+
+  configureFlags = [ "--disable-scrollkeeper --disable-mapnik" ];
+
+  preBuild = ''
+    sed -i help/Makefile \
+        -e 's|--noout|--noout --nonet --path "${scrollkeeper}/share/xml/scrollkeeper/dtds"|g'
+    sed -i help/Makefile -e 's|--postvalid||g'
+  '';
+
+  doCheck = true;
+
+  postInstall = ''
+    wrapProgram $out/bin/viking \
+      --prefix PATH : "${gpsbabel}/bin" \
+      --prefix PATH : "${expect}/bin"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "GPS data editor and analyzer";
+    longDescription = ''
+      Viking is a free/open source program to manage GPS data.  You
+      can import and plot tracks and waypoints, show Openstreetmaps
+      and/or Terraserver maps under it, download geocaches for an area
+      on the map, make new tracks and waypoints, see real-time GPS
+      position, etc.
+    '';
+    homepage = https://sourceforge.net/projects/viking/;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ pSub ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/visidata/default.nix b/nixpkgs/pkgs/applications/misc/visidata/default.nix
new file mode 100644
index 000000000000..5ebc98b57123
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/visidata/default.nix
@@ -0,0 +1,29 @@
+{ buildPythonApplication, lib, fetchFromGitHub
+, dateutil, pyyaml, openpyxl, xlrd, h5py, fonttools, lxml, pandas, pyshp
+}:
+buildPythonApplication rec {
+  name = "${pname}-${version}";
+  pname = "visidata";
+  version = "1.5.2";
+
+  src = fetchFromGitHub {
+    owner = "saulpw";
+    repo = "visidata";
+    rev = "v${version}";
+    sha256 = "19gs8i6chrrwibz706gib5sixx1cjgfzh7v011kp3izcrn524mc0";
+  };
+
+  propagatedBuildInputs = [dateutil pyyaml openpyxl xlrd h5py fonttools
+    lxml pandas pyshp ];
+
+  doCheck = false;
+
+  meta = {
+    inherit version;
+    description = "Interactive terminal multitool for tabular data";
+    license = lib.licenses.gpl3 ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
+    homepage = "http://visidata.org/";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/vit/default.nix b/nixpkgs/pkgs/applications/misc/vit/default.nix
new file mode 100644
index 000000000000..3eb797f182e7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/vit/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchFromGitHub
+, makeWrapper, which
+, taskwarrior, ncurses, perlPackages }:
+
+stdenv.mkDerivation rec {
+  pname = "vit";
+  version = "1.3";
+
+  src = fetchFromGitHub {
+    owner = "scottkosty";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0a34rh5w8393wf7jwwr0f74rp1zv2vz606z5j8sr7w19k352ijip";
+  };
+
+  preConfigure = ''
+    substituteInPlace Makefile.in \
+      --replace sudo ""
+    substituteInPlace configure \
+      --replace /usr/bin/perl ${perlPackages.perl}/bin/perl
+    substituteInPlace cmdline.pl \
+      --replace "view " "vim -R "
+  '';
+
+  postInstall = ''
+    wrapProgram $out/bin/vit --prefix PERL5LIB : $PERL5LIB
+  '';
+
+  nativeBuildInputs = [ makeWrapper which ];
+  buildInputs = [ taskwarrior ncurses ]
+    ++ (with perlPackages; [ perl Curses TryTiny TextCharWidth ]);
+
+  meta = with stdenv.lib; {
+    description = "Visual Interactive Taskwarrior";
+    maintainers = with maintainers; [ dtzWill ];
+    platforms = platforms.all;
+    license = licenses.gpl3;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/volnoti/default.nix b/nixpkgs/pkgs/applications/misc/volnoti/default.nix
new file mode 100644
index 000000000000..166811fb4ae3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/volnoti/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, fetchpatch
+, pkgconfig, dbus, gdk_pixbuf, glib, libX11, gtk2, librsvg
+, dbus-glib, autoreconfHook, wrapGAppsHook }:
+
+stdenv.mkDerivation rec {
+  name = "volnoti-unstable-${version}";
+  version = "2013-09-23";
+
+  src = fetchFromGitHub {
+    owner = "davidbrazdil";
+    repo = "volnoti";
+    rev = "4af7c8e54ecc499097121909f02ecb42a8a60d24";
+    sha256 = "155lb7w563dkdkdn4752hl0zjhgnq3j4cvs9z98nb25k1xpmpki7";
+  };
+
+  patches = [
+    # Fix dbus interface headers. See
+    # https://github.com/davidbrazdil/volnoti/pull/10
+    (fetchpatch {
+      url = "https://github.com/davidbrazdil/volnoti/pull/10.patch";
+      sha256 = "046zfdjmvhb7jrsgh04vfgi35sgy1zkrhd3bzdby3nvds1wslfam";
+    })
+  ];
+
+  nativeBuildInputs = [ pkgconfig autoreconfHook wrapGAppsHook ];
+
+  buildInputs = [
+    dbus gdk_pixbuf glib libX11 gtk2 dbus-glib librsvg
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Lightweight volume notification for Linux";
+    homepage = https://github.com/davidbrazdil/volnoti;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.gilligan ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/vp/default.nix b/nixpkgs/pkgs/applications/misc/vp/default.nix
new file mode 100644
index 000000000000..e794b82e2f6e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/vp/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, SDL, SDL_image }:
+
+stdenv.mkDerivation rec {
+  name = "vp-${version}";
+  version = "1.8";
+
+  src = fetchFromGitHub {
+    owner = "erikg";
+    repo = "vp";
+    rev = "v${version}";
+    sha256 = "08q6xrxsyj6vj0sz59nix9isqz84gw3x9hym63lz6v8fpacvykdq";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  buildInputs = [ SDL SDL_image ];
+
+  NIX_CFLAGS_COMPILE="-I${SDL}/include/SDL -I${SDL_image}/include/SDL";
+
+  meta = with stdenv.lib; {
+    homepage = http://brlcad.org/~erik/;
+    description = "SDL based picture viewer/slideshow";
+    platforms = platforms.unix;
+    license  = licenses.gpl3;
+    maintainers = [ maintainers.vrthra ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/vue/default.nix b/nixpkgs/pkgs/applications/misc/vue/default.nix
new file mode 100644
index 000000000000..1feec9e45509
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/vue/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, jre, runtimeShell }:
+
+stdenv.mkDerivation rec {
+  name = "vue-${version}";
+  version = "3.3.0";
+  src = fetchurl {
+    url = "http://releases.atech.tufts.edu/jenkins/job/VUE/116/deployedArtifacts/download/artifact.1";
+    sha256 = "0yfzr80pw632lkayg4qfmwzrqk02y30yz8br7isyhmgkswyp5rnx";
+  };
+
+  phases = "installPhase";
+
+  installPhase = ''
+    mkdir -p "$out"/{share/vue,bin}
+    cp ${src} "$out/share/vue/vue.jar"
+    echo '#!${runtimeShell}' >> "$out/bin/vue"
+    echo '${jre}/bin/java -jar "'"$out/share/vue/vue.jar"'" "$@"' >> "$out/bin/vue"
+    chmod a+x "$out/bin/vue"
+  '';
+
+  meta = {
+    description = "Visual Understanding Environment - mind mapping software";
+    maintainers = with stdenv.lib.maintainers; [ raskin ];
+    platforms = with stdenv.lib.platforms; linux;
+    license = stdenv.lib.licenses.free; # Apache License fork, actually
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/vym/default.nix b/nixpkgs/pkgs/applications/misc/vym/default.nix
new file mode 100644
index 000000000000..48818ca3b8b1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/vym/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, pkgconfig, qmake, qtsvg }:
+
+stdenv.mkDerivation rec {
+  name = "vym-${version}";
+  version = "2.6.11";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/vym/2.6.0/${name}.tar.bz2";
+    sha256 = "1yznlb47jahd662a2blgh1ccwpl5dp5rjz9chsxjzhj3vbkzx3nl";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  nativeBuildInputs = [ pkgconfig qmake ];
+  buildInputs = [ qtsvg ];
+
+  meta = with stdenv.lib; {
+    description = "A mind-mapping software";
+    longDescription = ''
+      VYM (View Your Mind) is a tool to generate and manipulate maps which show your thoughts.
+      Such maps can help you to improve your creativity and effectivity. You can use them
+      for time management, to organize tasks, to get an overview over complex contexts,
+      to sort your ideas etc.
+
+      Maps can be drawn by hand on paper or a flip chart and help to structure your thoughs.
+      While a tree like structure like shown on this page can be drawn by hand or any drawing software
+      vym offers much more features to work with such maps.
+    '';
+    homepage = http://www.insilmaril.de/vym/;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/waybar/default.nix b/nixpkgs/pkgs/applications/misc/waybar/default.nix
new file mode 100644
index 000000000000..0be04c895e35
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/waybar/default.nix
@@ -0,0 +1,53 @@
+{ stdenv, fetchFromGitHub, meson, pkgconfig, ninja
+, wayland, wlroots, gtkmm3, libinput, libsigcxx, jsoncpp, fmt, spdlog
+, traySupport  ? true,  libdbusmenu-gtk3
+, pulseSupport ? false, libpulseaudio
+, nlSupport    ? true,  libnl
+, udevSupport  ? true,  udev
+, swaySupport  ? true,  sway
+, mpdSupport   ? true,  mpd_clientlib
+}:
+  stdenv.mkDerivation rec {
+    pname = "waybar";
+    version = "0.7.0";
+
+    src = fetchFromGitHub {
+      owner = "Alexays";
+      repo = "Waybar";
+      rev = version;
+      sha256 = "0fylq8sz00zv7jvjp7pgckabvmhanpcsqfvpw8c84vy4d8dvqbkx";
+    };
+
+    nativeBuildInputs = [
+      meson ninja pkgconfig
+    ];
+
+    buildInputs = with stdenv.lib;
+      [ wayland wlroots gtkmm3 libinput libsigcxx jsoncpp fmt spdlog ]
+      ++ optional  traySupport  libdbusmenu-gtk3
+      ++ optional  pulseSupport libpulseaudio
+      ++ optional  nlSupport    libnl
+      ++ optional  udevSupport  udev
+      ++ optional  swaySupport  sway
+      ++ optional  mpdSupport   mpd_clientlib;
+
+    mesonFlags = (stdenv.lib.mapAttrsToList
+      (option: enable: "-D${option}=${if enable then "enabled" else "disabled"}")
+      {
+        dbusmenu-gtk = traySupport;
+        pulseaudio = pulseSupport;
+        libnl = nlSupport;
+        libudev = udevSupport;
+        mpd = mpdSupport;
+      }
+    ) ++ [
+      "-Dout=${placeholder "out"}"
+    ];
+
+    meta = with stdenv.lib; {
+      description = "Highly customizable Wayland bar for Sway and Wlroots based compositors";
+      license = licenses.mit;
+      maintainers = with maintainers; [ FlorianFranzen minijackson synthetica ];
+      platforms = platforms.unix;
+    };
+  }
diff --git a/nixpkgs/pkgs/applications/misc/wcalc/default.nix b/nixpkgs/pkgs/applications/misc/wcalc/default.nix
new file mode 100644
index 000000000000..1c6dc8f63c23
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/wcalc/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, mpfr, readline }:
+
+stdenv.mkDerivation rec {
+  name = "wcalc-${version}";
+  version = "2.5";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/w-calc/${name}.tar.bz2";
+    sha256 = "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f";
+  };
+
+  buildInputs = [ mpfr readline ];
+
+  meta = with stdenv.lib; {
+    description = "A command line calculator";
+    homepage = http://w-calc.sourceforge.net;
+    license = licenses.gpl2;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/weather/default.nix b/nixpkgs/pkgs/applications/misc/weather/default.nix
new file mode 100644
index 000000000000..90fa01661543
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/weather/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, pythonPackages }:
+
+stdenv.mkDerivation rec {
+    version = "2.3";
+    name = "weather-${version}";
+
+    src = fetchurl {
+        url = "http://fungi.yuggoth.org/weather/src/${name}.tar.xz";
+        sha256 = "0inij30prqqcmzjwcmfzjjn0ya5klv18qmajgxipz1jr3lpqs546";
+    };
+
+    nativeBuildInputs = [ pythonPackages.wrapPython ];
+
+    buildInputs = [ pythonPackages.python ];
+
+    phases = [ "unpackPhase" "installPhase" ];
+
+    installPhase = ''
+        site_packages=$out/${pythonPackages.python.sitePackages}
+        mkdir -p $out/{share/{man,weather-util},bin,etc} $site_packages
+        cp weather $out/bin/
+        cp weather.py $site_packages/
+        chmod +x $out/bin/weather
+        cp airports overrides.{conf,log} places slist stations zctas zlist zones $out/share/weather-util/
+        cp weatherrc $out/etc
+        cp weather.1 weatherrc.5 $out/share/man/
+        sed -i \
+          -e "s|/etc|$out/etc|g" \
+          -e "s|else: default_setpath = \".:~/.weather|&:$out/share/weather-util|" \
+          $site_packages/weather.py
+        wrapPythonPrograms
+    '';
+
+    meta = {
+        homepage = http://fungi.yuggoth.org/weather;
+        description = "Quick access to current weather conditions and forecasts";
+        license = stdenv.lib.licenses.isc;
+        maintainers = [ stdenv.lib.maintainers.matthiasbeyer ];
+        platforms = with stdenv.lib.platforms; linux; # my only platform
+    };
+}
diff --git a/nixpkgs/pkgs/applications/misc/wego/default.nix b/nixpkgs/pkgs/applications/misc/wego/default.nix
new file mode 100644
index 000000000000..a3d3ace009e1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/wego/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, buildGoPackage, fetchgit }:
+
+buildGoPackage rec {
+  name = "wego-${version}";
+  version = "20170403-${stdenv.lib.strings.substring 0 7 rev}";
+  rev = "415efdfab5d5ee68300bf261a0c6f630c6c2584c";
+  
+  goPackagePath = "github.com/schachmat/wego";
+
+  src = fetchgit {
+    inherit rev;
+    url = "https://github.com/schachmat/wego";
+    sha256 = "0w8sypwg0s2mvhk9cdibqr8bz5ipiiacs60a39sdswrpc4z486hg";
+  };
+
+  goDeps = ./deps.nix;
+
+  meta = {
+    license = stdenv.lib.licenses.isc;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/wego/deps.nix b/nixpkgs/pkgs/applications/misc/wego/deps.nix
new file mode 100644
index 000000000000..74ab69a30e14
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/wego/deps.nix
@@ -0,0 +1,38 @@
+[
+  {
+    goPackagePath = "github.com/mattn/go-isatty";
+    fetch = {
+      type = "git";
+      url = "https://github.com/mattn/go-isatty";
+      rev = "v0.0.4";
+      sha256 = "0zs92j2cqaw9j8qx1sdxpv3ap0rgbs0vrvi72m40mg8aa36gd39w";
+    };
+  }
+  {
+    goPackagePath = "github.com/mattn/go-runewidth";
+    fetch = {
+      type = "git";
+      url = "https://github.com/mattn/go-runewidth";
+      rev = "v0.0.4";
+      sha256 = "00b3ssm7wiqln3k54z2wcnxr3k3c7m1ybyhb9h8ixzbzspld0qzs";
+    };
+  }
+  {
+    goPackagePath = "github.com/mattn/go-colorable";
+    fetch = {
+      type = "git";
+      url = "https://github.com/mattn/go-colorable";
+      rev = "v0.0.9";
+      sha256 = "1nwjmsppsjicr7anq8na6md7b1z84l9ppnlr045hhxjvbkqwalvx";
+    };
+  }
+  {
+    goPackagePath = "github.com/schachmat/ingo";
+    fetch = {
+      type = "git";
+      url = "https://github.com/schachmat/ingo";
+      rev = "a4bdc0729a3fda62cc4069b6e490fc657fd54e33";
+      sha256 = "1gw0kddy7jh3467imsqni86cf9yq7k6vpfc0ywkbwj0zsjsdgd49";
+    };
+  }
+]
diff --git a/nixpkgs/pkgs/applications/misc/wikicurses/default.nix b/nixpkgs/pkgs/applications/misc/wikicurses/default.nix
new file mode 100644
index 000000000000..d8628b794d71
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/wikicurses/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, pythonPackages }:
+
+pythonPackages.buildPythonApplication rec {
+  version = "1.4";
+  name = "wikicurses-${version}";
+
+  src = fetchFromGitHub {
+    owner = "ids1024";
+    repo = "wikicurses";
+    rev = "v${version}";
+    sha256 = "0f14s4qx3q5pr5vn460c34b5mbz2xs62d8ljs3kic8gmdn8x2knm";
+  };
+
+  propagatedBuildInputs = with pythonPackages; [ urwid beautifulsoup4 lxml ];
+
+  meta = {
+    description = "A simple curses interface for MediaWiki sites such as Wikipedia";
+    homepage = https://github.com/ids1024/wikicurses/;
+    license = stdenv.lib.licenses.mit;
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = with stdenv.lib.maintainers; [ pSub ];
+  };
+
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/with-shell/default.nix b/nixpkgs/pkgs/applications/misc/with-shell/default.nix
new file mode 100644
index 000000000000..6a5f7c17b208
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/with-shell/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchFromGitHub }:
+stdenv.mkDerivation {
+  name = "with-2016-08-20";
+  src = fetchFromGitHub {
+    owner = "mchav";
+    repo = "With";
+    rev = "cc2828bddd92297147d4365765f4ef36385f050a";
+    sha256 = "10m2xv6icrdp6lfprw3a9hsrzb3bip19ipkbmscap0niddqgcl9b";
+  };
+  installPhase = ''
+    mkdir -p $out/bin
+    cp with $out/bin/with
+  '';
+  meta = {
+    homepage = https://github.com/mchav/With;
+    description = "Command prefixing for continuous workflow using a single tool";
+    license = stdenv.lib.licenses.asl20;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/wmname/default.nix b/nixpkgs/pkgs/applications/misc/wmname/default.nix
new file mode 100644
index 000000000000..68f6c4df1593
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/wmname/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, libX11 }:
+
+stdenv.mkDerivation rec {
+  name = "wmname-0.1";
+
+  src = fetchurl {
+    url = "https://dl.suckless.org/tools/${name}.tar.gz";
+    sha256 = "559ad188b2913167dcbb37ecfbb7ed474a7ec4bbcb0129d8d5d08cb9208d02c5";
+  };
+
+  buildInputs = [ libX11 ];
+
+  preConfigure = [ ''sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk'' ];
+
+  meta = {
+    description = "Prints or set the window manager name property of the root window";
+    homepage = https://tools.suckless.org/wmname;
+    license = stdenv.lib.licenses.mit;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/wordnet/default.nix b/nixpkgs/pkgs/applications/misc/wordnet/default.nix
new file mode 100644
index 000000000000..5d153a0e417f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/wordnet/default.nix
@@ -0,0 +1,52 @@
+{stdenv, fetchurl, tcl, tk, xlibsWrapper, makeWrapper}:
+
+stdenv.mkDerivation rec {
+  version = "3.0";
+  name = "wordnet-${version}";
+  src = fetchurl {
+    url = "http://wordnetcode.princeton.edu/${version}/WordNet-${version}.tar.bz2";
+    sha256 = "08pgjvd2vvmqk3h641x63nxp7wqimb9r30889mkyfh2agc62sjbc";
+  };
+
+  buildInputs = [tcl tk xlibsWrapper makeWrapper];
+
+  hardeningDisable = [ "format" ];
+
+  patchPhase = ''
+    sed "13i#define USE_INTERP_RESULT 1" -i src/stubs.c
+  '';
+
+  # Needs the path to `tclConfig.sh' and `tkConfig.sh'.
+  configureFlags = [
+    "--with-tcl=${tcl}/lib"
+    "--with-tk=${tk}/lib"
+  ];
+
+  postInstall = ''
+    wrapProgram $out/bin/wishwn --set TK_LIBRARY "${tk}/lib/${tk.libPrefix}"
+    wrapProgram $out/bin/wnb    --prefix PATH : "$out/bin"
+  '';
+
+  meta = {
+    description = "Lexical database for the English language";
+
+    longDescription =
+      '' WordNet® is a large lexical database of English.  Nouns, verbs,
+         adjectives and adverbs are grouped into sets of cognitive synonyms
+         (synsets), each expressing a distinct concept.  Synsets are
+         interlinked by means of conceptual-semantic and lexical relations.
+         The resulting network of meaningfully related words and concepts can
+         be navigated with the browser.  WordNet is also freely and publicly
+         available for download.  WordNet's structure makes it a useful tool
+         for computational linguistics and natural language processing.
+      '';
+
+    homepage = https://wordnet.princeton.edu/;
+    license = {
+      fullName = "WordNet 3.0 license";
+      url = https://wordnet.princeton.edu/license-and-commercial-use;
+    };
+    maintainers = [ ];
+    platforms = with stdenv.lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/worker/default.nix b/nixpkgs/pkgs/applications/misc/worker/default.nix
new file mode 100644
index 000000000000..69421e288d34
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/worker/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, libX11, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "worker-${version}";
+  version = "4.0.0";
+
+  src = fetchurl {
+    url = "http://www.boomerangsworld.de/cms/worker/downloads/${name}.tar.gz";
+    sha256 = "0cs1sq7zpp787r1irhqk5pmxa26rjz55mbgda4823z9zkzwfxy19";
+  };
+
+  buildInputs = [ libX11 ];
+
+  meta = with stdenv.lib; {
+    description = "A two-pane file manager with advanced file manipulation features";
+    homepage = http://www.boomerangsworld.de/cms/worker/index.html;
+    license =  licenses.gpl2;
+    maintainers = [ maintainers.ndowens ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/workrave/default.nix b/nixpkgs/pkgs/applications/misc/workrave/default.nix
new file mode 100644
index 000000000000..1547d2962116
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/workrave/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchFromGitHub, wrapGAppsHook
+, autoconf, autoconf-archive, automake, gettext, intltool, libtool, pkgconfig
+, libICE, libSM, libXScrnSaver, libXtst, cheetah
+, gobject-introspection, glib, glibmm, gtkmm3, atk, pango, pangomm, cairo
+, cairomm , dbus, dbus-glib, gdome2, gstreamer, gst-plugins-base
+, gst-plugins-good, libsigcxx }:
+
+stdenv.mkDerivation rec {
+  name = "workrave-${version}";
+  version = "1.10.31";
+
+  src = let
+  in fetchFromGitHub {
+    sha256 = "0v2mx2idaxlsyv5w66b7pknlill9j9i2gqcs3vq54gak7ix9fj1p";
+    rev = with stdenv.lib;
+      "v" + concatStringsSep "_" (splitString "." version);
+    repo = "workrave";
+    owner = "rcaelers";
+  };
+
+  nativeBuildInputs = [
+    autoconf autoconf-archive automake gettext intltool libtool pkgconfig wrapGAppsHook
+  ];
+  buildInputs = [
+    libICE libSM libXScrnSaver libXtst cheetah
+    gobject-introspection glib glibmm gtkmm3 atk pango pangomm cairo cairomm
+    dbus dbus-glib gdome2 gstreamer gst-plugins-base gst-plugins-good libsigcxx
+  ];
+
+  preConfigure = "./autogen.sh";
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A program to help prevent Repetitive Strain Injury";
+    longDescription = ''
+      Workrave is a program that assists in the recovery and prevention of
+      Repetitive Strain Injury (RSI). The program frequently alerts you to
+      take micro-pauses, rest breaks and restricts you to your daily limit.
+    '';
+    homepage = http://www.workrave.org/;
+    downloadPage = https://github.com/rcaelers/workrave/releases;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ prikhi ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/wtf/default.nix b/nixpkgs/pkgs/applications/misc/wtf/default.nix
new file mode 100644
index 000000000000..13e4ed81a592
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/wtf/default.nix
@@ -0,0 +1,28 @@
+{ buildGoModule
+, fetchFromGitHub
+, lib
+}:
+
+buildGoModule rec {
+  pname = "wtf";
+  version = "0.11.0";
+
+  src = fetchFromGitHub {
+    owner = "wtfutil";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1b671jhf3xaaisgpiad5apmvwkp40qr2hm4n21m0ya7k5ckps09z";
+  };
+
+  modSha256 = "0as736nnx7ci4w9gdp27g55g6dny9bh1fryz3g89gxm2sa2nlb9l";
+
+  buildFlagsArray = [ "-ldflags=" "-X main.version=${version}" ];
+
+  meta = with lib; {
+    description = "The personal information dashboard for your terminal";
+    homepage = http://wtfutil.com/;
+    license = licenses.mpl20;
+    maintainers = with maintainers; [ kalbasit ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xastir/default.nix b/nixpkgs/pkgs/applications/misc/xastir/default.nix
new file mode 100644
index 000000000000..987b676034f6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xastir/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, autoreconfHook
+, curl, db, libgeotiff
+, libXpm, libXt, motif, pcre
+, perl, proj, rastermagick, shapelib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xastir";
+  version = "2.1.2";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "Release-${version}";
+    sha256 = "1xfzd2m4l0zbb96ak2pniffxdrs9lax0amkxfgdsnyg8x5j0xcxm";
+  };
+
+  buildInputs = [
+    autoreconfHook
+    curl db libgeotiff
+    libXpm libXt motif pcre
+    perl proj rastermagick shapelib
+  ];
+
+  configureFlags = [ "--with-motif-includes=${motif}/include" ];
+
+  postPatch = "patchShebangs .";
+
+  meta = with stdenv.lib; {
+    description = "Graphical APRS client";
+    homepage = https://xastir.org;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.ehmry ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xautoclick/default.nix b/nixpkgs/pkgs/applications/misc/xautoclick/default.nix
new file mode 100644
index 000000000000..bf3d9b737a9e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xautoclick/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, xorg, pkgconfig
+, gtkSupport ? true, gtk2
+, qtSupport ? true, qt4
+}:
+
+stdenv.mkDerivation rec {
+  version = "0.31";
+  name = "xautoclick-${version}";
+  src = fetchurl {
+    url = "mirror://sourceforge/project/xautoclick/xautoclick/xautoclick-0.31/xautoclick-0.31.tar.gz";
+    sha256 = "0h522f12a7v2b89411xm51iwixmjp2mp90rnizjgiakx9ajnmqnm";
+  };
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ xorg.libX11 xorg.libXtst xorg.xinput xorg.libXi xorg.libXext ]
+    ++ stdenv.lib.optionals gtkSupport [ gtk2 ]
+    ++ stdenv.lib.optionals qtSupport [ qt4 ];
+  patchPhase = ''
+    substituteInPlace configure --replace /usr/X11R6 ${xorg.libX11.dev}
+  '';
+  preConfigure = stdenv.lib.optional qtSupport ''
+    mkdir .bin
+    ln -s ${qt4}/bin/moc .bin/moc-qt4
+    addToSearchPath PATH .bin
+    sed -i -e "s@LD=\$_cc@LD=\$_cxx@" configure
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Autoclicker application, which enables you to automatically click the left mousebutton";
+    homepage = http://xautoclick.sourceforge.net;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xca/default.nix b/nixpkgs/pkgs/applications/misc/xca/default.nix
new file mode 100644
index 000000000000..280b30128727
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xca/default.nix
@@ -0,0 +1,33 @@
+{ mkDerivation, lib, fetchFromGitHub, autoreconfHook, perl, pkgconfig
+, libtool, openssl, qtbase, qttools }:
+
+mkDerivation rec {
+  name = "xca-${version}";
+  version = "2.1.2";
+
+  src = fetchFromGitHub {
+    owner  = "chris2511";
+    repo   = "xca";
+    rev    = "RELEASE.${version}";
+    sha256 = "0slfqmz0b01lwmrv4h78hmrsdrhcyc7sjzsxcw05ylgmhvdq3dw9";
+  };
+
+  postPatch = ''
+    substituteInPlace doc/code2html \
+      --replace /usr/bin/perl ${perl}/bin/perl
+  '';
+
+  buildInputs = [ libtool openssl qtbase ];
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig qttools ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "An x509 certificate generation tool, handling RSA, DSA and EC keys, certificate signing requests (PKCS#10) and CRLs";
+    homepage    = https://hohnstaedt.de/xca/;
+    license     = licenses.bsd3;
+    maintainers = with maintainers; [ offline peterhoeg ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xchm/default.nix b/nixpkgs/pkgs/applications/misc/xchm/default.nix
new file mode 100644
index 000000000000..a7a6500fd22a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xchm/default.nix
@@ -0,0 +1,22 @@
+{stdenv, fetchurl, wxGTK, chmlib}:
+
+stdenv.mkDerivation {
+  name = "xchm-1.23";
+  src = fetchurl {
+    url = mirror://sourceforge/xchm/xchm-1.23.tar.gz;
+    sha256 = "0qn0fyxcrn30ndq2asx31k0qkx3grbm16fb1y580wd2gjmh5r3wg";
+  };
+  buildInputs = [wxGTK chmlib];
+
+  postConfigure = ''
+    export NIX_LDFLAGS="$NIX_LDFLAGS $(${wxGTK}/lib/wx/config/* --libs | sed -e s@-pthread@@)"
+    echo $NIX_LDFLAGS
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A viewer for Microsoft HTML Help files";
+    homepage = http://xchm.sourceforge.net;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xcruiser/default.nix b/nixpkgs/pkgs/applications/misc/xcruiser/default.nix
new file mode 100644
index 000000000000..8875c95fe578
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xcruiser/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, gccmakedep, imake, libXt, libXaw, libXpm, libXext }:
+
+stdenv.mkDerivation {
+  name = "xcruiser-0.30";
+
+  src = fetchurl {
+      url = mirror://sourceforge/xcruiser/xcruiser/xcruiser-0.30/xcruiser-0.30.tar.gz;
+      sha256 = "1r8whva38xizqdh7jmn6wcmfmsndc67pkw22wzfzr6rq0vf6hywi";
+    };
+
+  nativeBuildInputs = [ gccmakedep imake ];
+  buildInputs = [ libXt libXaw libXpm libXext ];
+
+  makeFlags = [
+    "BINDIR=$(out)/bin"
+    "XAPPLOADDIR=$(out)/etc/X11/app-defaults"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Filesystem visualization utility";
+    longDescription = ''
+      XCruiser, formerly known as XCruise, is a filesystem visualization utility.
+      It constructs a virtually 3-D formed universe from a directory
+      tree and allows you to "cruise" within a visualized filesystem.
+    '';
+    homepage = http://xcruiser.sourceforge.net/;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ ehmry ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xdgmenumaker/default.nix b/nixpkgs/pkgs/applications/misc/xdgmenumaker/default.nix
new file mode 100644
index 000000000000..ed7f2b27c381
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xdgmenumaker/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchFromGitHub, txt2tags, python2Packages }:
+
+stdenv.mkDerivation rec {
+  name = "xdgmenumaker-${version}";
+  version = "1.5";
+
+  src = fetchFromGitHub {
+    owner = "gapan";
+    repo = "xdgmenumaker";
+    rev = version;
+    sha256 = "1vrsp5c1ah7p4dpwd6aqvinpwzd8crdimvyyr3lbm3c6cwpyjmif";
+  };
+
+  nativeBuildInputs = [
+    txt2tags
+    python2Packages.wrapPython
+  ];
+
+  pythonPath = [
+    python2Packages.pyxdg
+    python2Packages.pygtk
+  ];
+
+  installPhase = ''
+    make install PREFIX=$out DESTDIR=
+    wrapProgram "$out/bin/xdgmenumaker" \
+      --prefix XDG_DATA_DIRS : "$out/share"
+    wrapPythonPrograms
+  '';
+  
+  meta = with stdenv.lib; {
+    description = "Command line tool that generates XDG menus for several window managers";
+    homepage = https://github.com/gapan/xdgmenumaker;
+    license = licenses.gpl2Plus;
+    # NOTE: exclude darwin from platforms because Travis reports hash mismatch
+    platforms = with platforms; filter (x: !(elem x darwin)) unix;
+    maintainers = [ maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xfe/default.nix b/nixpkgs/pkgs/applications/misc/xfe/default.nix
new file mode 100644
index 000000000000..444ab802673e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xfe/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, fox, pkgconfig, gettext, xlibsWrapper, gcc, intltool, file, libpng }:
+
+stdenv.mkDerivation rec {
+  name = "xfe-1.42";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xfe/${name}.tar.gz";
+    sha256 = "1v1v0vcbnm30kpyd3rj8f56yh7lfnwy7nbs9785wi229b29fiqx1";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ fox gettext xlibsWrapper gcc intltool file libpng ];
+
+  preConfigure = ''
+    sed -i s,/usr/share/xfe,$out/share/xfe, src/xfedefs.h
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "MS-Explorer like file manager for X";
+    longDescription = ''
+      X File Explorer (Xfe) is an MS-Explorer like file manager for X.
+      It is based on the popular, but discontinued, X Win Commander, which was developed by Maxim Baranov.
+      Xfe aims to be the filemanager of choice for all the Unix addicts!
+    '';
+    homepage = https://sourceforge.net/projects/xfe/;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xfontsel/default.nix b/nixpkgs/pkgs/applications/misc/xfontsel/default.nix
new file mode 100644
index 000000000000..5d2b70a80ee4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xfontsel/default.nix
@@ -0,0 +1,36 @@
+# This program used to come with xorg releases, but now I could only find it
+# at https://www.x.org/releases/individual/.
+# That is why this expression is not inside pkgs.xorg
+
+{stdenv, fetchurl, makeWrapper, libX11, pkgconfig, libXaw}:
+stdenv.mkDerivation rec {
+  name = "xfontsel-1.0.6";
+
+  src = fetchurl {
+    url = "mirror://xorg/individual/app/${name}.tar.bz2";
+    sha256 = "0700lf6hx7dg88wq1yll7zjvf9gbwh06xff20yffkxb289y0pai5";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [libX11 makeWrapper libXaw];
+
+  # Without this, it gets Xmu as a dependency, but without rpath entry
+  NIX_LDFLAGS = "-lXmu";
+
+  # This will not make xfontsel find its app-defaults, but at least the $out
+  # directory will contain them.
+  # hack: Copying the XFontSel app-defaults file to $HOME makes xfontsel work.
+  installPhase = ''
+    make install appdefaultdir=$out/share/X11/app-defaults
+    wrapProgram $out/bin/xfontsel \
+      --set XAPPLRESDIR $out/share/X11/app-defaults
+  '';
+
+  meta = {
+    homepage = https://www.x.org/;
+    description = "Allows testing the fonts available in an X server";
+    license = stdenv.lib.licenses.free;
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xiphos/default.nix b/nixpkgs/pkgs/applications/misc/xiphos/default.nix
new file mode 100644
index 000000000000..88ab52313b06
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xiphos/default.nix
@@ -0,0 +1,55 @@
+{ stdenv, fetchFromGitHub, pkgconfig
+, python
+, intltool
+, docbook2x, docbook_xml_dtd_412, libxslt
+, sword, clucene_core, biblesync
+, gnome-doc-utils
+, libgsf, gconf
+, gtkhtml, libglade, scrollkeeper
+, webkitgtk
+, dbus-glib, enchant, isocodes, libuuid, icu
+, wrapGAppsHook
+, wafHook
+}:
+
+stdenv.mkDerivation rec {
+  name = "xiphos-${version}";
+  version = "4.0.7";
+
+  src = fetchFromGitHub {
+    owner = "crosswire";
+    repo = "xiphos";
+    rev = "${version}";
+    sha256 = "1vwf1ps6nrajxl1qbs6v1cgykmq5wn4j09j10gbcd3b2nvrprf3g";
+  };
+
+  nativeBuildInputs = [ pkgconfig wrapGAppsHook wafHook ];
+  buildInputs = [ python intltool docbook2x docbook_xml_dtd_412 libxslt
+                  sword clucene_core biblesync gnome-doc-utils libgsf gconf gtkhtml
+                  libglade scrollkeeper webkitgtk dbus-glib enchant isocodes libuuid icu ];
+
+  prePatch = ''
+    patchShebangs .;
+  '';
+
+  preConfigure =  ''
+    export CLUCENE_HOME=${clucene_core};
+    export SWORD_HOME=${sword};
+  '';
+
+  wafConfigureFlags = [ "--enable-webkit2" ];
+
+  meta = with stdenv.lib; {
+    description = "A GTK Bible study tool";
+    longDescription = ''
+      Xiphos (formerly known as GnomeSword) is a Bible study tool
+      written for Linux, UNIX, and Windows using GTK, offering a rich
+      and featureful environment for reading, study, and research using
+      modules from The SWORD Project and elsewhere.
+    '';
+    homepage = http://www.xiphos.org/;
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xkbd/default.nix b/nixpkgs/pkgs/applications/misc/xkbd/default.nix
new file mode 100644
index 000000000000..3023e830dc79
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xkbd/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchFromGitHub, freetype, libXrender, libXft, xorgproto
+, xinput, libXi, libXext, libXtst, libXpm, libX11, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  name = "xkbd-${version}";
+  version = "0.8.18";
+
+  src = fetchFromGitHub {
+    owner = "mahatma-kaganovich";
+    repo = "xkbd";
+    rev = name;
+    sha256 = "05ry6q75jq545kf6p20nhfywaqf2wdkfiyp6iwdpv9jh238hf7m9";
+  };
+
+  buildInputs = [
+    freetype libXrender libXft libXext libXtst libXpm libX11
+    libXi xorgproto xinput
+  ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/mahatma-kaganovich/xkbd;
+    description = "onscreen soft keyboard for X11";
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.genesis ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xkblayout-state/default.nix b/nixpkgs/pkgs/applications/misc/xkblayout-state/default.nix
new file mode 100644
index 000000000000..3f3865d7688a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xkblayout-state/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, qt4 }:
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "xkblayout-state";
+  version = "1b";
+
+  src = fetchurl {
+    url = "https://github.com/nonpop/${pname}/archive/v${version}.tar.gz";
+    sha256 = "1m1nnplrdb2mclhj0881wf78ckvdnyk24g4k4p5s5gpd96cxxwnx";
+  };
+
+  buildInputs = [ qt4 ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp xkblayout-state $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A small command-line program to get/set the current XKB keyboard layout";
+    homepage = https://github.com/nonpop/xkblayout-state;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.jagajaga ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xkbmon/default.nix b/nixpkgs/pkgs/applications/misc/xkbmon/default.nix
new file mode 100644
index 000000000000..4fa1c833df53
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xkbmon/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, libX11 }:
+
+stdenv.mkDerivation rec {
+  name = "xkbmon-${version}";
+  version = "0.3";
+
+  src = fetchFromGitHub {
+    owner = "xkbmon";
+    repo = "xkbmon";
+    rev = version;
+    sha256 = "03v8f6fijgwagjphyj8w7lgh5hlc8jk0j2n45n7fm0xwy82cxxx9";
+  };
+
+  buildInputs = [ libX11 ];
+
+  installPhase = "install -D -t $out/bin xkbmon";
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/xkbmon/xkbmon;
+    description = "Command-line keyboard layout monitor for X11";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xmind/default.nix b/nixpkgs/pkgs/applications/misc/xmind/default.nix
new file mode 100644
index 000000000000..fc5abf109894
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xmind/default.nix
@@ -0,0 +1,90 @@
+{ stdenv, lib, fetchzip, fetchurl, gtk2, jre, libXtst, makeWrapper, makeDesktopItem, runtimeShell }:
+
+stdenv.mkDerivation rec {
+  name = "xmind-${version}";
+  version = "8-update8";
+
+  src = fetchzip {
+    url = "https://xmind.net/xmind/downloads/${name}-linux.zip";
+    stripRoot = false;
+    sha256 = "1p68z0b4brgiyybz190alqv716ncql49vsksm41y90mcjd8s4jhn";
+  };
+
+  srcIcon = fetchurl {
+    url = "https://aur.archlinux.org/cgit/aur.git/plain/xmind.png?h=xmind";
+    sha256 = "0jxq2fiq69q9ly0m6hx2qfybqad22sl42ciw636071khpqgc885f";
+  };
+
+  patches = [ ./java-env-config-fixes.patch ];
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  dontBuild = true;
+  dontPatchELF = true;
+  dontStrip = true;
+
+  libPath = lib.makeLibraryPath [ gtk2 libXtst ];
+
+  desktopItem = makeDesktopItem {
+    name = "XMind";
+    exec = "XMind";
+    icon = "xmind";
+    desktopName = "XMind";
+    comment = meta.description;
+    categories = "Office;";
+    mimeType = "application/xmind;xscheme-handler/xmind";
+  };
+
+  installPhase = let
+    targetDir = if stdenv.hostPlatform.system == "i686-linux"
+      then "XMind_i386"
+      else "XMind_amd64";
+  in ''
+    mkdir -p $out/{bin,libexec/configuration/,share/{applications/,fonts/,icons/hicolor/scalable/apps/}}
+    cp -r ${targetDir}/{configuration,p2,XMind{,.ini}} $out/libexec
+    cp -r {plugins,features} $out/libexec/
+    cp -r fonts $out/share/fonts/
+    cp "${desktopItem}/share/applications/XMind.desktop" $out/share/applications/XMind.desktop
+    cp ${srcIcon} $out/share/icons/hicolor/scalable/apps/xmind.png
+
+    patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
+      $out/libexec/XMind
+
+    wrapProgram $out/libexec/XMind \
+      --prefix LD_LIBRARY_PATH : "${libPath}"
+
+    # Inspired by https://aur.archlinux.org/cgit/aur.git/tree/?h=xmind
+    cat >$out/bin/XMind <<EOF
+      #! ${runtimeShell}
+      if [ ! -d "\$HOME/.xmind" ]; then
+        mkdir -p "\$HOME/.xmind/configuration-cathy/"
+        cp -r $out/libexec/configuration/ \$HOME/.xmind/configuration-cathy/
+      fi
+
+      exec "$out/libexec/XMind" "$@"
+    EOF
+    chmod +x $out/bin/XMind
+
+    ln -s ${jre} $out/libexec/jre
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Mind-mapping software";
+    longDescription = ''
+      XMind is a mind mapping and brainstorming software. In addition
+      to the management elements, the software can capture ideas,
+      clarify thinking, manage complex information, and promote team
+      collaboration for higher productivity.
+
+      It supports mind maps, fishbone diagrams, tree diagrams,
+      organization charts, spreadsheets, etc. Normally, it is used for
+      knowledge management, meeting minutes, task management, and
+      GTD. Meanwhile, XMind can read FreeMind and MindManager files,
+      and save to Evernote.
+    '';
+    homepage = https://www.xmind.net/;
+    license = licenses.unfree;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ michalrus ma27 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xmind/java-env-config-fixes.patch b/nixpkgs/pkgs/applications/misc/xmind/java-env-config-fixes.patch
new file mode 100644
index 000000000000..f359a9c2ba46
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xmind/java-env-config-fixes.patch
@@ -0,0 +1,40 @@
+diff --git a/XMind_amd64/XMind.ini b/XMind_amd64/XMind.ini
+index bdd8a37..5f35daf 100644
+--- a/XMind_amd64/XMind.ini
++++ b/XMind_amd64/XMind.ini
+@@ -1,11 +1,11 @@
+ -configuration
+-./configuration
++@user.home/.xmind/configuration-cathy_linux_64
+ -data
+-../workspace
++@user.home/.xmind/workspace-cathy
+ -startup
+-../plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
++plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
+ --launcher.library
+-../plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.400.v20160518-1444
++plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.400.v20160518-1444
+ --launcher.defaultAction
+ openFile
+ --launcher.GTK_version
+diff --git a/XMind_i386/XMind.ini b/XMind_i386/XMind.ini
+index 4ed3225..1d74258 100644
+--- a/XMind_i386/XMind.ini
++++ b/XMind_i386/XMind.ini
+@@ -1,11 +1,11 @@
+ -configuration
+-./configuration
++@user.home/.xmind/configuration-cathy_linux_64
+ -data
+-../workspace
++@user.home/.xmind/workspace-cathy
+ -startup
+-../plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
++plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
+ --launcher.library
+-../plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.400.v20160518-1444
++plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.400.v20160518-1444
+ --launcher.defaultAction
+ openFile
+ --launcher.GTK_version
diff --git a/nixpkgs/pkgs/applications/misc/xmr-stak/default.nix b/nixpkgs/pkgs/applications/misc/xmr-stak/default.nix
new file mode 100644
index 000000000000..fcd4ebfbeed2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xmr-stak/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, stdenvGcc6, lib
+, fetchFromGitHub, cmake, libmicrohttpd, openssl
+, opencl-headers, ocl-icd, hwloc, cudatoolkit
+, devDonationLevel ? "0.0"
+, cudaSupport ? false
+, openclSupport ? true
+}:
+
+let
+  stdenv' = if cudaSupport then stdenvGcc6 else stdenv;
+in
+
+stdenv'.mkDerivation rec {
+  name = "xmr-stak-${version}";
+  version = "2.10.5";
+
+  src = fetchFromGitHub {
+    owner = "fireice-uk";
+    repo = "xmr-stak";
+    rev = "${version}";
+    sha256 = "16b6bj0rsr3cq9x3gxm54j197827d8lnfk7ghfjmaf7qa3q08adx";
+  };
+
+  NIX_CFLAGS_COMPILE = "-O3";
+
+  cmakeFlags = lib.optional (!cudaSupport) "-DCUDA_ENABLE=OFF"
+    ++ lib.optional (!openclSupport) "-DOpenCL_ENABLE=OFF";
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libmicrohttpd openssl hwloc ]
+    ++ lib.optional cudaSupport cudatoolkit
+    ++ lib.optionals openclSupport [ opencl-headers ocl-icd ];
+
+  postPatch = ''
+    substituteInPlace xmrstak/donate-level.hpp \
+      --replace 'fDevDonationLevel = 2.0' 'fDevDonationLevel = ${devDonationLevel}'
+  '';
+
+  meta = with lib; {
+    description = "Unified All-in-one Monero miner";
+    homepage = "https://github.com/fireice-uk/xmr-stak";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ fpletz bfortz ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xmrig/default.nix b/nixpkgs/pkgs/applications/misc/xmrig/default.nix
new file mode 100644
index 000000000000..9afe3cae07bf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xmrig/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, lib, fetchFromGitHub, cmake, libuv, libmicrohttpd, openssl
+, donateLevel ? 0
+}:
+
+stdenv.mkDerivation rec {
+  name = "xmrig-${version}";
+  version = "2.14.4";
+
+  src = fetchFromGitHub {
+    owner = "xmrig";
+    repo = "xmrig";
+    rev = "v${version}";
+    sha256 = "0hmla9ys9gmmcrmkidw05ygiz734rs7skb9w86jnwxi5nlpxqrhj";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libuv libmicrohttpd openssl ];
+
+  postPatch = ''
+    substituteInPlace src/donate.h \
+      --replace "kDefaultDonateLevel = 5;" "kDefaultDonateLevel = ${toString donateLevel};" \
+      --replace "kMinimumDonateLevel = 1;" "kMinimumDonateLevel = ${toString donateLevel};"
+  '';
+
+  installPhase = ''
+    install -vD xmrig $out/bin/xmrig
+  '';
+
+  meta = with lib; {
+    description = "Monero (XMR) CPU miner";
+    homepage = "https://github.com/xmrig/xmrig";
+    license = licenses.gpl3Plus;
+    platforms   = [ "x86_64-linux" "x86_64-darwin" ];
+    maintainers = with maintainers; [ fpletz ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xmrig/proxy.nix b/nixpkgs/pkgs/applications/misc/xmrig/proxy.nix
new file mode 100644
index 000000000000..4922d3c6aed1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xmrig/proxy.nix
@@ -0,0 +1,38 @@
+{ stdenv, lib, fetchFromGitHub, cmake, libuv, libmicrohttpd, libuuid, openssl
+, donateLevel ? 0
+}:
+
+stdenv.mkDerivation rec {
+  name = "xmrig-proxy-${version}";
+  version = "2.14.4";
+
+  src = fetchFromGitHub {
+    owner = "xmrig";
+    repo = "xmrig-proxy";
+    rev = "v${version}";
+    sha256 = "11q4w5ncyyf2vgrb64zlr01n3adyaxja2pcqm5id9if0nvwwn4ga";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libuv libmicrohttpd libuuid openssl ];
+
+  postPatch = ''
+    # Set default donation level to 0%. Can be increased at runtime via --donate-level option.
+    substituteInPlace src/donate.h \
+      --replace "kDefaultDonateLevel = 2;" "kDefaultDonateLevel = ${toString donateLevel};"
+
+    # Link dynamically against libuuid instead of statically
+    substituteInPlace CMakeLists.txt --replace uuid.a uuid
+  '';
+
+  installPhase = ''
+    install -vD xmrig-proxy $out/bin/xmrig-proxy
+  '';
+
+  meta = with lib; {
+    description = "Monero (XMR) Stratum protocol proxy";
+    homepage = "https://github.com/xmrig/xmrig-proxy";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ aij ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xneur/default.nix b/nixpkgs/pkgs/applications/misc/xneur/default.nix
new file mode 100644
index 000000000000..c6438a21f2c3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xneur/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, pkgconfig, intltool, xorg, pcre, gst_all_1, glib
+, xosd, libnotify, enchant, wrapGAppsHook, gdk_pixbuf }:
+
+stdenv.mkDerivation rec {
+   name = "xneur-${version}";
+   version = "0.20.0";
+
+  src = fetchurl {
+    url = "https://github.com/AndrewCrewKuznetsov/xneur-devel/raw/f66723feb272c68f7c22a8bf0dbcafa5e3a8a5ee/dists/0.20.0/xneur_0.20.0.orig.tar.gz";
+    sha256 = "1lg3qpi9pkx9f5xvfc8yf39wwc98f769yb7i2438vqn66kla1xpr";
+  };
+
+  nativeBuildInputs = [
+    pkgconfig intltool wrapGAppsHook
+  ];
+
+  buildInputs = [
+    xorg.libX11 xorg.libXtst pcre gst_all_1.gstreamer glib
+    xosd xorg.libXext xorg.libXi libnotify
+    enchant gdk_pixbuf
+    gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good
+  ];
+
+  postPatch = ''
+    sed -e 's@for xosd_dir in@for xosd_dir in ${xosd} @' -i configure
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Utility for switching between keyboard layouts";
+    homepage = https://xneur.ru;
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xpad/default.nix b/nixpkgs/pkgs/applications/misc/xpad/default.nix
new file mode 100644
index 000000000000..5db4a2508399
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xpad/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl
+, autoreconfHook, pkgconfig, wrapGAppsHook
+, glib, intltool, gtk3, gtksourceview, hicolor-icon-theme }:
+
+stdenv.mkDerivation rec {
+  name = "xpad-${version}";
+  version = "5.4.0";
+
+  src = fetchurl {
+    url = "https://launchpad.net/xpad/trunk/${version}/+download/xpad-${version}.tar.bz2";
+    sha256 = "1qpmlwn0bcw1q73ag0l0fdnlzmwawfvsy4g9y5b0vyrc58lcp5d3";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig wrapGAppsHook ];
+
+  buildInputs = [ glib intltool gtk3 gtksourceview hicolor-icon-theme ];
+
+  meta = with stdenv.lib; {
+    description = "A sticky note application for jotting down things to remember";
+    homepage = https://launchpad.net/xpad;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ michalrus ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xpdf/cmake_version.patch b/nixpkgs/pkgs/applications/misc/xpdf/cmake_version.patch
new file mode 100644
index 000000000000..59a51f7506d5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xpdf/cmake_version.patch
@@ -0,0 +1,15 @@
+
+Fix "No known features for CXX compiler", see
+https://cmake.org/pipermail/cmake/2016-December/064733.html and the note at
+https://cmake.org/cmake/help/v3.10/command/cmake_minimum_required.html
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -8,7 +8,7 @@
+ #
+ #========================================================================
+ 
+-cmake_minimum_required(VERSION 2.8.8)
++cmake_minimum_required(VERSION 3.1.0)
+ 
+ project(xpdf)
+ 
diff --git a/nixpkgs/pkgs/applications/misc/xpdf/default.nix b/nixpkgs/pkgs/applications/misc/xpdf/default.nix
new file mode 100644
index 000000000000..eb76448391e3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xpdf/default.nix
@@ -0,0 +1,63 @@
+{ enableGUI ? true, enablePDFtoPPM ? true, useT1Lib ? false
+, stdenv, fetchurl, zlib, libpng, freetype ? null, t1lib ? null
+, cmake, qtbase ? null, qtsvg ? null, makeWrapper
+}:
+
+assert enableGUI -> qtbase != null && qtsvg != null && freetype != null;
+assert enablePDFtoPPM -> freetype != null;
+assert useT1Lib -> t1lib != null;
+
+assert !useT1Lib; # t1lib has multiple unpatched security vulnerabilities
+
+stdenv.mkDerivation {
+  name = "xpdf-4.00";
+
+   src = fetchurl {
+    url = http://www.xpdfreader.com/dl/xpdf-4.00.tar.gz;
+    sha256 = "1mhn89738vjva14xr5gblc2zrdgzmpqbbjdflqdmpqv647294ggz";
+  };
+
+  # Fix "No known features for CXX compiler", see
+  # https://cmake.org/pipermail/cmake/2016-December/064733.html and the note at
+  # https://cmake.org/cmake/help/v3.10/command/cmake_minimum_required.html
+  patches = stdenv.lib.optional stdenv.isDarwin  ./cmake_version.patch;
+
+  nativeBuildInputs = [ cmake makeWrapper ];
+
+  cmakeFlags = ["-DSYSTEM_XPDFRC=/etc/xpdfrc" "-DA4_PAPER=ON"];
+
+  buildInputs = [ zlib libpng ] ++
+    stdenv.lib.optional enableGUI qtbase ++
+    stdenv.lib.optional useT1Lib t1lib ++
+    stdenv.lib.optional enablePDFtoPPM freetype;
+
+  # Debian uses '-fpermissive' to bypass some errors on char* constantness.
+  CXXFLAGS = "-O2 -fpermissive";
+
+  hardeningDisable = [ "format" ];
+
+  postInstall = stdenv.lib.optionalString (stdenv.isDarwin && enableGUI) ''
+    wrapProgram $out/bin/xpdf \
+      --set QT_PLUGIN_PATH ${qtbase.bin}/${qtbase.qtPluginPrefix}:${qtsvg.bin}/${qtbase.qtPluginPrefix}
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://www.xpdfreader.com;
+    description = "Viewer for Portable Document Format (PDF) files";
+    longDescription = ''
+      XPDF includes multiple tools for viewing and processing PDF files.
+        xpdf:      PDF viewer (with Graphical Interface)
+        pdftotext: converts PDF to text
+        pdftops:   converts PDF to PostScript
+        pdftoppm:  converts PDF pages to netpbm (PPM/PGM/PBM) image files
+        pdftopng:  converts PDF pages to PNG image files
+        pdftohtml: converts PDF to HTML
+        pdfinfo:   extracts PDF metadata
+        pdfimages: extracts raw images from PDF files
+        pdffonts:  lists fonts used in PDF files
+        pdfdetach: extracts attached files from PDF files
+    '';
+    license = with licenses; [ gpl2 gpl3 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xpdf/libxpdf.nix b/nixpkgs/pkgs/applications/misc/xpdf/libxpdf.nix
new file mode 100644
index 000000000000..cf6f5f32ee2a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xpdf/libxpdf.nix
@@ -0,0 +1,52 @@
+{ stdenv, fetchurl
+}:
+
+stdenv.mkDerivation {
+  name = "libxpdf-3.02pl4";
+
+  src = fetchurl {
+    url = ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02.tar.gz;
+    sha256 = "000zq4ddbwyxiki4vdwpmxbnw5n9hsg9hvwra2p33hslyib7sfmk";
+  };
+  
+  patches = [
+    (fetchurl {
+      url = ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02pl1.patch;
+      sha256 = "1wxv9l0d2kkwi961ihpdwi75whdvk7cgqxkbfym8cjj11fq17xjq";
+    })
+    (fetchurl {
+      url = ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02pl2.patch;
+      sha256 = "1nfrgsh9xj0vryd8h65myzd94bjz117y89gq0hzji9dqn23xihfi";
+    })
+    (fetchurl {
+      url = ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02pl3.patch;
+      sha256 = "0jskkv8x6dqr9zj4azaglas8cziwqqrkbbnzrpm2kzrvsbxyhk2r";
+    })
+    (fetchurl {
+      url = ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02pl4.patch;
+      sha256 = "1c48h7aizx0ngmzlzw0mpja1w8vqyy3pg62hyxp7c60k86al715h";
+    })
+    ./xpdf-3.02-protection.patch
+    ./libxpdf.patch
+  ];
+
+  installPhase = ''
+    mkdir -p $out/lib/goo
+    mkdir -p $out/lib/fofi
+    mkdir -p $out/lib/xpdf
+    mkdir -p $out/include
+
+    cp -v goo/libGoo.a $out/lib/goo
+    cp -v fofi/libfofi.a $out/lib/fofi
+    cp -v xpdf/libxpdf.a $out/lib/xpdf
+    
+    cp -v *.h $out/include
+    cp -v goo/*.h $out/include
+    cp -v fofi/*.h $out/include
+    cp -v xpdf/*.h $out/include
+  '';
+    
+  meta = {
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xpdf/libxpdf.patch b/nixpkgs/pkgs/applications/misc/xpdf/libxpdf.patch
new file mode 100644
index 000000000000..606da76c7293
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xpdf/libxpdf.patch
@@ -0,0 +1,45 @@
+diff -rc xpdf-3.02/xpdf/Makefile.in xpdf-3.02-new/xpdf/Makefile.in
+*** xpdf-3.02/xpdf/Makefile.in	2007-02-27 23:05:52.000000000 +0100
+--- xpdf-3.02-new/xpdf/Makefile.in	2010-08-25 14:54:14.000000000 +0200
+***************
+*** 110,116 ****
+  	pdffonts$(EXE) pdftoppm$(EXE) pdfimages$(EXE)
+  
+  all-no-x: pdftops$(EXE) pdftotext$(EXE) pdfinfo$(EXE) pdffonts$(EXE) \
+! 	pdfimages$(EXE)
+  
+  #------------------------------------------------------------------------
+  
+--- 110,116 ----
+  	pdffonts$(EXE) pdftoppm$(EXE) pdfimages$(EXE)
+  
+  all-no-x: pdftops$(EXE) pdftotext$(EXE) pdfinfo$(EXE) pdffonts$(EXE) \
+! 	pdfimages$(EXE) libxpdf.a
+  
+  #------------------------------------------------------------------------
+  
+***************
+*** 248,253 ****
+--- 248,269 ----
+  
+  #------------------------------------------------------------------------
+  
++ PDFTOEPDF_OBJS = \
++         Array.o BuiltinFont.o BuiltinFontTables.o CMap.o \
++         Catalog.o CharCodeToUnicode.o Decrypt.o Dict.o Error.o \
++         FontEncodingTables.o Gfx.o GfxFont.o GfxState.o \
++         GlobalParams.o JArithmeticDecoder.o JBIG2Stream.o JPXStream.o Lexer.o Link.o \
++         NameToCharCode.o Object.o OutputDev.o Outline.o PDFDoc.o Page.o \
++         Parser.o PDFDocEncoding.o Stream.o UnicodeMap.o XRef.o Function.o \
++         PSTokenizer.o UnicodeTypeTable.o
++ 
++ libxpdf.a: $(PDFTOEPDF_OBJS)
++ 	rm -f $@
++ 	$(AR) $(ARFLAGS) $@ *.o
++ 	ranlib $@
++ 
++ #------------------------------------------------------------------------
++ 
+  depend:
+  	$(CXX) $(CXXFLAGS) -MM $(CXX_SRC) >Makefile.dep
+  
diff --git a/nixpkgs/pkgs/applications/misc/xpdf/xpdf-3.02-protection.patch b/nixpkgs/pkgs/applications/misc/xpdf/xpdf-3.02-protection.patch
new file mode 100644
index 000000000000..598fc6dbd073
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xpdf/xpdf-3.02-protection.patch
@@ -0,0 +1,74 @@
+diff -C 3 -r orig/xpdf/pdfimages.cc xpdf-3.02/xpdf/pdfimages.cc
+*** orig/xpdf/pdfimages.cc	2007-02-27 23:05:52.000000000 +0100
+--- xpdf-3.02/xpdf/pdfimages.cc	2007-10-31 20:17:22.601449943 +0100
+***************
+*** 118,130 ****
+      goto err1;
+    }
+  
+-   // check for copy permission
+-   if (!doc->okToCopy()) {
+-     error(-1, "Copying of images from this document is not allowed.");
+-     exitCode = 3;
+-     goto err1;
+-   }
+- 
+    // get page range
+    if (firstPage < 1)
+      firstPage = 1;
+--- 118,123 ----
+diff -C 3 -r orig/xpdf/pdftotext.cc xpdf-3.02/xpdf/pdftotext.cc
+*** orig/xpdf/pdftotext.cc	2007-02-27 23:05:52.000000000 +0100
+--- xpdf-3.02/xpdf/pdftotext.cc	2007-10-31 20:17:34.392224196 +0100
+***************
+*** 160,172 ****
+      goto err2;
+    }
+  
+-   // check for copy permission
+-   if (!doc->okToCopy()) {
+-     error(-1, "Copying of text from this document is not allowed.");
+-     exitCode = 3;
+-     goto err2;
+-   }
+- 
+    // construct text file name
+    if (argc == 3) {
+      textFileName = new GString(argv[2]);
+--- 160,165 ----
+diff -C 3 -r orig/xpdf/XPDFCore.cc xpdf-3.02/xpdf/XPDFCore.cc
+*** orig/xpdf/XPDFCore.cc	2007-02-27 23:05:52.000000000 +0100
+--- xpdf-3.02/xpdf/XPDFCore.cc	2007-10-31 20:18:05.370494431 +0100
+***************
+*** 384,394 ****
+  #ifndef NO_TEXT_SELECT
+        if (selectULX != selectLRX &&
+  	  selectULY != selectLRY) {
+! 	if (doc->okToCopy()) {
+! 	  copySelection();
+! 	} else {
+! 	  error(-1, "Copying of text from this document is not allowed.");
+! 	}
+        }
+  #endif
+      }
+--- 384,390 ----
+  #ifndef NO_TEXT_SELECT
+        if (selectULX != selectLRX &&
+  	  selectULY != selectLRY) {
+! 	copySelection();
+        }
+  #endif
+      }
+***************
+*** 407,415 ****
+    int pg;
+    double ulx, uly, lrx, lry;
+  
+-   if (!doc->okToCopy()) {
+-     return;
+-   }
+    if (getSelection(&pg, &ulx, &uly, &lrx, &lry)) {
+      //~ for multithreading: need a mutex here
+      if (currentSelection) {
+--- 403,408 ----
diff --git a/nixpkgs/pkgs/applications/misc/xrandr-invert-colors/default.nix b/nixpkgs/pkgs/applications/misc/xrandr-invert-colors/default.nix
new file mode 100644
index 000000000000..bb3385ad016a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xrandr-invert-colors/default.nix
@@ -0,0 +1,26 @@
+{ fetchurl, stdenv, libXrandr}:
+
+stdenv.mkDerivation rec {
+  version = "0.01";
+  name = "xrandr-invert-colors-${version}";
+  src = fetchurl {
+    url = "https://github.com/zoltanp/xrandr-invert-colors/archive/v${version}.tar.gz";
+    sha256 = "1z4hxn56rlflvqanb8ncqa1xqawnda85b1b37w6r2iqs8rw52d75";
+  };
+
+  buildInputs = [ libXrandr ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mv xrandr-invert-colors.bin xrandr-invert-colors
+    install xrandr-invert-colors $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Inverts the colors of your screen";
+    license = stdenv.lib.licenses.gpl3Plus;
+    homepage = https://github.com/zoltanp/xrandr-invert-colors;
+    maintainers = [stdenv.lib.maintainers.magnetophon ];
+    platforms = platforms.linux;
+  }; 
+}
diff --git a/nixpkgs/pkgs/applications/misc/xrq/default.nix b/nixpkgs/pkgs/applications/misc/xrq/default.nix
new file mode 100644
index 000000000000..fe65004b32ae
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xrq/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchFromGitHub, libX11}:
+
+stdenv.mkDerivation rec {
+  name = "xrq-unstable-2016-01-15";
+
+  src = fetchFromGitHub {
+	  owner = "arianon";
+	  repo = "xrq";
+    rev = "d5dc19c63881ebdd1287a02968e3a1447dde14a9";
+    sha256 = "1bxf6h3fjw3kjraz7028m7p229l423y1ngy88lqvf0xl1g3dhp36";
+  };
+
+  installPhase = ''
+    make PREFIX=$out install
+  '';
+
+  outputs = [ "out" "man" ];
+
+  buildInputs = [ libX11 ];
+
+  meta = {
+    description = "X utility for querying xrdb";
+    homepage = https://github.com/arianon/xrq;
+    license = stdenv.lib.licenses.mit;
+    platforms = with stdenv.lib.platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xscope/default.nix b/nixpkgs/pkgs/applications/misc/xscope/default.nix
new file mode 100644
index 000000000000..28ce4a0d500d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xscope/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, pkgconfig, libXt }:
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "xscope";
+  version = "1.4.1";
+
+  src = fetchurl {
+    url = "mirror://xorg/individual/app/${name}.tar.bz2";
+    sha256 = "08zl3zghvbcqy0r5dn54dim84lp52s0ygrr87jr3a942a6ypz01k";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ libXt ];
+
+  meta = with stdenv.lib; {
+    description = "program to monitor X11/Client conversations";
+    homepage = https://cgit.freedesktop.org/xorg/app/xscope/;
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ ];
+    platforms = with platforms; unix;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/xsuspender/default.nix b/nixpkgs/pkgs/applications/misc/xsuspender/default.nix
new file mode 100644
index 000000000000..ef9ce3393619
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xsuspender/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper, pkgconfig
+, glib, libwnck3, procps }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  name = "xsuspender-${version}";
+  version = "1.1";
+
+  src = fetchFromGitHub {
+    owner = "kernc";
+    repo = "xsuspender";
+    rev = version;
+    sha256 = "03lbga68dxg89d227sdwk1f5xj4r1pmj0qh2kasi2cqh8ll7qv4b";
+  };
+
+  outputs = [ "out" "man" "doc" ];
+
+  nativeBuildInputs = [ cmake pkgconfig makeWrapper ];
+  buildInputs = [ glib libwnck3 ];
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    wrapProgram $out/bin/xsuspender \
+      --prefix PATH : "${makeBinPath [ procps ]}"
+  '';
+
+  meta = {
+    description = "Auto-suspend inactive X11 applications.";
+    homepage = "https://kernc.github.io/xsuspender/";
+    license = licenses.wtfpl;
+    maintainers = with maintainers; [ offline ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xsw/default.nix b/nixpkgs/pkgs/applications/misc/xsw/default.nix
new file mode 100644
index 000000000000..3e8acff00f89
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xsw/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, lib, fetchFromGitHub, pkgconfig, SDL, SDL_image, SDL_ttf, SDL_gfx, flex, bison }:
+
+let
+  makeSDLFlags = map (p: "-I${lib.getDev p}/include/SDL");
+
+in stdenv.mkDerivation rec {
+  name = "xsw-${version}";
+  version = "0.1.2";
+
+  src = fetchFromGitHub {
+    owner = "andrenho";
+    repo = "xsw";
+    rev = version;
+    sha256 = "092vp61ngd2vscsvyisi7dv6qrk5m1i81gg19hyfl5qvjq5p0p8g";
+  };
+
+  nativeBuildInputs = [ pkgconfig flex bison ];
+
+  buildInputs = [ SDL SDL_image SDL_ttf SDL_gfx ];
+
+  NIX_CFLAGS_COMPILE = makeSDLFlags [ SDL SDL_image SDL_ttf SDL_gfx ];
+
+  patches = [
+    ./parse.patch # Fixes compilation error by avoiding redundant definitions.
+  ];
+
+  meta = with stdenv.lib; {
+    inherit (src.meta) homepage;
+    description = "A slide show presentation tool";
+
+    platforms = platforms.unix;
+    license  = licenses.gpl3;
+    maintainers = [ maintainers.vrthra ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xsw/parse.patch b/nixpkgs/pkgs/applications/misc/xsw/parse.patch
new file mode 100644
index 000000000000..6db6c14c26a7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xsw/parse.patch
@@ -0,0 +1,21 @@
+The `%code` causes Color definition to be added in both parser.h and parser.c
+causing duplicate definitions error. This ensures that once it has been included
+as part of parser.h, it wont be redefined in parser.c
+
+--- xsw-0.1.2-src/src/parser.y	1969-12-31 16:00:01.000000000 -0800
++++ xsw-0.1.2-src/src/parser.y	2016-06-28 13:21:35.707027770 -0700
+@@ -38,7 +38,13 @@
+ 
+ %}
+ 
+-%code requires { typedef struct { unsigned char c; } Color; }
++%code requires
++{
++#ifndef COLORDEF
++#define COLORDEF
++typedef struct { unsigned char c; } Color;
++#endif
++}
+ 
+ %token SLIDE COLON HIFEN TEXT X Y W H IMAGE SIZE SCALE TEMPLATE BACKGROUND FONT
+ %token STYLE ALIGN EXPAND PLUS IMAGE_PATH
diff --git a/nixpkgs/pkgs/applications/misc/xteddy/default.nix b/nixpkgs/pkgs/applications/misc/xteddy/default.nix
new file mode 100644
index 000000000000..6f67ed96c57f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xteddy/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchzip, pkg-config, xorg, imlib2, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "xteddy-${version}";
+  version = "2.2";
+  src = fetchzip {
+    url = "https://deb.debian.org/debian/pool/main/x/xteddy/xteddy_${version}.orig.tar.gz";
+    sha256 = "0sap4fqvs0888ymf5ga10p3n7n5kr35j38kfsfd7nj0xm4hmcma3";
+  };
+  nativeBuildInputs = [ pkg-config makeWrapper ];
+  buildInputs = [ imlib2 xorg.libX11 xorg.libXext ];
+
+  makeFlags = [ "LIBS=-lXext" ];
+
+  postPatch = ''
+    sed -i 's/man 1 xteddy/man 6 xteddy/' xteddy.c
+    sed -i "s:/usr/games/xteddy:$out/bin/xteddy:" xtoys
+    sed -i "s:/usr/share/xteddy:$out/share/xteddy:" xtoys
+  '';
+
+  postInstall = ''
+    cp -R images $out/share/images
+    # remove broken test script
+    rm $out/bin/xteddy_test
+  '';
+
+  postFixup = ''
+    # this is needed, because xteddy expects images to reside
+    # in the current working directory
+    wrapProgram $out/bin/xteddy --run "cd $out/share/images/"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Cuddly teddy bear for your X desktop";
+    homepage = https://weber.itn.liu.se/~stegu/xteddy/;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.xaverdh ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xterm/default.nix b/nixpkgs/pkgs/applications/misc/xterm/default.nix
new file mode 100644
index 000000000000..ab33612ded97
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xterm/default.nix
@@ -0,0 +1,71 @@
+{ stdenv, fetchurl, fetchpatch, xorg, ncurses, freetype, fontconfig, pkgconfig, makeWrapper
+, enableDecLocator ? true
+}:
+
+stdenv.mkDerivation rec {
+  name = "xterm-346";
+
+  src = fetchurl {
+    urls = [
+     "ftp://ftp.invisible-island.net/xterm/${name}.tgz"
+     "https://invisible-mirror.net/archives/xterm/${name}.tgz"
+   ];
+    sha256 = "0xwamhawgh77q2nlibciv77hznirwhnbs3r52rl4sdaqq1rpscng";
+  };
+
+  buildInputs =
+    [ xorg.libXaw xorg.xorgproto xorg.libXt xorg.libXext xorg.libX11 xorg.libSM xorg.libICE
+      ncurses freetype fontconfig pkgconfig xorg.libXft xorg.luit makeWrapper
+    ];
+
+  patches = [
+    ./sixel-256.support.patch
+  ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl
+    (fetchpatch {
+      name = "posix-ptys.patch";
+      url = "https://git.alpinelinux.org/cgit/aports/plain/community/xterm/posix-ptys.patch?id=3aa532e77875fa1db18c7fcb938b16647031bcc1";
+      sha256 = "0czgnsxkkmkrk1idw69qxbprh0jb4sw3c24zpnqq2v76jkl7zvlr";
+    });
+
+  configureFlags = [
+    "--enable-wide-chars"
+    "--enable-256-color"
+    "--enable-sixel-graphics"
+    "--enable-regis-graphics"
+    "--enable-load-vt-fonts"
+    "--enable-i18n"
+    "--enable-doublechars"
+    "--enable-luit"
+    "--enable-mini-luit"
+    "--with-tty-group=tty"
+    "--with-app-defaults=$(out)/lib/X11/app-defaults"
+  ] ++ stdenv.lib.optional enableDecLocator "--enable-dec-locator";
+
+  # Work around broken "plink.sh".
+  NIX_LDFLAGS = "-lXmu -lXt -lICE -lX11 -lfontconfig";
+
+  # Hack to get xterm built with the feature of releasing a possible setgid of 'utmp',
+  # decided by the sysadmin to allow the xterm reporting to /var/run/utmp
+  # If we used the configure option, that would have affected the xterm installation,
+  # (setgid with the given group set), and at build time the environment even doesn't have
+  # groups, and the builder will end up removing any setgid.
+  postConfigure = ''
+    echo '#define USE_UTMP_SETGID 1'
+  '';
+
+  postInstall = ''
+    for bin in $out/bin/*; do
+      wrapProgram $bin --set XAPPLRESDIR $out/lib/X11/app-defaults/
+    done
+
+    install -D -t $out/share/applications xterm.desktop
+    install -D -t $out/share/icons/hicolor/48x48/apps icons/xterm-color_48x48.xpm
+  '';
+
+  meta = {
+    homepage = https://invisible-island.net/xterm;
+    license = with stdenv.lib.licenses; [ mit ];
+    maintainers = with stdenv.lib.maintainers; [vrthra];
+    platforms = with stdenv.lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xterm/sixel-256.support.patch b/nixpkgs/pkgs/applications/misc/xterm/sixel-256.support.patch
new file mode 100644
index 000000000000..480e67e89ca3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xterm/sixel-256.support.patch
@@ -0,0 +1,11 @@
+--- xterm-325/graphics.c	2016-05-17 03:04:40.000000000 -0700
++++ xterm-325/graphics.c	2016-06-11 16:37:29.552584281 -0700
+@@ -667,7 +667,7 @@
+     case 330:
+ 	return 4U;
+     case 340:
+-	return 16U;
++	return 256U;
+     case 382:
+ 	return 2U;
+     default:
diff --git a/nixpkgs/pkgs/applications/misc/xtermcontrol/default.nix b/nixpkgs/pkgs/applications/misc/xtermcontrol/default.nix
new file mode 100644
index 000000000000..21f95c65fa56
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xtermcontrol/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "3.7";
+  name = "xtermcontrol-${version}";
+
+  src = fetchurl {
+    url = "https://thrysoee.dk/xtermcontrol/xtermcontrol-${version}.tar.gz";
+    sha256 = "04m12ddaps5sdbqvkwkp6lh81i8vh5ya5gzcxkrkilsga3m6qff2";
+  };
+
+  meta = {
+    description = "Enables dynamic control of xterm properties";
+    longDescription = ''
+      Enables dynamic control of xterm properties.
+      It makes it easy to change colors, title, font and geometry of a running xterm, as well as to report the current settings of these properties.
+      Window manipulations de-/iconify, raise/lower, maximize/restore and reset are also supported.
+      To complete the feature set; xtermcontrol lets advanced users issue any xterm control sequence of their choosing.
+    '';
+    homepage = http://thrysoee.dk/xtermcontrol;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.derchris ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/xxkb/default.nix b/nixpkgs/pkgs/applications/misc/xxkb/default.nix
new file mode 100644
index 000000000000..56638d126c19
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/xxkb/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, libX11, libXt, libXext, libXpm, imake, gccmakedep
+, svgSupport ? false, librsvg, glib, gdk_pixbuf, pkgconfig
+}:
+
+assert svgSupport ->
+  librsvg != null && glib != null && gdk_pixbuf != null && pkgconfig != null;
+
+stdenv.mkDerivation rec {
+  name = "xxkb-1.11.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xxkb/${name}-src.tar.gz";
+    sha256 = "0hl1i38z9xnbgfjkaz04vv1n8xbgfg88g5z8fyzyb2hxv2z37anf";
+  };
+
+  nativeBuildInputs = [ imake gccmakedep ];
+  buildInputs = [
+    libX11 libXt libXext libXpm
+  ] ++ stdenv.lib.optionals svgSupport [ librsvg glib gdk_pixbuf pkgconfig ];
+
+  outputs = [ "out" "man" ];
+
+  imakeFlags = stdenv.lib.optionalString svgSupport "-DWITH_SVG_SUPPORT";
+
+  makeFlags = [
+    "BINDIR=${placeholder "out"}/bin"
+    "PIXMAPDIR=${placeholder "out"}/share/xxkb"
+    "XAPPLOADDIR=${placeholder "out"}/etc/X11/app-defaults"
+    "MANDIR=${placeholder "man"}/share/man"
+  ];
+
+  installTargets = "install install.man";
+
+  meta = {
+    description = "A keyboard layout indicator and switcher";
+    homepage = http://xxkb.sourceforge.net/;
+    license = stdenv.lib.licenses.artistic2;
+    maintainers = with stdenv.lib.maintainers; [ rasendubi ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/yaft/default.nix b/nixpkgs/pkgs/applications/misc/yaft/default.nix
new file mode 100644
index 000000000000..d273d27944a8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/yaft/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, ncurses }:
+
+stdenv.mkDerivation rec {
+  version = "0.2.9";
+  name = "yaft-${version}";
+
+  src = fetchFromGitHub {
+    owner = "uobikiemukot";
+    repo = "yaft";
+    rev = "v${version}";
+    sha256 = "0l1ig8wm545kpn4l7186rymny83jkahnjim290wsl7hsszfq1ckd";
+  };
+
+  buildInputs = [ ncurses ];
+
+  installFlags = [ "PREFIX=$(out)" "MANPREFIX=$(out)/share/man" ];
+
+  meta = {
+    homepage = https://github.com/uobikiemukot/yaft;
+    description = "Yet another framebuffer terminal";
+    license = stdenv.lib.licenses.mit;
+    maintainers = [ stdenv.lib.maintainers.matthiasbeyer ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/yakuake/default.nix b/nixpkgs/pkgs/applications/misc/yakuake/default.nix
new file mode 100644
index 000000000000..8f8494ac45b5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/yakuake/default.nix
@@ -0,0 +1,70 @@
+{ mkDerivation
+, lib
+, fetchurl
+, kdoctools
+, wrapGAppsHook
+, extra-cmake-modules
+, karchive
+, kcrash
+, kdbusaddons
+, ki18n
+, kiconthemes
+, knewstuff
+, knotifications
+, knotifyconfig
+, konsole
+, kparts
+, kwindowsystem
+, qtx11extras
+}:
+
+mkDerivation rec {
+  pname = "yakuake";
+  version = "3.0.5";
+  name = "${pname}-${version}";
+
+    src = fetchurl {
+      url = "http://download.kde.org/stable/${pname}/${version}/src/${name}.tar.xz";
+      sha256 = "021a9mnghffv2mrdl987mn7wbg8bk6bnf6xz8kn2nwsqxp9kpqh8";
+    };
+
+    buildInputs = [
+      karchive
+      kcrash
+      kdbusaddons
+      ki18n
+      kiconthemes
+      knewstuff
+      knotifications
+      knotifyconfig
+      kparts
+      kwindowsystem
+      qtx11extras
+    ];
+
+  propagatedBuildInputs = [
+    karchive
+    kcrash
+    kdbusaddons
+    ki18n
+    kiconthemes
+    knewstuff
+    knotifications
+    knotifyconfig
+    kparts
+    kwindowsystem
+  ];
+
+  propagatedUserEnvPkgs = [ konsole ];
+
+  nativeBuildInputs = [
+    extra-cmake-modules kdoctools wrapGAppsHook
+  ];
+
+  meta = {
+    homepage = https://yakuake.kde.org;
+    description = "Quad-style terminal emulator for KDE";
+    maintainers = with lib.maintainers; [ fridh ];
+    license = lib.licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/yarssr/default.nix b/nixpkgs/pkgs/applications/misc/yarssr/default.nix
new file mode 100644
index 000000000000..a47fb93512db
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/yarssr/default.nix
@@ -0,0 +1,64 @@
+{ fetchFromGitHub, stdenv, lib, gettext, gtk2, makeWrapper, perlPackages, gnome2 }:
+
+let
+  perlDeps = with perlPackages; [
+    Glib Gtk2 Gnome2 Pango Cairo Gnome2Canvas Gnome2VFS Gtk2GladeXML Gtk2TrayIcon
+    XMLLibXML XMLSAXBase XMLParser XMLRSS
+    HTMLParser
+    DateTime DateTimeFormatMail DateTimeFormatW3CDTF DateTimeLocale DateTimeTimeZone
+    ParamsValidate
+    ModuleImplementation ModuleRuntime
+    TryTiny
+    ClassSingleton
+    URI
+    AnyEvent AnyEventHTTP
+    commonsense
+    FileSlurp
+    JSON
+    Guard
+    LocaleGettext
+  ];
+  libs = [
+    stdenv.cc.cc.lib
+    gtk2
+  ];
+in
+stdenv.mkDerivation rec {
+  version = "git-2017-12-01";
+  name = "yarssr-${version}";
+
+  src = fetchFromGitHub {
+    owner = "JGRennison";
+    repo = "yarssr";
+    rev = "e70eb9fc6563599bfb91c6de6a79654de531c18d";
+    sha256 = "0x7hz8x8qyp3i1vb22zhcnvwxm3jhmmmlr22jqc5b09vpmbw1l45";
+  };
+
+  nativeBuildInputs = [ perlPackages.perl gettext makeWrapper ];
+  buildInputs = perlDeps ++ [gnome2.libglade];
+  propagatedBuildInputs = libs ++ perlDeps;
+
+  installPhase = ''
+    DESTDIR=$out make install
+    mv $out/usr/* $out/
+    rm -R $out/usr
+    sed -i -r "s!use lib [^;]+;!use lib '$out/share/yarssr';!" $out/bin/yarssr
+    sed -i -r "s!$Yarssr::PREFIX = [^;]+;!$Yarssr::PREFIX = '$out';!" $out/bin/yarssr
+    sed -i -r "s!use Yarssr::Browser;!!" $out/share/yarssr/Yarssr/GUI.pm
+    chmod a+x $out/bin/yarssr
+  '';
+
+  postFixup = ''
+    wrapProgram $out/bin/yarssr \
+      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath libs} \
+      --set PERL5LIB "${perlPackages.makePerlPath perlDeps}"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/tsyrogit/zxcvbn-c;
+    description = "A fork of Yarssr (a RSS reader for the GNOME Tray) from http://yarssr.sf.net with various fixes.";
+    license = licenses.gpl1;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ xurei ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/yate/default.nix b/nixpkgs/pkgs/applications/misc/yate/default.nix
new file mode 100644
index 000000000000..53d427e61c2c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/yate/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, lib, qt4, openssl, autoconf, automake, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "yate-${version}";
+  version = "6.0.0-1";
+
+  src = fetchurl {
+    url = "http://voip.null.ro/tarballs/yate${lib.versions.major version}/${name}.tar.gz";
+    sha256 = "05qqdhi3rp5660gq1484jkmxkm9vq81j0yr765h0gf0xclan1dqa";
+  };
+
+  # TODO zaptel ? postgres ?
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ qt4 openssl autoconf automake ];
+
+  # /dev/null is used when linking which is a impure path for the wrapper
+  preConfigure =
+    ''
+      sed -i 's@,/dev/null@@' configure
+      patchShebangs configure
+    '';
+
+  # --unresolved-symbols=ignore-in-shared-libs makes ld no longer find --library=yate? Why?
+  preBuild =
+    ''
+      export NIX_LDFLAGS="-L$TMP/yate $NIX_LDFLAGS"
+      find . -type f -iname Makefile | xargs sed -i \
+        -e 's@-Wl,--unresolved-symbols=ignore-in-shared-libs@@' \
+        -e 's@-Wl,--retain-symbols-file@@'
+    '';
+
+  meta = {
+    description = "Yet another telephony engine";
+    homepage = http://yate.null.ro/;
+    # Yate's license is GPL with an exception for linking with
+    # OpenH323 and PWlib (licensed under MPL).
+    license = ["GPL" "MPL"];
+    maintainers = [ lib.maintainers.marcweber ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/misc/yokadi/default.nix b/nixpkgs/pkgs/applications/misc/yokadi/default.nix
new file mode 100644
index 000000000000..6b3a4f747f47
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/yokadi/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, buildPythonApplication, dateutil,
+  sqlalchemy, setproctitle, icalendar }:
+
+buildPythonApplication rec {
+  pname = "yokadi";
+  version = "1.2.0";
+
+  src = fetchurl {
+    url = "https://yokadi.github.io/download/${pname}-${version}.tar.gz";
+    sha256 = "681c8aa52b2e4b5255e1311e76b4b81dcb63ee7f6ca3a47178e684c06baf330f";
+  };
+
+  propagatedBuildInputs = [
+    dateutil
+    sqlalchemy
+    setproctitle
+    icalendar
+  ];
+
+  # Yokadi doesn't have any tests
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "A command line oriented, sqlite powered, todo-list";
+    homepage = https://yokadi.github.io/index.html;
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.nipav ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/yubioath-desktop/default.nix b/nixpkgs/pkgs/applications/misc/yubioath-desktop/default.nix
new file mode 100644
index 000000000000..3d4718990cb8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/yubioath-desktop/default.nix
@@ -0,0 +1,57 @@
+{ stdenv, fetchurl
+, qmake, qtbase, qtquickcontrols
+, python3, pyotherside
+, pcsclite, yubikey-personalization
+, yubikey-manager, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "yubioath-desktop";
+  version = "4.3.6";
+
+  src = fetchurl {
+    url = "https://developers.yubico.com/yubioath-desktop/Releases/yubioath-desktop-${version}.tar.gz";
+    sha256 = "0s04anjbb5zm98kfdpp9hr68k3mx3gqlp8fa1miy7nq87pr4f7a5";
+  };
+
+  doCheck = false;
+
+  buildInputs = [ stdenv qtbase qtquickcontrols python3 ];
+
+  nativeBuildInputs = [ qmake makeWrapper python3.pkgs.wrapPython ];
+
+  postPatch = ''
+    substituteInPlace deployment.pri \
+      --replace '/usr/bin' "$out/bin"
+  '';
+
+  pythonPath = [ yubikey-manager ];
+
+  # Need LD_PRELOAD for libykpers as the Nix cpython disables ctypes.cdll.LoadLibrary
+  # support that the yubicommon library uses to load libykpers
+
+  postInstall = ''
+    buildPythonPath "$out $pythonPath"
+    wrapProgram $out/bin/yubioath-desktop \
+      --prefix PYTHONPATH : "$program_PYTHONPATH" \
+      --prefix QML2_IMPORT_PATH : "${pyotherside}/${qtbase.qtQmlPrefix}" \
+      --prefix LD_PRELOAD : "${yubikey-personalization}/lib/libykpers-1.so" \
+      --prefix LD_LIBRARY_PATH : "${stdenv.lib.getLib pcsclite}/lib:${yubikey-personalization}/lib"
+
+      mkdir -p $out/share/applications
+      cp resources/yubioath-desktop.desktop \
+        $out/share/applications/yubioath-desktop.desktop
+      mkdir -p $out/share/yubioath/icons
+      cp resources/icons/*.{icns,ico,png,xpm} $out/share/yubioath/icons
+      substituteInPlace $out/share/applications/yubioath-desktop.desktop \
+        --replace 'Exec=yubioath-desktop' "Exec=$out/bin/yubioath-desktop" \
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Yubikey Desktop Authenticator";
+
+    homepage = https://www.yubico.com/support/knowledge-base/categories/articles/yubico-authenticator-download/;
+
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = with maintainers; [ mic92 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/zathura/cb/default.nix b/nixpkgs/pkgs/applications/misc/zathura/cb/default.nix
new file mode 100644
index 000000000000..eb2a0f1c1e14
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/zathura/cb/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, fetchurl, meson, ninja, pkgconfig, zathura_core
+, girara, gettext, libarchive }:
+
+stdenv.mkDerivation rec {
+  name = "zathura-cb-${version}";
+  version = "0.1.8";
+
+  src = fetchurl {
+    url = "https://pwmt.org/projects/zathura/plugins/download/${name}.tar.xz";
+    sha256 = "1i6cf0vks501cggwvfsl6qb7mdaf3sszdymphimfvnspw810faj5";
+  };
+
+  nativeBuildInputs = [ meson ninja pkgconfig gettext ];
+  buildInputs = [ libarchive zathura_core girara ];
+
+  PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura";
+
+  meta = with lib; {
+    homepage = https://pwmt.org/projects/zathura-cb/;
+    description = "A zathura CB plugin";
+    longDescription = ''
+      The zathura-cb plugin adds comic book support to zathura.
+      '';
+    license = licenses.zlib;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ jlesquembre ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/zathura/core/default.nix b/nixpkgs/pkgs/applications/misc/zathura/core/default.nix
new file mode 100644
index 000000000000..af72e0a8d9ad
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/zathura/core/default.nix
@@ -0,0 +1,54 @@
+{ stdenv, fetchurl, meson, ninja, wrapGAppsHook, pkgconfig
+, appstream-glib, desktop-file-utils, python3
+, gtk, girara, gettext, libxml2, check
+, sqlite, glib, texlive, libintl, libseccomp
+, file, librsvg
+, gtk-mac-integration, synctexSupport ? true
+}:
+
+assert synctexSupport -> texlive != null;
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "zathura-core-${version}";
+  version = "0.4.3";
+
+  src = fetchurl {
+    url = "https://pwmt.org/projects/zathura/download/zathura-${version}.tar.xz";
+    sha256 = "0hgx5x09i6d0z45llzdmh4l348fxh1y102sb1w76f2fp4r21j4ky";
+  };
+
+  outputs = [ "bin" "man" "dev" "out" ];
+
+  # Flag list:
+  # https://github.com/pwmt/zathura/blob/master/meson_options.txt
+  mesonFlags = [
+    "-Dsqlite=enabled"
+    "-Dmagic=enabled"
+    # "-Dseccomp=enabled"
+    "-Dmanpages=enabled"
+    "-Dconvert-icon=enabled"
+  ] ++ optional synctexSupport "-Dsynctex=enabled";
+
+  nativeBuildInputs = [
+    meson ninja pkgconfig desktop-file-utils python3.pkgs.sphinx
+    gettext wrapGAppsHook libxml2 check
+  ] ++ optional stdenv.isLinux appstream-glib;
+
+  buildInputs = [
+    gtk girara libintl sqlite glib file librsvg
+  ] ++ optional synctexSupport texlive.bin.core
+    ++ optional stdenv.isLinux libseccomp
+    ++ optional stdenv.isDarwin gtk-mac-integration;
+
+  doCheck = true;
+
+  meta = {
+    homepage = https://pwmt.org/projects/zathura/;
+    description = "A core component for zathura PDF viewer";
+    license = licenses.zlib;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/zathura/default.nix b/nixpkgs/pkgs/applications/misc/zathura/default.nix
new file mode 100644
index 000000000000..e3db15ca78d4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/zathura/default.nix
@@ -0,0 +1,36 @@
+{ config, pkgs
+# zathura_pdf_mupdf fails to load _opj_create_decompress at runtime on Darwin (https://github.com/NixOS/nixpkgs/pull/61295#issue-277982980)
+, useMupdf ? config.zathura.useMupdf or (!pkgs.stdenv.isDarwin)
+, synctexSupport ? true }:
+
+let
+  callPackage = pkgs.newScope self;
+
+  self = rec {
+    gtk = pkgs.gtk3;
+
+    zathura_core = callPackage ./core {
+      inherit synctexSupport;
+    };
+
+    zathura_pdf_poppler = callPackage ./pdf-poppler { };
+
+    zathura_pdf_mupdf = callPackage ./pdf-mupdf { };
+
+    zathura_djvu = callPackage ./djvu { };
+
+    zathura_ps = callPackage ./ps { };
+
+    zathura_cb = callPackage ./cb { };
+
+    zathuraWrapper = callPackage ./wrapper.nix {
+      plugins = [
+        zathura_djvu
+        zathura_ps
+        zathura_cb
+        (if useMupdf then zathura_pdf_mupdf else zathura_pdf_poppler)
+      ];
+    };
+  };
+
+in self.zathuraWrapper
diff --git a/nixpkgs/pkgs/applications/misc/zathura/djvu/default.nix b/nixpkgs/pkgs/applications/misc/zathura/djvu/default.nix
new file mode 100644
index 000000000000..54f68969d4f7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/zathura/djvu/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, meson, ninja, pkgconfig, gtk, zathura_core, girara, djvulibre, gettext }:
+
+stdenv.mkDerivation rec {
+  name = "zathura-djvu-0.2.8";
+
+  src = fetchurl {
+    url = "https://pwmt.org/projects/zathura/plugins/download/${name}.tar.xz";
+    sha256 = "0axkv1crdxn0z44whaqp2ibkdqcykhjnxk7qzms0dp1b67an9rnh";
+  };
+
+  nativeBuildInputs = [ meson ninja pkgconfig ];
+  buildInputs = [ djvulibre gettext zathura_core gtk girara ];
+
+  PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura";
+
+  meta = with stdenv.lib; {
+    homepage = https://pwmt.org/projects/zathura-djvu/;
+    description = "A zathura DJVU plugin";
+    longDescription = ''
+      The zathura-djvu plugin adds DjVu support to zathura by using the
+      djvulibre library.
+    '';
+    license = licenses.zlib;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/zathura/pdf-mupdf/default.nix b/nixpkgs/pkgs/applications/misc/zathura/pdf-mupdf/default.nix
new file mode 100644
index 000000000000..f3cacd21236e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/zathura/pdf-mupdf/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, lib, meson, ninja, fetchFromGitHub
+, pkgconfig, zathura_core, cairo , gtk-mac-integration, girara, mupdf }:
+
+stdenv.mkDerivation rec {
+  version = "0.3.4";
+  name = "zathura-pdf-mupdf-${version}";
+
+  # pwmt.org server was down at the time of last update
+  # src = fetchurl {
+  #   url = "https://pwmt.org/projects/zathura-pdf-mupdf/download/${name}.tar.xz";
+  #   sha256 = "1zbaqimav4wfgimpy3nfzl10qj7vyv23rdy2z5z7z93jwbp2rc2j";
+  # };
+  src = fetchFromGitHub {
+    owner = "pwmt";
+    repo = "zathura-pdf-mupdf";
+    rev = version;
+    sha256 = "1m4w4jrybpjmx6pi33a5saxzmfd8rrym2k13jpd1fv543s17d9dy";
+  };
+
+  nativeBuildInputs = [ meson ninja pkgconfig ];
+
+  buildInputs = [
+    zathura_core girara mupdf cairo
+  ] ++ lib.optional stdenv.isDarwin gtk-mac-integration;
+
+  PKG_CONFIG_ZATHURA_PLUGINDIR= "lib/zathura";
+
+  meta = with lib; {
+    homepage = https://pwmt.org/projects/zathura-pdf-mupdf/;
+    description = "A zathura PDF plugin (mupdf)";
+    longDescription = ''
+      The zathura-pdf-mupdf plugin adds PDF support to zathura by
+      using the mupdf rendering library.
+    '';
+    license = licenses.zlib;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ cstrahan ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/zathura/pdf-poppler/default.nix b/nixpkgs/pkgs/applications/misc/zathura/pdf-poppler/default.nix
new file mode 100644
index 000000000000..98cfb4c6687a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/zathura/pdf-poppler/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, fetchurl, meson, ninja, pkgconfig, zathura_core, girara, poppler }:
+
+stdenv.mkDerivation rec {
+  version = "0.2.9";
+  name = "zathura-pdf-poppler-${version}";
+
+  src = fetchurl {
+    url = "https://pwmt.org/projects/zathura/plugins/download/${name}.tar.xz";
+    sha256 = "1p4jcny0jniygns78mcf0nlm298dszh49qpmjmackrm6dq8hc25y";
+  };
+
+  nativeBuildInputs = [ meson ninja pkgconfig zathura_core ];
+  buildInputs = [ poppler girara ];
+
+  PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura";
+
+  meta = with lib; {
+    homepage = https://pwmt.org/projects/zathura-pdf-poppler/;
+    description = "A zathura PDF plugin (poppler)";
+    longDescription = ''
+      The zathura-pdf-poppler plugin adds PDF support to zathura by
+      using the poppler rendering library.
+    '';
+    license = licenses.zlib;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ cstrahan ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/zathura/ps/default.nix b/nixpkgs/pkgs/applications/misc/zathura/ps/default.nix
new file mode 100644
index 000000000000..48d42b5e9399
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/zathura/ps/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, fetchurl, meson, ninja, pkgconfig, zathura_core, girara, libspectre, gettext }:
+
+stdenv.mkDerivation rec {
+  name = "zathura-ps-0.2.6";
+
+  src = fetchurl {
+    url = "https://pwmt.org/projects/zathura/plugins/download/${name}.tar.xz";
+    sha256 = "0wygq89nyjrjnsq7vbpidqdsirjm6iq4w2rijzwpk2f83ys8bc3y";
+  };
+
+  nativeBuildInputs = [ meson ninja pkgconfig gettext ];
+  buildInputs = [ libspectre zathura_core girara ];
+
+  PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura";
+
+  meta = with lib; {
+    homepage = https://pwmt.org/projects/zathura-ps/;
+    description = "A zathura PS plugin";
+    longDescription = ''
+      The zathura-ps plugin adds PS support to zathura by using the
+      libspectre library.
+      '';
+    license = licenses.zlib;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ cstrahan ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/misc/zathura/wrapper.nix b/nixpkgs/pkgs/applications/misc/zathura/wrapper.nix
new file mode 100644
index 000000000000..3059c3f725b1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/zathura/wrapper.nix
@@ -0,0 +1,32 @@
+{ symlinkJoin, lib, makeWrapper, zathura_core, file, plugins ? [] }:
+
+let
+  pluginsPath = lib.makeSearchPath "lib/zathura" plugins;
+
+in symlinkJoin {
+  name = "zathura-with-plugins-${zathura_core.version}";
+
+  paths = with zathura_core; [ man dev out ];
+
+  buildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    makeWrapper ${zathura_core.bin}/bin/zathura $out/bin/zathura \
+      --prefix PATH ":" "${lib.makeBinPath [ file ]}" \
+      --add-flags --plugins-dir=${pluginsPath}
+  '';
+
+  meta = with lib; {
+    homepage = https://pwmt.org/projects/zathura/;
+    description = "A highly customizable and functional PDF viewer";
+    longDescription = ''
+      Zathura is a highly customizable and functional PDF viewer based on the
+      poppler rendering library and the gtk+ toolkit. The idea behind zathura
+      is an application that provides a minimalistic and space saving interface
+      as well as an easy usage that mainly focuses on keyboard interaction.
+    '';
+    license = licenses.zlib;
+    platforms = platforms.unix;
+    maintainers = with maintainers;[ smironov ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/zk-shell/default.nix b/nixpkgs/pkgs/applications/misc/zk-shell/default.nix
new file mode 100644
index 000000000000..ec8deadf9f54
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/zk-shell/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchFromGitHub, pythonPackages }:
+
+pythonPackages.buildPythonApplication rec {
+  version = "1.0.0";
+  name = "zk-shell-" + version;
+
+  src = fetchFromGitHub {
+    owner = "rgs1";
+    repo = "zk_shell";
+    rev = "v${version}";
+    sha256 = "0zisvvlclsf4sdh7dpqcl1149xbxw6pi1aqcwjbqblgf8m4nm0c7";
+  };
+
+  propagatedBuildInputs = (with pythonPackages; [
+    ansi kazoo nose six tabulate twitter
+  ]);
+
+  #requires a running zookeeper, don't know how to fix that for the moment
+  doCheck = false;
+
+  meta = {
+    description = "A powerful & scriptable shell for Apache ZooKeeper";
+    homepage = https://github.com/rgs1/zk_shell;
+    license = stdenv.lib.licenses.asl20;
+    maintainers = [ stdenv.lib.maintainers.mahe ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/zola/default.nix b/nixpkgs/pkgs/applications/misc/zola/default.nix
new file mode 100644
index 000000000000..48f5b216ea1b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/zola/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, rustPlatform, cmake, pkgconfig, openssl, CoreServices, cf-private }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "zola";
+  version = "0.8.0";
+
+  src = fetchFromGitHub {
+    owner = "getzola";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "166kmlkzd1qyw9yq2jqs58z8b3d956jjhw9r15jzw98md949psr5";
+  };
+
+  cargoSha256 = "1brmlg6nqyls1v62z0fg0km150q9m7h71wy67lidcnw76icmqr24";
+
+  nativeBuildInputs = [ cmake pkgconfig ];
+  buildInputs = [ openssl ] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices cf-private ];
+
+  postInstall = ''
+    install -D -m 444 completions/zola.bash \
+      -t $out/share/bash-completion/completions
+    install -D -m 444 completions/_zola \
+      -t $out/share/zsh/site-functions
+    install -D -m 444 completions/zola.fish \
+      -t $out/share/fish/vendor_completions.d
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A fast static site generator with everything built-in";
+    homepage = https://www.getzola.org/;
+    license = licenses.mit;
+    maintainers = with maintainers; [ dywedir ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/misc/zscroll/default.nix b/nixpkgs/pkgs/applications/misc/zscroll/default.nix
new file mode 100644
index 000000000000..18876cf355b8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/zscroll/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, python3, python3Packages, fetchFromGitHub }:
+
+let version = "1.0"; in
+
+python3Packages.buildPythonApplication {
+  name = "zscroll-${version}";
+  # don't prefix with python version
+  namePrefix = "";
+
+  src = fetchFromGitHub {
+    owner = "noctuid";
+    repo = "zscroll";
+    rev = "v${version}";
+    sha256 = "0rf9m1czy19hzpcp8dq9c5zawk0nhwfzzjxlhk9r2n06lhb81ig5";
+  };
+
+  doCheck = false;
+
+  propagatedBuildInputs = [ python3 ];
+
+  meta = with stdenv.lib; {
+    description = "A text scroller for use with panels and shells";
+    homepage = https://github.com/noctuid/zscroll;
+    license = licenses.bsd2;
+    platforms = platforms.all;
+  };
+}