mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
helpers: expose to config.nixvim.helpers (#59)
This commit is contained in:
parent
f7be736462
commit
1fa86d1699
2 changed files with 28 additions and 8 deletions
|
@ -2,18 +2,28 @@ modules:
|
|||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkOption mkIf mkMerge types;
|
||||
inherit (lib) mkEnableOption mkOption mkOptionType mkMerge mkIf types;
|
||||
cfg = config.programs.nixvim;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
programs.nixvim = lib.mkOption {
|
||||
programs.nixvim = mkOption {
|
||||
type = types.submodule ((modules pkgs) ++ [{
|
||||
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; };
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable
|
||||
config = mkIf cfg.enable
|
||||
(mkMerge [
|
||||
{ home.packages = [ cfg.finalPackage ]; }
|
||||
(mkIf (!cfg.wrapRc) {
|
||||
|
|
|
@ -2,18 +2,28 @@ modules:
|
|||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkOption mkMerge mkIf types;
|
||||
inherit (lib) mkEnableOption mkOption mkOptionType mkMerge mkIf types;
|
||||
cfg = config.programs.nixvim;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
programs.nixvim = lib.mkOption {
|
||||
programs.nixvim = mkOption {
|
||||
type = types.submodule ((modules pkgs) ++ [{
|
||||
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; };
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable
|
||||
config = mkIf cfg.enable
|
||||
(mkMerge [
|
||||
{ environment.systemPackages = [ cfg.finalPackage ]; }
|
||||
(mkIf (!cfg.wrapRc) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue