Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
53 lines
1.4 KiB
Nix
53 lines
1.4 KiB
Nix
{ lib, stdenv, rustPlatform, fetchFromGitHub
|
|
, installShellFiles
|
|
, makeWrapper
|
|
, nix
|
|
, openssl
|
|
, pkg-config
|
|
, Security
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "nix-template";
|
|
version = "0.4.1";
|
|
|
|
src = fetchFromGitHub {
|
|
name = "${pname}-${version}-src";
|
|
owner = "jonringer";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-42u5FmTIKHpfQ2zZQXIrFkAN2/XvU0wWnCRrQkQzcNI=";
|
|
};
|
|
|
|
cargoHash = "sha256-f8Th6SbV66Uukqh1Cb5uQVa844qw1PmBB9W7EMXMU4E=";
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
makeWrapper
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = [ openssl ]
|
|
++ lib.optional stdenv.hostPlatform.isDarwin Security;
|
|
|
|
# needed for nix-prefetch-url
|
|
postInstall = ''
|
|
wrapProgram $out/bin/nix-template \
|
|
--prefix PATH : ${lib.makeBinPath [ nix ]}
|
|
|
|
'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
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 = [ ];
|
|
mainProgram = "nix-template";
|
|
};
|
|
}
|