diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-07-14 15:50:11 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-08-14 00:01:17 +0000 |
commit | 69a15dd2dc85051ba1436613805f9286850e0596 (patch) | |
tree | d53cec2bb5b8d07df1d1919b212cb2deb3628cd6 /nixpkgs/pkgs/applications/editors/kakoune/wrapper.nix | |
parent | 6941276da135c3eb3b50e0be33d92e7d01ccba9a (diff) | |
parent | beff2f8d75ef2c65017fb25e251337c6bb2e950d (diff) | |
download | nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar.gz nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar.bz2 nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar.lz nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar.xz nixlib-69a15dd2dc85051ba1436613805f9286850e0596.tar.zst nixlib-69a15dd2dc85051ba1436613805f9286850e0596.zip |
Merge commit 'beff2f8d75ef2c65017fb25e251337c6bb2e950d'
v# modified: nixpkgs/pkgs/tools/networking/dhcpcd/default.nix
Diffstat (limited to 'nixpkgs/pkgs/applications/editors/kakoune/wrapper.nix')
-rw-r--r-- | nixpkgs/pkgs/applications/editors/kakoune/wrapper.nix | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/editors/kakoune/wrapper.nix b/nixpkgs/pkgs/applications/editors/kakoune/wrapper.nix new file mode 100644 index 000000000000..b4cc823880e7 --- /dev/null +++ b/nixpkgs/pkgs/applications/editors/kakoune/wrapper.nix @@ -0,0 +1,44 @@ +{ stdenv, bash }: +with stdenv.lib; + +kakoune: + +let + getPlugins = { plugins ? [] }: plugins; + + wrapper = { configure ? {} }: + stdenv.mkDerivation rec { + pname = "kakoune"; + version = getVersion kakoune; + + src = ./.; + buildCommand = '' + mkdir -p $out/share/kak + for plugin in ${strings.escapeShellArgs (getPlugins configure)}; do + if [[ -d $plugin/share/kak/autoload ]]; then + find "$plugin/share/kak/autoload" -type f -name '*.kak'| while read rcfile; do + printf 'source "%s"\n' "$rcfile" + done + fi + done >>$out/share/kak/plugins.kak + + mkdir -p $out/bin + substitute ${src}/wrapper.sh $out/bin/kak \ + --subst-var-by bash "${bash}" \ + --subst-var-by kakoune "${kakoune}" \ + --subst-var-by out "$out" + chmod +x $out/bin/kak + ''; + + preferLocalBuild = true; + buildInputs = [ bash kakoune ]; + passthru = { unwrapped = kakoune; }; + + meta = kakoune.meta // { + # prefer wrapper over the package + priority = (kakoune.meta.priority or 0) - 1; + hydraPlatforms = []; + }; + }; +in + makeOverridable wrapper |