modules: add catppuccin theme

This commit is contained in:
Dmitriy Pleshevskiy 2024-04-18 00:04:06 +03:00
parent 3eb6c9b8d8
commit e352894cd0
Signed by: pleshevskiy
GPG Key ID: 17041163DA10A9A2
4 changed files with 41 additions and 31 deletions

View File

@ -1,5 +1,21 @@
{ {
"nodes": { "nodes": {
"catppuccin": {
"flake": false,
"locked": {
"lastModified": 1713105352,
"narHash": "sha256-yTVou/WArEWygBBs2NFPI9Dm9iSGfwVftKFbOAGl8tk=",
"owner": "catppuccin",
"repo": "nvim",
"rev": "a1439ad7c584efb3d0ce14ccb835967f030450fe",
"type": "github"
},
"original": {
"owner": "catppuccin",
"repo": "nvim",
"type": "github"
}
},
"cmp-luasnip": { "cmp-luasnip": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -373,6 +389,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"catppuccin": "catppuccin",
"cmp-luasnip": "cmp-luasnip", "cmp-luasnip": "cmp-luasnip",
"cmp-nvim-lsp": "cmp-nvim-lsp", "cmp-nvim-lsp": "cmp-nvim-lsp",
"cmp-tabby": "cmp-tabby", "cmp-tabby": "cmp-tabby",
@ -398,8 +415,7 @@
"plenary-nvim": "plenary-nvim", "plenary-nvim": "plenary-nvim",
"tabby-nvim": "tabby-nvim", "tabby-nvim": "tabby-nvim",
"telescope-live-grep-args-nvim": "telescope-live-grep-args-nvim", "telescope-live-grep-args-nvim": "telescope-live-grep-args-nvim",
"telescope-nvim": "telescope-nvim", "telescope-nvim": "telescope-nvim"
"theme": "theme"
} }
}, },
"systems": { "systems": {
@ -464,22 +480,6 @@
"repo": "telescope.nvim", "repo": "telescope.nvim",
"type": "github" "type": "github"
} }
},
"theme": {
"flake": false,
"locked": {
"lastModified": 1695478950,
"narHash": "sha256-SV5DTVwcVv6YIb7TGNYwq6rtIG5pFKubK07snXhV7z8=",
"owner": "catppuccin",
"repo": "nvim",
"rev": "3d9a5ed556e289bce6c1fb0af89ec838360641b2",
"type": "github"
},
"original": {
"owner": "catppuccin",
"repo": "nvim",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@ -126,7 +126,7 @@
}; };
# https://github.com/catppuccin/nvim # https://github.com/catppuccin/nvim
theme = { catppuccin = {
url = "github:catppuccin/nvim"; url = "github:catppuccin/nvim";
flake = false; flake = false;
}; };
@ -191,7 +191,7 @@
"lualine-nvim" "lualine-nvim"
"lualine-lsp-progress" "lualine-lsp-progress"
"nvim-web-devicons" "nvim-web-devicons"
"theme" "catppuccin"
# ux # ux
"hop-nvim" "hop-nvim"
"nvim-orgmode" "nvim-orgmode"
@ -238,20 +238,17 @@
} // } //
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
inherit (builtins) mapAttrs;
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
minimalNeovim = mkNeovim pkgs; minimalNeovim = mkNeovim pkgs;
recommendedNeovim = minimalNeovim.override { recommendedNeovim = minimalNeovim.override (prev: {
modules = { modules = {
catppuccin = { };
nvim-tree-lua = { nvim-tree-lua = {
configs = { configs.renderer = {
renderer = { group_empty = true;
group_empty = true; full_name = true;
full_name = true;
};
}; };
keymaps = [ keymaps = [
{ mode = "n"; bind = "<leader>nt"; command = "<CMD>NvimTreeToggle<CR>"; } { mode = "n"; bind = "<leader>nt"; command = "<CMD>NvimTreeToggle<CR>"; }
@ -260,7 +257,7 @@
}; };
}; };
plugins = with minimalNeovim.nix2lua; { plugins = with prev.nix2lua.lib; {
lualine-nvim = pipe [ lualine-nvim = pipe [
(require "lualine") (require "lualine")
(call "setup" [{ (call "setup" [{
@ -278,7 +275,7 @@
}]) }])
]; ];
}; };
}; });
fullNeovim = recommendedNeovim.override { fullNeovim = recommendedNeovim.override {
plugins = recommendedNeovim.plugins // (with minimalNeovim.nix2lua; { plugins = recommendedNeovim.plugins // (with minimalNeovim.nix2lua; {

13
modules/catppuccin.nix Normal file
View File

@ -0,0 +1,13 @@
{ nix2lua }:
{ flavour ? "frappe" }:
with nix2lua.lib;
{
catppuccin = [
(set "vim.g.catppuccin_flavour" flavour)
(pipe [ (require "catppuccin") (call "setup" [ ]) ])
(call "vim.cmd" [ "colorscheme catppuccin" ])
];
}

View File

@ -84,6 +84,6 @@ in
}).overrideAttrs (oldAttrs: { }).overrideAttrs (oldAttrs: {
passthru = oldAttrs.passthru // { passthru = oldAttrs.passthru // {
nix2lua = nix2lua.lib; nix2lua = nix2lua.lib;
inherit plugins; inherit plugins modules;
}; };
}) })