2023-03-31 01:58:57 -06:00
|
|
|
# Atuin package definition
|
|
|
|
#
|
|
|
|
# This file will be similar to the package definition in nixpkgs:
|
|
|
|
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/atuin/default.nix
|
|
|
|
#
|
|
|
|
# Helpful documentation: https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md
|
2023-02-15 02:04:07 -07:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
installShellFiles,
|
|
|
|
rustPlatform,
|
|
|
|
libiconv,
|
|
|
|
Security,
|
|
|
|
SystemConfiguration,
|
|
|
|
}:
|
2023-03-31 01:58:57 -06:00
|
|
|
rustPlatform.buildRustPackage {
|
2023-02-15 02:04:07 -07:00
|
|
|
name = "atuin";
|
|
|
|
|
|
|
|
src = lib.cleanSource ./.;
|
|
|
|
|
2023-03-31 01:58:57 -06:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
# Allow dependencies to be fetched from git and avoid having to set the outputHashes manually
|
|
|
|
allowBuiltinFetchGit = true;
|
|
|
|
};
|
2023-02-15 02:04:07 -07:00
|
|
|
|
|
|
|
nativeBuildInputs = [installShellFiles];
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [libiconv Security SystemConfiguration];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd atuin \
|
|
|
|
--bash <($out/bin/atuin gen-completions -s bash) \
|
|
|
|
--fish <($out/bin/atuin gen-completions -s fish) \
|
|
|
|
--zsh <($out/bin/atuin gen-completions -s zsh)
|
|
|
|
'';
|
|
|
|
|
2023-07-28 01:49:42 -06:00
|
|
|
# Additional flags passed to the cargo test binary, see `cargo test -- --help`
|
|
|
|
checkFlags = [
|
|
|
|
# Registration tests require a postgres server
|
|
|
|
"--skip=registration"
|
|
|
|
];
|
|
|
|
|
2023-02-15 02:04:07 -07:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Replacement for a shell history which records additional commands context with optional encrypted synchronization between machines";
|
|
|
|
homepage = "https://github.com/ellie/atuin";
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|