mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-11 14:43:47 +00:00
![Artturin](/assets/img/avatar_default.png)
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" ```
67 lines
1.4 KiB
Nix
67 lines
1.4 KiB
Nix
{ lib
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
, stdenv
|
|
, darwin
|
|
, unixtools
|
|
, pkg-config
|
|
, alsa-lib
|
|
, xorg
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "daktilo";
|
|
version = "0.6.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "orhun";
|
|
repo = "daktilo";
|
|
rev = "v${version}";
|
|
hash = "sha256-gIBWonJGX6IpxyBeMulcfQEExsG1GrBVQLZbBBA1ruc=";
|
|
};
|
|
|
|
cargoHash = "sha256-lBlzXTkhsEboTby5tH7WfsvZxUwtw7sLYVJRozjI1D4=";
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = [
|
|
alsa-lib
|
|
xorg.libX11
|
|
xorg.libXi
|
|
xorg.libXtst
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
darwin.apple_sdk.frameworks.Security
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
unixtools.script
|
|
];
|
|
|
|
postInstall = ''
|
|
mkdir -p man completions
|
|
|
|
OUT_DIR=man $out/bin/daktilo-mangen
|
|
OUT_DIR=completions $out/bin/daktilo-completions
|
|
|
|
installManPage man/daktilo.1
|
|
installShellCompletion \
|
|
completions/daktilo.{bash,fish} \
|
|
--zsh completions/_daktilo
|
|
|
|
rm $out/bin/daktilo-{completions,mangen}
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Turn your keyboard into a typewriter";
|
|
homepage = "https://github.com/orhun/daktilo";
|
|
changelog = "https://github.com/orhun/daktilo/blob/${src.rev}/CHANGELOG.md";
|
|
license = with licenses; [ asl20 mit ];
|
|
maintainers = with maintainers; [ orhun ];
|
|
mainProgram = "daktilo";
|
|
};
|
|
}
|