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
This commit is contained in:
Matt Sturgeon 2025-02-22 16:02:13 +00:00
parent 0ab9947137
commit 6d10fc0c87
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
16 changed files with 366 additions and 285 deletions

View file

@ -1,17 +1,18 @@
{ lib, inputs, ... }:
{
imports = lib.optional (inputs.devshell ? flakeModule) inputs.devshell.flakeModule;
imports = [
inputs.devshell.flakeModule
];
perSystem =
{
lib,
pkgs,
config,
self',
system,
...
}:
lib.optionalAttrs (inputs.devshell ? flakeModule) {
{
devshells.default = {
devshell.startup.pre-commit.text = config.pre-commit.installationScript;