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:
parent
d73d8f6a48
commit
54703a4621
5 changed files with 71 additions and 1 deletions
26
modules/neovide/hm.nix
Normal file
26
modules/neovide/hm.nix
Normal 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
6
modules/neovide/meta.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
name = "Neovide";
|
||||
homepage = "https://neovide.dev/";
|
||||
maintainers = [ lib.maintainers.mightyiam ];
|
||||
}
|
||||
8
modules/neovide/nixvim.nix
Normal file
8
modules/neovide/nixvim.nix
Normal 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
|
||||
'';
|
||||
}
|
||||
20
modules/neovide/testbeds/neovide.nix
Normal file
20
modules/neovide/testbeds/neovide.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue