mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
flake: add nixvimConfigurations
flake-parts module
This commit is contained in:
parent
9aa6d0f6e6
commit
5426c9dd83
5 changed files with 37 additions and 7 deletions
|
@ -4,6 +4,7 @@
|
|||
./flake-modules
|
||||
./lib.nix
|
||||
./legacy-packages.nix
|
||||
./nixvim-configurations.nix
|
||||
./overlays.nix
|
||||
./packages.nix
|
||||
./templates.nix
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
{ inputs, ... }:
|
||||
let
|
||||
# Modules for the flakeModules output and the default module
|
||||
defaultModules = { };
|
||||
defaultModules = {
|
||||
nixvimConfigurations = ./nixvimConfigurations.nix;
|
||||
};
|
||||
|
||||
# Modules for the flakeModules output, but not the default module
|
||||
extraModules = {
|
||||
|
|
21
flake/flake-modules/nixvimConfigurations.nix
Normal file
21
flake/flake-modules/nixvimConfigurations.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ lib, flake-parts-lib, ... }:
|
||||
let
|
||||
configurationType = lib.mkOptionType {
|
||||
name = "configuration";
|
||||
description = "configuration";
|
||||
descriptionClass = "noun";
|
||||
merge = lib.options.mergeOneOption;
|
||||
check = x: x._type or null == "configuration";
|
||||
};
|
||||
in
|
||||
flake-parts-lib.mkTransposedPerSystemModule {
|
||||
name = "nixvimConfigurations";
|
||||
option = lib.mkOption {
|
||||
type = lib.types.lazyAttrsOf configurationType;
|
||||
default = { };
|
||||
description = ''
|
||||
An attribute set of Nixvim configurations.
|
||||
'';
|
||||
};
|
||||
file = ./nixvimConfigurations.nix;
|
||||
}
|
|
@ -1,19 +1,15 @@
|
|||
{ helpers, ... }:
|
||||
{
|
||||
perSystem =
|
||||
{
|
||||
config,
|
||||
makeNixvimWithModule,
|
||||
system,
|
||||
...
|
||||
}:
|
||||
{
|
||||
legacyPackages = rec {
|
||||
inherit makeNixvimWithModule;
|
||||
makeNixvim = module: makeNixvimWithModule { inherit module; };
|
||||
|
||||
nixvimConfiguration = helpers.modules.evalNixvim {
|
||||
inherit system;
|
||||
};
|
||||
nixvimConfiguration = config.nixvimConfigurations.default;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
10
flake/nixvim-configurations.nix
Normal file
10
flake/nixvim-configurations.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ helpers, ... }:
|
||||
{
|
||||
perSystem =
|
||||
{ system, ... }:
|
||||
{
|
||||
nixvimConfigurations.default = helpers.modules.evalNixvim {
|
||||
inherit system;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue