2021-05-08 09:28:16 +00:00
|
|
|
{ lib
|
2021-05-11 21:02:05 +00:00
|
|
|
, stdenv
|
2021-05-08 09:28:16 +00:00
|
|
|
, fetchFromGitHub
|
2021-12-19 06:19:27 +00:00
|
|
|
, installShellFiles
|
2021-05-08 09:28:16 +00:00
|
|
|
, rustPlatform
|
2021-05-11 21:02:05 +00:00
|
|
|
, libiconv
|
|
|
|
, Security
|
|
|
|
, SystemConfiguration
|
2023-03-02 17:23:50 +00:00
|
|
|
, xvfb-run
|
2022-12-16 03:07:26 +00:00
|
|
|
, nixosTests
|
2021-05-08 09:28:16 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "atuin";
|
2023-04-17 11:38:52 +00:00
|
|
|
version = "14.0.1";
|
2021-05-08 09:28:16 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ellie";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-04-17 11:38:52 +00:00
|
|
|
hash = "sha256-mfeHgUCnt/DkdKxFlYx/t2LLjiqDX5mBMHto9A4mj78=";
|
2021-05-08 09:28:16 +00:00
|
|
|
};
|
|
|
|
|
2023-04-17 11:38:52 +00:00
|
|
|
# TODO: unify this to one hash because updater do not support this
|
|
|
|
cargoHash = if stdenv.isLinux then "sha256-oaBTj+ZSJ36AFwIrB6d0cZppoAzV4QDr3+EylYqY7cw=" else "sha256-UNuoW/EOGtuNROm1qZJ4afDfMlecziVsem1m3Z1ZsOU=";
|
2021-12-19 06:19:27 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2021-05-08 09:28:16 +00:00
|
|
|
|
2021-05-11 21:02:05 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ libiconv Security SystemConfiguration ];
|
|
|
|
|
2021-12-19 06:19:27 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd atuin \
|
2022-04-13 10:54:54 +00:00
|
|
|
--bash <($out/bin/atuin gen-completions -s bash) \
|
|
|
|
--fish <($out/bin/atuin gen-completions -s fish) \
|
|
|
|
--zsh <($out/bin/atuin gen-completions -s zsh)
|
2021-12-19 06:19:27 +00:00
|
|
|
'';
|
|
|
|
|
2023-03-03 21:37:59 +00:00
|
|
|
nativeCheckInputs = lib.optionals xvfb-run.meta.available [
|
2023-03-02 17:23:50 +00:00
|
|
|
xvfb-run
|
|
|
|
];
|
|
|
|
|
2023-03-03 21:37:59 +00:00
|
|
|
checkPhase = lib.optionalString xvfb-run.meta.available ''
|
2023-03-02 17:23:50 +00:00
|
|
|
runHook preCheck
|
|
|
|
xvfb-run cargo test
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2022-12-16 03:07:26 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) atuin;
|
|
|
|
};
|
|
|
|
|
2021-05-08 09:28:16 +00: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;
|
2023-03-02 17:23:50 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 sciencentistguy _0x4A6F ];
|
2021-05-08 09:28:16 +00:00
|
|
|
};
|
|
|
|
}
|