vimPluginsUpdater: Format files with nixfmt

This is a rare case of a Nix file actually ending up in the build result.
We reformat this now, causing a rebuild, so that we won't cause a rebuild
in the treewide reformatting PR.
This commit is contained in:
Silvan Mosberger 2024-07-12 04:14:07 +02:00 committed by Silvan Mosberger
parent 65e7143039
commit 323012ced2

View File

@ -1,19 +1,28 @@
with import <localpkgs> {};
with import <localpkgs> { };
let
inherit (vimUtils.override {inherit vim;}) buildVimPlugin;
inherit (vimUtils.override { inherit vim; }) buildVimPlugin;
inherit (neovimUtils) buildNeovimPlugin;
generated = callPackage <localpkgs/pkgs/applications/editors/vim/plugins/generated.nix> {
inherit buildNeovimPlugin buildVimPlugin;
} {} {};
hasChecksum = value:
lib.isAttrs value && lib.hasAttrByPath ["src" "outputHash"] value;
getChecksum = name: value:
if hasChecksum value then {
submodules = value.src.fetchSubmodules or false;
sha256 = value.src.outputHash;
rev = value.src.rev;
} else null;
} { } { };
hasChecksum =
value:
lib.isAttrs value
&& lib.hasAttrByPath [
"src"
"outputHash"
] value;
getChecksum =
name: value:
if hasChecksum value then
{
submodules = value.src.fetchSubmodules or false;
sha256 = value.src.outputHash;
rev = value.src.rev;
}
else
null;
checksums = lib.mapAttrs getChecksum generated;
in
lib.filterAttrs (n: v: v != null) checksums
lib.filterAttrs (n: v: v != null) checksums