mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-09 14:45:58 +01:00
flake/modules: add finalPackage akin to nixos' neovim module
This commit is contained in:
parent
8c4f32645b
commit
c53c8311fc
2 changed files with 14 additions and 10 deletions
|
@ -13,7 +13,7 @@ packages: inputs: {
|
|||
cfg = config.programs.neovim-flake;
|
||||
inherit (import ../../configuration.nix inputs) neovimConfiguration;
|
||||
|
||||
builtPackage = neovimConfiguration {
|
||||
neovimConfigured = neovimConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [cfg.settings];
|
||||
};
|
||||
|
@ -23,10 +23,10 @@ in {
|
|||
options.programs.neovim-flake = {
|
||||
enable = mkEnableOption "neovim-flake, the extensible neovim-wrapper";
|
||||
|
||||
builtPackage = mkOption {
|
||||
finalPackage = mkOption {
|
||||
type = anything;
|
||||
default = builtPackage;
|
||||
internal = true;
|
||||
visible = false;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
The built neovim-flake package, wrapped with the user's configuration.
|
||||
'';
|
||||
|
@ -57,6 +57,8 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [builtPackage];
|
||||
home.packages = [cfg.finalPackage];
|
||||
|
||||
programs.neovim-flake.finalPackage = neovimConfigured.neovim;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ packages: inputs: {
|
|||
cfg = config.programs.neovim-flake;
|
||||
inherit (import ../../configuration.nix inputs) neovimConfiguration;
|
||||
|
||||
builtPackage = neovimConfiguration {
|
||||
neovimConfigured = neovimConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [cfg.settings];
|
||||
};
|
||||
|
@ -23,10 +23,10 @@ in {
|
|||
options.programs.neovim-flake = {
|
||||
enable = mkEnableOption "neovim-flake, the extensible neovim-wrapper";
|
||||
|
||||
builtPackage = mkOption {
|
||||
finalPackage = mkOption {
|
||||
type = anything;
|
||||
default = builtPackage;
|
||||
internal = true;
|
||||
visible = false;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
The built neovim-flake package, wrapped with the user's configuration.
|
||||
'';
|
||||
|
@ -57,6 +57,8 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [builtPackage];
|
||||
environment.systemPackages = [cfg.finalPackage];
|
||||
|
||||
programs.neovim-flake.finalPackage = neovimConfigured.neovim;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue