depot/third_party/nixpkgs/pkgs/by-name/at/atuin/package.nix

73 lines
1.9 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, installShellFiles
, rustPlatform
, libiconv
, darwin
, nixosTests
}:
rustPlatform.buildRustPackage rec {
pname = "atuin";
version = "18.0.2";
src = fetchFromGitHub {
owner = "atuinsh";
repo = "atuin";
rev = "v${version}";
hash = "sha256-1ZNp6e2ZjVRU0w9m8YDWOHApu8vRYlcg6MJw03ZV49M=";
};
# TODO: unify this to one hash because updater do not support this
cargoHash =
if stdenv.isLinux
then "sha256-1yGv6Tmp7QhxIu3GNyRzK1i9Ghcil30+e8gTvyeKiZs="
else "sha256-+QdtQuXTk7Aw7xwelVDp/0T7FAYOnhDqSjazGemzSLw=";
# atuin's default features include 'check-updates', which do not make sense
# for distribution builds. List all other default features.
buildNoDefaultFeatures = true;
buildFeatures = [
"client" "sync" "server" "clipboard"
];
nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [
libiconv
darwin.apple_sdk.frameworks.AppKit
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.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)
'';
passthru.tests = {
inherit (nixosTests) atuin;
};
checkFlags = [
# tries to make a network access
"--skip=registration"
# No such file or directory (os error 2)
"--skip=sync"
# PermissionDenied (Operation not permitted)
"--skip=change_password"
"--skip=multi_user_test"
];
meta = with lib; {
description = "Replacement for a shell history which records additional commands context with optional encrypted synchronization between machines";
homepage = "https://github.com/atuinsh/atuin";
license = licenses.mit;
maintainers = with maintainers; [ SuperSandro2000 sciencentistguy _0x4A6F ];
mainProgram = "atuin";
};
}