mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-30 23:55:15 +02:00
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:
parent
0ab9947137
commit
6d10fc0c87
16 changed files with 366 additions and 285 deletions
|
@ -1,6 +1,12 @@
|
|||
{
|
||||
lib,
|
||||
inputs,
|
||||
config,
|
||||
partitionStack,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./dev
|
||||
./flake-modules
|
||||
./lib.nix
|
||||
./legacy-packages.nix
|
||||
|
@ -8,7 +14,43 @@
|
|||
./overlays.nix
|
||||
./packages.nix
|
||||
./templates.nix
|
||||
./tests.nix
|
||||
./wrappers.nix
|
||||
inputs.flake-parts.flakeModules.partitions
|
||||
];
|
||||
|
||||
# Define flake partitions
|
||||
# Each has a `module`, assigned to the partition's submodule,
|
||||
# and an `extraInputsFlake`, used for its inputs.
|
||||
# See https://flake.parts/options/flake-parts-partitions.html
|
||||
partitions = {
|
||||
dev = {
|
||||
module = ./dev;
|
||||
extraInputsFlake = ./dev;
|
||||
};
|
||||
};
|
||||
|
||||
# Specify which outputs are defined by which partitions
|
||||
partitionedAttrs = {
|
||||
checks = "dev";
|
||||
devShells = "dev";
|
||||
formatter = "dev";
|
||||
};
|
||||
|
||||
# For any output attrs normally defined by the root flake configuration,
|
||||
# any exceptions must be manually propagated from the `dev` partition.
|
||||
#
|
||||
# NOTE: Attrs should be explicitly propagated at the deepest level.
|
||||
# Otherwise the partition won't be lazy, making it pointless.
|
||||
# E.g. propagate `packages.${system}.foo` instead of `packages.${system}`
|
||||
# See: https://github.com/hercules-ci/flake-parts/issues/258
|
||||
perSystem =
|
||||
{ system, ... }:
|
||||
{
|
||||
packages = lib.optionalAttrs (partitionStack == [ ]) {
|
||||
# Propagate `packages` from the `dev` partition:
|
||||
inherit (config.partitions.dev.module.flake.packages.${system})
|
||||
list-plugins
|
||||
;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue