bash-pinyin-completion-rs: init
flake.lock: update
This commit is contained in:
parent
02dc79ba3e
commit
ca3760997f
2 changed files with 55 additions and 2 deletions
4
flake.lock
generated
4
flake.lock
generated
|
|
@ -2,8 +2,8 @@
|
|||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1759143120,
|
||||
"narHash": "sha256-Lz9jvhswQu/niKVttNvOds0w+OS+2x63NivPVJng5G4=",
|
||||
"lastModified": 1760573772,
|
||||
"narHash": "sha256-RoIm6fgfvnkNQldHrbBhtAaFyiWJV5KF4D0dI41Fr90=",
|
||||
"type": "tarball",
|
||||
"url": "https://mirrors.cernet.edu.cn/nix-channels/nixos-unstable/nixexprs.tar.xz"
|
||||
},
|
||||
|
|
|
|||
53
pkgs/bash-pinyin-completion-rs/package.nix
Normal file
53
pkgs/bash-pinyin-completion-rs/package.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{ lib
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, bash
|
||||
, bash-completion
|
||||
, glibc
|
||||
, gcc
|
||||
, findutils
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "bash-pinyin-completion-rs";
|
||||
version = "1.0.0-beta";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "AOSC-Dev";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-VXIIG+ZGb4fS3LSIkGW744ui4AKTdQCjrNlObH/YZVY=";
|
||||
};
|
||||
|
||||
#cargoHash = "sha256-VXIIG+ZGb4fS3LSIkGW744ui4AKTdQCjrNlObH/YZVY=";
|
||||
cargoHash = "sha256-IEtGulY6EqJ74ok1xLY64K1yKSZcmb/wyObtcaHYMRk=";
|
||||
|
||||
nativeBuildInputs = [ ];
|
||||
buildInputs = [ bash bash-completion glibc gcc findutils ];
|
||||
|
||||
# Tests are enabled by default; equivalent to Arch’s `check()`
|
||||
doCheck = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
BIN_PATH=$(${findutils}/bin/find target -type f -executable -name bash-pinyin-completion-rs)
|
||||
install -Dm755 -t $out/bin/ "$BIN_PATH"
|
||||
install -Dm644 -t "$out/share/${pname}" scripts/bash_pinyin_completion
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Simple completion script for pinyin, written in Rust.";
|
||||
longDescription = ''
|
||||
Simple completion script for pinyin, written in Rust.
|
||||
==> Remember to enable bash-pinyin-completion-rs in your .bashrc
|
||||
==> (add the following line):
|
||||
source /run/current-system/sw/share/bash-pinyin-completion-rs/bash_pinyin_completion
|
||||
==> Or if installed via nix profile:
|
||||
source ~/.nix-profile/share/bash-pinyin-completion-rs/bash_pinyin_completion
|
||||
'';
|
||||
homepage = "https://github.com/AOSC-Dev/bash-pinyin-completion-rs";
|
||||
license = licenses.gpl3Only;
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue