3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/package-management/nix-template/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.3 KiB
Nix
Raw Normal View History

2021-07-11 23:51:54 +01:00
{ lib, stdenv, rustPlatform, fetchFromGitHub
, installShellFiles
2021-07-11 23:51:54 +01:00
, makeWrapper
, nix
, openssl
, pkg-config
, Security
}:
2020-08-31 01:47:31 +01:00
rustPlatform.buildRustPackage rec {
pname = "nix-template";
2022-09-10 19:49:44 +01:00
version = "0.4.0";
2020-08-31 01:47:31 +01:00
src = fetchFromGitHub {
name = "${pname}-${version}-src";
2020-08-31 01:47:31 +01:00
owner = "jonringer";
repo = pname;
rev = "v${version}";
2022-09-10 19:49:44 +01:00
sha256 = "sha256-5Xxv9TH5rGA4VU/64YarrBIOrROWjFu3RYRcoNo70UA=";
2020-08-31 01:47:31 +01:00
};
2022-09-10 19:49:44 +01:00
cargoSha256 = "sha256-GvIE46NXNWg1kSEbffvOCwVDr0YmVMo8C8+52RDEwco=";
nativeBuildInputs = [
installShellFiles
makeWrapper
pkg-config
];
2021-07-11 23:51:54 +01:00
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)
2021-07-11 23:51:54 +01:00
'';
2020-08-31 01:47:31 +01:00
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 ];
};
}