feat(tmux): add fish completions
This commit is contained in:
parent
3e8ff2e064
commit
b8be6a3a4e
6 changed files with 77 additions and 22 deletions
49
overlays/builders.nix
Normal file
49
overlays/builders.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
_:
|
||||
|
||||
final: _:
|
||||
with final.lib;
|
||||
{
|
||||
writeFishApplication =
|
||||
{ name
|
||||
, text
|
||||
, completions ? null
|
||||
, runtimeInputs ? [ ]
|
||||
, checkPhase ? null
|
||||
}:
|
||||
let
|
||||
fishFile = destination: content: final.writeTextFile {
|
||||
inherit name destination;
|
||||
executable = true;
|
||||
allowSubstitutes = true;
|
||||
preferLocalBuild = false;
|
||||
text = ''
|
||||
#!${getExe final.fish}
|
||||
'' + optionalString (runtimeInputs != [ ]) ''
|
||||
|
||||
export PATH="${makeBinPath runtimeInputs}:$PATH"
|
||||
'' + ''
|
||||
|
||||
${content}
|
||||
'';
|
||||
|
||||
checkPhase =
|
||||
if checkPhase == null then ''
|
||||
runHook preCheck
|
||||
${getExe final.fish} -n "$target"
|
||||
runHook postCheck
|
||||
''
|
||||
else checkPhase;
|
||||
};
|
||||
|
||||
|
||||
script = fishFile "/bin/${name}" text;
|
||||
|
||||
completions_file = fishFile "/share/fish/vendor_completions.d/${name}.fish" completions;
|
||||
in
|
||||
final.symlinkJoin {
|
||||
inherit name;
|
||||
paths = [
|
||||
script
|
||||
] ++ optional (completions != null) completions_file;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue