mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
modules/top-level: move out of wrappers/modules
This commit is contained in:
parent
b59fa976d0
commit
2deb61f6a5
10 changed files with 34 additions and 16 deletions
|
@ -63,9 +63,11 @@ let
|
|||
# Evaluation is irrelevant, only used for documentation.
|
||||
};
|
||||
|
||||
# Construct our own top-level modules, because we want to stub the `files` option
|
||||
# FIXME: add a way to handle this with specialArgs
|
||||
topLevelModules = [
|
||||
../modules
|
||||
../wrappers/modules/output.nix
|
||||
../modules/top-level/output.nix
|
||||
# Fake module to avoid a duplicated documentation
|
||||
(lib.setDefaultModuleLocation "${nixvimPath}/wrappers/modules/files.nix" {
|
||||
options.files = lib.mkOption {
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
# This module includes the nixvim modules that should always be evaluated.
|
||||
#
|
||||
# You may want to use the `/modules/top-level` module instead, unless you're
|
||||
# using this in a submodule nested within another nixvim config.
|
||||
{
|
||||
imports = [
|
||||
./misc
|
||||
|
|
12
modules/top-level/default.nix
Normal file
12
modules/top-level/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Alternative to `/modules` that also includes modules that should only exist at the "top-level".
|
||||
# Therefore, `/modules` should be used instead for submodules nested within a nixvim config.
|
||||
#
|
||||
# When using this, you likely also want a "wrapper" module for any platform-specific options.
|
||||
# See `/wrappers/modules` for examples.
|
||||
{
|
||||
imports = [
|
||||
../.
|
||||
./files.nix
|
||||
./output.nix
|
||||
];
|
||||
}
|
|
@ -17,7 +17,7 @@ let
|
|||
(
|
||||
{ name, config, ... }:
|
||||
{
|
||||
imports = [ ../../modules ];
|
||||
imports = [ ../. ];
|
||||
options.plugin = lib.mkOption {
|
||||
type = types.package;
|
||||
description = "A derivation with the content of the file in it";
|
|
@ -5,12 +5,6 @@ let
|
|||
cfg = config.programs.nixvim;
|
||||
in
|
||||
{
|
||||
topLevelModules = [
|
||||
../modules
|
||||
./modules/output.nix
|
||||
./modules/files.nix
|
||||
];
|
||||
|
||||
helpers = mkOption {
|
||||
type = mkOptionType {
|
||||
name = "helpers";
|
||||
|
|
|
@ -30,7 +30,10 @@ in
|
|||
defaultPkgs = pkgs;
|
||||
inherit helpers;
|
||||
};
|
||||
modules = [ ./modules/darwin.nix ] ++ shared.topLevelModules;
|
||||
modules = [
|
||||
./modules/darwin.nix
|
||||
../modules/top-level
|
||||
];
|
||||
};
|
||||
};
|
||||
nixvim.helpers = shared.helpers;
|
||||
|
|
|
@ -32,7 +32,10 @@ in
|
|||
defaultPkgs = pkgs;
|
||||
inherit helpers;
|
||||
};
|
||||
modules = [ ./modules/hm.nix ] ++ shared.topLevelModules;
|
||||
modules = [
|
||||
./modules/hm.nix
|
||||
../modules/top-level
|
||||
];
|
||||
};
|
||||
};
|
||||
nixvim.helpers = shared.helpers;
|
||||
|
|
|
@ -33,7 +33,10 @@ in
|
|||
defaultPkgs = pkgs;
|
||||
inherit helpers;
|
||||
};
|
||||
modules = [ ./modules/nixos.nix ] ++ shared.topLevelModules;
|
||||
modules = [
|
||||
./modules/nixos.nix
|
||||
../modules/top-level
|
||||
];
|
||||
};
|
||||
};
|
||||
nixvim.helpers = shared.helpers;
|
||||
|
|
|
@ -10,10 +10,6 @@ let
|
|||
inherit (pkgs) lib;
|
||||
|
||||
helpers = getHelpers pkgs _nixvimTests;
|
||||
shared = import ./_shared.nix helpers {
|
||||
inherit pkgs lib;
|
||||
config = { };
|
||||
};
|
||||
|
||||
handleAssertions =
|
||||
config:
|
||||
|
@ -32,7 +28,8 @@ let
|
|||
modules = [
|
||||
mod
|
||||
{ wrapRc = true; }
|
||||
] ++ shared.topLevelModules;
|
||||
../modules/top-level
|
||||
];
|
||||
specialArgs = {
|
||||
inherit helpers;
|
||||
defaultPkgs = pkgs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue