diff options
author | Tim Cuthbertson <tim@gfxmonk.net> | 2017-01-24 04:44:43 +1100 |
---|---|---|
committer | zimbatm <zimbatm@zimbatm.com> | 2017-01-23 17:44:43 +0000 |
commit | ca38ef79e9d1530cd32890bf9e4760096f25f048 (patch) | |
tree | 54f4390017e930817ba61dc5a6f7d0b77cecd16a | |
parent | 6aae00edfc5431be95c4285ca93f471b7b9f69e4 (diff) |
add nix-prefetch-source (#21734)
-rw-r--r-- | pkgs/tools/package-management/nix-update-source/default.nix | 29 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
2 files changed, 31 insertions, 0 deletions
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 0000000000000..06ac8203f8221 --- /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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d17bd889df52b..944f9c9d2258c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17597,6 +17597,8 @@ in nix-prefetch-zip nix-prefetch-scripts; + nix-update-source = callPackage ../tools/package-management/nix-update-source {}; + nix-template-rpm = callPackage ../build-support/templaterpm { inherit (pythonPackages) python toposort; }; nix-repl = callPackage ../tools/package-management/nix-repl { }; |