nixpkgs/pkgs/tools/misc/atuin/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
1.5 KiB
Nix
Raw Normal View History

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
, installShellFiles
2021-05-08 09:28:16 +00:00
, rustPlatform
2021-05-11 21:02:05 +00:00
, libiconv
, Security
, SystemConfiguration
, xvfb-run
, nixosTests
2021-05-08 09:28:16 +00:00
}:
rustPlatform.buildRustPackage rec {
pname = "atuin";
version = "14.0.1";
2021-05-08 09:28:16 +00:00
src = fetchFromGitHub {
owner = "ellie";
repo = pname;
rev = "v${version}";
hash = "sha256-mfeHgUCnt/DkdKxFlYx/t2LLjiqDX5mBMHto9A4mj78=";
2021-05-08 09:28:16 +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=";
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 ];
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)
'';
nativeCheckInputs = lib.optionals xvfb-run.meta.available [
xvfb-run
];
checkPhase = lib.optionalString xvfb-run.meta.available ''
runHook preCheck
xvfb-run cargo test
runHook postCheck
'';
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;
maintainers = with maintainers; [ SuperSandro2000 sciencentistguy _0x4A6F ];
2021-05-08 09:28:16 +00:00
};
}