depot/third_party/nixpkgs/pkgs/tools/package-management/nix-template/default.nix
Default email 22017988c6 Project import generated by Copybara.
GitOrigin-RevId: c777cdf5c564015d5f63b09cc93bef4178b19b01
2022-04-27 11:35:20 +02:00

51 lines
1.3 KiB
Nix

{ lib, stdenv, rustPlatform, fetchFromGitHub
, installShellFiles
, makeWrapper
, nix
, openssl
, pkg-config
, Security
}:
rustPlatform.buildRustPackage rec {
pname = "nix-template";
version = "0.3.0";
src = fetchFromGitHub {
name = "${pname}-${version}-src";
owner = "jonringer";
repo = pname;
rev = "v${version}";
sha256 = "sha256-5redgssfwbNEgpjmakIcU8cL4Xg1kPvyK88v+xMqAtw=";
};
cargoSha256 = "sha256-d4gxOIpgtVBpqy4QGW4/UB/FP94CS+yzS8GCjRVaXOM=";
nativeBuildInputs = [
installShellFiles
makeWrapper
pkg-config
];
buildInputs = [ openssl ]
++ lib.optional stdenv.isDarwin Security;
# needed for nix-prefetch-url
postInstall = ''
wrapProgram $out/bin/nix-template \
--prefix PATH : ${lib.makeBinPath [ nix ]}
installShellCompletion --cmd nix-template \
--bash <($out/bin/nix-template completions bash) \
--fish <($out/bin/nix-template completions fish) \
--zsh <($out/bin/nix-template completions zsh)
'';
meta = with lib; {
description = "Make creating nix expressions easy";
homepage = "https://github.com/jonringer/nix-template/";
changelog = "https://github.com/jonringer/nix-template/releases/tag/v${version}";
license = licenses.cc0;
maintainers = with maintainers; [ jonringer ];
};
}