mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35: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.
|
# 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 = [
|
topLevelModules = [
|
||||||
../modules
|
../modules
|
||||||
../wrappers/modules/output.nix
|
../modules/top-level/output.nix
|
||||||
# Fake module to avoid a duplicated documentation
|
# Fake module to avoid a duplicated documentation
|
||||||
(lib.setDefaultModuleLocation "${nixvimPath}/wrappers/modules/files.nix" {
|
(lib.setDefaultModuleLocation "${nixvimPath}/wrappers/modules/files.nix" {
|
||||||
options.files = lib.mkOption {
|
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 = [
|
imports = [
|
||||||
./misc
|
./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, ... }:
|
{ name, config, ... }:
|
||||||
{
|
{
|
||||||
imports = [ ../../modules ];
|
imports = [ ../. ];
|
||||||
options.plugin = lib.mkOption {
|
options.plugin = lib.mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
description = "A derivation with the content of the file in it";
|
description = "A derivation with the content of the file in it";
|
|
@ -5,12 +5,6 @@ let
|
||||||
cfg = config.programs.nixvim;
|
cfg = config.programs.nixvim;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
topLevelModules = [
|
|
||||||
../modules
|
|
||||||
./modules/output.nix
|
|
||||||
./modules/files.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
helpers = mkOption {
|
helpers = mkOption {
|
||||||
type = mkOptionType {
|
type = mkOptionType {
|
||||||
name = "helpers";
|
name = "helpers";
|
||||||
|
|
|
@ -30,7 +30,10 @@ in
|
||||||
defaultPkgs = pkgs;
|
defaultPkgs = pkgs;
|
||||||
inherit helpers;
|
inherit helpers;
|
||||||
};
|
};
|
||||||
modules = [ ./modules/darwin.nix ] ++ shared.topLevelModules;
|
modules = [
|
||||||
|
./modules/darwin.nix
|
||||||
|
../modules/top-level
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
nixvim.helpers = shared.helpers;
|
nixvim.helpers = shared.helpers;
|
||||||
|
|
|
@ -32,7 +32,10 @@ in
|
||||||
defaultPkgs = pkgs;
|
defaultPkgs = pkgs;
|
||||||
inherit helpers;
|
inherit helpers;
|
||||||
};
|
};
|
||||||
modules = [ ./modules/hm.nix ] ++ shared.topLevelModules;
|
modules = [
|
||||||
|
./modules/hm.nix
|
||||||
|
../modules/top-level
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
nixvim.helpers = shared.helpers;
|
nixvim.helpers = shared.helpers;
|
||||||
|
|
|
@ -33,7 +33,10 @@ in
|
||||||
defaultPkgs = pkgs;
|
defaultPkgs = pkgs;
|
||||||
inherit helpers;
|
inherit helpers;
|
||||||
};
|
};
|
||||||
modules = [ ./modules/nixos.nix ] ++ shared.topLevelModules;
|
modules = [
|
||||||
|
./modules/nixos.nix
|
||||||
|
../modules/top-level
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
nixvim.helpers = shared.helpers;
|
nixvim.helpers = shared.helpers;
|
||||||
|
|
|
@ -10,10 +10,6 @@ let
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
|
|
||||||
helpers = getHelpers pkgs _nixvimTests;
|
helpers = getHelpers pkgs _nixvimTests;
|
||||||
shared = import ./_shared.nix helpers {
|
|
||||||
inherit pkgs lib;
|
|
||||||
config = { };
|
|
||||||
};
|
|
||||||
|
|
||||||
handleAssertions =
|
handleAssertions =
|
||||||
config:
|
config:
|
||||||
|
@ -32,7 +28,8 @@ let
|
||||||
modules = [
|
modules = [
|
||||||
mod
|
mod
|
||||||
{ wrapRc = true; }
|
{ wrapRc = true; }
|
||||||
] ++ shared.topLevelModules;
|
../modules/top-level
|
||||||
|
];
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit helpers;
|
inherit helpers;
|
||||||
defaultPkgs = pkgs;
|
defaultPkgs = pkgs;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue