feat: nixos module

This commit is contained in:
Guz
2025-03-05 17:31:53 -03:00
parent 8a8e249937
commit 69366c019d
2 changed files with 38 additions and 0 deletions

View File

@@ -45,6 +45,11 @@
};
default = self.packages."${pkgs.system}".neovim;
});
nixosModules = {
neovim = import ./nixos.nix {inherit self;};
default = self.nixosModules.neovim;
};
homeManagerModules = {
neovim = import ./nixos.nix {inherit self;};
default = self.homeManagerModules.neovim;

33
nixos.nix Normal file
View File

@@ -0,0 +1,33 @@
{self}: {
config,
lib,
pkgs,
...
}: let
neovim = self.packages.${pkgs.system}.default;
cfg = config.neovim;
in
with lib; {
options = {
enable = mkOption {
type = with types; bool;
default = true;
};
package = mkOption {
type = with types; package;
default = neovim;
};
defaultEditor = mkOption {
type = with types; bool;
default = true;
};
};
config = mkIf cfg.enable {
environment.variables = {EDITOR = "nvim";};
environment.systemPackages = [cfg.package];
# Disable NixOS's Neovim
programs.neovim.enable = mkForce false;
};
}