
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" ```
32 lines
923 B
Nix
32 lines
923 B
Nix
{ lib, stdenv, fetchFromGitHub, rustPlatform, libiconv, testers, gptman }:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "gptman";
|
|
version = "1.1.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "rust-disk-partition-management";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
hash = "sha256-ebV61EilGggix6JSN/MW4Ka0itkSpvikLDSO005TTYY=";
|
|
};
|
|
|
|
cargoHash = "sha256-P+qez0oVsHBiaBYban2o8MRvF8ElLf5zb+p+tYunWWA=";
|
|
|
|
buildInputs = lib.optional stdenv.hostPlatform.isDarwin libiconv;
|
|
|
|
buildFeatures = [ "cli" ];
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
package = gptman;
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "GPT manager that allows you to copy partitions from one disk to another and more";
|
|
homepage = "https://github.com/rust-disk-partition-management/gptman";
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
|
maintainers = with maintainers; [ akshgpt7 ];
|
|
mainProgram = "gptman";
|
|
};
|
|
}
|