Skip to content

Commit 2884670

Browse files
authoredMar 6, 2025··
feat(home-manager/neovim): add option for custom settings (#457)
1 parent 868ac54 commit 2884670

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed
 

‎modules/home-manager/neovim.nix

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
{ catppuccinLib }:
2-
{
3-
config,
4-
lib,
5-
...
6-
}:
7-
2+
{ config, lib, ... }:
83
let
94
cfg = config.catppuccin.nvim;
10-
in
115

6+
defaultConfig = {
7+
compile_path = lib.generators.mkLuaInline "compile_path";
8+
flavour = cfg.flavor;
9+
};
10+
in
1211
{
13-
options.catppuccin.nvim = catppuccinLib.mkCatppuccinOption { name = "neovim"; };
12+
options.catppuccin.nvim = catppuccinLib.mkCatppuccinOption { name = "neovim"; } // {
13+
settings = lib.mkOption {
14+
description = "Extra settings that will be passed to the setup function.";
15+
default = { };
16+
type = lib.types.submodule { freeformType = lib.types.attrsOf lib.types.anything; };
17+
apply = lib.recursiveUpdate defaultConfig;
18+
};
19+
};
1420

1521
imports = catppuccinLib.mkRenamedCatppuccinOptions {
1622
from = [
@@ -32,10 +38,7 @@ in
3238
vim.fn.mkdir(compile_path, "p")
3339
vim.opt.runtimepath:append(compile_path)
3440
35-
require("catppuccin").setup({
36-
compile_path = compile_path,
37-
flavour = "${cfg.flavor}",
38-
})
41+
require("catppuccin").setup(${lib.generators.toLua { } cfg.settings})
3942
4043
vim.api.nvim_command("colorscheme catppuccin")
4144
EOF

0 commit comments

Comments
 (0)
Please sign in to comment.