Initial commit
This commit is contained in:
20
hello-world-callpackage/build.nix
Normal file
20
hello-world-callpackage/build.nix
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchzip,
|
||||
version,
|
||||
hash,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "hello";
|
||||
version = "${version}";
|
||||
src = fetchzip {
|
||||
url = "https://ftp.gnu.org/gnu/hello/hello-${version}.tar.gz";
|
||||
hash = "${hash}";
|
||||
};
|
||||
installPhase = ''
|
||||
./hello --version
|
||||
mkdir -p $out/bin
|
||||
cp hello $out/bin/hello
|
||||
'';
|
||||
}
|
10
hello-world-callpackage/default.nix
Normal file
10
hello-world-callpackage/default.nix
Normal file
@ -0,0 +1,10 @@
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
let
|
||||
commonBuild = import ./build.nix;
|
||||
callPackageForVersion = { version, hash }: pkgs.callPackage commonBuild { version = version; hash = hash; };
|
||||
in
|
||||
{
|
||||
p0 = callPackageForVersion { version = "2.11"; hash = "sha256-1nXiB0vMCmMYmikTopb/j5WKFwHkc7xoLOqL9/bDFak="; };
|
||||
p1 = callPackageForVersion { version = "2.12"; hash = "sha256-4GQeKLIxoWfYiOraJub5RsHNVQBr2H+3bfPP22PegdU="; };
|
||||
p2 = callPackageForVersion { version = "2.12.1"; hash = "sha256-1kJjhtlsAkpNB7f6tZEs+dbKd8z7KoNHyDHEJ0tmhnc="; };
|
||||
}
|
Reference in New Issue
Block a user