mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 13:00:23 +00:00
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.
Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.
A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.
This commit was automatically created and can be verified using
nix-build a08b3a4d19.tar.gz \
--argstr baseRev 57b193d8dd
result/bin/apply-formatting $NIXPKGS_PATH
48 lines
1.3 KiB
Nix
48 lines
1.3 KiB
Nix
{
|
|
lib,
|
|
symlinkJoin,
|
|
makeWrapper,
|
|
kakoune,
|
|
plugins ? [ ],
|
|
configure ? { },
|
|
}:
|
|
|
|
let
|
|
# "plugins" is the preferred way, but some configurations may be
|
|
# using "configure.plugins", so accept both
|
|
requestedPlugins = plugins ++ (configure.plugins or [ ]);
|
|
|
|
in
|
|
symlinkJoin {
|
|
name = "kakoune-${kakoune.version}";
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
paths = [ kakoune ] ++ requestedPlugins;
|
|
|
|
postBuild = ''
|
|
# create a directory for bins that kakoune needs
|
|
# access to, without polluting the users path by adding
|
|
# that binary nested with this symlinkJoin.
|
|
mkdir -p $out/share/kak/bin
|
|
|
|
# location of kak binary is used to find ../share/kak/autoload,
|
|
# unless explicitly overriden with KAKOUNE_RUNTIME
|
|
rm "$out/bin/kak"
|
|
makeWrapper "${kakoune}/bin/kak" "$out/bin/kak" \
|
|
--set KAKOUNE_RUNTIME "$out/share/kak" \
|
|
--suffix PATH : "$out/share/kak/bin"
|
|
|
|
# currently kakoune ignores doc files if they are symlinks, so workaround by
|
|
# copying doc files over, so they become regular files...
|
|
mkdir "$out/DELETE_ME"
|
|
mv "$out/share/kak/doc" "$out/DELETE_ME"
|
|
cp -r --dereference "$out/DELETE_ME/doc" "$out/share/kak"
|
|
rm -Rf "$out/DELETE_ME"
|
|
'';
|
|
|
|
meta = kakoune.meta // {
|
|
priority = (kakoune.meta.priority or lib.meta.defaultPriority) - 1;
|
|
};
|
|
}
|