Merge pull request #39355 from timbertson/nix-pin-2

nix-pin: 0.1.2 -> 0.2.2 and add updateScript
This commit is contained in:
Jörg Thalheim 2018-04-23 07:57:18 +01:00 committed by GitHub
commit fc878616f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,12 +1,12 @@
{ pkgs, stdenv, fetchFromGitHub, mypy, python3 }: { pkgs, stdenv, fetchFromGitHub, mypy, python3 }:
let self = stdenv.mkDerivation rec { let self = stdenv.mkDerivation rec {
name = "nix-pin-${version}"; name = "nix-pin-${version}";
version = "0.1.2"; version = "0.2.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "timbertson"; owner = "timbertson";
repo = "nix-pin"; repo = "nix-pin";
rev = "version-0.1.2"; rev = "version-0.2.2";
sha256 = "1zwfb5198qzbjwivgiaxbwva9frgrrqaj92nw8vz95yi08pijssh"; sha256 = "1kw43kzy4m6lnnif51r2a8i4vcgr7d4vqb1c75p7pk2b9y3jwxsz";
}; };
buildInputs = [ python3 mypy ]; buildInputs = [ python3 mypy ];
buildPhase = '' buildPhase = ''
@ -16,12 +16,27 @@ let self = stdenv.mkDerivation rec {
mkdir "$out" mkdir "$out"
cp -r bin share "$out" cp -r bin share "$out"
''; '';
passthru = { passthru =
callWithPins = path: args: let
import "${self}/share/nix/call.nix" { defaults = import "${self}/share/nix/defaults.nix";
inherit pkgs path args; in {
}; api = { pinConfig ? defaults.pinConfig }:
}; let impl = import "${self}/share/nix/api.nix" { inherit pkgs pinConfig; }; in
{ inherit (impl) augmentedPkgs pins callPackage; };
updateScript = ''
set -e
echo
cd ${toString ./.}
${pkgs.nix-update-source}/bin/nix-update-source \
--prompt version \
--replace-attr version \
--set owner timbertson \
--set repo nix-pin \
--set type fetchFromGitHub \
--set rev 'version-{version}' \
--modify-nix default.nix
'';
};
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = "https://github.com/timbertson/nix-pin"; homepage = "https://github.com/timbertson/nix-pin";
description = "nixpkgs development utility"; description = "nixpkgs development utility";