diff --git a/flake/default.nix b/flake/default.nix index 52506c3e..31b434cf 100644 --- a/flake/default.nix +++ b/flake/default.nix @@ -4,6 +4,7 @@ ./flake-modules ./lib.nix ./legacy-packages.nix + ./nixvim-configurations.nix ./overlays.nix ./packages.nix ./templates.nix diff --git a/flake/flake-modules/default.nix b/flake/flake-modules/default.nix index 75d3058f..613ba621 100644 --- a/flake/flake-modules/default.nix +++ b/flake/flake-modules/default.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 = { diff --git a/flake/flake-modules/nixvimConfigurations.nix b/flake/flake-modules/nixvimConfigurations.nix new file mode 100644 index 00000000..89830e0f --- /dev/null +++ b/flake/flake-modules/nixvimConfigurations.nix @@ -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; +} diff --git a/flake/legacy-packages.nix b/flake/legacy-packages.nix index 323decc7..ac83fd99 100644 --- a/flake/legacy-packages.nix +++ b/flake/legacy-packages.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; }; }; } diff --git a/flake/nixvim-configurations.nix b/flake/nixvim-configurations.nix new file mode 100644 index 00000000..b7f45eb6 --- /dev/null +++ b/flake/nixvim-configurations.nix @@ -0,0 +1,10 @@ +{ helpers, ... }: +{ + perSystem = + { system, ... }: + { + nixvimConfigurations.default = helpers.modules.evalNixvim { + inherit system; + }; + }; +}