{ lib, pkgs, fetchFromGitHub, python3Packages, nix-prefetch-scripts }:
python3Packages.buildPythonApplication rec {
  version = "0.2.2";
  name = "nix-update-source-${version}";
  src = fetchFromGitHub {
    owner = "timbertson";
    repo = "nix-update-source";
    rev = "version-${version}";
    sha256 = "0liigkr37ib2xy269bcp53ivpir4mpg6lzwnfrsqc4kbkz3l16gg";
  };
  propagatedBuildInputs = [ nix-prefetch-scripts ];
  passthru = {
    fetch = path:
      let
        fetchers = {
          # whitelist of allowed fetchers
          inherit (pkgs) fetchgit fetchurl fetchFromGitHub;
        };
        json = lib.importJSON path;
        fetchFn = builtins.getAttr json.fetch.fn fetchers;
        src = fetchFn json.fetch.args;
      in
      json // json.fetch // { inherit src; };
  };
  meta = {
    description = "Utility to autimate updating of nix derivation sources";
    maintainers = with lib.maintainers; [ timbertson ];
  };
}

{ lib, pkgs, fetchFromGitHub, python3Packages, nix-prefetch-scripts }:
python3Packages.buildPythonApplication rec {
  version = "0.2.1";
  name = "nix-update-source-${version}";
  src = fetchFromGitHub {
    owner = "timbertson";
    repo = "nix-update-source";
    rev = "version-${version}";
    sha256 = "1w3aj0kjp8zhxkzqxnm5srrsqsvrmxhn4sqkr4kjffh61jg8jq8a";
  };
  propagatedBuildInputs = [ nix-prefetch-scripts ];
  passthru = {
    fetch = path:
      let
        fetchers = {
          # whitelist of allowed fetchers
          inherit (pkgs) fetchgit fetchurl fetchFromGitHub;
        };
        json = lib.importJSON path;
        fetchFn = builtins.getAttr json.fetch.fn fetchers;
        src = fetchFn json.fetch.args;
      in
      json // { inherit src; };
  };
  meta = {
    description = "Utility to autimate updating of nix derivation sources";
    maintainers = with lib.maintainers; [ timbertson ];
  };
}

Revert "nix-update-source: 0.2.1 -> 0.2.2"
Revert "nix-update-source: 0.2.1 -> 0.2.2"

This reverts commit b984d5d25f3c5f4d8c700f3c5e0b41bd48cfcb79.
