nixpkgs/pkgs/by-name/da/daktilo/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

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";
};
}