2021-07-16 19:40:57 +00:00
|
|
|
{ lib, stdenv, rustPlatform, fetchFromGitHub
|
2021-07-21 07:28:18 +00:00
|
|
|
, installShellFiles
|
2021-07-16 19:40:57 +00:00
|
|
|
, makeWrapper
|
|
|
|
, nix
|
|
|
|
, openssl
|
|
|
|
, pkg-config
|
|
|
|
, Security
|
|
|
|
}:
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "nix-template";
|
2022-12-28 21:21:41 +00:00
|
|
|
version = "0.4.1";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-07-21 07:28:18 +00:00
|
|
|
name = "${pname}-${version}-src";
|
2020-09-25 04:45:31 +00:00
|
|
|
owner = "jonringer";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-12-28 21:21:41 +00:00
|
|
|
sha256 = "sha256-42u5FmTIKHpfQ2zZQXIrFkAN2/XvU0wWnCRrQkQzcNI=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
cargoSha256 = "sha256-f8Th6SbV66Uukqh1Cb5uQVa844qw1PmBB9W7EMXMU4E=";
|
2021-07-21 07:28:18 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
makeWrapper
|
|
|
|
pkg-config
|
|
|
|
];
|
2021-07-16 19:40:57 +00:00
|
|
|
|
|
|
|
buildInputs = [ openssl ]
|
|
|
|
++ lib.optional stdenv.isDarwin Security;
|
|
|
|
|
|
|
|
# needed for nix-prefetch-url
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/nix-template \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ nix ]}
|
2021-07-21 07:28:18 +00:00
|
|
|
|
|
|
|
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-16 19:40:57 +00:00
|
|
|
'';
|
2020-09-25 04:45:31 +00: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 ];
|
|
|
|
};
|
|
|
|
}
|