blob: 08b5dcb319ca86ecdca6c91d281a7b0debcde90f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
{ 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 ];
};
}
|