From ca38ef79e9d1530cd32890bf9e4760096f25f048 Mon Sep 17 00:00:00 2001 From: Tim Cuthbertson Date: Tue, 24 Jan 2017 04:44:43 +1100 Subject: add nix-prefetch-source (#21734) --- .../nix-update-source/default.nix | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 pkgs/tools/package-management/nix-update-source/default.nix (limited to 'pkgs/tools/package-management') diff --git a/pkgs/tools/package-management/nix-update-source/default.nix b/pkgs/tools/package-management/nix-update-source/default.nix new file mode 100644 index 000000000000..06ac8203f822 --- /dev/null +++ b/pkgs/tools/package-management/nix-update-source/default.nix @@ -0,0 +1,29 @@ +{ 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 ]; + }; +} -- cgit 1.4.1