1
0
Fork 0
mirror of https://github.com/NotAShelf/neovim-flake.git synced 2024-12-25 13:49:49 +01:00

Merge pull request from NotAShelf/rename-module-opts

flake/modules: alias `programs.nvf` to `programs.neovim-flake`
This commit is contained in:
raf 2024-05-06 06:54:59 +00:00 committed by GitHub
commit a777941eed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 18 deletions

View file

@ -6,12 +6,12 @@ packages: inputs: {
...
}: let
inherit (lib) maintainers;
inherit (lib.modules) mkIf;
inherit (lib.modules) mkIf mkAliasOptionModule;
inherit (lib.lists) optional;
inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) attrsOf anything bool;
cfg = config.programs.neovim-flake;
cfg = config.programs.nvf;
inherit (import ../../configuration.nix inputs) neovimConfiguration;
neovimConfigured = neovimConfiguration {
@ -19,22 +19,26 @@ packages: inputs: {
modules = [cfg.settings];
};
in {
imports = [
(mkAliasOptionModule ["programs" "neovim-flake"] ["programs" "nvf"])
];
meta.maintainers = with maintainers; [NotAShelf];
options.programs.neovim-flake = {
enable = mkEnableOption "neovim-flake, the extensible neovim configuration wrapper";
options.programs.nvf = {
enable = mkEnableOption "nvf, the extensible neovim configuration wrapper";
enableManpages = mkOption {
type = bool;
default = false;
description = "Whether to enable manpages for neovim-flake.";
description = "Whether to enable manpages for nvf.";
};
defaultEditor = mkOption {
type = bool;
default = false;
description = ''
Whether to set `neovim-flake` as the default editor.
Whether to set `nvf` as the default editor.
This will set the `EDITOR` environment variable as `nvim`
if set to true.
@ -46,14 +50,14 @@ in {
visible = false;
readOnly = true;
description = ''
The built neovim-flake package, wrapped with the user's configuration.
The built nvf package, wrapped with the user's configuration.
'';
};
settings = mkOption {
type = attrsOf anything;
default = {};
description = "Attribute set of neovim-flake preferences.";
description = "Attribute set of nvf preferences.";
example = literalExpression ''
{
vim.viAlias = false;
@ -75,7 +79,7 @@ in {
};
config = mkIf cfg.enable {
programs.neovim-flake.finalPackage = neovimConfigured.neovim;
programs.nvf.finalPackage = neovimConfigured.neovim;
home = {
sessionVariables = mkIf cfg.defaultEditor {EDITOR = "nvim";};

View file

@ -6,12 +6,12 @@ packages: inputs: {
...
}: let
inherit (lib) maintainers;
inherit (lib.modules) mkIf mkOverride;
inherit (lib.modules) mkIf mkOverride mkAliasOptionModule;
inherit (lib.lists) optional;
inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) attrsOf anything bool;
cfg = config.programs.neovim-flake;
cfg = config.programs.nvf;
inherit (import ../../configuration.nix inputs) neovimConfiguration;
neovimConfigured = neovimConfiguration {
@ -19,22 +19,26 @@ packages: inputs: {
modules = [cfg.settings];
};
in {
imports = [
(mkAliasOptionModule ["programs" "neovim-flake"] ["programs" "nvf"])
];
meta.maintainers = with maintainers; [NotAShelf];
options.programs.neovim-flake = {
enable = mkEnableOption "neovim-flake, the extensible neovim configuration wrapper";
options.programs.nvf = {
enable = mkEnableOption "nvf, the extensible neovim configuration wrapper";
enableManpages = mkOption {
type = bool;
default = false;
description = "Whether to enable manpages for neovim-flake.";
description = "Whether to enable manpages for nvf.";
};
defaultEditor = mkOption {
type = bool;
default = false;
description = ''
Whether to set `neovim-flake` as the default editor.
Whether to set `nvf` as the default editor.
This will set the `EDITOR` environment variable as `nvim`
if set to true.
@ -46,14 +50,14 @@ in {
visible = false;
readOnly = true;
description = ''
The built neovim-flake package, wrapped with the user's configuration.
The built nvf package, wrapped with the user's configuration.
'';
};
settings = mkOption {
type = attrsOf anything;
default = {};
description = "Attribute set of neovim-flake preferences.";
description = "Attribute set of nvf preferences.";
example = literalExpression ''
{
vim.viAlias = false;
@ -75,7 +79,7 @@ in {
};
config = mkIf cfg.enable {
programs.neovim-flake.finalPackage = neovimConfigured.neovim;
programs.nvf.finalPackage = neovimConfigured.neovim;
environment = {
variables.EDITOR = mkIf cfg.defaultEditor (mkOverride 900 "nvim");