add nix-prefetch-source (#21734)

authored by Tim Cuthbertson and committed by zimbatm.tngl.sh ca38ef79 6aae00ed

+31
+29
pkgs/tools/package-management/nix-update-source/default.nix
··· 1 + { lib, pkgs, fetchFromGitHub, python3Packages, nix-prefetch-scripts }: 2 + python3Packages.buildPythonApplication rec { 3 + version = "0.2.1"; 4 + name = "nix-update-source-${version}"; 5 + src = fetchFromGitHub { 6 + owner = "timbertson"; 7 + repo = "nix-update-source"; 8 + rev = "version-${version}"; 9 + sha256 = "1w3aj0kjp8zhxkzqxnm5srrsqsvrmxhn4sqkr4kjffh61jg8jq8a"; 10 + }; 11 + propagatedBuildInputs = [ nix-prefetch-scripts ]; 12 + passthru = { 13 + fetch = path: 14 + let 15 + fetchers = { 16 + # whitelist of allowed fetchers 17 + inherit (pkgs) fetchgit fetchurl fetchFromGitHub; 18 + }; 19 + json = lib.importJSON path; 20 + fetchFn = builtins.getAttr json.fetch.fn fetchers; 21 + src = fetchFn json.fetch.args; 22 + in 23 + json // { inherit src; }; 24 + }; 25 + meta = { 26 + description = "Utility to autimate updating of nix derivation sources"; 27 + maintainers = with lib.maintainers; [ timbertson ]; 28 + }; 29 + }
+2
pkgs/top-level/all-packages.nix
··· 17597 17597 nix-prefetch-zip 17598 17598 nix-prefetch-scripts; 17599 17599 17600 + nix-update-source = callPackage ../tools/package-management/nix-update-source {}; 17601 + 17600 17602 nix-template-rpm = callPackage ../build-support/templaterpm { inherit (pythonPackages) python toposort; }; 17601 17603 17602 17604 nix-repl = callPackage ../tools/package-management/nix-repl { };