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" ```
47 lines
1006 B
Nix
47 lines
1006 B
Nix
{ lib
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, llvmPackages
|
|
, stdenv
|
|
, darwin
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "caligula";
|
|
version = "0.4.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ifd3f";
|
|
repo = "caligula";
|
|
rev = "v${version}";
|
|
hash = "sha256-fi4W7Z32S30kzKNVEDbV8PRyTW9fZxumBGtLn8SkI5Y=";
|
|
};
|
|
|
|
cargoHash = "sha256-ma7JVbWSiKfkCXCDwA8DFm2+KPrWR+8nSdgGSqehNg8=";
|
|
|
|
env = {
|
|
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
|
};
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin (
|
|
with darwin.apple_sdk.frameworks; [
|
|
Cocoa
|
|
IOKit
|
|
Foundation
|
|
DiskArbitration
|
|
]
|
|
);
|
|
|
|
RUSTFLAGS = "--cfg tracing_unstable";
|
|
|
|
meta = with lib; {
|
|
description = "User-friendly, lightweight TUI for disk imaging";
|
|
homepage = "https://github.com/ifd3f/caligula/";
|
|
license = licenses.gpl3Only;
|
|
maintainers = with maintainers; [ ifd3f sodiboo ];
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
mainProgram = "caligula";
|
|
};
|
|
}
|