nix-home/packages/common/nki-kakoune/rc.nix
2024-10-07 16:31:33 +02:00

28 lines
454 B
Nix

{ lib
, fish
, writeScript
, writeTextDir
, prependRc ? ""
, appendRc ? ""
, ...
}:
let
source-pwd = writeScript "source-pwd" ''
#!/usr/bin/env ${lib.getExe fish}
${builtins.readFile ./source-pwd.fish}
'';
in
writeTextDir "share/kak/kakrc.local" ''
${prependRc}
${builtins.readFile ./kakrc}
${appendRc}
# Source any settings in the current working directory,
# recursive upwards
evaluate-commands %sh{
${source-pwd}
}
''