mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +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, ... }:
|
{ pkgs, config, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkEnableOption mkOption mkIf mkMerge types;
|
inherit (lib) mkEnableOption mkOption mkOptionType mkMerge mkIf types;
|
||||||
cfg = config.programs.nixvim;
|
cfg = config.programs.nixvim;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options = {
|
options = {
|
||||||
programs.nixvim = lib.mkOption {
|
programs.nixvim = mkOption {
|
||||||
type = types.submodule ((modules pkgs) ++ [{
|
type = types.submodule ((modules pkgs) ++ [{
|
||||||
options.enable = mkEnableOption "nixvim";
|
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 [
|
(mkMerge [
|
||||||
{ home.packages = [ cfg.finalPackage ]; }
|
{ home.packages = [ cfg.finalPackage ]; }
|
||||||
(mkIf (!cfg.wrapRc) {
|
(mkIf (!cfg.wrapRc) {
|
||||||
|
|
|
@ -2,18 +2,28 @@ modules:
|
||||||
{ pkgs, config, lib, ... }:
|
{ pkgs, config, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkEnableOption mkOption mkMerge mkIf types;
|
inherit (lib) mkEnableOption mkOption mkOptionType mkMerge mkIf types;
|
||||||
cfg = config.programs.nixvim;
|
cfg = config.programs.nixvim;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options = {
|
options = {
|
||||||
programs.nixvim = lib.mkOption {
|
programs.nixvim = mkOption {
|
||||||
type = types.submodule ((modules pkgs) ++ [{
|
type = types.submodule ((modules pkgs) ++ [{
|
||||||
options.enable = mkEnableOption "nixvim";
|
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 [
|
(mkMerge [
|
||||||
{ environment.systemPackages = [ cfg.finalPackage ]; }
|
{ environment.systemPackages = [ cfg.finalPackage ]; }
|
||||||
(mkIf (!cfg.wrapRc) {
|
(mkIf (!cfg.wrapRc) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue