
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" ```
52 lines
1.2 KiB
Nix
52 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
alsa-lib,
|
|
darwin,
|
|
fetchFromGitHub,
|
|
pkg-config,
|
|
protobuf,
|
|
rustPlatform,
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "music-player";
|
|
version = "0.2.0-alpha.14-unstable-2024-08-24";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "tsirysndr";
|
|
repo = "music-player";
|
|
# No patch for 0.2.0, diff patch has a big size, temporarily until the next release
|
|
rev = "cf01ae4d2dcf5c804559250f2c7f922d870ae26d";
|
|
hash = "sha256-8C8uFnXSBalLD2MUgzzfg4ylvTVecyPJOSUri5jbvkM=";
|
|
};
|
|
|
|
cargoHash = "sha256-JmyuA5p6/7jtNuOMWuAuspYYid+dGOeollIlS0DRCIE=";
|
|
|
|
nativeBuildInputs =
|
|
[
|
|
protobuf
|
|
rustPlatform.bindgenHook
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs =
|
|
lib.optionals stdenv.hostPlatform.isLinux [
|
|
alsa-lib
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
darwin.apple_sdk.frameworks.AudioUnit
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Extensible music player daemon written in Rust";
|
|
homepage = "https://github.com/tsirysndr/music-player";
|
|
changelog = "https://github.com/tsirysndr/music-player/releases/tag/v${version}";
|
|
license = licenses.mit;
|
|
maintainers = [ ];
|
|
mainProgram = "music-player";
|
|
};
|
|
}
|