summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix Bühler <Stunkymonkey@users.noreply.github.com>2021-11-07 21:29:51 +0100
committerGitHub <noreply@github.com>2021-11-07 21:29:51 +0100
commitfbdf78236a346f57f716fb66ed62e1993260c9e5 (patch)
treed8ad89d78673cf511a52ad329e014f76bc116641
parent3b61f5c4366408ffdffa485457e499867d778b96 (diff)
downloadnixpkgs-fbdf78236a346f57f716fb66ed62e1993260c9e5.tar
nixpkgs-fbdf78236a346f57f716fb66ed62e1993260c9e5.tar.gz
nixpkgs-fbdf78236a346f57f716fb66ed62e1993260c9e5.tar.bz2
nixpkgs-fbdf78236a346f57f716fb66ed62e1993260c9e5.tar.lz
nixpkgs-fbdf78236a346f57f716fb66ed62e1993260c9e5.tar.xz
nixpkgs-fbdf78236a346f57f716fb66ed62e1993260c9e5.tar.zst
nixpkgs-fbdf78236a346f57f716fb66ed62e1993260c9e5.zip
pkgs/applications: rename name to pname&version part 1 (#144949)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
-rw-r--r--pkgs/applications/audio/aumix/default.nix17
-rw-r--r--pkgs/applications/audio/clerk/default.nix20
-rw-r--r--pkgs/applications/audio/espeak/default.nix5
-rw-r--r--pkgs/applications/audio/espeak/edit.nix5
-rw-r--r--pkgs/applications/audio/nootka/unstable.nix32
-rw-r--r--pkgs/applications/audio/paprefs/default.nix8
-rw-r--r--pkgs/applications/audio/wavegain/default.nix4
-rw-r--r--pkgs/applications/backup/areca/default.nix7
-rw-r--r--pkgs/applications/editors/bluefish/default.nix31
-rw-r--r--pkgs/applications/editors/elvis/default.nix17
-rw-r--r--pkgs/applications/editors/emacs/elisp-packages/cedet/default.nix5
-rw-r--r--pkgs/applications/editors/emacs/elisp-packages/session-management-for-emacs/default.nix18
-rw-r--r--pkgs/applications/editors/fte/default.nix3
-rw-r--r--pkgs/applications/editors/kile/default.nix5
-rw-r--r--pkgs/applications/editors/sublime/2/default.nix18
-rw-r--r--pkgs/applications/graphics/autopanosiftc/default.nix9
-rw-r--r--pkgs/applications/graphics/autotrace/autofig.nix3
-rw-r--r--pkgs/applications/graphics/comical/default.nix13
-rw-r--r--pkgs/applications/graphics/exrdisplay/default.nix7
-rw-r--r--pkgs/applications/graphics/fbida/default.nix49
-rw-r--r--pkgs/applications/graphics/freepv/default.nix23
-rw-r--r--pkgs/applications/graphics/gocr/default.nix5
-rw-r--r--pkgs/applications/graphics/gpicview/default.nix13
-rw-r--r--pkgs/applications/graphics/gqview/default.nix11
-rw-r--r--pkgs/applications/graphics/hugin/default.nix71
-rw-r--r--pkgs/applications/graphics/minidjvu/default.nix12
-rw-r--r--pkgs/applications/graphics/photivo/default.nix20
-rw-r--r--pkgs/applications/graphics/pinta/default.nix34
-rw-r--r--pkgs/applications/graphics/qscreenshot/default.nix5
-rw-r--r--pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix7
-rw-r--r--pkgs/applications/graphics/sane/xsane.nix22
-rw-r--r--pkgs/applications/graphics/scantailor/default.nix9
-rw-r--r--pkgs/applications/graphics/wings/default.nix16
-rw-r--r--pkgs/applications/misc/abook/default.nix13
-rw-r--r--pkgs/applications/misc/adobe-reader/default.nix28
-rw-r--r--pkgs/applications/misc/audio/sox/default.nix52
-rw-r--r--pkgs/applications/misc/audio/wavesurfer/default.nix7
-rw-r--r--pkgs/applications/misc/audio/wavrsocvt/default.nix21
-rw-r--r--pkgs/applications/misc/avrdudess/default.nix3
-rw-r--r--pkgs/applications/misc/catclock/default.nix3
-rw-r--r--pkgs/applications/misc/colort/default.nix5
-rw-r--r--pkgs/applications/misc/ding/default.nix5
-rw-r--r--pkgs/applications/misc/dmenu/default.nix15
-rw-r--r--pkgs/applications/misc/fbreader/default.nix33
-rw-r--r--pkgs/applications/misc/fehlstart/default.nix3
-rw-r--r--pkgs/applications/misc/garmin-plugin/default.nix10
-rw-r--r--pkgs/applications/misc/gkrellm/default.nix24
-rw-r--r--pkgs/applications/misc/gpa/default.nix5
-rw-r--r--pkgs/applications/misc/grip/default.nix5
-rw-r--r--pkgs/applications/misc/gv/default.nix10
-rw-r--r--pkgs/applications/misc/gxneur/default.nix20
-rw-r--r--pkgs/applications/misc/jigdo/default.nix7
-rw-r--r--pkgs/applications/misc/loxodo/default.nix3
-rw-r--r--pkgs/applications/misc/mencal/default.nix11
-rw-r--r--pkgs/applications/misc/metar/default.nix3
-rw-r--r--pkgs/applications/misc/mpvc/default.nix3
-rw-r--r--pkgs/applications/misc/navipowm/default.nix11
-rw-r--r--pkgs/applications/misc/openbrf/default.nix3
-rw-r--r--pkgs/applications/misc/pcmanfm/default.nix23
-rw-r--r--pkgs/applications/misc/posterazor/default.nix7
-rw-r--r--pkgs/applications/misc/ptask/default.nix5
-rw-r--r--pkgs/applications/misc/sbagen/default.nix5
-rw-r--r--pkgs/applications/misc/slade/git.nix7
-rw-r--r--pkgs/applications/misc/speedread/default.nix9
-rw-r--r--pkgs/applications/misc/stag/default.nix3
-rw-r--r--pkgs/applications/misc/twmn/default.nix3
-rw-r--r--pkgs/applications/misc/wmname/default.nix5
-rw-r--r--pkgs/applications/misc/xcruiser/default.nix11
-rw-r--r--pkgs/applications/misc/xfe/default.nix13
-rw-r--r--pkgs/applications/misc/xpdf/libxpdf.nix7
-rw-r--r--pkgs/applications/misc/xrq/default.nix5
-rw-r--r--pkgs/applications/office/antiword/default.nix10
-rw-r--r--pkgs/applications/office/beancount/bean-add.nix3
73 files changed, 641 insertions, 302 deletions
diff --git a/pkgs/applications/audio/aumix/default.nix b/pkgs/applications/audio/aumix/default.nix
index b1808ed90f1..7dcabf6a2a8 100644
--- a/pkgs/applications/audio/aumix/default.nix
+++ b/pkgs/applications/audio/aumix/default.nix
@@ -1,19 +1,26 @@
-{lib, stdenv, fetchurl, gettext, ncurses
+{ lib
+, stdenv
+, fetchurl
+, gettext
+, ncurses
 , gtkGUI ? false
 , pkg-config ? null
-, gtk2 ? null}:
+, gtk2 ? null
+}:
 
 assert gtkGUI -> pkg-config != null && gtk2 != null;
 
 stdenv.mkDerivation rec {
-  name = "aumix-2.9.1";
+  pname = "aumix";
+  version = "2.9.1";
+
   src = fetchurl {
-    url = "http://www.jpj.net/~trevor/aumix/releases/${name}.tar.bz2";
+    url = "http://www.jpj.net/~trevor/aumix/releases/aumix-${version}.tar.bz2";
     sha256 = "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj";
   };
 
   buildInputs = [ gettext ncurses ]
-    ++ (if gtkGUI then [pkg-config gtk2] else []);
+    ++ lib.optionals gtkGUI [ pkg-config gtk2 ];
 
   meta = {
     description = "Audio mixer for X and the console";
diff --git a/pkgs/applications/audio/clerk/default.nix b/pkgs/applications/audio/clerk/default.nix
index ebcd09ca6ad..ff9dca961ae 100644
--- a/pkgs/applications/audio/clerk/default.nix
+++ b/pkgs/applications/audio/clerk/default.nix
@@ -1,8 +1,18 @@
-{ lib, stdenv, fetchFromGitHub, makeWrapper, rofi, mpc_cli, perl,
-util-linux, python3Packages, libnotify }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, makeWrapper
+, rofi
+, mpc_cli
+, perl
+, util-linux
+, python3Packages
+, libnotify
+}:
 
 stdenv.mkDerivation {
-  name = "clerk-2016-10-14";
+  pname = "clerk";
+  version = "unstable-2016-10-14";
 
   src = fetchFromGitHub {
     owner = "carnager";
@@ -26,8 +36,8 @@ stdenv.mkDerivation {
 
   meta = with lib; {
     description = "An MPD client built on top of rofi";
-    homepage    = "https://github.com/carnager/clerk";
-    license     = licenses.mit;
+    homepage = "https://github.com/carnager/clerk";
+    license = licenses.mit;
     maintainers = with maintainers; [ anderspapitto ];
   };
 }
diff --git a/pkgs/applications/audio/espeak/default.nix b/pkgs/applications/audio/espeak/default.nix
index 675f31b478c..e5579175bbb 100644
--- a/pkgs/applications/audio/espeak/default.nix
+++ b/pkgs/applications/audio/espeak/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, unzip, portaudio }:
 
 stdenv.mkDerivation rec {
-  name = "espeak-1.48.04";
+  pname = "espeak";
+  version = "1.48.04";
 
   src = fetchurl {
-    url = "mirror://sourceforge/espeak/${name}-source.zip";
+    url = "mirror://sourceforge/espeak/espeak-${version}-source.zip";
     sha256 = "0n86gwh9pw0jqqpdz7mxggllfr8k0r7pc67ayy7w5z6z79kig6mz";
   };
 
diff --git a/pkgs/applications/audio/espeak/edit.nix b/pkgs/applications/audio/espeak/edit.nix
index 0b9fa3dfbe5..2240a856116 100644
--- a/pkgs/applications/audio/espeak/edit.nix
+++ b/pkgs/applications/audio/espeak/edit.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, pkg-config, unzip, portaudio, wxGTK, sox }:
 
 stdenv.mkDerivation rec {
-  name = "espeakedit-1.48.03";
+  pname = "espeakedit";
+  version = "1.48.03";
 
   src = fetchurl {
-    url = "mirror://sourceforge/espeak/${name}.zip";
+    url = "mirror://sourceforge/espeak/espeakedit-${version}.zip";
     sha256 = "0x8s7vpb7rw5x37yjzy1f98m4f2csdg89libb74fm36gn8ly0hli";
   };
 
diff --git a/pkgs/applications/audio/nootka/unstable.nix b/pkgs/applications/audio/nootka/unstable.nix
index edfb1948364..b5e820e8345 100644
--- a/pkgs/applications/audio/nootka/unstable.nix
+++ b/pkgs/applications/audio/nootka/unstable.nix
@@ -1,20 +1,38 @@
-{ lib, stdenv, fetchurl, cmake
-, alsa-lib, fftwSinglePrec, libjack2, libpulseaudio, libvorbis, soundtouch
-, qtbase, qtdeclarative, qtquickcontrols2
+{ lib
+, stdenv
+, fetchurl
+, cmake
+, alsa-lib
+, fftwSinglePrec
+, libjack2
+, libpulseaudio
+, libvorbis
+, soundtouch
+, qtbase
+, qtdeclarative
+, qtquickcontrols2
 }:
 
 stdenv.mkDerivation rec {
-  name = "nootka-1.7.0-beta1";
+  pname = "nootka";
+  version = "1.7.0-beta1";
 
   src = fetchurl {
-    url = "mirror://sourceforge/nootka/${name}-source.tar.bz2";
+    url = "mirror://sourceforge/nootka/nootka-${version}-source.tar.bz2";
     sha256 = "13b50vnpr1zx2mrgkc8fmhsyfa19rqq1rksvn31145dy6fk1f3gc";
   };
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [
-    alsa-lib fftwSinglePrec libjack2 libpulseaudio libvorbis soundtouch
-    qtbase qtdeclarative qtquickcontrols2
+    alsa-lib
+    fftwSinglePrec
+    libjack2
+    libpulseaudio
+    libvorbis
+    soundtouch
+    qtbase
+    qtdeclarative
+    qtquickcontrols2
   ];
 
   dontWrapQtApps = true;
diff --git a/pkgs/applications/audio/paprefs/default.nix b/pkgs/applications/audio/paprefs/default.nix
index 64e403001a3..31ccb212cd5 100644
--- a/pkgs/applications/audio/paprefs/default.nix
+++ b/pkgs/applications/audio/paprefs/default.nix
@@ -1,5 +1,6 @@
 { fetchurl
-, lib, stdenv
+, lib
+, stdenv
 , meson
 , ninja
 , gettext
@@ -11,10 +12,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "paprefs-1.1";
+  pname = "paprefs";
+  version = "1.1";
 
   src = fetchurl {
-    url = "https://freedesktop.org/software/pulseaudio/paprefs/${name}.tar.xz";
+    url = "https://freedesktop.org/software/pulseaudio/paprefs/paprefs-${version}.tar.xz";
     sha256 = "189z5p20hk0xv9vwvym293503j4pwl03xqk9hl7cl6dwgv0l7wkf";
   };
 
diff --git a/pkgs/applications/audio/wavegain/default.nix b/pkgs/applications/audio/wavegain/default.nix
index f4ef7f6d8a5..1820ed2def1 100644
--- a/pkgs/applications/audio/wavegain/default.nix
+++ b/pkgs/applications/audio/wavegain/default.nix
@@ -1,7 +1,9 @@
 { lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation {
-  name = "wavegain-1.3.1";
+  pname = "wavegain";
+  version = "1.3.1";
+
   src = fetchFromGitHub {
     owner = "MestreLion";
     repo = "wavegain";
diff --git a/pkgs/applications/backup/areca/default.nix b/pkgs/applications/backup/areca/default.nix
index d16fc0f85c5..816646ab6f1 100644
--- a/pkgs/applications/backup/areca/default.nix
+++ b/pkgs/applications/backup/areca/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, ant, jre, jdk, swt, acl, attr }:
 
-stdenv.mkDerivation {
-  name = "areca-7.5";
+stdenv.mkDerivation rec {
+  pname = "areca";
+  version = "7.5";
 
   src = fetchurl {
-    url = "mirror://sourceforge/project/areca/areca-stable/areca-7.5/areca-7.5-src.tar.gz";
+    url = "mirror://sourceforge/project/areca/areca-stable/areca-${version}/areca-${version}-src.tar.gz";
     sha256 = "1q4ha9s96c1syplxm04bh1v1gvjq16l4pa8w25w95d2ywwvyq1xb";
   };
 
diff --git a/pkgs/applications/editors/bluefish/default.nix b/pkgs/applications/editors/bluefish/default.nix
index 3a5436d4f32..1919e6b6947 100644
--- a/pkgs/applications/editors/bluefish/default.nix
+++ b/pkgs/applications/editors/bluefish/default.nix
@@ -1,24 +1,41 @@
-{ lib, stdenv, fetchurl, intltool, wrapGAppsHook, pkg-config , gtk, libxml2
-, enchant, gucharmap, python3, gnome
+{ lib
+, stdenv
+, fetchurl
+, intltool
+, wrapGAppsHook
+, pkg-config
+, gtk
+, libxml2
+, enchant
+, gucharmap
+, python3
+, gnome
 }:
 
 stdenv.mkDerivation rec {
-  name = "bluefish-2.2.12";
+  pname = "bluefish";
+  version = "2.2.12";
 
   src = fetchurl {
-    url = "mirror://sourceforge/bluefish/${name}.tar.bz2";
+    url = "mirror://sourceforge/bluefish/bluefish-${version}.tar.bz2";
     sha256 = "0slyjx4b4l612505q02crk00pjg9d5wi8gm5gxvcs0f6l9dr1y8d";
   };
 
   nativeBuildInputs = [ intltool pkg-config wrapGAppsHook ];
-  buildInputs = [ gnome.adwaita-icon-theme gtk libxml2
-    enchant gucharmap python3 ];
+  buildInputs = [
+    gnome.adwaita-icon-theme
+    gtk
+    libxml2
+    enchant
+    gucharmap
+    python3
+  ];
 
   meta = with lib; {
     description = "A powerful editor targeted towards programmers and webdevelopers";
     homepage = "http://bluefish.openoffice.nl/";
     license = licenses.gpl3Plus;
-    maintainers = [maintainers.vbgl];
+    maintainers = with maintainers; [ vbgl ];
     platforms = platforms.all;
   };
 }
diff --git a/pkgs/applications/editors/elvis/default.nix b/pkgs/applications/editors/elvis/default.nix
index f63598a7c5e..eb288ff8b2a 100644
--- a/pkgs/applications/editors/elvis/default.nix
+++ b/pkgs/applications/editors/elvis/default.nix
@@ -1,19 +1,22 @@
 { fetchurl, fetchpatch, lib, stdenv, ncurses }:
 
-stdenv.mkDerivation {
-  name = "elvis-2.2_0";
+stdenv.mkDerivation rec {
+  pname = "elvis";
+  version = "2.2_0";
 
   src = fetchurl {
-    url = "http://www.the-little-red-haired-girl.org/pub/elvis/elvis-2.2_0.tar.gz";
+    url = "http://www.the-little-red-haired-girl.org/pub/elvis/elvis-${version}.tar.gz";
     sha256 = "182fj9qzyq6cjq1r849gpam6nq9smwv9f9xwaq84961p56r6d14s";
   };
 
   buildInputs = [ ncurses ];
 
-  patches = [ (fetchpatch {
-    url = "https://github.com/mbert/elvis/commit/076cf4ad5cc993be0c6195ec0d5d57e5ad8ac1eb.patch";
-    sha256 = "0yzkc1mxjwg09mfmrk20ksa0vfnb2x83ndybwvawq4xjm1qkcahc";
-  }) ];
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/mbert/elvis/commit/076cf4ad5cc993be0c6195ec0d5d57e5ad8ac1eb.patch";
+      sha256 = "0yzkc1mxjwg09mfmrk20ksa0vfnb2x83ndybwvawq4xjm1qkcahc";
+    })
+  ];
 
   postPatch = ''
     substituteInPlace configure \
diff --git a/pkgs/applications/editors/emacs/elisp-packages/cedet/default.nix b/pkgs/applications/editors/emacs/elisp-packages/cedet/default.nix
index 18dcef129cc..31106654ae6 100644
--- a/pkgs/applications/editors/emacs/elisp-packages/cedet/default.nix
+++ b/pkgs/applications/editors/emacs/elisp-packages/cedet/default.nix
@@ -1,10 +1,11 @@
 { lib, fetchurl, stdenv, emacs, python }:
 
 stdenv.mkDerivation rec {
-  name = "cedet-1.1";
+  pname = "cedet";
+  version = "1.1";
 
   src = fetchurl {
-    url = "mirror://sourceforge/cedet/${name}.tar.gz";
+    url = "mirror://sourceforge/cedet/cedet-${version}.tar.gz";
     sha256 = "0p2bwlpwwa019axvgj09xkxbr53j0pq23d46s4la9jfhl47nbh22";
   };
 
diff --git a/pkgs/applications/editors/emacs/elisp-packages/session-management-for-emacs/default.nix b/pkgs/applications/editors/emacs/elisp-packages/session-management-for-emacs/default.nix
index 61749a89fde..9dcf7ae45ed 100644
--- a/pkgs/applications/editors/emacs/elisp-packages/session-management-for-emacs/default.nix
+++ b/pkgs/applications/editors/emacs/elisp-packages/session-management-for-emacs/default.nix
@@ -1,14 +1,15 @@
-{stdenv, fetchurl, emacs}:
+{ stdenv, fetchurl, emacs }:
 
-stdenv.mkDerivation {
-  name = "session-management-for-emacs-2.2a";
+stdenv.mkDerivation rec {
+  pname = "session-management-for-emacs";
+  version = "2.2a";
 
   src = fetchurl {
-    url = "mirror://sourceforge/emacs-session/session-2.2a.tar.gz";
+    url = "mirror://sourceforge/emacs-session/session-${version}.tar.gz";
     sha256 = "37dfba7420b5164eab90dafa9e8bf9a2c8f76505fe2fefa14a64e81fa76d0144";
   };
 
-  buildInputs = [emacs];
+  buildInputs = [ emacs ];
 
   installPhase = ''
     mkdir -p "$out/share/emacs/site-lisp"
@@ -16,10 +17,9 @@ stdenv.mkDerivation {
   '';
 
   meta = {
-    /* installation: add to your ~/.emacs
-       (require 'session)
-       (add-hook 'after-init-hook 'session-initialize)
-    */
+    # installation: add to your ~/.emacs
+    #  (require 'session)
+    #  (add-hook 'after-init-hook 'session-initialize)
     description = "Small session management for emacs";
     homepage = "http://emacs-session.sourceforge.net/";
     license = "GPL";
diff --git a/pkgs/applications/editors/fte/default.nix b/pkgs/applications/editors/fte/default.nix
index 4f78267dbe5..05841bb1bac 100644
--- a/pkgs/applications/editors/fte/default.nix
+++ b/pkgs/applications/editors/fte/default.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, fetchurl, unzip, perl, libX11, libXpm, gpm, ncurses, slang }:
 
 stdenv.mkDerivation rec {
-  name = "fte-0.50.02";
+  pname = "fte";
+  version = "0.50.02";
 
   nativeBuildInputs = [ unzip ];
   buildInputs = [ perl libX11 libXpm gpm ncurses slang ];
diff --git a/pkgs/applications/editors/kile/default.nix b/pkgs/applications/editors/kile/default.nix
index 6819c4337f4..686113452eb 100644
--- a/pkgs/applications/editors/kile/default.nix
+++ b/pkgs/applications/editors/kile/default.nix
@@ -22,10 +22,11 @@
 }:
 
 mkDerivation rec {
-  name = "kile-2.9.93";
+  pname = "kile";
+  version = "2.9.93";
 
   src = fetchurl {
-    url = "mirror://sourceforge/kile/${name}.tar.bz2";
+    url = "mirror://sourceforge/kile/kile-${version}.tar.bz2";
     sha256 = "BEmSEv/LJPs6aCkUmnyuTGrV15WYXwgIANbfcviMXfA=";
   };
 
diff --git a/pkgs/applications/editors/sublime/2/default.nix b/pkgs/applications/editors/sublime/2/default.nix
index 7102d695139..7f14bf8ae14 100644
--- a/pkgs/applications/editors/sublime/2/default.nix
+++ b/pkgs/applications/editors/sublime/2/default.nix
@@ -1,26 +1,28 @@
 { fetchurl, lib, stdenv, glib, xorg, cairo, gtk2, makeDesktopItem }:
 let
-  libPath = lib.makeLibraryPath [glib xorg.libX11 gtk2 cairo];
+  libPath = lib.makeLibraryPath [ glib xorg.libX11 gtk2 cairo ];
 in
 
 stdenv.mkDerivation rec {
-  name = "sublimetext-2.0.2";
+  pname = "sublimetext";
+  version = "2.0.2";
+
   src =
     if stdenv.hostPlatform.system == "i686-linux" then
       fetchurl {
-        name = "sublimetext-2.0.2.tar.bz2";
+        name = "sublimetext-${version}.tar.bz2";
         urls = [
-          "http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2.tar.bz2"
-          "https://download.sublimetext.com/Sublime%20Text%202.0.2.tar.bz2"
+          "http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20${version}.tar.bz2"
+          "https://download.sublimetext.com/Sublime%20Text%20${version}.tar.bz2"
         ];
         sha256 = "026g5mppk28lzzzn9ibykcqkrd5msfmg0sc0z8w8jd7v3h28wcq7";
       }
     else
       fetchurl {
-        name = "sublimetext-2.0.2.tar.bz2";
+        name = "sublimetext-${version}.tar.bz2";
         urls = [
-          "http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2.tar.bz2"
-          "https://download.sublimetext.com/Sublime%20Text%202.0.2%20x64.tar.bz2"
+          "http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20${version}.tar.bz2"
+          "https://download.sublimetext.com/Sublime%20Text%20${version}%20x64.tar.bz2"
         ];
         sha256 = "115b71nbv9mv8cz6bkjwpbdf2ywnjc1zy2d3080f6ck4sqqfvfh1";
       };
diff --git a/pkgs/applications/graphics/autopanosiftc/default.nix b/pkgs/applications/graphics/autopanosiftc/default.nix
index 129e3e54769..20874dd55e7 100644
--- a/pkgs/applications/graphics/autopanosiftc/default.nix
+++ b/pkgs/applications/graphics/autopanosiftc/default.nix
@@ -1,10 +1,11 @@
-{lib, stdenv, fetchurl, cmake, libpng, libtiff, libjpeg, panotools, libxml2 }:
+{ lib, stdenv, fetchurl, cmake, libpng, libtiff, libjpeg, panotools, libxml2 }:
 
-stdenv.mkDerivation {
-  name = "autopano-sift-C-2.5.1";
+stdenv.mkDerivation rec {
+  pname = "autopano-sift-C";
+  version = "2.5.1";
 
   src = fetchurl {
-    url = "mirror://sourceforge/hugin/autopano-sift-C-2.5.1.tar.gz";
+    url = "mirror://sourceforge/hugin/autopano-sift-C-${version}.tar.gz";
     sha256 = "0dqk8ff82gmy4v5ns5nr9gpzkc1p7c2y8c8fkid102r47wsjk44s";
   };
 
diff --git a/pkgs/applications/graphics/autotrace/autofig.nix b/pkgs/applications/graphics/autotrace/autofig.nix
index 0f53965786b..9555dd4c02e 100644
--- a/pkgs/applications/graphics/autotrace/autofig.nix
+++ b/pkgs/applications/graphics/autotrace/autofig.nix
@@ -1,7 +1,8 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation {
-  name = "autofig-0.1";
+  pname = "autofig";
+  version = "0.1";
 
   src = fetchurl {
     url = "http://autotrace.sourceforge.net/tools/autofig.tar.gz";
diff --git a/pkgs/applications/graphics/comical/default.nix b/pkgs/applications/graphics/comical/default.nix
index 5c6ec804e62..36da9d26410 100644
--- a/pkgs/applications/graphics/comical/default.nix
+++ b/pkgs/applications/graphics/comical/default.nix
@@ -1,13 +1,16 @@
-{lib, stdenv, fetchurl, wxGTK, util-linux, zlib }:
+{ lib, stdenv, fetchurl, wxGTK, util-linux, zlib }:
 
 stdenv.mkDerivation rec {
-  name = "comical-0.8";
+  pname = "comical";
+  version = "0.8";
+
   src = fetchurl {
-    url = "mirror://sourceforge/comical/${name}.tar.gz";
+    url = "mirror://sourceforge/comical/comical-${version}.tar.gz";
     sha256 = "0b6527cc06b25a937041f1eb248d0fd881cf055362097036b939817f785ab85e";
   };
+
   buildInputs = [ wxGTK util-linux zlib ];
-  preBuild="makeFlags=\"prefix=$out\"";
+  makeFlags = [ "prefix=${placeholder "out"}" ];
 
   patches = [ ./wxgtk-2.8.patch ];
 
@@ -17,7 +20,7 @@ stdenv.mkDerivation rec {
     description = "Viewer of CBR and CBZ files, often used to store scanned comics";
     homepage = "http://comical.sourceforge.net/";
     license = lib.licenses.gpl2Plus;
-    maintainers = with lib.maintainers; [viric];
+    maintainers = with lib.maintainers; [ viric ];
     platforms = with lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/graphics/exrdisplay/default.nix b/pkgs/applications/graphics/exrdisplay/default.nix
index c31c1407da7..2bb480a54f4 100644
--- a/pkgs/applications/graphics/exrdisplay/default.nix
+++ b/pkgs/applications/graphics/exrdisplay/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, pkg-config, fltk, openexr, libGLU, libGL, ctl }:
 
-stdenv.mkDerivation {
-  name ="openexr_viewers-2.2.1";
+stdenv.mkDerivation rec {
+  pname = "openexr_viewers";
+  version = "2.2.1";
 
   src = fetchurl {
-    url =  "mirror://savannah/openexr/openexr_viewers-2.2.1.tar.gz";
+    url = "mirror://savannah/openexr/openexr_viewers-${version}.tar.gz";
     sha256 = "1ixx2wbjp4rvsf7h3bkja010gl1ihjrcjzy7h20jnn47ikg12vj8";
   };
 
diff --git a/pkgs/applications/graphics/fbida/default.nix b/pkgs/applications/graphics/fbida/default.nix
index 279f49e6a49..5f13136d0c8 100644
--- a/pkgs/applications/graphics/fbida/default.nix
+++ b/pkgs/applications/graphics/fbida/default.nix
@@ -1,12 +1,33 @@
-{ lib, stdenv, fetchurl, libjpeg, libexif, giflib, libtiff, libpng, libwebp, libdrm
-, pkg-config, freetype, fontconfig, which, imagemagick, curl, sane-backends, libXpm
-, epoxy, poppler, mesa, lirc }:
+{ lib
+, stdenv
+, fetchurl
+, libjpeg
+, libexif
+, giflib
+, libtiff
+, libpng
+, libwebp
+, libdrm
+, pkg-config
+, freetype
+, fontconfig
+, which
+, imagemagick
+, curl
+, sane-backends
+, libXpm
+, epoxy
+, poppler
+, mesa
+, lirc
+}:
 
 stdenv.mkDerivation rec {
-  name = "fbida-2.14";
+  pname = "fbida";
+  version = "2.14";
 
   src = fetchurl {
-    url = "http://dl.bytesex.org/releases/fbida/${name}.tar.gz";
+    url = "http://dl.bytesex.org/releases/fbida/fbida-${version}.tar.gz";
     sha256 = "0f242mix20rgsqz1llibhsz4r2pbvx6k32rmky0zjvnbaqaw1dwm";
   };
 
@@ -21,8 +42,22 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkg-config which ];
   buildInputs = [
-    libexif libjpeg libpng giflib freetype fontconfig libtiff libwebp
-    imagemagick curl sane-backends libdrm libXpm epoxy poppler lirc
+    libexif
+    libjpeg
+    libpng
+    giflib
+    freetype
+    fontconfig
+    libtiff
+    libwebp
+    imagemagick
+    curl
+    sane-backends
+    libdrm
+    libXpm
+    epoxy
+    poppler
+    lirc
     mesa
   ];
 
diff --git a/pkgs/applications/graphics/freepv/default.nix b/pkgs/applications/graphics/freepv/default.nix
index bf990c4d0ef..d11798a9b29 100644
--- a/pkgs/applications/graphics/freepv/default.nix
+++ b/pkgs/applications/graphics/freepv/default.nix
@@ -1,11 +1,24 @@
-{ lib, stdenv, fetchurl, libjpeg, libGLU, libGL, freeglut, zlib, cmake, libX11, libxml2, libpng,
-  libXxf86vm }:
+{ lib
+, stdenv
+, fetchurl
+, libjpeg
+, libGLU
+, libGL
+, freeglut
+, zlib
+, cmake
+, libX11
+, libxml2
+, libpng
+, libXxf86vm
+}:
 
-stdenv.mkDerivation {
-  name = "freepv-0.3.0";
+stdenv.mkDerivation rec {
+  pname = "freepv";
+  version = "0.3.0";
 
   src = fetchurl {
-    url = "mirror://sourceforge/freepv/freepv-0.3.0.tar.gz";
+    url = "mirror://sourceforge/freepv/freepv-${version}.tar.gz";
     sha256 = "1w19abqjn64w47m35alg7bcdl1p97nf11zn64cp4p0dydihmhv56";
   };
 
diff --git a/pkgs/applications/graphics/gocr/default.nix b/pkgs/applications/graphics/gocr/default.nix
index 3c87e62e3d6..21ba4c662c2 100644
--- a/pkgs/applications/graphics/gocr/default.nix
+++ b/pkgs/applications/graphics/gocr/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, tk }:
 
 stdenv.mkDerivation rec {
-  name = "gocr-0.52";
+  pname = "gocr";
+  version = "0.52";
 
   src = fetchurl {
-    url = "https://www-e.uni-magdeburg.de/jschulen/ocr/${name}.tar.gz";
+    url = "https://www-e.uni-magdeburg.de/jschulen/ocr/gocr-${version}.tar.gz";
     sha256 = "11l6gds1lrm8lwrrsxnm5fjlwz8q1xbh896cprrl4psz21in946z";
   };
 
diff --git a/pkgs/applications/graphics/gpicview/default.nix b/pkgs/applications/graphics/gpicview/default.nix
index b661ba562f9..9e5de29c31b 100644
--- a/pkgs/applications/graphics/gpicview/default.nix
+++ b/pkgs/applications/graphics/gpicview/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, intltool, pkg-config, gtk2, fetchpatch }:
 
-stdenv.mkDerivation {
-  name = "gpicview-0.2.4";
+stdenv.mkDerivation rec {
+  pname = "gpicview";
+  version = "0.2.4";
 
   src = fetchurl {
-    url    = "mirror://sourceforge/lxde/gpicview-0.2.4.tar.gz";
+    url = "mirror://sourceforge/lxde/gpicview-${version}.tar.gz";
     sha256 = "1svcy1c8bgk0pl12yhyv16h2fl52x5vzzcv57z6qdcv5czgvgglr";
   };
 
@@ -17,11 +18,11 @@ stdenv.mkDerivation {
 
   meta = with lib; {
     description = "A simple and fast image viewer for X";
-    homepage    = "http://lxde.sourceforge.net/gpicview/";
+    homepage = "http://lxde.sourceforge.net/gpicview/";
     repositories.git = "git://lxde.git.sourceforge.net/gitroot/lxde/gpicview";
-    license     = licenses.gpl2;
+    license = licenses.gpl2;
     maintainers = with maintainers; [ lovek323 ];
-    platforms   = platforms.unix;
+    platforms = platforms.unix;
   };
 
   nativeBuildInputs = [ pkg-config ];
diff --git a/pkgs/applications/graphics/gqview/default.nix b/pkgs/applications/graphics/gqview/default.nix
index 39f7a42b3b3..9dfbf0e50f1 100644
--- a/pkgs/applications/graphics/gqview/default.nix
+++ b/pkgs/applications/graphics/gqview/default.nix
@@ -1,20 +1,21 @@
-{lib, stdenv, fetchurl, pkg-config, gtk2, libpng}:
+{ lib, stdenv, fetchurl, pkg-config, gtk2, libpng }:
 
 assert pkg-config != null && gtk2 != null && libpng != null;
 # Note that we cannot just copy gtk's png attribute, since gtk might
 # not be linked against png.
 # !!! assert libpng == gtk2.libpng;
 
-stdenv.mkDerivation {
-  name = "gqview-2.1.5";
+stdenv.mkDerivation rec {
+  pname = "gqview";
+  version = "2.1.5";
 
   src = fetchurl {
-    url = "mirror://sourceforge/gqview/gqview-2.1.5.tar.gz";
+    url = "mirror://sourceforge/gqview/gqview-${version}.tar.gz";
     sha256 = "0ilm5s7ps9kg4f5hzgjhg0xhn6zg0v9i7jnd67zrx9h7wsaa9zhj";
   };
 
   nativeBuildInputs = [ pkg-config ];
-  buildInputs = [ gtk2 libpng];
+  buildInputs = [ gtk2 libpng ];
 
   hardeningDisable = [ "format" ];
 
diff --git a/pkgs/applications/graphics/hugin/default.nix b/pkgs/applications/graphics/hugin/default.nix
index a83070e5e6b..ec2ac709f86 100644
--- a/pkgs/applications/graphics/hugin/default.nix
+++ b/pkgs/applications/graphics/hugin/default.nix
@@ -1,14 +1,46 @@
-{ lib, stdenv, cmake, fetchurl, gnumake, makeWrapper, pkg-config, fetchpatch
-, autopanosiftc, boost, cairo, enblend-enfuse, exiv2, fftw, flann, gettext
-, glew, ilmbase, lcms2, lensfun, libjpeg, libpng, libtiff, libX11, libXi
-, libXmu, libGLU, libGL, openexr, panotools, perlPackages, sqlite, vigra, wxGTK, zlib
+{ lib
+, stdenv
+, cmake
+, fetchurl
+, gnumake
+, makeWrapper
+, pkg-config
+, fetchpatch
+, autopanosiftc
+, boost
+, cairo
+, enblend-enfuse
+, exiv2
+, fftw
+, flann
+, gettext
+, glew
+, ilmbase
+, lcms2
+, lensfun
+, libjpeg
+, libpng
+, libtiff
+, libX11
+, libXi
+, libXmu
+, libGLU
+, libGL
+, openexr
+, panotools
+, perlPackages
+, sqlite
+, vigra
+, wxGTK
+, zlib
 }:
 
 stdenv.mkDerivation rec {
-  name = "hugin-2019.0.0";
+  pname = "hugin";
+  version = "2019.0.0";
 
   src = fetchurl {
-    url = "mirror://sourceforge/hugin/${name}.tar.bz2";
+    url = "mirror://sourceforge/hugin/hugin-${version}.tar.bz2";
     sha256 = "1l925qslp98gg7yzmgps10h6dq0nb60wbfk345anlxsv0g2ifizr";
   };
 
@@ -21,9 +53,30 @@ stdenv.mkDerivation rec {
   ];
 
   buildInputs = [
-    boost cairo exiv2 fftw flann gettext glew ilmbase lcms2 lensfun libjpeg
-    libpng libtiff libX11 libXi libXmu libGLU libGL openexr panotools sqlite vigra
-    wxGTK zlib
+    boost
+    cairo
+    exiv2
+    fftw
+    flann
+    gettext
+    glew
+    ilmbase
+    lcms2
+    lensfun
+    libjpeg
+    libpng
+    libtiff
+    libX11
+    libXi
+    libXmu
+    libGLU
+    libGL
+    openexr
+    panotools
+    sqlite
+    vigra
+    wxGTK
+    zlib
   ];
 
   nativeBuildInputs = [ cmake makeWrapper pkg-config ];
diff --git a/pkgs/applications/graphics/minidjvu/default.nix b/pkgs/applications/graphics/minidjvu/default.nix
index 40b28dd8566..f0693cc6121 100644
--- a/pkgs/applications/graphics/minidjvu/default.nix
+++ b/pkgs/applications/graphics/minidjvu/default.nix
@@ -1,9 +1,11 @@
-{lib, stdenv, fetchurl, libtiff, gettext }:
+{ lib, stdenv, fetchurl, libtiff, gettext }:
+
+stdenv.mkDerivation rec {
+  pname = "minidjvu";
+  version = "0.8";
 
-stdenv.mkDerivation {
-  name = "minidjvu-0.8";
   src = fetchurl {
-    url = "mirror://sourceforge/minidjvu/minidjvu-0.8.tar.gz";
+    url = "mirror://sourceforge/minidjvu/minidjvu-${version}.tar.gz";
     sha256 = "0jmpvy4g68k6xgplj9zsl6brg6vi81mx3nx2x9hfbr1f4zh95j79";
   };
 
@@ -11,7 +13,7 @@ stdenv.mkDerivation {
     sed -i s,/usr/bin/gzip,gzip, Makefile.in
   '';
 
-  buildInputs = [ libtiff gettext];
+  buildInputs = [ libtiff gettext ];
 
   preInstall = ''
     mkdir -p $out/lib
diff --git a/pkgs/applications/graphics/photivo/default.nix b/pkgs/applications/graphics/photivo/default.nix
index 4acb50e200f..338f716e9bb 100644
--- a/pkgs/applications/graphics/photivo/default.nix
+++ b/pkgs/applications/graphics/photivo/default.nix
@@ -1,8 +1,22 @@
-{ lib, stdenv, fetchhg, fetchpatch, cmake, qt4, fftw, graphicsmagick_q16,
-  lcms2, lensfun, pkg-config, libjpeg, exiv2, liblqr1 }:
+{ lib
+, stdenv
+, fetchhg
+, fetchpatch
+, cmake
+, qt4
+, fftw
+, graphicsmagick_q16
+, lcms2
+, lensfun
+, pkg-config
+, libjpeg
+, exiv2
+, liblqr1
+}:
 
 stdenv.mkDerivation {
-  name = "photivo-2014-01-25";
+  pname = "photivo";
+  version = "2014-01-25";
 
   src = fetchhg {
     url = "http://code.google.com/p/photivo/";
diff --git a/pkgs/applications/graphics/pinta/default.nix b/pkgs/applications/graphics/pinta/default.nix
index 2635b2d3d88..66804fc3110 100644
--- a/pkgs/applications/graphics/pinta/default.nix
+++ b/pkgs/applications/graphics/pinta/default.nix
@@ -1,14 +1,18 @@
-{ lib, fetchFromGitHub, buildDotnetPackage, dotnetPackages, gtksharp,
-  gettext }:
+{ lib
+, fetchFromGitHub
+, buildDotnetPackage
+, dotnetPackages
+, gtksharp
+, gettext
+}:
 
 let
   mono-addins = dotnetPackages.MonoAddins;
 in
 buildDotnetPackage rec {
-  name = "pinta-1.6";
-
   baseName = "Pinta";
   version = "1.6";
+
   outputFiles = [ "bin/*" ];
   buildInputs = [ gtksharp mono-addins gettext ];
   xBuildFiles = [ "Pinta.sln" ];
@@ -37,23 +41,25 @@ buildDotnetPackage rec {
       "Mono\\.Addins\\.Setup"
     ];
 
-    stripVersion = name: file: let
+    stripVersion = name: file:
+      let
         match = ''<Reference Include="${name}([ ,][^"]*)?"'';
         replace = ''<Reference Include="${name}"'';
-      in "sed -i -re 's/${match}/${replace}/g' ${file}\n";
+      in
+      "sed -i -re 's/${match}/${replace}/g' ${file}\n";
 
     # Map all possible pairs of two lists
     map2 = f: listA: listB: concatMap (a: map (f a) listB) listA;
     concatMap2Strings = f: listA: listB: concatStrings (map2 f listA listB);
   in
-    concatMap2Strings stripVersion versionedNames csprojFiles
-    + ''
-      # For some reason there is no Microsoft.Common.tasks file
-      # in ''${mono}/lib/mono/3.5 .
-      substituteInPlace Pinta.Install.proj \
-        --replace 'ToolsVersion="3.5"' 'ToolsVersion="4.0"' \
-        --replace "/usr/local" "$out"
-    '';
+  concatMap2Strings stripVersion versionedNames csprojFiles
+  + ''
+    # For some reason there is no Microsoft.Common.tasks file
+    # in ''${mono}/lib/mono/3.5 .
+    substituteInPlace Pinta.Install.proj \
+      --replace 'ToolsVersion="3.5"' 'ToolsVersion="4.0"' \
+      --replace "/usr/local" "$out"
+  '';
 
   makeWrapperArgs = [
     "--prefix MONO_GAC_PREFIX : ${gtksharp}"
diff --git a/pkgs/applications/graphics/qscreenshot/default.nix b/pkgs/applications/graphics/qscreenshot/default.nix
index b3e555358be..6a47760082e 100644
--- a/pkgs/applications/graphics/qscreenshot/default.nix
+++ b/pkgs/applications/graphics/qscreenshot/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, dos2unix, which, qt, Carbon }:
 
 stdenv.mkDerivation rec {
-  name = "qscreenshot-1.0";
+  pname = "qscreenshot";
+  version = "1.0";
 
   src = fetchurl {
-    url = "mirror://sourceforge/qscreenshot/${name}-src.tar.gz";
+    url = "mirror://sourceforge/qscreenshot/qscreenshot-${version}-src.tar.gz";
     sha256 = "1spj5fg2l8p5bk81xsv6hqn1kcrdiy54w19jsfb7g5i94vcb1pcx";
   };
 
diff --git a/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix b/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix
index 9ca0a702060..05b018215bb 100644
--- a/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix
+++ b/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix
@@ -1,10 +1,11 @@
-{ lib, stdenv, fetchurl, libsaneUDevRuleNumber ? "49"}:
+{ lib, stdenv, fetchurl, libsaneUDevRuleNumber ? "49" }:
 
 stdenv.mkDerivation rec {
-  name = "brother-udev-rule-type1-1.0.0-1";
+  pname = "brother-udev-rule-type1";
+  version = "1.0.0-1";
 
   src = fetchurl {
-    url = "http://download.brother.com/welcome/dlf006654/${name}.all.deb";
+    url = "http://download.brother.com/welcome/dlf006654/brother-udev-rule-type1-${version}.all.deb";
     sha256 = "0i0x5jw135pli4jl9mgnr5n2rrdvml57nw84yq2999r4frza53xi";
   };
 
diff --git a/pkgs/applications/graphics/sane/xsane.nix b/pkgs/applications/graphics/sane/xsane.nix
index e394acf2b06..8febb819bb3 100644
--- a/pkgs/applications/graphics/sane/xsane.nix
+++ b/pkgs/applications/graphics/sane/xsane.nix
@@ -1,15 +1,25 @@
-{ lib, stdenv, fetchurl, sane-backends, sane-frontends, libX11, gtk2, pkg-config, libpng
+{ lib
+, stdenv
+, fetchurl
+, sane-backends
+, sane-frontends
+, libX11
+, gtk2
+, pkg-config
+, libpng
 , libusb-compat-0_1 ? null
-, gimpSupport ? false, gimp ? null
+, gimpSupport ? false
+, gimp ? null
 }:
 
 assert gimpSupport -> gimp != null;
 
 stdenv.mkDerivation rec {
-  name = "xsane-0.999";
+  pname = "xsane";
+  version = "0.999";
 
   src = fetchurl {
-    url = "http://www.xsane.org/download/${name}.tar.gz";
+    url = "http://www.xsane.org/download/xsane-${version}.tar.gz";
     sha256 = "0jrb918sfb9jw3vmrz0z7np4q55hgsqqffpixs0ir5nwcwzd50jp";
   };
 
@@ -19,8 +29,8 @@ stdenv.mkDerivation rec {
   '';
 
   nativeBuildInputs = [ pkg-config ];
-  buildInputs = [libpng sane-backends sane-frontends libX11 gtk2 ]
-    ++ (if libusb-compat-0_1 != null then [libusb-compat-0_1] else [])
+  buildInputs = [ libpng sane-backends sane-frontends libX11 gtk2 ]
+    ++ (if libusb-compat-0_1 != null then [ libusb-compat-0_1 ] else [ ])
     ++ lib.optional gimpSupport gimp;
 
   meta = {
diff --git a/pkgs/applications/graphics/scantailor/default.nix b/pkgs/applications/graphics/scantailor/default.nix
index 898cc3336a5..a0e52ab5d30 100644
--- a/pkgs/applications/graphics/scantailor/default.nix
+++ b/pkgs/applications/graphics/scantailor/default.nix
@@ -1,10 +1,11 @@
-{lib, stdenv, fetchurl, qt4, cmake, libjpeg, libtiff, boost }:
+{ lib, stdenv, fetchurl, qt4, cmake, libjpeg, libtiff, boost }:
 
-stdenv.mkDerivation {
-  name = "scantailor-0.9.12.1";
+stdenv.mkDerivation rec {
+  pname = "scantailor";
+  version = "0.9.12.1";
 
   src = fetchurl {
-    url = "https://github.com/scantailor/scantailor/archive/RELEASE_0_9_12_1.tar.gz";
+    url = "https://github.com/scantailor/scantailor/archive/RELEASE_${lib.replaceStrings ["."] ["_"] version}.tar.gz";
     sha256 = "1pjx3a6hs16az6rki59bchy3biy7jndjx8r125q01aq7lbf5npgg";
   };
 
diff --git a/pkgs/applications/graphics/wings/default.nix b/pkgs/applications/graphics/wings/default.nix
index ef8d4b5096e..53f65859073 100644
--- a/pkgs/applications/graphics/wings/default.nix
+++ b/pkgs/applications/graphics/wings/default.nix
@@ -1,9 +1,11 @@
 { fetchurl, lib, stdenv, erlang, cl, libGL, libGLU, runtimeShell }:
 
 stdenv.mkDerivation rec {
-  name = "wings-2.2.4";
+  pname = "wings";
+  version = "2.2.4";
+
   src = fetchurl {
-    url = "mirror://sourceforge/wings/${name}.tar.bz2";
+    url = "mirror://sourceforge/wings/wings-${version}.tar.bz2";
     sha256 = "1xcmifs4vq2810pqqvsjsm8z3lz24ys4c05xkh82nyppip2s89a3";
   };
 
@@ -24,13 +26,13 @@ stdenv.mkDerivation rec {
 
   # I did not test the *cl* part. I added the -pa just by imitation.
   installPhase = ''
-    mkdir -p $out/bin $out/lib/${name}/ebin
-    cp ebin/* $out/lib/${name}/ebin
-    cp -R textures shaders plugins $out/lib/$name
+    mkdir -p $out/bin $out/lib/wings-${version}/ebin
+    cp ebin/* $out/lib/wings-${version}/ebin
+    cp -R textures shaders plugins $out/lib/wings-${version}
     cat << EOF > $out/bin/wings
     #!${runtimeShell}
     ${erlang}/bin/erl \
-      -pa $out/lib/${name}/ebin -run wings_start start_halt "$@"
+      -pa $out/lib/wings-${version}/ebin -run wings_start start_halt "$@"
     EOF
     chmod +x $out/bin/wings
   '';
@@ -39,7 +41,7 @@ stdenv.mkDerivation rec {
     homepage = "http://www.wings3d.com/";
     description = "Subdivision modeler inspired by Nendo and Mirai from Izware";
     license = lib.licenses.tcltk;
-    maintainers = with lib.maintainers; [viric];
+    maintainers = with lib.maintainers; [ viric ];
     platforms = with lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/misc/abook/default.nix b/pkgs/applications/misc/abook/default.nix
index 62cba4a5b73..de463cfd666 100644
--- a/pkgs/applications/misc/abook/default.nix
+++ b/pkgs/applications/misc/abook/default.nix
@@ -1,19 +1,20 @@
 { lib, stdenv, fetchurl, fetchpatch, pkg-config, ncurses, readline, autoreconfHook }:
 
 stdenv.mkDerivation rec {
-  name = "abook-0.6.1";
+  pname = "abook";
+  version = "0.6.1";
 
   src = fetchurl {
-    url = "http://abook.sourceforge.net/devel/${name}.tar.gz";
+    url = "http://abook.sourceforge.net/devel/abook-${version}.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";
-     })
+      url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/gcc5.patch?h=packages/abook";
+      name = "gcc5.patch";
+      sha256 = "13n3qd6yy45i5n8ppjn9hj6y63ymjrq96280683xk7f7rjavw5nn";
+    })
   ];
 
   nativeBuildInputs = [ pkg-config autoreconfHook ];
diff --git a/pkgs/applications/misc/adobe-reader/default.nix b/pkgs/applications/misc/adobe-reader/default.nix
index 8f1b3f5ca88..6b44128fbce 100644
--- a/pkgs/applications/misc/adobe-reader/default.nix
+++ b/pkgs/applications/misc/adobe-reader/default.nix
@@ -1,17 +1,31 @@
-{ lib, stdenv, fetchurl, libX11, cups, zlib, libxml2, pango, atk, gtk2, glib
-, gdk-pixbuf, gdk-pixbuf-xlib }:
+{ lib
+, stdenv
+, fetchurl
+, libX11
+, cups
+, zlib
+, libxml2
+, pango
+, atk
+, gtk2
+, glib
+, gdk-pixbuf
+, gdk-pixbuf-xlib
+}:
 
 assert stdenv.hostPlatform.system == "i686-linux";
 
-let version = "9.5.5"; in
-
-stdenv.mkDerivation {
-  name = "adobe-reader-${version}-1";
+let
+  baseVersion = "9.5.5";
+in
+stdenv.mkDerivation rec {
+  pname = "adobe-reader";
+  version = "${baseVersion}-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";
+    url = "http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/${baseVersion}/enu/AdbeRdr${version}_i486linux_enu.tar.bz2";
     sha256 = "0h35misxrqkl5zlmmvray1bqf4ywczkm89n9qw7d9arqbg3aj3pf";
   };
 
diff --git a/pkgs/applications/misc/audio/sox/default.nix b/pkgs/applications/misc/audio/sox/default.nix
index 9baf2d4d2f2..02a9ab36295 100644
--- a/pkgs/applications/misc/audio/sox/default.nix
+++ b/pkgs/applications/misc/audio/sox/default.nix
@@ -1,26 +1,46 @@
-{ config, lib, stdenv, fetchurl, pkg-config, CoreAudio
-, enableAlsa ? true, alsa-lib ? 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
-, enableWavpack ? true, wavpack ? null
-# amrnb and amrwb are unfree, disabled by default
-, enableAMR ? false, amrnb ? null, amrwb ? null
-, enableLibpulseaudio ? true, libpulseaudio ? null
+{ config
+, lib
+, stdenv
+, fetchurl
+, pkg-config
+, CoreAudio
+, enableAlsa ? true
+, alsa-lib ? 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
+, enableWavpack ? true
+, wavpack ? null
+  # amrnb and amrwb are unfree, disabled by default
+, enableAMR ? false
+, amrnb ? null
+, amrwb ? null
+, enableLibpulseaudio ? true
+, libpulseaudio ? null
 }:
 
 with lib;
 
 stdenv.mkDerivation rec {
-  name = "sox-14.4.2";
+  pname = "sox";
+  version = "14.4.2";
 
   src = fetchurl {
-    url = "mirror://sourceforge/sox/${name}.tar.gz";
+    url = "mirror://sourceforge/sox/sox-${version}.tar.gz";
     sha256 = "0v2znlxkxxcd3f48hf3dx9pq7i6fdhb62kgj7wv8xggz8f35jpxl";
   };
 
diff --git a/pkgs/applications/misc/audio/wavesurfer/default.nix b/pkgs/applications/misc/audio/wavesurfer/default.nix
index 9c8a99a5934..99cdc9ade21 100644
--- a/pkgs/applications/misc/audio/wavesurfer/default.nix
+++ b/pkgs/applications/misc/audio/wavesurfer/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, snack, tcl, tk, makeWrapper }:
 
-stdenv.mkDerivation {
-  name = "wavesurfer-1.8.5";
+stdenv.mkDerivation rec {
+  pname = "wavesurfer";
+  version = "1.8.5";
 
   src = fetchurl {
-    url = "https://www.speech.kth.se/wavesurfer/wavesurfer-1.8.5.tar.gz";
+    url = "https://www.speech.kth.se/wavesurfer/wavesurfer-${version}.tar.gz";
     sha256 = "1yx9s1j47cq0v40cwq2gn7bdizpw46l95ba4zl9z4gg31mfvm807";
   };
 
diff --git a/pkgs/applications/misc/audio/wavrsocvt/default.nix b/pkgs/applications/misc/audio/wavrsocvt/default.nix
index 6b09a2e38d8..10aac715b48 100644
--- a/pkgs/applications/misc/audio/wavrsocvt/default.nix
+++ b/pkgs/applications/misc/audio/wavrsocvt/default.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
-  name = "wavrsocvt-1.0.2.0";
+  pname = "wavrsocvt";
+  version = "1.0.2.0";
 
   src = fetchurl {
     url = "http://bricxcc.sourceforge.net/wavrsocvt.tgz";
@@ -10,23 +11,23 @@ stdenv.mkDerivation {
 
   unpackPhase = ''
     tar -zxf $src
-    '';
+  '';
 
   installPhase = ''
     mkdir -p $out/bin
     cp wavrsocvt $out/bin
-    '';
+  '';
 
   meta = with 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.
+      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;
diff --git a/pkgs/applications/misc/avrdudess/default.nix b/pkgs/applications/misc/avrdudess/default.nix
index 61cab2b6a2a..0a42e6f5e2c 100644
--- a/pkgs/applications/misc/avrdudess/default.nix
+++ b/pkgs/applications/misc/avrdudess/default.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, runtimeShell, fetchurl, unzip, mono, avrdude, gtk2, xdg-utils }:
 
 stdenv.mkDerivation {
-  name = "avrdudess-2.2.20140102";
+  pname = "avrdudess";
+  version = "2.2.20140102";
 
   src = fetchurl {
     url = "http://blog.zakkemble.co.uk/download/avrdudess_20140102.zip";
diff --git a/pkgs/applications/misc/catclock/default.nix b/pkgs/applications/misc/catclock/default.nix
index 9c6b1812683..768eb7b308e 100644
--- a/pkgs/applications/misc/catclock/default.nix
+++ b/pkgs/applications/misc/catclock/default.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, fetchFromGitHub, xlibsWrapper, motif }:
 
 stdenv.mkDerivation {
-  name = "catclock-2015-10-04";
+  pname = "catclock";
+  version = "unstable-2015-10-04";
 
   src = fetchFromGitHub {
     owner = "BarkyTheDog";
diff --git a/pkgs/applications/misc/colort/default.nix b/pkgs/applications/misc/colort/default.nix
index a4283e5ebb9..7a1ae7a9e2f 100644
--- a/pkgs/applications/misc/colort/default.nix
+++ b/pkgs/applications/misc/colort/default.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation {
-  name = "colort-unstable-2017-03-12";
+  pname = "colort";
+  version = "unstable-2017-03-12";
 
   src = fetchFromGitHub {
     owner = "neeasade";
@@ -10,7 +11,7 @@ stdenv.mkDerivation {
     sha256 = "10n8rbr2h6hz86hcx73f86pjbbfiaw2rvxsk0yfajnma7bpxgdxw";
   };
 
-  makeFlags = ["PREFIX=$(out)"];
+  makeFlags = [ "PREFIX=$(out)" ];
 
   meta = with lib; {
     description = "A program for 'tinting' color values";
diff --git a/pkgs/applications/misc/ding/default.nix b/pkgs/applications/misc/ding/default.nix
index 649fbe55fae..3c193d3f569 100644
--- a/pkgs/applications/misc/ding/default.nix
+++ b/pkgs/applications/misc/ding/default.nix
@@ -10,10 +10,11 @@ let
   };
 in
 stdenv.mkDerivation rec {
-  name = "ding-1.9";
+  pname = "ding";
+  version = "1.9";
 
   src = fetchurl {
-    url = "http://ftp.tu-chemnitz.de/pub/Local/urz/ding/${name}.tar.gz";
+    url = "http://ftp.tu-chemnitz.de/pub/Local/urz/ding/ding-${version}.tar.gz";
     sha256 = "sha256-aabIH894WihsBTo1LzIBzIZxxyhRYVxLcHpDQwmwmOU=";
   };
 
diff --git a/pkgs/applications/misc/dmenu/default.nix b/pkgs/applications/misc/dmenu/default.nix
index 62f02ce6714..42bc0599866 100644
--- a/pkgs/applications/misc/dmenu/default.nix
+++ b/pkgs/applications/misc/dmenu/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, libX11, libXinerama, libXft, zlib, patches ? null }:
 
 stdenv.mkDerivation rec {
-  name = "dmenu-5.0";
+  pname = "dmenu";
+  version = "5.0";
 
   src = fetchurl {
-    url = "https://dl.suckless.org/tools/${name}.tar.gz";
+    url = "https://dl.suckless.org/tools/dmenu-${version}.tar.gz";
     sha256 = "1lvfxzg3chsgcqbc2vr0zic7vimijgmbvnspayx73kyvqi1f267y";
   };
 
@@ -24,10 +25,10 @@ stdenv.mkDerivation rec {
   makeFlags = [ "CC:=$(CC)" ];
 
   meta = with 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 globin ];
-      platforms = platforms.all;
+    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 globin ];
+    platforms = platforms.all;
   };
 }
diff --git a/pkgs/applications/misc/fbreader/default.nix b/pkgs/applications/misc/fbreader/default.nix
index c2347d5fbb8..c684d273bc7 100644
--- a/pkgs/applications/misc/fbreader/default.nix
+++ b/pkgs/applications/misc/fbreader/default.nix
@@ -1,9 +1,21 @@
-{ lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config
-, bzip2, curl, expat, fribidi, libunibreak, sqlite, zlib
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, pkg-config
+, 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
+, qt4
+, gtk2
+, AppKit
+, Cocoa
 }:
 
 with lib;
@@ -16,7 +28,8 @@ assert uiTarget == "macosx" -> uiType == "cocoa";
 # which is way to old and no longer in nixpkgs.
 
 stdenv.mkDerivation {
-  name = "fbreader-${uiType}-0.99.6";
+  pname = "fbreader-${uiType}";
+  version = "0.99.6";
 
   src = fetchFromGitHub {
     owner = "geometer";
@@ -53,7 +66,13 @@ stdenv.mkDerivation {
   nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [
-    bzip2 curl expat fribidi libunibreak sqlite zlib
+    bzip2
+    curl
+    expat
+    fribidi
+    libunibreak
+    sqlite
+    zlib
   ]
   ++ optional (uiType == "qt4") qt4
   ++ optional (uiType == "gtk") gtk2
@@ -68,7 +87,7 @@ stdenv.mkDerivation {
     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
+      || uiType == "gtk"; # builds, but the result is unusable, hangs a lot
     platforms = platforms.unix;
     maintainers = [ maintainers.coroa ];
   };
diff --git a/pkgs/applications/misc/fehlstart/default.nix b/pkgs/applications/misc/fehlstart/default.nix
index 992b6278082..69050ca661f 100644
--- a/pkgs/applications/misc/fehlstart/default.nix
+++ b/pkgs/applications/misc/fehlstart/default.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, pkg-config, gtk2, keybinder, fetchFromGitLab }:
 
 stdenv.mkDerivation {
-  name = "fehlstart-9f4342d7";
+  pname = "fehlstart";
+  version = "unstable-2016-05-23";
 
   src = fetchFromGitLab {
     owner = "fehlstart";
diff --git a/pkgs/applications/misc/garmin-plugin/default.nix b/pkgs/applications/misc/garmin-plugin/default.nix
index c2c3a69140b..724f2aeee62 100644
--- a/pkgs/applications/misc/garmin-plugin/default.nix
+++ b/pkgs/applications/misc/garmin-plugin/default.nix
@@ -1,11 +1,13 @@
 { lib, stdenv, fetchurl, garmintools, libgcrypt, libusb-compat-0_1, pkg-config, tinyxml, zlib }:
-stdenv.mkDerivation {
-  name = "garmin-plugin-0.3.26";
+stdenv.mkDerivation rec {
+  pname = "garmin-plugin";
+  version = "0.3.26";
+
   src = fetchurl {
-    url = "https://github.com/adiesner/GarminPlugin/archive/V0.3.26.tar.gz";
+    url = "https://github.com/adiesner/GarminPlugin/archive/V${version}.tar.gz";
     sha256 = "15gads1fj4sj970m5960dgnhys41ksi4cm53ldkf67wn8dc9i4k0";
   };
-  sourceRoot = "GarminPlugin-0.3.26/src";
+  sourceRoot = "GarminPlugin-${version}/src";
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ garmintools libusb-compat-0_1 libgcrypt tinyxml zlib ];
   configureFlags = [
diff --git a/pkgs/applications/misc/gkrellm/default.nix b/pkgs/applications/misc/gkrellm/default.nix
index aaaab255c76..9c59377ea37 100644
--- a/pkgs/applications/misc/gkrellm/default.nix
+++ b/pkgs/applications/misc/gkrellm/default.nix
@@ -1,19 +1,33 @@
-{ lib, fetchurl, stdenv, gettext, pkg-config, glib, gtk2, libX11, libSM, libICE, which
-, IOKit, copyDesktopItems, makeDesktopItem, wrapGAppsHook
+{ lib
+, fetchurl
+, stdenv
+, gettext
+, pkg-config
+, glib
+, gtk2
+, libX11
+, libSM
+, libICE
+, which
+, IOKit
+, copyDesktopItems
+, makeDesktopItem
+, wrapGAppsHook
 }:
 
 with lib;
 
 stdenv.mkDerivation rec {
-  name = "gkrellm-2.3.11";
+  pname = "gkrellm";
+  version = "2.3.11";
 
   src = fetchurl {
-    url = "http://gkrellm.srcbox.net/releases/${name}.tar.bz2";
+    url = "http://gkrellm.srcbox.net/releases/gkrellm-${version}.tar.bz2";
     sha256 = "01lccz4fga40isv09j8rjgr0qy10rff9vj042n6gi6gdv4z69q0y";
   };
 
   nativeBuildInputs = [ copyDesktopItems pkg-config which wrapGAppsHook ];
-  buildInputs = [gettext glib gtk2 libX11 libSM libICE]
+  buildInputs = [ gettext glib gtk2 libX11 libSM libICE ]
     ++ optionals stdenv.isDarwin [ IOKit ];
 
   hardeningDisable = [ "format" ];
diff --git a/pkgs/applications/misc/gpa/default.nix b/pkgs/applications/misc/gpa/default.nix
index af204b23506..0d567dd79a1 100644
--- a/pkgs/applications/misc/gpa/default.nix
+++ b/pkgs/applications/misc/gpa/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, intltool, pkg-config, gtk2, gpgme, libgpg-error, libassuan }:
 
 stdenv.mkDerivation rec {
-  name = "gpa-0.10.0";
+  pname = "gpa";
+  version = "0.10.0";
 
   src = fetchurl {
-    url = "mirror://gnupg/gpa/${name}.tar.bz2";
+    url = "mirror://gnupg/gpa/gpa-${version}.tar.bz2";
     sha256 = "1cbpc45f8qbdkd62p12s3q2rdq6fa5xdzwmcwd3xrj55bzkspnwm";
   };
 
diff --git a/pkgs/applications/misc/grip/default.nix b/pkgs/applications/misc/grip/default.nix
index 557cd45c42c..6a6666763c1 100644
--- a/pkgs/applications/misc/grip/default.nix
+++ b/pkgs/applications/misc/grip/default.nix
@@ -15,10 +15,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "grip-4.2.2";
+  pname = "grip";
+  version = "4.2.2";
 
   src = fetchurl {
-    url = "mirror://sourceforge/grip/${name}.tar.gz";
+    url = "mirror://sourceforge/grip/grip-${version}.tar.gz";
     sha256 = "sha256-nXtGgJeNYM8lyllNi9UdmsnVcHOCXfryWmKGZ9QFTHE=";
   };
 
diff --git a/pkgs/applications/misc/gv/default.nix b/pkgs/applications/misc/gv/default.nix
index aa07058dc80..851f2d80c97 100644
--- a/pkgs/applications/misc/gv/default.nix
+++ b/pkgs/applications/misc/gv/default.nix
@@ -1,13 +1,11 @@
 { lib, stdenv, fetchurl, Xaw3d, ghostscriptX, perl, pkg-config, libiconv }:
 
-let
-  name = "gv-3.7.4";
-in
-stdenv.mkDerivation {
-  inherit name;
+stdenv.mkDerivation rec {
+  pname = "gv";
+  version = "3.7.4";
 
   src = fetchurl {
-    url = "mirror://gnu/gv/${name}.tar.gz";
+    url = "mirror://gnu/gv/gv-${version}.tar.gz";
     sha256 = "0q8s43z14vxm41pfa8s5h9kyyzk1fkwjhkiwbf2x70alm6rv6qi1";
   };
 
diff --git a/pkgs/applications/misc/gxneur/default.nix b/pkgs/applications/misc/gxneur/default.nix
index 9e8c5ddaef4..7c32cec7219 100644
--- a/pkgs/applications/misc/gxneur/default.nix
+++ b/pkgs/applications/misc/gxneur/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, pkg-config, intltool, gtk2, xorg, glib, xneur, libglade, GConf, libappindicator-gtk2, pcre }:
 
-stdenv.mkDerivation {
-  name = "gxneur-0.20.0";
+stdenv.mkDerivation rec {
+  pname = "gxneur";
+  version = "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";
+    url = "https://github.com/AndrewCrewKuznetsov/xneur-devel/raw/f66723feb272c68f7c22a8bf0dbcafa5e3a8a5ee/dists/${version}/gxneur_${version}.orig.tar.gz";
     sha256 = "0avmhdcj0hpr55fc0iih8fjykmdhn34c8mwdnqvl8jh4nhxxchxr";
   };
 
@@ -13,8 +14,17 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ pkg-config intltool ];
   buildInputs = [
-    xorg.libX11 glib gtk2 xorg.libXpm xorg.libXt xorg.libXext xneur
-    libglade GConf pcre libappindicator-gtk2
+    xorg.libX11
+    glib
+    gtk2
+    xorg.libXpm
+    xorg.libXt
+    xorg.libXext
+    xneur
+    libglade
+    GConf
+    pcre
+    libappindicator-gtk2
   ];
 
   meta = with lib; {
diff --git a/pkgs/applications/misc/jigdo/default.nix b/pkgs/applications/misc/jigdo/default.nix
index b4573a81635..0f5a9aa0d82 100644
--- a/pkgs/applications/misc/jigdo/default.nix
+++ b/pkgs/applications/misc/jigdo/default.nix
@@ -1,11 +1,12 @@
 { lib, stdenv, fetchurl, db, gtk2, bzip2 }:
 
-stdenv.mkDerivation {
-  name = "jigdo-0.7.3";
+stdenv.mkDerivation rec {
+  pname = "jigdo";
+  version = "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";
+    url = "http://ftp.de.debian.org/debian/pool/main/j/jigdo/jigdo_${version}.orig.tar.gz";
     sha256 = "1qvqzgzb0dzq82fa1ffs6hyij655rajnfwkljk1y0mnkygnha1xv";
   };
 
diff --git a/pkgs/applications/misc/loxodo/default.nix b/pkgs/applications/misc/loxodo/default.nix
index 65f9a9f0f17..d304e39f9d7 100644
--- a/pkgs/applications/misc/loxodo/default.nix
+++ b/pkgs/applications/misc/loxodo/default.nix
@@ -4,7 +4,8 @@ let
   python = py.python;
 in
 py.buildPythonApplication {
-  name = "loxodo-0.20150124";
+  pname = "loxodo";
+  version = "0.20150124";
 
   src = fetchgit {
     url = "https://github.com/sommer/loxodo.git";
diff --git a/pkgs/applications/misc/mencal/default.nix b/pkgs/applications/misc/mencal/default.nix
index 806d6a53cfa..c4973b27553 100644
--- a/pkgs/applications/misc/mencal/default.nix
+++ b/pkgs/applications/misc/mencal/default.nix
@@ -1,17 +1,18 @@
 { lib, stdenv, fetchurl, perl }:
 
 stdenv.mkDerivation rec {
-  name = "mencal-3.0";
+  pname = "mencal";
+  version = "3.0";
 
   src = fetchurl {
-    url = "http://kyberdigi.cz/projects/mencal/files/${name}.tar.gz";
+    url = "http://kyberdigi.cz/projects/mencal/files/mencal-${version}.tar.gz";
     sha256 = "9328d0b2f3f57847e8753c5184531f4832be7123d1b6623afdff892074c03080";
   };
 
   installPhase = ''
-      mkdir -p $out/bin
-      cp mencal $out/bin/
-    '';
+    mkdir -p $out/bin
+    cp mencal $out/bin/
+  '';
 
   buildInputs = [ perl ];
 
diff --git a/pkgs/applications/misc/metar/default.nix b/pkgs/applications/misc/metar/default.nix
index d9e1922f1c4..50721a58636 100644
--- a/pkgs/applications/misc/metar/default.nix
+++ b/pkgs/applications/misc/metar/default.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, fetchgit, curl }:
 
 stdenv.mkDerivation {
-  name = "metar-20161013.1";
+  pname = "metar";
+  version = "20161013.1";
 
   src = fetchgit {
     url = "https://github.com/keesL/metar.git";
diff --git a/pkgs/applications/misc/mpvc/default.nix b/pkgs/applications/misc/mpvc/default.nix
index 69aca239d31..bfdfeebae27 100644
--- a/pkgs/applications/misc/mpvc/default.nix
+++ b/pkgs/applications/misc/mpvc/default.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, socat, fetchFromGitHub, makeWrapper }:
 
 stdenv.mkDerivation {
-  name = "mpvc-unstable-2017-03-18";
+  pname = "mpvc";
+  version = "unstable-2017-03-18";
 
   src = fetchFromGitHub {
     owner = "wildefyr";
diff --git a/pkgs/applications/misc/navipowm/default.nix b/pkgs/applications/misc/navipowm/default.nix
index 0727f867291..6527a4f5741 100644
--- a/pkgs/applications/misc/navipowm/default.nix
+++ b/pkgs/applications/misc/navipowm/default.nix
@@ -1,9 +1,10 @@
 { lib, stdenv, fetchurl, qt4, qmake4Hook }:
 stdenv.mkDerivation rec {
-  name = "navipowm-0.2.4";
+  pname = "navipowm";
+  version = "0.2.4";
 
   src = fetchurl {
-    url = "mirror://sourceforge/navipowm/NaviPOWM-0.2.4.tar.gz";
+    url = "mirror://sourceforge/navipowm/NaviPOWM-${version}.tar.gz";
     sha256 = "1kdih8kwpgcgfh6l6njkr9gq2j5hv39xvzmzgvhip553kn6bss7b";
   };
 
@@ -12,10 +13,10 @@ stdenv.mkDerivation rec {
   '';
 
   installPhase = ''
-    mkdir -p $out/bin $out/share/${name}/Icons
+    mkdir -p $out/bin $out/share/navipowm-${version}/Icons
     cp bin/NaviPOWM $out/bin
-    cp ../../common/Config/navipowm.ini $out/share/${name}
-    cp ../../common/Images/* $out/share/${name}
+    cp ../../common/Config/navipowm.ini $out/share/navipowm-${version}
+    cp ../../common/Images/* $out/share/navipowm-${version}
   '';
 
   buildInputs = [ qt4 ];
diff --git a/pkgs/applications/misc/openbrf/default.nix b/pkgs/applications/misc/openbrf/default.nix
index 663a7bf43ea..c0fb436b7f8 100644
--- a/pkgs/applications/misc/openbrf/default.nix
+++ b/pkgs/applications/misc/openbrf/default.nix
@@ -2,7 +2,8 @@
 
 
 mkDerivation {
-  name = "openbrf-unstable-2016-01-09";
+  pname = "openbrf";
+  version = "unstable-2016-01-09";
 
   src = fetchFromGitHub {
     owner = "cfcohen";
diff --git a/pkgs/applications/misc/pcmanfm/default.nix b/pkgs/applications/misc/pcmanfm/default.nix
index a8b407dd7b5..deb9a98a517 100644
--- a/pkgs/applications/misc/pcmanfm/default.nix
+++ b/pkgs/applications/misc/pcmanfm/default.nix
@@ -1,5 +1,18 @@
-{ lib, stdenv, fetchurl, glib, intltool, libfm, libX11, pango, pkg-config
-, wrapGAppsHook, gnome, withGtk3 ? true, gtk2, gtk3 }:
+{ lib
+, stdenv
+, fetchurl
+, glib
+, intltool
+, libfm
+, libX11
+, pango
+, pkg-config
+, wrapGAppsHook
+, gnome
+, withGtk3 ? true
+, gtk2
+, gtk3
+}:
 
 let
   libfm' = libfm.override { inherit withGtk3; };
@@ -7,9 +20,11 @@ let
   inherit (lib) optional;
 in
 stdenv.mkDerivation rec {
-  name = "pcmanfm-1.3.2";
+  pname = "pcmanfm";
+  version = "1.3.2";
+
   src = fetchurl {
-    url = "mirror://sourceforge/pcmanfm/${name}.tar.xz";
+    url = "mirror://sourceforge/pcmanfm/pcmanfm-${version}.tar.xz";
     sha256 = "sha256-FMt7JHSTxMzmX7tZAmEeOtAKeocPvB5QrcUEKMUUDPc=";
   };
 
diff --git a/pkgs/applications/misc/posterazor/default.nix b/pkgs/applications/misc/posterazor/default.nix
index 602ac3e5e3b..77e5e34899e 100644
--- a/pkgs/applications/misc/posterazor/default.nix
+++ b/pkgs/applications/misc/posterazor/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, cmake, unzip, pkg-config, libXpm, fltk13, freeimage }:
 
-stdenv.mkDerivation {
-  name = "posterazor-1.5.1";
+stdenv.mkDerivation rec {
+  pname = "posterazor";
+  version = "1.5.1";
 
   src = fetchurl {
-    url = "mirror://sourceforge/posterazor/1.5.1/PosteRazor-1.5.1-Source.zip";
+    url = "mirror://sourceforge/posterazor/${version}/PosteRazor-${version}-Source.zip";
     sha256 = "1dqpdk8zl0smdg4fganp3hxb943q40619qmxjlga9jhjc01s7fq5";
   };
 
diff --git a/pkgs/applications/misc/ptask/default.nix b/pkgs/applications/misc/ptask/default.nix
index b243f194181..73900372044 100644
--- a/pkgs/applications/misc/ptask/default.nix
+++ b/pkgs/applications/misc/ptask/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, pkg-config, makeWrapper, gtk3, json_c, taskwarrior }:
 
 stdenv.mkDerivation rec {
-  name = "ptask-1.0.0";
+  pname = "ptask";
+  version = "1.0.0";
 
   src = fetchurl {
-    url = "https://wpitchoune.net/ptask/files/${name}.tar.gz";
+    url = "https://wpitchoune.net/ptask/files/ptask-${version}.tar.gz";
     sha256 = "13nirr7b29bv3w2zc8zxphhmc9ayhs61i11jl4819nabk7vy1kdq";
   };
 
diff --git a/pkgs/applications/misc/sbagen/default.nix b/pkgs/applications/misc/sbagen/default.nix
index 215447ed4e9..4ddfa6f9cf2 100644
--- a/pkgs/applications/misc/sbagen/default.nix
+++ b/pkgs/applications/misc/sbagen/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "sbagen-1.4.4";
+  pname = "sbagen";
+  version = "1.4.4";
 
   src = fetchurl {
-    url = "https://uazu.net/sbagen/${name}.tgz";
+    url = "https://uazu.net/sbagen/sbagen-${version}.tgz";
     sha256 = "0w62yk1b0hq79kl0angma897yqa8p1ww0dwydf3zlwav333prkd2";
   };
 
diff --git a/pkgs/applications/misc/slade/git.nix b/pkgs/applications/misc/slade/git.nix
index f263c4ee74d..124ae206c8c 100644
--- a/pkgs/applications/misc/slade/git.nix
+++ b/pkgs/applications/misc/slade/git.nix
@@ -1,4 +1,6 @@
-{ lib, stdenv, fetchFromGitHub
+{ lib
+, stdenv
+, fetchFromGitHub
 , cmake
 , pkg-config
 , wxGTK
@@ -15,7 +17,8 @@
 }:
 
 stdenv.mkDerivation {
-  name = "slade-git-3.2.0.2021.05.13";
+  pname = "slade";
+  version = "unstable-2021-05-13";
 
   src = fetchFromGitHub {
     owner = "sirjuddington";
diff --git a/pkgs/applications/misc/speedread/default.nix b/pkgs/applications/misc/speedread/default.nix
index a7b9cb591a5..451382cda37 100644
--- a/pkgs/applications/misc/speedread/default.nix
+++ b/pkgs/applications/misc/speedread/default.nix
@@ -1,12 +1,13 @@
 { lib, stdenv, fetchFromGitHub, perl }:
 
 stdenv.mkDerivation rec {
-  name = "speedread-unstable-2016-09-21";
+  pname = "speedread";
+  version = "unstable-2016-09-21";
 
   src = fetchFromGitHub {
-    owner  = "pasky";
-    repo   = "speedread";
-    rev    = "93acfd61a1bf4482537ce5d71b9164b8446cb6bd";
+    owner = "pasky";
+    repo = "speedread";
+    rev = "93acfd61a1bf4482537ce5d71b9164b8446cb6bd";
     sha256 = "1h94jx3v18fdlc64lfmj2g5x63fjyqb8c56k5lihl7bva0xgdkxd";
   };
 
diff --git a/pkgs/applications/misc/stag/default.nix b/pkgs/applications/misc/stag/default.nix
index 03c90af2368..0a7ebae14e7 100644
--- a/pkgs/applications/misc/stag/default.nix
+++ b/pkgs/applications/misc/stag/default.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, fetchgit, curses }:
 
 stdenv.mkDerivation {
-  name = "stag-1.0";
+  pname = "stag";
+  version = "1.0";
 
   src = fetchgit {
     url = "https://github.com/seenaburns/stag.git";
diff --git a/pkgs/applications/misc/twmn/default.nix b/pkgs/applications/misc/twmn/default.nix
index b7974966be4..d4b4d1d9d80 100644
--- a/pkgs/applications/misc/twmn/default.nix
+++ b/pkgs/applications/misc/twmn/default.nix
@@ -1,7 +1,8 @@
 { lib, mkDerivation, fetchFromGitHub, qtbase, qtx11extras, qmake, pkg-config, boost }:
 
 mkDerivation {
-  name = "twmn-git-2018-10-01";
+  pname = "twmn";
+  version = "unstable-2018-10-01";
 
   src = fetchFromGitHub {
     owner = "sboli";
diff --git a/pkgs/applications/misc/wmname/default.nix b/pkgs/applications/misc/wmname/default.nix
index cb4f5ec3442..438bd5c5d56 100644
--- a/pkgs/applications/misc/wmname/default.nix
+++ b/pkgs/applications/misc/wmname/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, libX11 }:
 
 stdenv.mkDerivation rec {
-  name = "wmname-0.1";
+  pname = "wmname";
+  version = "0.1";
 
   src = fetchurl {
-    url = "https://dl.suckless.org/tools/${name}.tar.gz";
+    url = "https://dl.suckless.org/tools/wmname-${version}.tar.gz";
     sha256 = "559ad188b2913167dcbb37ecfbb7ed474a7ec4bbcb0129d8d5d08cb9208d02c5";
   };
 
diff --git a/pkgs/applications/misc/xcruiser/default.nix b/pkgs/applications/misc/xcruiser/default.nix
index db7fe260b92..d57eb487817 100644
--- a/pkgs/applications/misc/xcruiser/default.nix
+++ b/pkgs/applications/misc/xcruiser/default.nix
@@ -1,12 +1,13 @@
 { lib, stdenv, fetchurl, gccmakedep, imake, libXt, libXaw, libXpm, libXext }:
 
-stdenv.mkDerivation {
-  name = "xcruiser-0.30";
+stdenv.mkDerivation rec {
+  pname = "xcruiser";
+  version = "0.30";
 
   src = fetchurl {
-      url = "mirror://sourceforge/xcruiser/xcruiser/xcruiser-0.30/xcruiser-0.30.tar.gz";
-      sha256 = "1r8whva38xizqdh7jmn6wcmfmsndc67pkw22wzfzr6rq0vf6hywi";
-    };
+    url = "mirror://sourceforge/xcruiser/xcruiser/xcruiser-${version}/xcruiser-${version}.tar.gz";
+    sha256 = "1r8whva38xizqdh7jmn6wcmfmsndc67pkw22wzfzr6rq0vf6hywi";
+  };
 
   nativeBuildInputs = [ gccmakedep imake ];
   buildInputs = [ libXt libXaw libXpm libXext ];
diff --git a/pkgs/applications/misc/xfe/default.nix b/pkgs/applications/misc/xfe/default.nix
index 17e58cb54d7..d59b936608c 100644
--- a/pkgs/applications/misc/xfe/default.nix
+++ b/pkgs/applications/misc/xfe/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, fox, pkg-config, gettext, xlibsWrapper, gcc, intltool, file, libpng }:
 
 stdenv.mkDerivation rec {
-  name = "xfe-1.42";
+  pname = "xfe";
+  version = "1.42";
 
   src = fetchurl {
-    url = "mirror://sourceforge/xfe/${name}.tar.gz";
+    url = "mirror://sourceforge/xfe/xfe-${version}.tar.gz";
     sha256 = "1v1v0vcbnm30kpyd3rj8f56yh7lfnwy7nbs9785wi229b29fiqx1";
   };
 
@@ -17,7 +18,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = {
+  meta = with lib; {
     description = "MS-Explorer like file manager for X";
     longDescription = ''
       X File Explorer (Xfe) is an MS-Explorer like file manager for X.
@@ -25,8 +26,8 @@ stdenv.mkDerivation rec {
       Xfe aims to be the filemanager of choice for all the Unix addicts!
     '';
     homepage = "https://sourceforge.net/projects/xfe/";
-    license = lib.licenses.gpl2;
-    maintainers = [];
-    platforms = lib.platforms.linux;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/misc/xpdf/libxpdf.nix b/pkgs/applications/misc/xpdf/libxpdf.nix
index 065ca813155..61c696f1309 100644
--- a/pkgs/applications/misc/xpdf/libxpdf.nix
+++ b/pkgs/applications/misc/xpdf/libxpdf.nix
@@ -1,8 +1,11 @@
-{ lib, stdenv, fetchurl
+{ lib
+, stdenv
+, fetchurl
 }:
 
 stdenv.mkDerivation {
-  name = "libxpdf-3.02pl5";
+  pname = "libxpdf";
+  version = "3.02pl5";
 
   src = fetchurl {
     url = "https://dl.xpdfreader.com/old/xpdf-3.02.tar.gz";
diff --git a/pkgs/applications/misc/xrq/default.nix b/pkgs/applications/misc/xrq/default.nix
index e8e6490cbd6..22ad3d789ac 100644
--- a/pkgs/applications/misc/xrq/default.nix
+++ b/pkgs/applications/misc/xrq/default.nix
@@ -1,7 +1,8 @@
-{ lib, stdenv, fetchFromGitHub, libX11}:
+{ lib, stdenv, fetchFromGitHub, libX11 }:
 
 stdenv.mkDerivation {
-  name = "xrq-unstable-2016-01-15";
+  pname = "xrq";
+  version = "unstable-2016-01-15";
 
   src = fetchFromGitHub {
     owner = "arianon";
diff --git a/pkgs/applications/office/antiword/default.nix b/pkgs/applications/office/antiword/default.nix
index f0aa3235545..5da7d84905b 100644
--- a/pkgs/applications/office/antiword/default.nix
+++ b/pkgs/applications/office/antiword/default.nix
@@ -1,13 +1,11 @@
 { lib, fetchurl, stdenv }:
 
-let
-  name = "antiword-0.37";
-in
-stdenv.mkDerivation {
-  inherit name;
+stdenv.mkDerivation rec{
+  pname = "antiword";
+  version = "0.37";
 
   src = fetchurl {
-    url = "http://www.winfield.demon.nl/linux/${name}.tar.gz";
+    url = "http://www.winfield.demon.nl/linux/antiword-${version}.tar.gz";
     sha256 = "1b7mi1l20jhj09kyh0bq14qzz8vdhhyf35gzwsq43mn6rc7h0b4f";
   };
 
diff --git a/pkgs/applications/office/beancount/bean-add.nix b/pkgs/applications/office/beancount/bean-add.nix
index ba3afbff946..1d5bafbdb40 100644
--- a/pkgs/applications/office/beancount/bean-add.nix
+++ b/pkgs/applications/office/beancount/bean-add.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, fetchFromGitHub, python3Packages }:
 
 stdenv.mkDerivation {
-  name = "bean-add-2018-01-08";
+  pname = "bean-add";
+  version = "unstable-2018-01-08";
 
   src = fetchFromGitHub {
     owner = "simon-v";