mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
43 lines
1.3 KiB
Nix
43 lines
1.3 KiB
Nix
{ lib, stdenv, rustPlatform, fetchCrate, installShellFiles
|
|
, libgpg-error, gpgme, gettext, openssl, Security
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "sheesy-cli";
|
|
version = "4.0.11";
|
|
|
|
src = fetchCrate {
|
|
inherit version pname;
|
|
hash = "sha256-rJ/V9pJgmqERgjD0FQ/oqhZQlIeN4/3ECx15/FOUQdA=";
|
|
};
|
|
|
|
cargoHash = "sha256-o2XRvzw54x6xv81l97s1hwc2MC0Ioeyheoz3F+AtKpU=";
|
|
cargoDepsName = pname;
|
|
|
|
nativeBuildInputs = [ libgpg-error gpgme gettext installShellFiles ];
|
|
|
|
buildInputs = [ openssl ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Security ];
|
|
|
|
buildFeatures = [ "vault" "extract" "completions" "substitute" "process" ];
|
|
|
|
checkFeatures = [ ];
|
|
|
|
cargoBuildFlags = [ "--bin" "sy" ];
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
installShellCompletion --cmd sy \
|
|
--bash <($out/bin/sy completions bash) \
|
|
--fish <($out/bin/sy completions fish) \
|
|
--zsh <($out/bin/sy completions zsh)
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "'share-secrets-safely' CLI to interact with GPG/pass-like vaults";
|
|
homepage = "https://share-secrets-safely.github.io/cli/";
|
|
changelog = "https://github.com/share-secrets-safely/cli/releases/tag/${version}";
|
|
license = with licenses; [ lgpl21Only ];
|
|
maintainers = with maintainers; [ devhell ];
|
|
mainProgram = "sy";
|
|
};
|
|
}
|