update-nix-fetchgit: A program to update fetchgit values in Nix expressions

[ bsd3, library, nix, program ] [ Propose Tags ]

This command-line utility is meant to be used by people maintaining Nix expressions that fetch files from Git repositories. It automates the process of keeping such expressions up-to-date with the latest upstream sources.


[Skip to Readme]
Versions [faq] 0.1.0.0, 0.1.1.0, 0.1.2.0
Change log CHANGELOG.md
Dependencies aeson (>=0.9), async (>=2.1), base (>=4.7 && <5), bytestring (>=0.10), errors (>=2.1), hnix (>=0.8), prettyprinter, process (>=1.2), text (>=1.2), time (>=1.5), transformers (>=0.4), uniplate (>=1.6), update-nix-fetchgit, utf8-string (>=1.0) [details]
License BSD-3-Clause
Copyright 2015 Joe Hermaszewski
Author Joe Hermaszewski
Maintainer haskell@monoid.al
Category Nix
Home page https://github.com/expipiplus1/update-nix-fetchgit#readme
Source repo head: git clone https://github.com/expipiplus1/update-nix-fetchgit
Uploaded by srk at 2020-10-07T11:52:44Z
Distributions NixOS:0.1.2.0
Executables update-nix-fetchgit
Downloads 783 total (54 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2020-10-07 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for update-nix-fetchgit-0.1.2.0

[back to package description]

update-nix-fetchgit

This is a command-line utility for updating fetchgit, fetchgitPrivate, and fetchFromGitHub calls in Nix expressions. This utility is meant to be used by people maintaining Nix expressions that fetch files from Git repositories. It automates the process of keeping such expressions up-to-date with the latest upstream sources.

When you run update-nix-fetchgit on a file, it will:

  • Read the file and parse it as a Nix expression.
  • Find all Git fetches (calls to fetchgit, fetchgitPrivate, fetchFromGitHub or fetchFromGitLab).
  • Run nix-prefetch-git to get information about the latest HEAD commit of each repository.
  • Update the corresponding rev, sha256, and version attributes for each repository.
  • Overwrite the original input file.

Any version attribute found in the file will be updated if it is in a set that contains (directly or inderictly) a Git fetch. The version attribute will be updated to the commit date of the latest HEAD commit in the Git repository, in the time zone of the committer, in "YYYY-MM-DD" format. If the set contains multiple Git fetches, the latest such date is used.

When this program fetches information from multiple repositories, it runs multiple instances of nix-prefetch-git in parallel.

Usage

Pass the name of the file to be updated as the first argument:

update-nix-fetchgit filename.nix

The file will be updated in place.

Extra arguments

update-nix-fetchgit will pass any extra arguments after the filename to nix-prefetch-git:

update-nix-fetchgit filename.nix --rev refs/heads/myBranch

Example

Here is an example of a Nix expression that can be updated by this program:

{ stdenv, fetchgit }:

stdenv.mkDerivation rec {
  name = "foo-${version}";
  version = "2016-07-13";
  src = fetchgit {
    url = "git://midipix.org/slibtool";
    rev = "4f56fd184ef6020626492a6f954a486d54f8b7ba";
    sha256 = "0nmyp5yrzl9dbq85wyiimsj9fklb8637a1936nw7zzvlnzkgh28n";
  };
}

The rev, sha256, and version attributes will all be updated.

Building from source

The recommended way to build this program from source for development purposes is to download and run nix-shell in the top-level source directory and then run cabal build.

More documentation

You can run update-nix-fetchgit --help or man update-nix-fetchgit for more documentation.

Authors