nixpkgs/pkgs/by-name/co/comodoro/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

49 lines
1.4 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, stdenv
, installShellFiles
, installShellCompletions ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
, installManPages ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
, withTcp ? true
}:
rustPlatform.buildRustPackage rec {
pname = "comodoro";
version = "0.0.10";
src = fetchFromGitHub {
owner = "soywod";
repo = "comodoro";
rev = "v${version}";
hash = "sha256-Y9SuxqI8wvoF0+X6CLNDlSFCwlSU8R73NYF/LjACP18=";
};
cargoHash = "sha256-1WJIIsTzbChWqvdBSR/OpLC1iR8FgLmypJFQEtpalbw=";
nativeBuildInputs = lib.optional (installManPages || installShellCompletions) installShellFiles;
buildNoDefaultFeatures = true;
buildFeatures = lib.optional withTcp "tcp";
postInstall = lib.optionalString installManPages ''
mkdir -p $out/man
$out/bin/comodoro man $out/man
installManPage $out/man/*
'' + lib.optionalString installShellCompletions ''
installShellCompletion --cmd comodoro \
--bash <($out/bin/comodoro completion bash) \
--fish <($out/bin/comodoro completion fish) \
--zsh <($out/bin/comodoro completion zsh)
'';
meta = with lib; {
description = "CLI to manage your time";
homepage = "https://github.com/pimalaya/comodoro";
changelog = "https://github.com/soywod/comodoro/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ soywod ];
mainProgram = "comodoro";
};
}