nix-community.nixvim/flake/dev/list-plugins/default.nix
Matt Sturgeon 6d10fc0c87
flake: partition dev dependencies
This removes the need for end-users to manually set
`nixvim.inputs.devshell.follows = ""` (etc)

We offload evaluation of some of our flake modules into a `dev`
partition submodule.
- When its not needed, this submodule is not evaluated.
- When it is needed, it fetches extra inputs from `flake/dev/flake.nix`
  as part of evaluating the submodule.

See https://flake.parts/options/flake-parts-partitions.html
2025-02-23 17:23:57 +00:00

40 lines
909 B
Nix

{ self, ... }:
{
perSystem =
{
lib,
pkgs,
...
}:
let
package = pkgs.writers.writePython3Bin "list-plugins" {
# Disable flake8 checks that are incompatible with the ruff ones
flakeIgnore = [
# line too long
"E501"
# line break before binary operator
"W503"
];
} (builtins.readFile ./list-plugins.py);
in
{
packages.list-plugins = package;
checks.list-plugins-test =
pkgs.runCommand "list-plugins-test"
{
nativeBuildInputs = [ package ];
}
''
list-plugins --root-path ${self} > $out
'';
devshells.default.commands = [
{
name = "list-plugins";
command = ''${lib.getExe package} "$@"'';
help = "List plugins and get implementation infos";
}
];
};
}