nixpkgs/pkgs/by-name/mq/mqttui/package.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
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"
```
2024-09-25 00:04:37 +03:00

45 lines
1001 B
Nix

{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
darwin,
}:
rustPlatform.buildRustPackage rec {
pname = "mqttui";
version = "0.21.1";
src = fetchFromGitHub {
owner = "EdJoPaTo";
repo = "mqttui";
rev = "refs/tags/v${version}";
hash = "sha256-JxaXiQj/dGSUhqyDtNij3JKT5NtEkyMta6rLGHmcLrU=";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"ratatui-binary-data-widget-0.1.0" = "sha256-IQ6BbFW1huv8QrNjqBMVKVMN7gfic/NyTBQNf+wCwAo=";
};
};
postPatch = ''
ln -sf ${./Cargo.lock} Cargo.lock
'';
buildInputs = lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.frameworks.Security;
meta = with lib; {
description = "Terminal client for MQTT";
homepage = "https://github.com/EdJoPaTo/mqttui";
changelog = "https://github.com/EdJoPaTo/mqttui/blob/v${version}/CHANGELOG.md";
license = licenses.gpl3Only;
maintainers = with maintainers; [
fab
sikmir
];
mainProgram = "mqttui";
};
}