14 canExecute = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
20 src = fetchFromGitHub {
23 rev = "refs/tags/cli-v${version}";
24 hash = "sha256-ynbljYl73XwCnt3RUNmOYdrN8FX3sJ+3qDhWa8m2YJs=";
25 sparseCheckout = [ "cli" ];
30 vendorHash = "sha256-Gg1mifMVt6Ma8yQ/t0R5nf6NXbzLZBpuZrYsW48p0mw=";
37 "-X main.AppVersion=cli-v${version}"
40 nativeBuildInputs = [ installShellFiles ];
44 mv $out/bin/{cli,ente}
46 # running ente results in the following errors:
47 # > mkdir /homeless-shelter: permission denied
48 # > error getting password from keyring: exec: "dbus-launch": executable file not found in $PATH
49 # fix by setting ENTE_CLI_CONFIG_PATH to $TMP and ENTE_CLI_SECRETS_PATH to a non existing path
50 # also guarding with `isLinux` because ENTE_CLI_SECRETS_PATH doesn't help on darwin:
51 # > error setting password in keyring: exit status 195
53 + lib.optionalString (stdenv.buildPlatform.isLinux && canExecute) ''
54 export ENTE_CLI_CONFIG_PATH=$TMP
55 export ENTE_CLI_SECRETS_PATH=$TMP/secrets
57 installShellCompletion --cmd ente \
58 --bash <($out/bin/ente completion bash) \
59 --fish <($out/bin/ente completion fish) \
60 --zsh <($out/bin/ente completion zsh)
64 # only works on linux, see comment above about ENTE_CLI_SECRETS_PATH on darwin
65 tests.version = lib.optionalAttrs stdenv.isLinux (
69 env ENTE_CLI_CONFIG_PATH=$TMP \
70 ENTE_CLI_SECRETS_PATH=$TMP/secrets \
73 version = "Version cli-v${ente-cli.version}";
76 updateScript = nix-update-script {
85 description = "CLI client for downloading your data from Ente";
87 The Ente CLI is a Command Line Utility for exporting data from Ente. It also does a few more things, for example, you can use it to decrypting the export from Ente Auth.
89 homepage = "https://github.com/ente-io/ente/tree/main/cli#readme";
90 changelog = "https://github.com/ente-io/ente/releases/tag/cli-v${version}";
91 license = lib.licenses.agpl3Only;
93 lib.maintainers.zi3m5f