mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 22:53:42 +00:00
34 lines
770 B
Nix
34 lines
770 B
Nix
{ lib, stdenv, rtpPath ? "share/kak/autoload/plugins" }:
|
|
rec {
|
|
buildKakounePlugin = attrs@{
|
|
name ? "${attrs.pname}-${attrs.version}",
|
|
namePrefix ? "kakplugin-",
|
|
src,
|
|
unpackPhase ? "",
|
|
configurePhase ? "",
|
|
buildPhase ? "",
|
|
preInstall ? "",
|
|
postInstall ? "",
|
|
path ? lib.getName name,
|
|
...
|
|
}:
|
|
stdenv.mkDerivation ((builtins.removeAttrs attrs [ "namePrefix" "path" ]) // {
|
|
name = namePrefix + name;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
target=$out/${rtpPath}/${path}
|
|
mkdir -p $out/${rtpPath}
|
|
cp -r . $target
|
|
|
|
runHook postInstall
|
|
'';
|
|
});
|
|
|
|
buildKakounePluginFrom2Nix = attrs: buildKakounePlugin ({
|
|
dontBuild = true;
|
|
dontConfigure = true;
|
|
} // attrs);
|
|
}
|