mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-29 22:30:13 +02:00
wrappers: removed code duplication
This commit is contained in:
parent
78e7d229a1
commit
e0ed2eabf9
4 changed files with 25 additions and 30 deletions
|
@ -1,8 +1,9 @@
|
|||
modules:
|
||||
{ pkgs, config, lib, ... }:
|
||||
{ pkgs, config, lib, ... }@args:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkOption mkOptionType mkMerge mkIf types;
|
||||
shared = import ./_shared.nix args;
|
||||
cfg = config.programs.nixvim;
|
||||
in
|
||||
{
|
||||
|
@ -12,15 +13,7 @@ in
|
|||
options.enable = mkEnableOption "nixvim";
|
||||
}]);
|
||||
};
|
||||
nixvim.helpers = mkOption {
|
||||
type = mkOptionType {
|
||||
name = "helpers";
|
||||
description = "Helpers that can be used when writing nixvim configs";
|
||||
check = builtins.isAttrs;
|
||||
};
|
||||
description = "Use this option to access the helpers";
|
||||
default = import ../plugins/helpers.nix { inherit (pkgs) lib; };
|
||||
};
|
||||
nixvim.helpers = shared.helpers;
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue