2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2021-12-21 02:18:32 +00:00
|
|
|
, installShellFiles
|
2021-05-20 23:08:51 +00:00
|
|
|
, rustPlatform
|
|
|
|
, libiconv
|
2024-02-29 20:09:43 +00:00
|
|
|
, darwin
|
2022-12-17 10:02:37 +00:00
|
|
|
, nixosTests
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "atuin";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "18.2.0";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-08-10 07:59:29 +00:00
|
|
|
owner = "atuinsh";
|
|
|
|
repo = "atuin";
|
2021-05-20 23:08:51 +00:00
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-TTQ2XLqng7TMLnRsLDb/50yyHYuMSPZJ4H+7CEFWQQ0=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
# TODO: unify this to one hash because updater do not support this
|
2023-07-15 17:15:38 +00:00
|
|
|
cargoHash =
|
|
|
|
if stdenv.isLinux
|
2024-04-21 15:54:59 +00:00
|
|
|
then "sha256-KMH19Op7uyb3Z/cjT6bdmO+JEp1o2n6rWRNYmn1+0hE="
|
|
|
|
else "sha256-mBOyo6bKipMfmsowQujeUpog12jXAiqx5CtkwCxquRU=";
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
# 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"
|
|
|
|
];
|
2021-12-21 02:18:32 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
libiconv
|
2024-04-21 15:54:59 +00:00
|
|
|
darwin.apple_sdk_11_0.frameworks.AppKit
|
|
|
|
darwin.apple_sdk_11_0.frameworks.Security
|
|
|
|
darwin.apple_sdk_11_0.frameworks.SystemConfiguration
|
2024-02-29 20:09:43 +00:00
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2021-12-21 02:18:32 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd atuin \
|
2022-04-15 01:41:22 +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-21 02:18:32 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) atuin;
|
|
|
|
};
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
checkFlags = [
|
|
|
|
# tries to make a network access
|
|
|
|
"--skip=registration"
|
2023-11-16 04:20:00 +00:00
|
|
|
# No such file or directory (os error 2)
|
|
|
|
"--skip=sync"
|
2024-02-29 20:09:43 +00:00
|
|
|
# PermissionDenied (Operation not permitted)
|
|
|
|
"--skip=change_password"
|
|
|
|
"--skip=multi_user_test"
|
2024-04-21 15:54:59 +00:00
|
|
|
# Tries to touch files
|
|
|
|
"--skip=build_aliases"
|
2023-08-10 07:59:29 +00:00
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Replacement for a shell history which records additional commands context with optional encrypted synchronization between machines";
|
2023-08-10 07:59:29 +00:00
|
|
|
homepage = "https://github.com/atuinsh/atuin";
|
2021-05-20 23:08:51 +00:00
|
|
|
license = licenses.mit;
|
2023-03-04 12:14:45 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 sciencentistguy _0x4A6F ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "atuin";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
}
|