nixpkgs/pkgs/by-name/yo/youki/package.nix
2024-09-04 15:07:47 +00:00

63 lines
1.3 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
installShellFiles,
dbus,
libseccomp,
systemd,
stdenv,
}:
rustPlatform.buildRustPackage rec {
pname = "youki";
version = "0.4.1";
src = fetchFromGitHub {
owner = "containers";
repo = pname;
rev = "v${version}";
hash = "sha256-vXYoLjmPiK2f6Yg5YGTp76hmawnbfcnMOOppsWwKtAk=";
};
nativeBuildInputs = [
pkg-config
installShellFiles
];
buildInputs = [
dbus
libseccomp
systemd
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd youki \
--bash <($out/bin/youki completion -s bash) \
--fish <($out/bin/youki completion -s fish) \
--zsh <($out/bin/youki completion -s zsh)
'';
cargoBuildFlags = [
"-p"
"youki"
];
cargoTestFlags = [
"-p"
"youki"
];
cargoHash = "sha256-s8L/L3be5fRahDiLKnHQcU52F+AJVr7Q3uL8mcloVv8=";
meta = with lib; {
description = "Container runtime written in Rust";
homepage = "https://containers.github.io/youki/";
changelog = "https://github.com/containers/youki/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ builditluc ];
platforms = platforms.linux;
mainProgram = "youki";
};
}