diff --git a/nix/sources.json b/nix/sources.json
index 4b72316c3c3fc3a247b116ef8d7651bb7c1bd23d..8bdb61aa1bcbe0864ea4b29140d221dbf3000108 100644
--- a/nix/sources.json
+++ b/nix/sources.json
@@ -2,6 +2,7 @@ {
     "cfiles": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-06-09T05:17:34Z",
         "description": "A ncurses file manager written in C with vim like keybindings",
         "homepage": "https://github.com/mananapr/cfiles",
         "owner": "mananapr",
@@ -15,6 +16,7 @@     },
     "cheetah3": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-05-16T18:33:02Z",
         "description": "Cheetah3 is a free (MIT) and open source template engine for Python",
         "homepage": "https://cheetahtemplate.org/",
         "owner": "CheetahTemplate3",
@@ -28,6 +30,7 @@     },
     "csvquote": {
         "branch": "master",
         "builtin": false,
+        "date": "2018-05-28T13:43:50Z",
         "description": "Enables common unix utlities like cut, awk, wc, head to work correctly with csv data containing delimiters and newlines",
         "homepage": "https://github.com/dbro/csvquote",
         "owner": "dbro",
@@ -41,6 +44,7 @@     },
     "csvtools": {
         "branch": "master",
         "builtin": false,
+        "date": "2019-08-03T13:11:03Z",
         "description": "GNU-alike tools for parsing RFC 4180 CSVs at high speed",
         "homepage": "https://github.com/DavyLandman/csvtools",
         "owner": "DavyLandman",
@@ -54,6 +58,7 @@     },
     "datamaps": {
         "branch": "master",
         "builtin": false,
+        "date": "2014-08-19T19:28:16Z",
         "description": "Indexes points and lines and generates map tiles to display them",
         "homepage": "https://github.com/ericfischer/datamaps",
         "owner": "ericfischer",
@@ -67,6 +72,7 @@     },
     "docker-reg-tool": {
         "branch": "master",
         "builtin": false,
+        "date": "2019-10-13T09:07:48Z",
         "description": "Docker registry cli tool, primarily for deleting images",
         "homepage": "https://github.com/byrnedo/docker-reg-tool",
         "owner": "byrnedo",
@@ -80,6 +86,7 @@     },
     "elevation": {
         "branch": "master",
         "builtin": false,
+        "date": "2019-05-27T22:01:34Z",
         "description": "Python script to download global terrain digital elevation models, SRTM 30m DEM and SRTM 90m DEM",
         "homepage": "http://elevation.bopen.eu",
         "owner": "bopen",
@@ -93,6 +100,7 @@     },
     "embox": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-02-04T15:17:46Z",
         "description": "Modular and configurable OS for embedded applications",
         "homepage": "http://embox.github.io",
         "owner": "embox",
@@ -106,6 +114,7 @@     },
     "foma": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-06-10T20:12:35Z",
         "description": "xfst-compatible C++ finite-state transducer library",
         "homepage": "https://github.com/mhulden/foma",
         "owner": "mhulden",
@@ -119,6 +128,7 @@     },
     "gef": {
         "branch": "dev",
         "builtin": false,
+        "date": "2020-06-28T16:20:31Z",
         "description": "GEF - GDB Enhanced Features for exploit devs & reversers",
         "homepage": "http://gef.rtfd.io",
         "owner": "hugsy",
@@ -156,6 +166,7 @@     },
     "gimgtools": {
         "branch": "master",
         "builtin": false,
+        "date": "2013-09-19T06:22:45Z",
         "description": "Garmin Image Tools",
         "homepage": "https://github.com/wuyongzheng/gimgtools",
         "owner": "wuyongzheng",
@@ -169,6 +180,7 @@     },
     "glauth": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-02-24T15:03:07Z",
         "description": "A lightweight LDAP server for development, home use, or CI",
         "homepage": "https://github.com/glauth/glauth",
         "owner": "glauth",
@@ -182,6 +194,7 @@     },
     "gpx-layer": {
         "branch": "master",
         "builtin": false,
+        "date": "2013-09-19T22:24:41Z",
         "description": "Tools to turn GPX files into a GPS map tracing layer",
         "homepage": "https://github.com/ericfischer/gpx-layer",
         "owner": "ericfischer",
@@ -195,6 +208,7 @@     },
     "gpxelevations": {
         "branch": "master",
         "builtin": false,
+        "date": "2019-12-18T15:16:42Z",
         "description": "Geo elevation data parser for \"The Shuttle Radar Topography Mission\" data",
         "homepage": "https://github.com/tkrajina/srtm.py",
         "owner": "tkrajina",
@@ -208,6 +222,7 @@     },
     "gpxlab": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-05-03T14:00:04Z",
         "description": "Program to show and manipulate GPS tracks",
         "homepage": "https://github.com/BourgeoisLab/GPXLab",
         "owner": "BourgeoisLab",
@@ -221,6 +236,7 @@     },
     "gpxsee": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-07-06T21:19:42Z",
         "description": "GPS log file viewer and analyzer",
         "homepage": "https://www.gpxsee.org",
         "owner": "tumic0",
@@ -234,6 +250,7 @@     },
     "gpxsee-maps": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-06-26T17:18:06Z",
         "description": "GPXSee maps",
         "homepage": "https://tumic0.github.io/GPXSee-maps",
         "owner": "tumic0",
@@ -260,6 +277,7 @@     },
     "gt-bash-client": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-06-09T15:44:09Z",
         "description": "Get translated text from your terminal! Console Google Translate Script (bash+curl+sed)",
         "homepage": "https://ophoperhpo.github.io/GT-bash-client/",
         "owner": "OPHoperHPO",
@@ -273,6 +291,7 @@     },
     "gt4gd": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-05-04T07:12:12Z",
         "description": "Add Google translate to GoldenDict",
         "homepage": "https://github.com/xinebf/google-translate-for-goldendict",
         "owner": "xinebf",
@@ -286,6 +305,7 @@     },
     "hfst": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-07-04T20:30:59Z",
         "description": "Helsinki Finite-State Technology (library and application suite)",
         "homepage": "https://hfst.github.io",
         "owner": "hfst",
@@ -299,6 +319,7 @@     },
     "libshell": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-03-16T17:18:36Z",
         "description": "A library of shell functions",
         "homepage": "https://github.com/legionus/libshell",
         "owner": "legionus",
@@ -312,6 +333,7 @@     },
     "lsdreader": {
         "branch": "master",
         "builtin": false,
+        "date": "2018-12-28T12:22:11Z",
         "description": "decompile Lingvo LSD dictionary to DSL",
         "homepage": "https://github.com/sv99/lsdreader",
         "owner": "sv99",
@@ -322,9 +344,10 @@         "type": "tarball",
         "url": "https://github.com/sv99/lsdreader/archive/c78ab22e794f1fbfbc93ffb3ee7ae481f54dd8c2.tar.gz",
         "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
     },
-    "map_hr": {
+    "map-hr": {
         "branch": "master",
         "builtin": false,
+        "date": "2019-07-14T23:28:27Z",
         "description": "Slazav mountains",
         "homepage": "http://slazav.mccme.ru/maps/",
         "owner": "slazav",
@@ -335,9 +358,10 @@         "type": "tarball",
         "url": "https://github.com/slazav/map_hr/archive/1555f0e49e8b26b5991c6b8ce8ea1f0688b26047.tar.gz",
         "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
     },
-    "map_podm": {
+    "map-podm": {
         "branch": "master",
         "builtin": false,
+        "date": "2019-12-08T17:24:57Z",
         "description": "Карты Подмосковья в виде номенклатурных листов 1:100000 - исходники в формате mapsoft vmap",
         "homepage": "http://slazav.mccme.ru/maps/",
         "owner": "slazav",
@@ -351,6 +375,7 @@     },
     "mapper": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-07-03T07:52:55Z",
         "description": "OpenOrienteering Mapper is a software for creating maps for the orienteering sport",
         "homepage": "https://www.openorienteering.org/apps/mapper/",
         "owner": "OpenOrienteering",
@@ -364,6 +389,7 @@     },
     "mapsoft": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-01-15T22:56:03Z",
         "description": "Mapping software for linux",
         "homepage": "http://slazav.mccme.ru/prog/mapsoft.htm",
         "owner": "ushakov",
@@ -388,6 +414,7 @@     },
     "mbtileserver": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-05-11T18:18:31Z",
         "description": "Basic Go server for mbtiles",
         "homepage": "https://github.com/consbio/mbtileserver",
         "owner": "consbio",
@@ -401,6 +428,7 @@     },
     "mercantile": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-06-16T22:49:21Z",
         "description": "Spherical mercator tile and coordinate utilities",
         "homepage": "https://github.com/mapbox/mercantile",
         "owner": "mapbox",
@@ -414,6 +442,7 @@     },
     "mikatools": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-02-21T12:09:22Z",
         "description": "Mikatools provides fast and easy methods for common Python coding tasks",
         "homepage": "https://github.com/mikahama/mikatools",
         "owner": "mikahama",
@@ -427,6 +456,7 @@     },
     "morse-talk": {
         "branch": "master",
         "builtin": false,
+        "date": "2016-12-25T13:48:00Z",
         "description": "A Python library written for Morse Code",
         "homepage": "https://github.com/morse-talk/morse-talk",
         "owner": "morse-talk",
@@ -450,6 +480,7 @@     },
     "musig": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-02-22T23:15:04Z",
         "description": "A shazam like tool to store musics fingerprints and retrieve them",
         "homepage": "https://github.com/sfluor/musig",
         "owner": "sfluor",
@@ -463,6 +494,7 @@     },
     "nakarte": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-07-05T15:13:02Z",
         "description": "Source code of site http://nakarte.me",
         "homepage": "https://nakarte.me",
         "owner": "wladich",
@@ -476,6 +508,7 @@     },
     "nnn": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-07-08T15:23:35Z",
         "description": "n³ The missing terminal file manager for X",
         "homepage": "https://github.com/jarun/nnn",
         "owner": "jarun",
@@ -489,6 +522,7 @@     },
     "odict": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-06-27T00:03:02Z",
         "description": "A blazingly-fast replacement for Apple Dictionaries, Babylon, StarDict, etc",
         "homepage": "https://odict.org",
         "owner": "odict",
@@ -502,6 +536,7 @@     },
     "openmtbmap": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-06-10T11:16:05Z",
         "description": "Linux script to extract and compile garmin *.img map files from openmtbmap.org or openvelomap.org downloads",
         "homepage": "https://github.com/btittelbach/openmtbmap_openvelomap_linux",
         "owner": "btittelbach",
@@ -515,6 +550,7 @@     },
     "osm2mp": {
         "branch": "master",
         "builtin": false,
+        "date": "2018-08-31T10:45:18Z",
         "description": "Convert Openstreetmap data to MP format",
         "homepage": "https://github.com/liosha/osm2mp",
         "owner": "liosha",
@@ -525,9 +561,10 @@         "type": "tarball",
         "url": "https://github.com/liosha/osm2mp/archive/748f93792ead174ad0e94a183a173ef3fcacf200.tar.gz",
         "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
     },
-    "pg_tileserv": {
+    "pg-tileserv": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-06-12T14:56:48Z",
         "description": "A very thin PostGIS-only tile server in Go. Takes in HTTP tile requests, executes SQL, returns MVT tiles",
         "homepage": "https://github.com/CrunchyData/pg_tileserv",
         "owner": "CrunchyData",
@@ -541,6 +578,7 @@     },
     "pyephem": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-06-29T14:30:02Z",
         "description": "Scientific-grade astronomy routines for Python",
         "homepage": "https://rhodesmill.org/pyephem",
         "owner": "brandon-rhodes",
@@ -554,6 +592,7 @@     },
     "pymbtiles": {
         "branch": "master",
         "builtin": false,
+        "date": "2019-10-16T20:59:08Z",
         "description": "Python utilities for Mapbox mbtiles files",
         "homepage": "https://github.com/consbio/pymbtiles",
         "owner": "consbio",
@@ -567,6 +606,7 @@     },
     "qtpbfimageplugin-styles": {
         "branch": "master",
         "builtin": false,
+        "date": "2020-04-10T11:06:10Z",
         "description": "QtPBFImagePlugin styles",
         "homepage": "https://github.com/tumic0/QtPBFImagePlugin-styles",
         "owner": "tumic0",
@@ -580,6 +620,7 @@     },
     "redict": {
         "branch": "master",
         "builtin": false,
+        "date": "2019-06-20T23:15:30Z",
         "description": "A dictionary for Linux, based on C++/Qt development",
         "homepage": "https://github.com/rekols/redict",
         "owner": "rekols",
@@ -593,6 +634,7 @@     },
     "stardict-3": {
         "branch": "master",
         "builtin": false,
+        "date": "2019-12-09T10:04:43Z",
         "description": "Automatically exported from code.google.com/p/stardict-3",
         "homepage": "https://github.com/huzheng001/stardict-3",
         "owner": "huzheng001",
@@ -606,6 +648,7 @@     },
     "supermercado": {
         "branch": "master",
         "builtin": false,
+        "date": "2019-01-02T15:10:23Z",
         "description": "Supercharger for mercantile",
         "homepage": "https://github.com/mapbox/supermercado",
         "owner": "mapbox",
@@ -619,6 +662,7 @@     },
     "supload": {
         "branch": "master",
         "builtin": false,
+        "date": "2015-08-04T11:30:01Z",
         "description": "Bash script for upload file to cloud storage based on OpenStack Swift API",
         "homepage": "https://github.com/selectel/supload",
         "owner": "selectel",
@@ -632,6 +676,7 @@     },
     "tpkutils": {
         "branch": "master",
         "builtin": false,
+        "date": "2019-10-31T03:05:49Z",
         "description": "ArcGIS Tile Package Utilities",
         "homepage": "https://github.com/consbio/tpkutils",
         "owner": "consbio",
diff --git a/pkgs/applications/gpxlab/default.nix b/pkgs/applications/gpxlab/default.nix
index 8001d238638c7f1aed764ffe42f7e26ec94914db..a7975929b432bb87467a9a9fad3e0e3f0c40b514 100644
--- a/pkgs/applications/gpxlab/default.nix
+++ b/pkgs/applications/gpxlab/default.nix
@@ -9,10 +9,13 @@ , sources
 , substituteAll
 , withI18n ? true
 }:
-
+let
+  pname = "gpxlab";
+  date = lib.substring 0 10 sources.gpxlab.date;
+  version = "unstable-" + date;
+in
 mkDerivation {
-  pname = "gpxlab";
-  version = lib.substring 0 7 sources.gpxlab.rev;
+  inherit pname version;
   src = sources.gpxlab;
 
   patches = (substituteAll {
diff --git a/pkgs/applications/gpxsee/default.nix b/pkgs/applications/gpxsee/default.nix
index 2f6dbf4b507816fd364d6ca722e6a63467196d79..102ffe2876fb674f52223e669adf99a2c09f1380 100644
--- a/pkgs/applications/gpxsee/default.nix
+++ b/pkgs/applications/gpxsee/default.nix
@@ -9,10 +9,13 @@ , sources
 , substituteAll
 , withI18n ? true
 }:
-
+let
+  pname = "gpxsee";
+  date = lib.substring 0 10 sources.gpxsee.date;
+  version = "unstable-" + date;
+in
 mkDerivation {
-  pname = "gpxsee";
-  version = lib.substring 0 7 sources.gpxsee.rev;
+  inherit pname version;
   src = sources.gpxsee;
 
   patches = (substituteAll {
diff --git a/pkgs/applications/mapsoft/default.nix b/pkgs/applications/mapsoft/default.nix
index ee54fd0c7de21d5bd8e20baaddcd2a554d333ba1..96cf28b141339b51fc5cf052b6496b80e2666ae4 100644
--- a/pkgs/applications/mapsoft/default.nix
+++ b/pkgs/applications/mapsoft/default.nix
@@ -28,10 +28,13 @@ , shapelib
 , zlib
 , getopt
 }:
-
+let
+  pname = "mapsoft";
+  date = stdenv.lib.substring 0 10 sources.mapsoft.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "mapsoft";
-  version = stdenv.lib.substring 0 7 sources.mapsoft.rev;
+  inherit pname version;
   src = sources.mapsoft;
 
   patches = [ ./0001-fix-build.patch ];
diff --git a/pkgs/applications/nnn-plugins/default.nix b/pkgs/applications/nnn-plugins/default.nix
index 9fdfe750096b86be3cd7b3ec1d5401a049ccd658..c5ba0e72a313295d95be354f9a70bcbc1aac4cca 100644
--- a/pkgs/applications/nnn-plugins/default.nix
+++ b/pkgs/applications/nnn-plugins/default.nix
@@ -1,8 +1,11 @@
 { stdenv, sources }:
-
+let
+  pname = "nnn-plugins";
+  date = stdenv.lib.substring 0 10 sources.nnn.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "nnn-plugins";
-  version = stdenv.lib.substring 0 7 sources.nnn.rev;
+  inherit pname version;
   src = sources.nnn;
 
   phases = [ "installPhase" "fixupPhase" ];
diff --git a/pkgs/applications/openorienteering-mapper/default.nix b/pkgs/applications/openorienteering-mapper/default.nix
index 95e9fd2506364c93b3e6c50eceb21ba6bd7dd248..aab5860987e196c313accfc951a0bba53642b91a 100644
--- a/pkgs/applications/openorienteering-mapper/default.nix
+++ b/pkgs/applications/openorienteering-mapper/default.nix
@@ -18,10 +18,13 @@ , qtimageformats
 , sources
 , substituteAll
 }:
-
+let
+  pname = "OpenOrienteering-Mapper";
+  date = lib.substring 0 10 sources.mapper.date;
+  version = "unstable-" + date;
+in
 mkDerivation {
-  pname = "OpenOrienteering-Mapper";
-  version = lib.substring 0 7 sources.mapper.rev;
+  inherit pname version;
   src = sources.mapper;
 
   patches = (substituteAll {
diff --git a/pkgs/applications/redict/default.nix b/pkgs/applications/redict/default.nix
index 1eb8807c0e5e992aa753bd251368fad05afb1627..5b4b68bbbbcf05bbba00cf2b5ab1b438813ee6a6 100644
--- a/pkgs/applications/redict/default.nix
+++ b/pkgs/applications/redict/default.nix
@@ -14,10 +14,13 @@ , libXtst
 , sources
 , withI18n ? true
 }:
-
+let
+  pname = "redict";
+  date = lib.substring 0 10 sources.redict.date;
+  version = "unstable-" + date;
+in
 mkDerivation {
-  pname = "redict";
-  version = lib.substring 0 7 sources.redict.rev;
+  inherit pname version;
   src = sources.redict;
 
   nativeBuildInputs = [ qmake pkgconfig ] ++ (lib.optional withI18n qttools);
diff --git a/pkgs/data/maps/gpxsee-maps/default.nix b/pkgs/data/maps/gpxsee-maps/default.nix
index 84ee04ec36dea4eb04adfc2d79f261ec61e2ce3f..aa57dbe1ffcbfb12a2578bdf843fecd777ce45fb 100644
--- a/pkgs/data/maps/gpxsee-maps/default.nix
+++ b/pkgs/data/maps/gpxsee-maps/default.nix
@@ -3,10 +3,13 @@ , sources
 , maptilerApiKey ? ""
 , mapboxApiKey ? ""
 }:
-
+let
+  pname = "gpxsee-maps";
+  date = stdenv.lib.substring 0 10 sources.gpxsee-maps.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "gpxsee-maps";
-  version = stdenv.lib.substring 0 7 sources.gpxsee-maps.rev;
+  inherit pname version;
   src = sources.gpxsee-maps;
 
   postPatch = ''
diff --git a/pkgs/data/maps/slazav/hr.nix b/pkgs/data/maps/slazav/hr.nix
index ffd8e0d452d3224be1ae9fd382f3026c68b8f35f..8485fbb1a160ee69582b27625bba0a5fc7da9b05 100644
--- a/pkgs/data/maps/slazav/hr.nix
+++ b/pkgs/data/maps/slazav/hr.nix
@@ -1,9 +1,12 @@
 { stdenv, cgpsmapper, gmaptool, imagemagick, mapsoft, netpbm, zip, sources }:
-
+let
+  pname = "slazav-hr";
+  date = stdenv.lib.substring 0 10 sources.map-hr.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "slazav-hr";
-  version = stdenv.lib.substring 0 7 sources.map_hr.rev;
-  src = sources.map_hr;
+  inherit pname version;
+  src = sources.map-hr;
 
   patches = [ ./0001-fix-hr.patch ];
 
@@ -36,7 +39,7 @@     install -Dm644 hr.img -t $out/share/gpxsee/maps
   '';
 
   meta = with stdenv.lib; {
-    inherit (sources.map_hr) description homepage;
+    inherit (sources.map-hr) description homepage;
     license = licenses.free;
     maintainers = with maintainers; [ sikmir ];
     platforms = platforms.all;
diff --git a/pkgs/data/maps/slazav/podm.nix b/pkgs/data/maps/slazav/podm.nix
index 2004443a3a02ed2a165c406f0402ccced8ab47e7..cc7b9d17055c853f07d06027aecc26a9003323f1 100644
--- a/pkgs/data/maps/slazav/podm.nix
+++ b/pkgs/data/maps/slazav/podm.nix
@@ -1,9 +1,12 @@
 { stdenv, cgpsmapper, gmaptool, imagemagick, mapsoft, netpbm, zip, sources }:
-
+let
+  pname = "slazav-podm";
+  date = stdenv.lib.substring 0 10 sources.map-podm.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "slazav-podm";
-  version = stdenv.lib.substring 0 7 sources.map_podm.rev;
-  src = sources.map_podm;
+  inherit pname version;
+  src = sources.map-podm;
 
   patches = [ ./0001-fix-podm.patch ];
 
@@ -34,7 +37,7 @@     install -Dm644 podm.img -t $out/share/gpxsee/maps
   '';
 
   meta = with stdenv.lib; {
-    inherit (sources.map_podm) description homepage;
+    inherit (sources.map-podm) description homepage;
     license = licenses.free;
     maintainers = with maintainers; [ sikmir ];
     platforms = platforms.all;
diff --git a/pkgs/data/themes/qtpbfimageplugin-styles/default.nix b/pkgs/data/themes/qtpbfimageplugin-styles/default.nix
index e5b3688176e78e9cc077632f7fab0380be677292..097e544eacf298c95618887e7c608cbb3c5412f3 100644
--- a/pkgs/data/themes/qtpbfimageplugin-styles/default.nix
+++ b/pkgs/data/themes/qtpbfimageplugin-styles/default.nix
@@ -1,8 +1,11 @@
 { stdenv, sources }:
-
+let
+  pname = "qtpbfimageplugin-styles";
+  date = stdenv.lib.substring 0 10 sources.qtpbfimageplugin-styles.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "qtpbfimageplugin-styles";
-  version = stdenv.lib.substring 0 7 sources.qtpbfimageplugin-styles.rev;
+  inherit pname version;
   src = sources.qtpbfimageplugin-styles;
 
   dontBuild = true;
diff --git a/pkgs/development/libraries/foma/default.nix b/pkgs/development/libraries/foma/default.nix
index 3a6f24e49568d96d6e70340d7329393898bdd976..0bf4288ad76cf16bb70c6ee5d7006bd543ed427f 100644
--- a/pkgs/development/libraries/foma/default.nix
+++ b/pkgs/development/libraries/foma/default.nix
@@ -1,8 +1,11 @@
 { stdenv, bison, flex, libtool, ncurses, readline, zlib, sources }:
-
+let
+  pname = "foma";
+  date = stdenv.lib.substring 0 10 sources.foma.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "foma";
-  version = stdenv.lib.substring 0 7 sources.foma.rev;
+  inherit pname version;
   src = sources.foma;
 
   sourceRoot = "source/foma";
diff --git a/pkgs/development/libraries/hfst/default.nix b/pkgs/development/libraries/hfst/default.nix
index ca15d3123e800bcc64a653692a40fb227aa889bc..e644d373970edbfab45cc5e14d3f004089020328 100644
--- a/pkgs/development/libraries/hfst/default.nix
+++ b/pkgs/development/libraries/hfst/default.nix
@@ -1,8 +1,11 @@
 { stdenv, autoreconfHook, bison, flex, sources }:
-
+let
+  pname = "hfst";
+  date = stdenv.lib.substring 0 10 sources.hfst.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "hfst";
-  version = stdenv.lib.substring 0 7 sources.hfst.rev;
+  inherit pname version;
   src = sources.hfst;
 
   nativeBuildInputs = [ autoreconfHook bison flex ];
diff --git a/pkgs/development/libraries/libshell/default.nix b/pkgs/development/libraries/libshell/default.nix
index ed2182185a6e3dc643198b51cfde4f214b9657b6..bbdaab9e3c8d9b15f1852da728711247cc8d18d9 100644
--- a/pkgs/development/libraries/libshell/default.nix
+++ b/pkgs/development/libraries/libshell/default.nix
@@ -7,10 +7,13 @@ , sources
 , withDoc ? false
 , scdoc
 }:
-
+let
+  pname = "libshell";
+  date = stdenv.lib.substring 0 10 sources.libshell.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "libshell";
-  version = stdenv.lib.substring 0 7 sources.libshell.rev;
+  inherit pname version;
   src = sources.libshell;
 
   nativeBuildInputs = [ help2man ];
diff --git a/pkgs/development/python-modules/cheetah3/default.nix b/pkgs/development/python-modules/cheetah3/default.nix
index 4f5acbe746fcc405deb60ef74e11dcf548a02187..41a2113c0c3c793dfdc83f0ff65010c3794c222e 100644
--- a/pkgs/development/python-modules/cheetah3/default.nix
+++ b/pkgs/development/python-modules/cheetah3/default.nix
@@ -1,8 +1,11 @@
 { lib, buildPythonPackage, sources }:
-
+let
+  pname = "cheetah3";
+  date = lib.substring 0 10 sources.cheetah3.date;
+  version = "unstable-" + date;
+in
 buildPythonPackage {
-  pname = "cheetah3";
-  version = lib.substring 0 7 sources.cheetah3.rev;
+  inherit pname version;
   src = sources.cheetah3;
 
   doCheck = false;
diff --git a/pkgs/development/python-modules/gpxelevations/default.nix b/pkgs/development/python-modules/gpxelevations/default.nix
index 60bcb20c02746e17ab53b8dd9bed1d5957f5796c..70811a34b2aeea4ef988d01d1a701ba59c89c24b 100644
--- a/pkgs/development/python-modules/gpxelevations/default.nix
+++ b/pkgs/development/python-modules/gpxelevations/default.nix
@@ -1,8 +1,11 @@
 { lib, buildPythonApplication, python, requests, gpxpy, sources }:
-
+let
+  pname = "gpxelevations";
+  date = lib.substring 0 10 sources.gpxelevations.date;
+  version = "unstable-" + date;
+in
 buildPythonApplication {
-  pname = "gpxelevations";
-  version = lib.substring 0 7 sources.gpxelevations.rev;
+  inherit pname version;
   src = sources.gpxelevations;
 
   propagatedBuildInputs = [ requests gpxpy ];
diff --git a/pkgs/development/python-modules/mercantile/default.nix b/pkgs/development/python-modules/mercantile/default.nix
index 6630c32be418963034e238c386febd8294026973..7191d60cf8af662a24643358412170acb23d4fba 100644
--- a/pkgs/development/python-modules/mercantile/default.nix
+++ b/pkgs/development/python-modules/mercantile/default.nix
@@ -1,8 +1,11 @@
 { lib, buildPythonPackage, click, pytest, hypothesis, sources }:
-
+let
+  pname = "mercantile";
+  date = lib.substring 0 10 sources.mercantile.date;
+  version = "unstable-" + date;
+in
 buildPythonPackage {
-  pname = "mercantile";
-  version = lib.substring 0 7 sources.mercantile.rev;
+  inherit pname version;
   src = sources.mercantile;
 
   propagatedBuildInputs = [ click ];
diff --git a/pkgs/development/python-modules/mikatools/default.nix b/pkgs/development/python-modules/mikatools/default.nix
index 24a91190dbf4386cc5cde0443a50a3542877cdd4..efd65fe6515f529288cf18e29894ebc82116d936 100644
--- a/pkgs/development/python-modules/mikatools/default.nix
+++ b/pkgs/development/python-modules/mikatools/default.nix
@@ -1,8 +1,11 @@
 { lib, buildPythonPackage, requests, clint, sources }:
-
+let
+  pname = "mikatools";
+  date = lib.substring 0 10 sources.mikatools.date;
+  version = "unstable-" + date;
+in
 buildPythonPackage {
-  pname = "mikatools";
-  version = lib.substring 0 7 sources.mikatools.rev;
+  inherit pname version;
   src = sources.mikatools;
 
   propagatedBuildInputs = [ requests clint ];
diff --git a/pkgs/development/python-modules/pyephem/default.nix b/pkgs/development/python-modules/pyephem/default.nix
index 863bcce691a400879431216f5b3e4f148898c8b8..808ac4b1f149c6758c396d3227a170308d0e6e09 100644
--- a/pkgs/development/python-modules/pyephem/default.nix
+++ b/pkgs/development/python-modules/pyephem/default.nix
@@ -1,8 +1,11 @@
 { lib, buildPythonPackage, sources }:
-
+let
+  pname = "pyephem";
+  date = lib.substring 0 10 sources.pyephem.date;
+  version = "unstable-" + date;
+in
 buildPythonPackage {
-  pname = "pyephem";
-  version = lib.substring 0 7 sources.pyephem.rev;
+  inherit pname version;
   src = sources.pyephem;
 
   meta = with lib; {
diff --git a/pkgs/development/python-modules/pymbtiles/default.nix b/pkgs/development/python-modules/pymbtiles/default.nix
index d7b66e1e0c6f1d838a6c268dda6c22e372634fc3..d8f9da72784cd905fc1bf079ce5cfc26b68366cc 100644
--- a/pkgs/development/python-modules/pymbtiles/default.nix
+++ b/pkgs/development/python-modules/pymbtiles/default.nix
@@ -1,8 +1,11 @@
 { lib, buildPythonPackage, pytest, sources }:
-
+let
+  pname = "pymbtiles";
+  date = lib.substring 0 10 sources.pymbtiles.date;
+  version = "unstable-" + date;
+in
 buildPythonPackage {
-  pname = "pymbtiles";
-  version = lib.substring 0 7 sources.pymbtiles.rev;
+  inherit pname version;
   src = sources.pymbtiles;
 
   checkInputs = [ pytest ];
diff --git a/pkgs/development/tools/gef/default.nix b/pkgs/development/tools/gef/default.nix
index 7bf3759a9e9fb7ba36ec00a6cf54ee19e0221063..59e159d9c1425c549bcb6c37455dd96bb2d90e17 100644
--- a/pkgs/development/tools/gef/default.nix
+++ b/pkgs/development/tools/gef/default.nix
@@ -10,6 +10,10 @@ , python3
 , gdb
 }:
 let
+  pname = "gef";
+  date = stdenv.lib.substring 0 10 sources.gef.date;
+  version = "unstable-" + date;
+
   initGef = writeScript "init-gef" ''
     source @out@/share/gef/gef.py
   '';
@@ -23,8 +27,7 @@     ''
   );
 in
 stdenv.mkDerivation {
-  pname = "gef";
-  version = stdenv.lib.substring 0 7 sources.gef.rev;
+  inherit pname version;
   src = sources.gef;
 
   postPatch = ''
diff --git a/pkgs/embox/default.nix b/pkgs/embox/default.nix
index ea0c9fe8fd0d3e82549337ac80f9c3e12a114dec..941535a56a26950992f8712a948fcd192088bee0 100644
--- a/pkgs/embox/default.nix
+++ b/pkgs/embox/default.nix
@@ -10,6 +10,9 @@ , unzip
 , which
 }:
 let
+  pname = "embox";
+  date = stdenv.lib.substring 0 10 sources.embox.date;
+  version = "unstable-" + date;
   template = "arm/qemu";
 
   cjson = fetchurl {
@@ -28,8 +31,7 @@       -nographic
   '';
 in
 stdenv.mkDerivation {
-  pname = "embox";
-  version = stdenv.lib.substring 0 7 sources.embox.rev;
+  inherit pname version;
   src = sources.embox;
 
   patches = [ ./0001-fix-build.patch ];
diff --git a/pkgs/servers/glauth/default.nix b/pkgs/servers/glauth/default.nix
index 0cfe874a26cc715bcb10c645ca3258e193052f04..c1f15152a6eb43515d9b3d596c52d2da3f506edf 100644
--- a/pkgs/servers/glauth/default.nix
+++ b/pkgs/servers/glauth/default.nix
@@ -1,8 +1,11 @@
 { lib, buildGoModule, go-bindata, sources }:
-
+let
+  pname = "glauth";
+  date = lib.substring 0 10 sources.glauth.date;
+  version = "unstable-" + date;
+in
 buildGoModule {
-  pname = "glauth";
-  version = lib.substring 0 7 sources.glauth.rev;
+  inherit pname version;
   src = sources.glauth;
 
   vendorSha256 = "18inm0s9mww7c19z9alnvy0g80d3laxh4lwbgzkcc8kf9zg25149";
diff --git a/pkgs/servers/mbtileserver/default.nix b/pkgs/servers/mbtileserver/default.nix
index cd971c6bfb867df5539d29c827d7512726c71cdb..f8b33b5ea43614d805c9d31010698b19ddc1b5b5 100644
--- a/pkgs/servers/mbtileserver/default.nix
+++ b/pkgs/servers/mbtileserver/default.nix
@@ -1,8 +1,11 @@
 { lib, buildGoModule, sources }:
-
+let
+  pname = "mbtileserver";
+  date = lib.substring 0 10 sources.mbtileserver.date;
+  version = "unstable-" + date;
+in
 buildGoModule {
-  pname = "mbtileserver";
-  version = lib.substring 0 7 sources.mbtileserver.rev;
+  inherit pname version;
   src = sources.mbtileserver;
 
   vendorSha256 = null;
diff --git a/pkgs/servers/nakarte/default.nix b/pkgs/servers/nakarte/default.nix
index 23a7175bf88baea5e780cb493578f8e9bfac48b1..6ac1a59514ee36af89d8ef70ae330fdee1810bcb 100644
--- a/pkgs/servers/nakarte/default.nix
+++ b/pkgs/servers/nakarte/default.nix
@@ -1,9 +1,11 @@
 { stdenv, mkYarnPackage, sources, secretsConfig ? null }:
 let
-  version = stdenv.lib.substring 0 7 sources.nakarte.rev;
+  pname = "nakarte";
+  date = stdenv.lib.substring 0 10 sources.nakarte.date;
+  version = "unstable-" + date;
 in
 mkYarnPackage {
-  name = "nakarte-${version}";
+  name = "${pname}-${version}";
   src = sources.nakarte;
 
   postPatch =
diff --git a/pkgs/servers/pg_tileserv/default.nix b/pkgs/servers/pg_tileserv/default.nix
index 9d9bd39f440cc80fbc865552c41cd3482b85529a..aced81806a0a2bba9932e824d4c98224056e4433 100644
--- a/pkgs/servers/pg_tileserv/default.nix
+++ b/pkgs/servers/pg_tileserv/default.nix
@@ -1,14 +1,17 @@
 { lib, buildGoModule, sources }:
-
+let
+  pname = "pg_tileserv";
+  date = lib.substring 0 10 sources.pg-tileserv.date;
+  version = "unstable-" + date;
+in
 buildGoModule {
-  pname = "pg_tileserv";
-  version = lib.substring 0 7 sources.pg_tileserv.rev;
-  src = sources.pg_tileserv;
+  inherit pname version;
+  src = sources.pg-tileserv;
 
   vendorSha256 = "1wpzj6par25z7cyyz6p41cxdll4nzb0jjdl1pffgawiy9z7j17vb";
 
   meta = with lib; {
-    inherit (sources.pg_tileserv) description homepage;
+    inherit (sources.pg-tileserv) description homepage;
     license = licenses.asl20;
     maintainers = with maintainers; [ sikmir ];
     platforms = platforms.unix;
diff --git a/pkgs/tools/audio/musig/default.nix b/pkgs/tools/audio/musig/default.nix
index f116aafd96ec7ff60c9a7b1d9aa603b3c260e76a..15e2c31b2b08ba6ff0b1793c3739b2a674dc1d53 100644
--- a/pkgs/tools/audio/musig/default.nix
+++ b/pkgs/tools/audio/musig/default.nix
@@ -1,10 +1,11 @@
 { lib, buildGoModule, pkgconfig, portaudio, sources }:
 let
-  version = lib.substring 0 7 sources.musig.rev;
+  pname = "musig";
+  date = lib.substring 0 10 sources.musig.date;
+  version = "unstable-" + date;
 in
 buildGoModule {
-  pname = "musig";
-  inherit version;
+  inherit pname version;
   src = sources.musig;
 
   vendorSha256 = "0ha1xjdwibm8543b4bx0xrbigngiiakksdc6mnp0mz5y6ai56pg5";
diff --git a/pkgs/tools/cfiles/default.nix b/pkgs/tools/cfiles/default.nix
index 1eb729fd48eb14cae29dc5a45354268c2f86a5ae..3f1041eb7ec77b62f07972ae6d0b6beef5ed7d41 100644
--- a/pkgs/tools/cfiles/default.nix
+++ b/pkgs/tools/cfiles/default.nix
@@ -1,8 +1,11 @@
 { stdenv, pkg-config, ncurses, w3m, ueberzug, sources }:
-
+let
+  pname = "cfiles";
+  date = stdenv.lib.substring 0 10 sources.cfiles.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "cfiles";
-  version = stdenv.lib.substring 0 7 sources.cfiles.rev;
+  inherit pname version;
   src = sources.cfiles;
 
   nativeBuildInputs = [ pkg-config ];
diff --git a/pkgs/tools/dict/gt-bash-client/default.nix b/pkgs/tools/dict/gt-bash-client/default.nix
index 80cd930478258a6ebba5075f91608e3165f54a25..79c1109bd746a69155887f8ebd3be873a1bd9444 100644
--- a/pkgs/tools/dict/gt-bash-client/default.nix
+++ b/pkgs/tools/dict/gt-bash-client/default.nix
@@ -1,8 +1,11 @@
 { stdenv, sources }:
-
+let
+  pname = "gt-bash-client";
+  date = stdenv.lib.substring 0 10 sources.gt-bash-client.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "gt-bash-client";
-  version = stdenv.lib.substring 0 7 sources.gt-bash-client.rev;
+  inherit pname version;
   src = sources.gt-bash-client;
 
   installPhase = ''
diff --git a/pkgs/tools/dict/gt4gd/default.nix b/pkgs/tools/dict/gt4gd/default.nix
index 835404896883f567fb61ea05273ddb9965937c8a..8261784b0abc93a189bd91ba832b719c7df3c3fc 100644
--- a/pkgs/tools/dict/gt4gd/default.nix
+++ b/pkgs/tools/dict/gt4gd/default.nix
@@ -5,10 +5,13 @@ , sources
 , withUI ? true
 , tkinter
 }:
-
+let
+  pname = "gt4gd";
+  date = lib.substring 0 10 sources.gt4gd.date;
+  version = "unstable-" + date;
+in
 buildPythonApplication {
-  pname = "gt4gd";
-  version = lib.substring 0 7 sources.gt4gd.rev;
+  inherit pname version;
   src = sources.gt4gd;
 
   propagatedBuildInputs = [ requests ] ++ (lib.optional withUI tkinter);
diff --git a/pkgs/tools/dict/lsdreader/default.nix b/pkgs/tools/dict/lsdreader/default.nix
index 62265b03065fab363a18e4e05efeec71ec21e118..d47715e9a4c67d7029ed78e223f35dbc4a912464 100644
--- a/pkgs/tools/dict/lsdreader/default.nix
+++ b/pkgs/tools/dict/lsdreader/default.nix
@@ -1,8 +1,11 @@
 { lib, buildPythonApplication, sources }:
-
+let
+  pname = "lsdreader";
+  date = lib.substring 0 10 sources.lsdreader.date;
+  version = "unstable-" + date;
+in
 buildPythonApplication {
-  pname = "lsdreader";
-  version = lib.substring 0 7 sources.lsdreader.rev;
+  inherit pname version;
   src = sources.lsdreader;
 
   doCheck = false;
diff --git a/pkgs/tools/dict/odict/default.nix b/pkgs/tools/dict/odict/default.nix
index 23640717ea0f5280b65a69eed2a48f23a0a82aca..22d2a5fe20cda342501b9be5360119451a2f8a0f 100644
--- a/pkgs/tools/dict/odict/default.nix
+++ b/pkgs/tools/dict/odict/default.nix
@@ -1,8 +1,11 @@
 { lib, buildGoModule, sources }:
-
+let
+  pname = "odict";
+  date = lib.substring 0 10 sources.odict.date;
+  version = "unstable-" + date;
+in
 buildGoModule {
-  pname = "odict";
-  version = lib.substring 0 7 sources.odict.rev;
+  inherit pname version;
   src = sources.odict;
 
   vendorSha256 = "083mvrgpv9hyfmi26sankv940qp0bmyr55jm33dx1ivhd2xhkg78";
diff --git a/pkgs/tools/dict/stardict-tools/default.nix b/pkgs/tools/dict/stardict-tools/default.nix
index 6e20c6ced97309d9f25ffbcc66e4027c823f39ea..9ba80b0567a010aaa9a0dabf61cc7f06982288bf 100644
--- a/pkgs/tools/dict/stardict-tools/default.nix
+++ b/pkgs/tools/dict/stardict-tools/default.nix
@@ -9,10 +9,13 @@ , libxml2
 , pcre
 , sources
 }:
-
+let
+  pname = "stardict-tools";
+  date = stdenv.lib.substring 0 10 sources.stardict-3.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "stardict-tools";
-  version = stdenv.lib.substring 0 7 sources.stardict-3.rev;
+  inherit pname version;
   src = sources.stardict-3;
 
   nativeBuildInputs = [
diff --git a/pkgs/tools/docker-reg-tool/default.nix b/pkgs/tools/docker-reg-tool/default.nix
index 986906e9c1765f1d68f87c6cabf2626306f07933..c9add0932da2efaca984c35bf5718f5b31c9edaf 100644
--- a/pkgs/tools/docker-reg-tool/default.nix
+++ b/pkgs/tools/docker-reg-tool/default.nix
@@ -1,8 +1,11 @@
 { stdenv, sources }:
-
+let
+  pname = "docker-reg-tool";
+  date = stdenv.lib.substring 0 10 sources.docker-reg-tool.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "docker-reg-tool";
-  version = stdenv.lib.substring 0 7 sources.docker-reg-tool.rev;
+  inherit pname version;
   src = sources.docker-reg-tool;
 
   installPhase = ''
diff --git a/pkgs/tools/geo/datamaps/default.nix b/pkgs/tools/geo/datamaps/default.nix
index 39fc891aaa39ddf14793229f8b66f0a10604781d..686a9821d0c2f865ff2c01ccec5318082749eede 100644
--- a/pkgs/tools/geo/datamaps/default.nix
+++ b/pkgs/tools/geo/datamaps/default.nix
@@ -1,8 +1,11 @@
 { stdenv, libpng, pkg-config, sources }:
-
+let
+  pname = "datamaps";
+  date = stdenv.lib.substring 0 10 sources.datamaps.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "datamaps";
-  version = stdenv.lib.substring 0 7 sources.datamaps.rev;
+  inherit pname version;
   src = sources.datamaps;
 
   nativeBuildInputs = [ pkg-config ];
diff --git a/pkgs/tools/geo/elevation/default.nix b/pkgs/tools/geo/elevation/default.nix
index 2d2b4e0fcd69809a36523ee0ed835c9b36cf5cdd..afaebccadf26b2c41cb4fcaccf7613540fbeb989 100644
--- a/pkgs/tools/geo/elevation/default.nix
+++ b/pkgs/tools/geo/elevation/default.nix
@@ -13,10 +13,13 @@ , pytest
 , pytest-mock
 , sources
 }:
-
+let
+  pname = "elevation";
+  date = lib.substring 0 10 sources.elevation.date;
+  version = "unstable-" + date;
+in
 buildPythonApplication {
-  pname = "elevation";
-  version = lib.substring 0 7 sources.elevation.rev;
+  inherit pname version;
   src = sources.elevation;
 
   propagatedBuildInputs = [ fasteners future appdirs click ];
diff --git a/pkgs/tools/geo/gimgtools/default.nix b/pkgs/tools/geo/gimgtools/default.nix
index 46e8bd65cf68ab86a8970731bfd8a8581b378a2d..95e241440a172545896379f5c43222d83fde148e 100644
--- a/pkgs/tools/geo/gimgtools/default.nix
+++ b/pkgs/tools/geo/gimgtools/default.nix
@@ -1,8 +1,11 @@
 { stdenv, sources, libiconv }:
-
+let
+  pname = "gimgtools";
+  date = stdenv.lib.substring 0 10 sources.gimgtools.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "gimgtools";
-  version = stdenv.lib.substring 0 7 sources.gimgtools.rev;
+  inherit pname version;
   src = sources.gimgtools;
 
   buildInputs = stdenv.lib.optional stdenv.isDarwin libiconv;
diff --git a/pkgs/tools/geo/gpx-layer/default.nix b/pkgs/tools/geo/gpx-layer/default.nix
index ec2c92748306f860dba16604a198d7d65142db8c..3683dd22abc83d645904a416a233e1343bba1ba1 100644
--- a/pkgs/tools/geo/gpx-layer/default.nix
+++ b/pkgs/tools/geo/gpx-layer/default.nix
@@ -1,8 +1,11 @@
 { lib, buildPerlPackage, XMLParser, sources }:
-
+let
+  pname = "gpx-layer";
+  date = lib.substring 0 10 sources.gpx-layer.date;
+  version = "unstable-" + date;
+in
 buildPerlPackage {
-  pname = "gpx-layer";
-  version = lib.substring 0 7 sources.gpx-layer.rev;
+  inherit pname version;
   src = sources.gpx-layer;
 
   outputs = [ "out" ];
diff --git a/pkgs/tools/geo/openmtbmap/default.nix b/pkgs/tools/geo/openmtbmap/default.nix
index 0c6c054f44e36398d7f1358014d2e0fed4ccd899..245c626f8296314e057b64e30bff415ac36c5503 100644
--- a/pkgs/tools/geo/openmtbmap/default.nix
+++ b/pkgs/tools/geo/openmtbmap/default.nix
@@ -1,8 +1,11 @@
 { stdenv, gmaptool, mkgmap, p7zip, zsh, sources, substituteAll }:
-
+let
+  pname = "openmtbmap";
+  date = stdenv.lib.substring 0 10 sources.openmtbmap.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "openmtbmap";
-  version = stdenv.lib.substring 0 7 sources.openmtbmap.rev;
+  inherit pname version;
   src = sources.openmtbmap;
 
   patches = (substituteAll {
diff --git a/pkgs/tools/geo/osm2mp/default.nix b/pkgs/tools/geo/osm2mp/default.nix
index 51e1205ef76e9ddfabcfd798f44cb6349b643858..c4465e4743f725582ebd4fc5442d704289b2b988 100644
--- a/pkgs/tools/geo/osm2mp/default.nix
+++ b/pkgs/tools/geo/osm2mp/default.nix
@@ -16,10 +16,13 @@ , TextUnidecode
 , TreeR
 , YAML
 }:
-
+let
+  pname = "osm2mp";
+  date = lib.substring 0 10 sources.osm2mp.date;
+  version = "unstable-" + date;
+in
 buildPerlPackage {
-  pname = "osm2mp";
-  version = lib.substring 0 7 sources.osm2mp.rev;
+  inherit pname version;
   src = sources.osm2mp;
 
   outputs = [ "out" ];
diff --git a/pkgs/tools/geo/supermercado/default.nix b/pkgs/tools/geo/supermercado/default.nix
index 0437b0f7ee920999639c548de450a5c82aca2fd6..826416e8b5b920b7974c9160cedf2499e7971733 100644
--- a/pkgs/tools/geo/supermercado/default.nix
+++ b/pkgs/tools/geo/supermercado/default.nix
@@ -8,10 +8,13 @@ , numpy
 , pytest
 , sources
 }:
-
+let
+  pname = "supermercado";
+  date = lib.substring 0 10 sources.supermercado.date;
+  version = "unstable-" + date;
+in
 buildPythonApplication {
-  pname = "supermercado";
-  version = lib.substring 0 7 sources.supermercado.rev;
+  inherit pname version;
   src = sources.supermercado;
 
   patches = [
diff --git a/pkgs/tools/geo/tpkutils/default.nix b/pkgs/tools/geo/tpkutils/default.nix
index 3a363ebaf16f60951a8fd4a78f02dbc75d4558ef..7827893545e7d8cd49d0e0d1b9f2e01f85680b05 100644
--- a/pkgs/tools/geo/tpkutils/default.nix
+++ b/pkgs/tools/geo/tpkutils/default.nix
@@ -1,8 +1,11 @@
 { lib, buildPythonApplication, mercantile, pymbtiles, pytest, setuptools, six, sources }:
-
+let
+  pname = "tpkutils";
+  date = lib.substring 0 10 sources.tpkutils.date;
+  version = "unstable-" + date;
+in
 buildPythonApplication {
-  pname = "tpkutils";
-  version = lib.substring 0 7 sources.tpkutils.rev;
+  inherit pname version;
   src = sources.tpkutils;
 
   propagatedBuildInputs = [ mercantile pymbtiles setuptools six ];
diff --git a/pkgs/tools/morse-talk/default.nix b/pkgs/tools/morse-talk/default.nix
index a9812fac0eea54a54b2bc49c560eb16e8c4a2950..416fb9aceef0cef9ee342e379f6dab8992d3297e 100644
--- a/pkgs/tools/morse-talk/default.nix
+++ b/pkgs/tools/morse-talk/default.nix
@@ -1,8 +1,11 @@
 { lib, buildPythonApplication, matplotlib, nose, sounddevice, sources }:
-
+let
+  pname = "morse-talk";
+  date = lib.substring 0 10 sources.morse-talk.date;
+  version = "unstable-" + date;
+in
 buildPythonApplication {
-  pname = "morse-talk";
-  version = lib.substring 0 7 sources.morse-talk.rev;
+  inherit pname version;
   src = sources.morse-talk;
 
   propagatedBuildInputs = [ matplotlib sounddevice ];
diff --git a/pkgs/tools/supload/default.nix b/pkgs/tools/supload/default.nix
index d2df7ddecb9a9b1d90f893bc4c7abc986a27b03f..5b73ec5fb815c348fbf6dd00e827172a886d4f18 100644
--- a/pkgs/tools/supload/default.nix
+++ b/pkgs/tools/supload/default.nix
@@ -1,8 +1,11 @@
 { stdenv, curl, file, coreutils, sources }:
-
+let
+  pname = "supload";
+  date = stdenv.lib.substring 0 10 sources.supload.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "supload";
-  version = stdenv.lib.substring 0 7 sources.supload.rev;
+  inherit pname version;
   src = sources.supload;
 
   buildInputs = [ curl file ];
diff --git a/pkgs/tools/text/csvquote/default.nix b/pkgs/tools/text/csvquote/default.nix
index c92b36d7a323d395a60d81641fe1d2109fd1cae4..a068622ad2d1e650d9537e5bd25cd5c216d49af4 100644
--- a/pkgs/tools/text/csvquote/default.nix
+++ b/pkgs/tools/text/csvquote/default.nix
@@ -1,8 +1,11 @@
 { stdenv, sources }:
-
+let
+  pname = "csvquote";
+  date = stdenv.lib.substring 0 10 sources.csvquote.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "csvquote";
-  version = stdenv.lib.substring 0 7 sources.csvquote.rev;
+  inherit pname version;
   src = sources.csvquote;
 
   makeFlags = [ "BINDIR=$(out)/bin" ];
diff --git a/pkgs/tools/text/csvtools/default.nix b/pkgs/tools/text/csvtools/default.nix
index 5d9b459de24324b3b271b60bcfdd39f46afb6daf..9458344894c0f267eacdee7e0e0906b9d0f644b0 100644
--- a/pkgs/tools/text/csvtools/default.nix
+++ b/pkgs/tools/text/csvtools/default.nix
@@ -1,8 +1,11 @@
 { stdenv, pcre, openssl, sources }:
-
+let
+  pname = "csvtools";
+  date = stdenv.lib.substring 0 10 sources.csvtools.date;
+  version = "unstable-" + date;
+in
 stdenv.mkDerivation {
-  pname = "csvtools";
-  version = stdenv.lib.substring 0 7 sources.csvtools.rev;
+  inherit pname version;
   src = sources.csvtools;
 
   buildInputs = [ pcre ];
diff --git a/update-commit-dates.sh b/update-commit-dates.sh
new file mode 100755
index 0000000000000000000000000000000000000000..6fd55dd3f0fbcb2bacacaddb73fb8ce16480a317
--- /dev/null
+++ b/update-commit-dates.sh
@@ -0,0 +1,45 @@
+#!/usr/bin/env nix-shell
+#! nix-shell -i bash -p curl jq moreutils
+
+# heredoc variables
+typeset \
+  commit_dates_filter='' \
+  commit_dates_query='' \
+
+
+IFS='' read -r -d '' commit_dates_query <<'EOF' # vim:ft=jq
+def repoField($alias):
+  "\($alias): repository(owner: \(.owner | @json), name: \(.repo | @json)) { " +
+    "object(expression: \(.rev | @json)) { ...go } }";
+
+def build_query:
+"fragment go on GitObject { ... on Commit { committedDate } }
+
+query CommitDates {
+  " + (map(.key as $alias | .value |
+    select(has("owner") and has("repo")) |
+      repoField($alias | gsub("-"; "_"))
+  ) | join("\n  ")) + "
+}";
+
+{ query: to_entries | build_query }
+EOF
+
+IFS='' read -r -d '' commit_dates_filter <<'EOF' # vim:ft=jq
+.data | with_entries(
+  .key |= gsub("_"; "-") |
+  .value |= { date: .object.committedDate }
+) as $overrides | $sources[] * $overrides
+EOF
+
+set -o errexit -o errtrace -o nounset -o pipefail
+shopt -s inherit_errexit
+
+curl 'https://api.github.com/graphql' \
+    -H "Authorization: bearer $GITHUB_TOKEN" \
+    --data-binary "$(jq "${commit_dates_query}" nix/sources.json)" | \
+  jq -S --indent 4 "${commit_dates_filter}" \
+    --slurpfile sources nix/sources.json | \
+  sponge nix/sources.json
+
+# vim:et:ft=sh:sw=2:tw=78
