1 { lib, pkgs, fetchFromGitHub, python3Packages, nix-prefetch-scripts, runtimeShell }:
3 python3Packages.buildPythonApplication rec {
4 pname = "nix-update-source";
7 src = fetchFromGitHub {
8 hash = "sha256-+49Yb+rZ3CzFnwEpwj5xrcMUVBiYOJtCk9YeZ15IM/U=";
10 repo = "nix-update-source";
11 rev = "version-${version}";
14 propagatedBuildInputs = [ nix-prefetch-scripts ];
19 # NOTE: `fetch` should not be used within nixpkgs because it
20 # uses a non-idiomatic structure. It is provided for use by
21 # out-of-tree nix derivations.
25 # whitelist of allowed fetchers
26 inherit (pkgs) fetchgit fetchurl fetchFromGitHub;
28 json = lib.importJSON path;
29 fetchFn = builtins.getAttr json.fetch.fn fetchers;
30 src = fetchFn json.fetch.args;
32 json // json.fetch // {
34 overrideSrc = drv: lib.overrideDerivation drv (orig: { inherit src; });
45 ${pkgs.nix-update-source}/bin/nix-update-source \
47 --replace-attr version \
48 --set owner timbertson \
49 --set repo nix-update-source \
50 --set type fetchFromGitHub \
51 --set rev 'version-{version}' \
52 --nix-literal rev 'version-''${version}'\
53 --modify-nix default.nix
59 homepage = "https://github.com/timbertson/nix-update-source";
60 description = "Utility to automate updating of nix derivation sources";
61 maintainers = with lib.maintainers; [ timbertson ];
62 license = lib.licenses.mit;
63 mainProgram = "nix-update-source";