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

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

75 lines
2.0 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
2024-02-09 13:12:05 +00:00
, darwin
, nixosTests
2021-05-08 09:28:16 +00:00
}:
rustPlatform.buildRustPackage rec {
pname = "atuin";
2024-04-15 14:20:58 +00:00
version = "18.2.0";
2021-05-08 09:28:16 +00:00
src = fetchFromGitHub {
2023-08-08 09:43:18 +00:00
owner = "atuinsh";
repo = "atuin";
2021-05-08 09:28:16 +00:00
rev = "v${version}";
2024-04-15 14:20:58 +00:00
hash = "sha256-TTQ2XLqng7TMLnRsLDb/50yyHYuMSPZJ4H+7CEFWQQ0=";
2021-05-08 09:28:16 +00:00
};
# TODO: unify this to one hash because updater do not support this
2023-06-01 14:54:29 +00:00
cargoHash =
if stdenv.isLinux
2024-04-15 14:20:58 +00:00
then "sha256-KMH19Op7uyb3Z/cjT6bdmO+JEp1o2n6rWRNYmn1+0hE="
else "sha256-mBOyo6bKipMfmsowQujeUpog12jXAiqx5CtkwCxquRU=";
2024-02-22 21:23:42 +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"
];
nativeBuildInputs = [ installShellFiles ];
2021-05-08 09:28:16 +00:00
2024-02-09 13:12:05 +00:00
buildInputs = lib.optionals stdenv.isDarwin [
libiconv
darwin.apple_sdk_11_0.frameworks.AppKit
darwin.apple_sdk_11_0.frameworks.Security
darwin.apple_sdk_11_0.frameworks.SystemConfiguration
2024-02-09 13:12:05 +00:00
];
2021-05-11 21:02:05 +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)
'';
passthru.tests = {
inherit (nixosTests) atuin;
};
2023-08-08 09:43:18 +00:00
checkFlags = [
# tries to make a network access
"--skip=registration"
# No such file or directory (os error 2)
"--skip=sync"
2024-02-12 19:32:42 +00:00
# PermissionDenied (Operation not permitted)
2024-02-09 13:12:05 +00:00
"--skip=change_password"
"--skip=multi_user_test"
2024-04-15 14:20:58 +00:00
# Tries to touch files
"--skip=build_aliases"
2023-08-08 09:43:18 +00:00
];
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";
2023-08-08 09:43:18 +00:00
homepage = "https://github.com/atuinsh/atuin";
2021-05-08 09:28:16 +00:00
license = licenses.mit;
maintainers = with maintainers; [ SuperSandro2000 sciencentistguy _0x4A6F ];
2023-11-27 01:17:53 +00:00
mainProgram = "atuin";
2021-05-08 09:28:16 +00:00
};
}