mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
helpers: expose helpers to config.nixvim.helpers
This commit is contained in:
parent
4adcb35851
commit
9ada457ca8
1 changed files with 36 additions and 23 deletions
33
flake.nix
33
flake.nix
|
@ -21,8 +21,8 @@
|
||||||
config = {
|
config = {
|
||||||
_module.args = {
|
_module.args = {
|
||||||
pkgs = mkForce pkgs;
|
pkgs = mkForce pkgs;
|
||||||
lib = pkgs.lib;
|
inherit (pkgs) lib;
|
||||||
helpers = import ./plugins/helpers.nix { lib = pkgs.lib; };
|
helpers = import ./plugins/helpers.nix { inherit (pkgs) lib; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
@ -35,6 +35,15 @@
|
||||||
options.enable = mkEnableOption "Enable nixvim";
|
options.enable = mkEnableOption "Enable nixvim";
|
||||||
}]);
|
}]);
|
||||||
};
|
};
|
||||||
|
helperOption = pkgs: 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; };
|
||||||
|
};
|
||||||
|
|
||||||
build = pkgs:
|
build = pkgs:
|
||||||
configuration:
|
configuration:
|
||||||
|
@ -54,9 +63,16 @@
|
||||||
nixvimModules = nixvimModules;
|
nixvimModules = nixvimModules;
|
||||||
inherit nmdSrc;
|
inherit nmdSrc;
|
||||||
};
|
};
|
||||||
|
});
|
||||||
|
in
|
||||||
|
flakeOutput // rec {
|
||||||
|
inherit build;
|
||||||
|
|
||||||
nixosModules.nixvim = { pkgs, config, lib, ... }: {
|
nixosModules.nixvim = { pkgs, config, lib, ... }: {
|
||||||
options.programs.nixvim = nixvimOption pkgs;
|
options = {
|
||||||
|
programs.nixvim = nixvimOption pkgs;
|
||||||
|
nixvim.helpers = helperOption pkgs;
|
||||||
|
};
|
||||||
config = mkIf config.programs.nixvim.enable {
|
config = mkIf config.programs.nixvim.enable {
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
config.programs.nixvim.output
|
config.programs.nixvim.output
|
||||||
|
@ -65,18 +81,15 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
homeManagerModules.nixvim = { pkgs, config, lib, ... }: {
|
homeManagerModules.nixvim = { pkgs, config, lib, ... }: {
|
||||||
options.programs.nixvim = nixvimOption pkgs;
|
options = {
|
||||||
|
programs.nixvim = nixvimOption pkgs;
|
||||||
|
nixvim.helpers = helperOption pkgs;
|
||||||
|
};
|
||||||
config = mkIf config.programs.nixvim.enable {
|
config = mkIf config.programs.nixvim.enable {
|
||||||
home.packages = [
|
home.packages = [
|
||||||
config.programs.nixvim.output
|
config.programs.nixvim.output
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
|
||||||
in
|
|
||||||
flakeOutput // {
|
|
||||||
inherit build;
|
|
||||||
homeManagerModules.nixvim = flakeOutput.homeManagerModules.x86_64-linux.nixvim;
|
|
||||||
nixosModules.nixvim = flakeOutput.nixosModules.x86_64-linux.nixvim;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue