feat: nixos module
This commit is contained in:
@@ -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
33
nixos.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user