Files
nixpkgs/pkgs/by-name/ni/nix-template/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

57 lines
1.3 KiB
Nix

{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
installShellFiles,
makeWrapper,
nix,
openssl,
pkg-config,
}:
rustPlatform.buildRustPackage rec {
pname = "nix-template";
version = "0.4.1";
src = fetchFromGitHub {
name = "${pname}-${version}-src";
owner = "jonringer";
repo = "nix-template";
rev = "v${version}";
sha256 = "sha256-42u5FmTIKHpfQ2zZQXIrFkAN2/XvU0wWnCRrQkQzcNI=";
};
cargoHash = "sha256-cLSGWOyBQLv235TeYqSVg/f0Zmcnpj+RshINN69JYEU=";
nativeBuildInputs = [
installShellFiles
makeWrapper
pkg-config
];
buildInputs = [ openssl ];
# 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 = {
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 = lib.licenses.cc0;
maintainers = [ ];
mainProgram = "nix-template";
};
}