From a1ed6a69fa433c11ee3e7c2fe9489f5c565f2dcd Mon Sep 17 00:00:00 2001 From: Ivan Kirilov Dimitrov Date: Fri, 5 Jul 2024 22:07:52 +0200 Subject: [PATCH] create packages for overlays --- default.nix | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/default.nix b/default.nix index 7f2f2b7..d1c2335 100644 --- a/default.nix +++ b/default.nix @@ -2,19 +2,34 @@ top@{ inputs, ... }: { imports = [ ./nixos ./home ]; systems = [ "x86_64-linux" ]; flake.stateVersion = "24.05"; - perSystem = perSystem@{ system, ... }: { + perSystem = perSystem@{ config, system, pkgs, ... }: { + config.packages = { + nvim = inputs.ide.nvim.${system}.standalone.default { + autoCmd = [ + { + callback.__raw = /*lua*/ '' + function() require("otter").activate() end + ''; + event = [ "BufEnter" "BufWinEnter" "BufWritePost" ]; + pattern = [ "*.nix" ]; + } + ]; + plugins.lsp.servers = { + bashls.enable = true; + pylsp.enable = true; + lua-ls.enable = true; + }; + extraPlugins = with pkgs.vimPlugins; [ otter-nvim ]; + }; + scripts = (pkgs.buildEnv { name = "scripts"; paths = [ ./. ]; }); + }; config._module.args = { pkgs = import inputs.nixpkgs { inherit system; overlays = [ (final: prev: { - nvim = inputs.ide.nvim.${system}.standalone.default { - plugins.lsp.servers = { - bashls.enable = true; - nushell.enable = true; - }; - }; - scripts = (prev.buildEnv { name = "scripts"; paths = [ ./. ]; }); + nvim = config.packages.nvim; + scripts = config.packages.scripts; }) inputs.sal.overlays.default ];