neovide: init (#1406)

Link: https://github.com/nix-community/stylix/pull/1406

Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Tested-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
Shahar "Dawn" Or 2025-06-11 00:11:53 +07:00 committed by GitHub
parent d73d8f6a48
commit 54703a4621
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 71 additions and 1 deletions

26
modules/neovide/hm.nix Normal file
View file

@ -0,0 +1,26 @@
{ mkTarget, ... }:
mkTarget {
name = "neovide";
humanName = "Neovide";
configElements = [
(
{ fonts }:
{
programs.neovide.settings.font = {
normal = [ fonts.monospace.name ];
size = fonts.sizes.terminal;
};
}
)
(
{ opacity }:
{
programs.neovim.extraLuaConfig = ''
if vim.g.neovide then
vim.g.neovide_normal_opacity = ${toString opacity.terminal}
end
'';
}
)
];
}

6
modules/neovide/meta.nix Normal file
View file

@ -0,0 +1,6 @@
{ lib, ... }:
{
name = "Neovide";
homepage = "https://neovide.dev/";
maintainers = [ lib.maintainers.mightyiam ];
}

View file

@ -0,0 +1,8 @@
# imported from `modules/nixvim/nixvim.nix`
stylix: {
extraConfigLua = ''
if vim.g.neovide then
vim.g.neovide_normal_opacity = ${toString stylix.opacity.terminal}
end
'';
}

View file

@ -0,0 +1,20 @@
{ lib, pkgs, ... }:
let
package = pkgs.neovide;
in
{
stylix.testbed.ui.application = {
name = "neovide";
inherit package;
};
home-manager.sharedModules = lib.singleton {
programs = {
neovide = {
enable = true;
inherit package;
};
neovim.enable = true;
};
};
}

View file

@ -135,7 +135,17 @@ in
config = lib.mkMerge [
{
lib.stylix.nixvim.config = pluginConfigs.${cfg.plugin};
lib.stylix.nixvim.config = {
imports = [
(lib.modules.importApply ../neovide/nixvim.nix config.stylix)
];
config = lib.mkMerge [
pluginConfigs.${cfg.plugin}
{
opts.guifont = "${config.stylix.fonts.monospace.name}:h${toString config.stylix.fonts.sizes.terminal}";
}
];
};
}
(lib.mkIf (config.stylix.enable && cfg.enable && options.programs ? nixvim) (
lib.optionalAttrs (options.programs ? nixvim) {