mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-29 09:04:17 +00:00
571c71e6f7
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.
41 lines
1.2 KiB
Nix
41 lines
1.2 KiB
Nix
{ lib, rustPlatform, fetchFromGitHub, fetchpatch, installShellFiles }:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "page";
|
|
version = "4.6.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "I60R";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
hash = "sha256-uNdtgx9/9+KOfQvHiKNrT8NFWtR2tfJuI2bMwywBC/4=";
|
|
};
|
|
|
|
cargoHash = "sha256-ctYQMBAdSUfEek2vcCa3gnI9N6ZG9b+VvtAzT20jlXY=";
|
|
|
|
cargoPatches = [
|
|
# Cargo.lock is outdated.
|
|
# https://github.com/I60R/page/pull/45.
|
|
(fetchpatch {
|
|
url = "https://github.com/I60R/page/commit/83f936b64620ba74043c1db31207b4366c0f7e3d.patch";
|
|
hash = "sha256-qA5oP4K/6eG0A+syVNb1izl+bnYll5V6sWM3LVFTb4o=";
|
|
})
|
|
];
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
postInstall = ''
|
|
completions_dir=$(find "target" -name "assets" -type d -printf "%T+\t%p\n" | sort | awk 'NR==1{print $2}')
|
|
installShellCompletion --bash $completions_dir/page.bash
|
|
installShellCompletion --fish $completions_dir/page.fish
|
|
installShellCompletion --zsh $completions_dir/_page
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Use neovim as pager";
|
|
homepage = "https://github.com/I60R/page";
|
|
license = licenses.mit;
|
|
mainProgram = "page";
|
|
maintainers = [ maintainers.s1341 ];
|
|
};
|
|
}
|