diff --git a/config/default.nix b/config/default.nix index 58f8239..8594138 100644 --- a/config/default.nix +++ b/config/default.nix @@ -1,4 +1,4 @@ -{pkgs}: +{ pkgs }: pkgs.stdenv.mkDerivation { name = "nvim-config"; src = ./src; diff --git a/config/src/nvim/lua/config/lazy.lua b/config/src/nvim/lua/config/lazy.lua index 02dcb3a..5aedcca 100644 --- a/config/src/nvim/lua/config/lazy.lua +++ b/config/src/nvim/lua/config/lazy.lua @@ -34,7 +34,9 @@ require("lazy").setup({ { import = "lazyvim.plugins.extras.lang.yaml" }, { import = "lazyvim.plugins.extras.ui.mini-indentscope" }, { import = "lazyvim.plugins.extras.ui.treesitter-context" }, - { import = "plugins.tokyonight" }, + { import = "plugins.catppuccin" }, + -- { import = "plugins.tokyonight" }, + -- { import = "plugins.lang.nix" }, { import = "plugins.lang.shell" }, { import = "plugins.misc.tmux-navigator" }, }, @@ -51,7 +53,7 @@ require("lazy").setup({ lazyvim = false, neovim = false, }, - install = { colorscheme = { "tokyonight", "habamax" } }, + install = { colorscheme = { "catppuccin-macchiato" } }, checker = { enabled = true }, -- automatically check for plugin updates performance = { rtp = { diff --git a/config/src/nvim/lua/plugins/catppuccin.lua b/config/src/nvim/lua/plugins/catppuccin.lua new file mode 100644 index 0000000..378353b --- /dev/null +++ b/config/src/nvim/lua/plugins/catppuccin.lua @@ -0,0 +1,62 @@ +return { + "catppuccin/nvim", + lazy = true, + name = "catppuccin", + opts = { + flavour = "macchiato", + transparent_background = false, + integrations = { + aerial = true, + alpha = true, + cmp = true, + dashboard = true, + flash = true, + grug_far = true, + gitsigns = true, + headlines = true, + illuminate = true, + indent_blankline = { enabled = true }, + leap = true, + lsp_trouble = true, + mason = true, + markdown = true, + mini = true, + native_lsp = { + enabled = true, + underlines = { + errors = { "undercurl" }, + hints = { "undercurl" }, + warnings = { "undercurl" }, + information = { "undercurl" }, + }, + }, + navic = { enabled = true, custom_bg = "lualine" }, + neotest = true, + neotree = true, + noice = true, + notify = true, + semantic_tokens = true, + telescope = true, + treesitter = true, + treesitter_context = true, + which_key = true, + }, + }, + specs = { + { + "akinsho/bufferline.nvim", + optional = true, + opts = function(_, opts) + if (vim.g.colors_name or ""):find("catppuccin") then + opts.highlights = require("catppuccin.groups.integrations.bufferline").get() + end + end, + }, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "catppuccin-macchiato", + }, + }, +} diff --git a/config/src/nvim/lua/plugins/tokyonight.lua b/config/src/nvim/lua/plugins/tokyonight.lua index 2302514..6dcb72f 100644 --- a/config/src/nvim/lua/plugins/tokyonight.lua +++ b/config/src/nvim/lua/plugins/tokyonight.lua @@ -1,10 +1,10 @@ return { - "folke/tokyonight.nvim", - opts = { - transparent = true, - styles = { - sidebars = "transparent", - floats = "transparent", - }, - }, + "folke/tokyonight.nvim", + opts = { + transparent = true, + styles = { + sidebars = "transparent", + floats = "transparent", + }, + }, } diff --git a/flake.nix b/flake.nix index d534b69..a72674a 100644 --- a/flake.nix +++ b/flake.nix @@ -12,42 +12,48 @@ nixConfig = { trusted-substituters = [ "https://nix-community.cachix.org" + "https://palkx.cachix.org" ]; extra-trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "palkx.cachix.org-1:qaQoL5CXpGzUbqsIvxUEL7wUhoIrjV0Q8M4HbJ8/8S4=" ]; }; - outputs = inputs @ { - nixpkgs, - flake-utils, - neovim-nightly-overlay, - ... - }: - flake-utils.lib.eachDefaultSystem (system: let - overlayFlakeInputs = prev: final: { - neovim = neovim-nightly-overlay.packages.${system}.default.overrideAttrs (oa: { - nativeBuildInputs = oa.nativeBuildInputs ++ [final.libtermkey]; - }); - }; - - overlayLazyVim = prev: final: { - lazyVim = import ./packages/lazyVim.nix { - pkgs = final; + outputs = + inputs@{ + nixpkgs, + flake-utils, + neovim-nightly-overlay, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + overlayFlakeInputs = prev: final: { + neovim = neovim-nightly-overlay.packages.${system}.default.overrideAttrs (oa: { + nativeBuildInputs = oa.nativeBuildInputs ++ [ final.libtermkey ]; + }); }; - }; - pkgs = import nixpkgs { - inherit system; - overlays = [overlayFlakeInputs overlayLazyVim]; - }; - in rec { - packages.lazyVim = pkgs.lazyVim; - apps.lazyVim = { - type = "app"; - program = "${packages.default}/bin/nvim"; - }; - packages.default = packages.lazyVim; - apps.default = apps.lazyVim; - }); + overlayLazyVim = prev: final: { lazyVim = import ./packages/lazyVim.nix { pkgs = final; }; }; + + pkgs = import nixpkgs { + inherit system; + overlays = [ + overlayFlakeInputs + overlayLazyVim + ]; + }; + in + rec { + packages.lazyVim = pkgs.lazyVim; + apps.lazyVim = { + type = "app"; + program = "${packages.default}/bin/nvim"; + }; + packages.default = packages.lazyVim; + apps.default = apps.lazyVim; + } + ); } diff --git a/packages/lazyVim.nix b/packages/lazyVim.nix index 77c9df7..fffb812 100644 --- a/packages/lazyVim.nix +++ b/packages/lazyVim.nix @@ -1,12 +1,13 @@ -{pkgs}: let - config = import ../config {inherit pkgs;}; - runtimeDeps = import ../runtimeDeps.nix {inherit pkgs;}; +{ pkgs }: +let + config = import ../config { inherit pkgs; }; + runtimeDeps = import ../runtimeDeps.nix { inherit pkgs; }; in - pkgs.wrapNeovim pkgs.neovim { - viAlias = true; - vimAlias = true; - withNodeJs = true; - withPython3 = true; - withRuby = false; - extraMakeWrapperArgs = ''--prefix PATH : "${pkgs.lib.makeBinPath runtimeDeps.dependencies}" --set XDG_CONFIG_HOME "${config}"''; - } +pkgs.wrapNeovim pkgs.neovim { + viAlias = true; + vimAlias = true; + withNodeJs = true; + withPython3 = true; + withRuby = false; + extraMakeWrapperArgs = ''--prefix PATH : "${pkgs.lib.makeBinPath runtimeDeps.dependencies}" --set XDG_CONFIG_HOME "${config}"''; +} diff --git a/runtimeDeps.nix b/runtimeDeps.nix index 524257c..9e3d1ff 100644 --- a/runtimeDeps.nix +++ b/runtimeDeps.nix @@ -1,28 +1,34 @@ -{pkgs}: { - dependencies = with pkgs; [ - nixd # nix lsp - alejandra # nix formatter - statix # linter for nix - ripgrep - fd - git - curl # needed to fetch titles from urls - wget - cargo - php82 - php82Packages.composer - go - ruby - luarocks - zulu #java11 - fish - fzf - perl536 - perl536Packages.CPAN - unzip - tree-sitter - gcc - gnumake - lazygit - ]; +{ pkgs }: +{ + dependencies = + with pkgs; + [ + nixfmt-rfc-style # nix formatter + (terraform.overrideAttrs (oldAttrs: { + meta.license = lib.licenses.mpl20; + })) # terraform fmt + ripgrep + fd + git + curl # needed to fetch titles from urls + wget + cargo + php82 + php82Packages.composer + go + ruby + luarocks + zulu # java11 + fish + fzf + perl536 + perl536Packages.CPAN + unzip + tree-sitter + gnumake + lazygit + python312 + python312Packages.pip + ] + ++ (if pkgs.stdenv.hostPlatform.isDarwin then [ ] else [ gcc ]); }