nix+nvim
This commit is contained in:
		
							parent
							
								
									d86e7d732a
								
							
						
					
					
						commit
						297da93a1e
					
				
					 5 changed files with 19 additions and 38 deletions
				
			
		
							
								
								
									
										22
									
								
								flake.lock
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								flake.lock
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -82,7 +82,9 @@
 | 
			
		|||
    "nil": {
 | 
			
		||||
      "inputs": {
 | 
			
		||||
        "flake-utils": "flake-utils_2",
 | 
			
		||||
        "nixpkgs": "nixpkgs",
 | 
			
		||||
        "nixpkgs": [
 | 
			
		||||
          "nixpkgs"
 | 
			
		||||
        ],
 | 
			
		||||
        "rust-overlay": "rust-overlay"
 | 
			
		||||
      },
 | 
			
		||||
      "locked": {
 | 
			
		||||
| 
						 | 
				
			
			@ -100,22 +102,6 @@
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "nixpkgs": {
 | 
			
		||||
      "locked": {
 | 
			
		||||
        "lastModified": 1690441914,
 | 
			
		||||
        "narHash": "sha256-Ac+kJQ5z9MDAMyzSc0i0zJDx2i3qi9NjlW5Lz285G/I=",
 | 
			
		||||
        "owner": "nixos",
 | 
			
		||||
        "repo": "nixpkgs",
 | 
			
		||||
        "rev": "db8672b8d0a2593c2405aed0c1dfa64b2a2f428f",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      },
 | 
			
		||||
      "original": {
 | 
			
		||||
        "owner": "nixos",
 | 
			
		||||
        "ref": "nixpkgs-unstable",
 | 
			
		||||
        "repo": "nixpkgs",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "nixpkgs_2": {
 | 
			
		||||
      "locked": {
 | 
			
		||||
        "lastModified": 1695360818,
 | 
			
		||||
        "narHash": "sha256-JlkN3R/SSoMTa+CasbxS1gq+GpGxXQlNZRUh9+LIy/0=",
 | 
			
		||||
| 
						 | 
				
			
			@ -136,7 +122,7 @@
 | 
			
		|||
        "home-manager": "home-manager",
 | 
			
		||||
        "neovim": "neovim",
 | 
			
		||||
        "nil": "nil",
 | 
			
		||||
        "nixpkgs": "nixpkgs_2"
 | 
			
		||||
        "nixpkgs": "nixpkgs"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "rust-overlay": {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										12
									
								
								flake.nix
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								flake.nix
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -3,21 +3,27 @@
 | 
			
		|||
 | 
			
		||||
  inputs = {
 | 
			
		||||
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
 | 
			
		||||
 | 
			
		||||
    home-manager = {
 | 
			
		||||
      url = "github:nix-community/home-manager";
 | 
			
		||||
      inputs.nixpkgs.follows = "nixpkgs";
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    neovim = {
 | 
			
		||||
      url = "github:neovim/neovim?dir=contrib";
 | 
			
		||||
      inputs.nixpkgs.follows = "nixpkgs";
 | 
			
		||||
    };
 | 
			
		||||
    nil.url = "github:oxalica/nil";
 | 
			
		||||
 | 
			
		||||
    nil = {
 | 
			
		||||
      url = "github:oxalica/nil";
 | 
			
		||||
      inputs.nixpkgs.follows = "nixpkgs";
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  outputs = { nixpkgs, home-manager, neovim, ... }:
 | 
			
		||||
    let
 | 
			
		||||
      system = "x86_64-linux";                # change your system type here
 | 
			
		||||
      user = "nikos";                         # change your user here
 | 
			
		||||
      system = "x86_64-linux"; # change your system type here
 | 
			
		||||
      user = "nikos"; # change your user here
 | 
			
		||||
      dotfilesHome = "/home/nikos/.dotfiles"; # specify your dotfiles path
 | 
			
		||||
      pkgs = nixpkgs.legacyPackages.${system};
 | 
			
		||||
    in
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										5
									
								
								home.nix
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								home.nix
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -59,6 +59,11 @@
 | 
			
		|||
    );
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  programs.direnv = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    nix-direnv.enable = true;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  # Let Home Manager install and manage itself.
 | 
			
		||||
  programs.home-manager.enable = true;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,21 +12,7 @@ for dir in vim.fs.parents(vim.api.nvim_buf_get_name(0)) do
 | 
			
		|||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local border = {
 | 
			
		||||
    { "┌", "FloatBorder" },
 | 
			
		||||
    { "─", "FloatBorder" },
 | 
			
		||||
    { "┐", "FloatBorder" },
 | 
			
		||||
    { "│", "FloatBorder" },
 | 
			
		||||
    { "┘", "FloatBorder" },
 | 
			
		||||
    { "─", "FloatBorder" },
 | 
			
		||||
    { "└", "FloatBorder" },
 | 
			
		||||
    { "│", "FloatBorder" },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
local handlers = {
 | 
			
		||||
    ["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border }),
 | 
			
		||||
    ["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = border }),
 | 
			
		||||
}
 | 
			
		||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "single" })
 | 
			
		||||
 | 
			
		||||
local capabilities = {}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -195,6 +181,5 @@ for lsp, settings in pairs(servers) do
 | 
			
		|||
    lspconfig[lsp].setup(vim.tbl_extend("force", {
 | 
			
		||||
        on_attach = on_attach,
 | 
			
		||||
        capabilities = capabilities,
 | 
			
		||||
        handlers = handlers,
 | 
			
		||||
    }, settings))
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,6 +6,5 @@ pkgs: with pkgs; [
 | 
			
		|||
  zoxide # "z" command
 | 
			
		||||
  nil # Nix LSP
 | 
			
		||||
  nixpkgs-fmt # Nix formatter
 | 
			
		||||
  direnv # Sources .envrc files
 | 
			
		||||
  (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) # nerdfonts jetbrains mono
 | 
			
		||||
]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue