nvim: initial config
This commit is contained in:
		
							parent
							
								
									a667691f49
								
							
						
					
					
						commit
						1f7f453fc3
					
				@ -55,9 +55,14 @@
 | 
			
		||||
          url = "github:nix-community/lanzaboote/v0.3.0";
 | 
			
		||||
          inputs.nixpkgs.follows = "nixpkgs";
 | 
			
		||||
       };
 | 
			
		||||
 | 
			
		||||
       nixvim = {
 | 
			
		||||
           url = "github:nix-community/nixvim";
 | 
			
		||||
           inputs.nixpkgs.follows = "nixpkgs";
 | 
			
		||||
       };
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
  outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, nixos-hardware, home-manager, home-manager-unstable, nur, agenix, jovian-nixos, microvm, impermanence, lanzaboote, ... }:   # Function that tells my flake which to use and what do what to do with the dependencies.
 | 
			
		||||
  outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, nixos-hardware, home-manager, home-manager-unstable, nur, agenix, jovian-nixos, microvm, impermanence, lanzaboote, nixvim, ... }:   # Function that tells my flake which to use and what do what to do with the dependencies.
 | 
			
		||||
    let                                                                     # Variables that can be used in the config files
 | 
			
		||||
      user = "kabbone";
 | 
			
		||||
      userdmz = "diablo";
 | 
			
		||||
@ -68,7 +73,7 @@
 | 
			
		||||
      nixosConfigurations = (                                               # NixOS configurations
 | 
			
		||||
        import ./hosts {                                                    # Imports ./hosts/default.nix
 | 
			
		||||
          inherit (nixpkgs) lib;
 | 
			
		||||
          inherit inputs nixpkgs nixpkgs-unstable nixos-hardware home-manager home-manager-unstable nur user userdmz userserver location agenix jovian-nixos microvm impermanence lanzaboote;   # Also inherit home-manager so it does not need to be defined here.
 | 
			
		||||
          inherit inputs nixpkgs nixpkgs-unstable nixos-hardware home-manager home-manager-unstable nur user userdmz userserver location agenix jovian-nixos microvm impermanence lanzaboote nixvim;   # Also inherit home-manager so it does not need to be defined here.
 | 
			
		||||
          nix.allowedUsers = [ "@wheel" ];
 | 
			
		||||
          security.sudo.execWheelOnly = true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -11,7 +11,7 @@
 | 
			
		||||
#            └─ ./home.nix 
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
{ lib, inputs, nixpkgs, nixpkgs-unstable, nixos-hardware, home-manager, home-manager-unstable, nur, user, userdmz, userserver, location, agenix, jovian-nixos, microvm, impermanence, lanzaboote, ... }:
 | 
			
		||||
{ lib, inputs, nixpkgs, nixpkgs-unstable, nixos-hardware, home-manager, home-manager-unstable, nur, user, userdmz, userserver, location, agenix, jovian-nixos, microvm, impermanence, lanzaboote, nixvim, ... }:
 | 
			
		||||
 | 
			
		||||
let
 | 
			
		||||
  system = "x86_64-linux";                                  # System architecture
 | 
			
		||||
@ -28,12 +28,13 @@ in
 | 
			
		||||
{
 | 
			
		||||
  desktop = lib.nixosSystem {                                # Desktop profile
 | 
			
		||||
    inherit system;
 | 
			
		||||
    specialArgs = { inherit inputs user location nixos-hardware nur agenix microvm nixpkgs lanzaboote; };
 | 
			
		||||
    specialArgs = { inherit inputs user location nixos-hardware nur agenix microvm nixpkgs lanzaboote nixvim; };
 | 
			
		||||
    modules = [
 | 
			
		||||
      agenix.nixosModules.default
 | 
			
		||||
      nur.nixosModules.nur
 | 
			
		||||
      microvm.nixosModules.host
 | 
			
		||||
      lanzaboote.nixosModules.lanzaboote
 | 
			
		||||
      nixvim.nixosModules.nixvim
 | 
			
		||||
      ./desktop
 | 
			
		||||
      ./configuration_desktop.nix
 | 
			
		||||
      ../modules/hardware/remoteBuilder.nix
 | 
			
		||||
 | 
			
		||||
@ -17,13 +17,14 @@
 | 
			
		||||
#           └─ default.nix
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
{ config, nixpkgs, pkgs, user, lib, ... }:
 | 
			
		||||
{ config, nixpkgs, pkgs, user, lib, nixvim, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports =                                                         # For now, if applying to other system, swap files
 | 
			
		||||
    [(import ./hardware-configuration.nix)] ++                      # Current system hardware config @ /etc/nixos/hardware-configuration.nix
 | 
			
		||||
    #[(import ../../modules/desktop/hyprland/default.nix)] ++        # Window Manager
 | 
			
		||||
    [(import ../../modules/desktop/sway/default.nix)] ++        # Window Manager
 | 
			
		||||
    #[(import ../../modules/editors/nvim/config/default.nix)] ++        # Window Manager
 | 
			
		||||
    (import ../../modules/desktop/virtualisation) ++   # Docker
 | 
			
		||||
    (import ../../modules/hardware);                                # Hardware devices
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										5
									
								
								modules/editors/nvim/config/bufferline.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								modules/editors/nvim/config/bufferline.nix
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,5 @@
 | 
			
		||||
{
 | 
			
		||||
  plugins.bufferline = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										16
									
								
								modules/editors/nvim/config/default.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								modules/editors/nvim/config/default.nix
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,16 @@
 | 
			
		||||
{ nvim, ... }:
 | 
			
		||||
{
 | 
			
		||||
  # Import all your configuration modules here
 | 
			
		||||
  programs.nixvim = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      colorschemes.gruvbox.enable = true;
 | 
			
		||||
 | 
			
		||||
      imports = [
 | 
			
		||||
        ./bufferline.nix
 | 
			
		||||
        ./plugins.nix
 | 
			
		||||
        ./options.nix
 | 
			
		||||
        ./keymaps.nix
 | 
			
		||||
        ./highlight.nix
 | 
			
		||||
      ];
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										8
									
								
								modules/editors/nvim/config/highlight.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								modules/editors/nvim/config/highlight.nix
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
			
		||||
{
 | 
			
		||||
  highlight = {
 | 
			
		||||
    Comment.fg = "#ff00ff";
 | 
			
		||||
    Comment.bg = "#000000";
 | 
			
		||||
    Comment.underline = true;
 | 
			
		||||
    Comment.bold = true;
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										8
									
								
								modules/editors/nvim/config/keymaps.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								modules/editors/nvim/config/keymaps.nix
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
			
		||||
{
 | 
			
		||||
  keymaps = [
 | 
			
		||||
    {
 | 
			
		||||
      action = "<cmd>Telescope live_grep<CR>";
 | 
			
		||||
      key = "<leader>g";
 | 
			
		||||
    }
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										14
									
								
								modules/editors/nvim/config/options.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								modules/editors/nvim/config/options.nix
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,14 @@
 | 
			
		||||
{
 | 
			
		||||
    config = {
 | 
			
		||||
        globals.mapleader = " ";
 | 
			
		||||
        viAlias = true;
 | 
			
		||||
        vimAlias = true;
 | 
			
		||||
 | 
			
		||||
        opts = {
 | 
			
		||||
            number = true;         # Show line numbers
 | 
			
		||||
            relativenumber = true; # Show relative line numbers
 | 
			
		||||
 | 
			
		||||
            shiftwidth = 2;        # Tab width should be 2
 | 
			
		||||
        };
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										51
									
								
								modules/editors/nvim/config/plugins.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								modules/editors/nvim/config/plugins.nix
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,51 @@
 | 
			
		||||
{
 | 
			
		||||
    plugins = {
 | 
			
		||||
        lualine.enable = true;
 | 
			
		||||
 | 
			
		||||
        cmp = {
 | 
			
		||||
            enable = true;
 | 
			
		||||
            autoEnableSources = true;
 | 
			
		||||
            settings = {
 | 
			
		||||
                sources = [
 | 
			
		||||
                  {name = "nvim_lsp";}
 | 
			
		||||
                  {name = "path";}
 | 
			
		||||
                  {name = "buffer";}
 | 
			
		||||
                  {name = "luasnip";}
 | 
			
		||||
                ];
 | 
			
		||||
 | 
			
		||||
                mapping = {
 | 
			
		||||
                    "<C-d>" = "cmp.mapping.scroll_docs(-4)";
 | 
			
		||||
                    "<C-f>" = "cmp.mapping.scroll_docs(4)";
 | 
			
		||||
                    "<C-Space>" = "cmp.mapping.complete()";
 | 
			
		||||
                    "<C-e>" = "cmp.mapping.close()";
 | 
			
		||||
                    "<CR>" = "cmp.mapping.confirm({ select = true })";
 | 
			
		||||
                    "<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
 | 
			
		||||
                    "<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
 | 
			
		||||
                };
 | 
			
		||||
            };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        lsp = {
 | 
			
		||||
            enable = true;
 | 
			
		||||
 | 
			
		||||
            servers = {
 | 
			
		||||
                tsserver.enable = true;
 | 
			
		||||
 | 
			
		||||
                lua-ls = {
 | 
			
		||||
                    enable = true;
 | 
			
		||||
                    settings.telemetry.enable = false;
 | 
			
		||||
                };
 | 
			
		||||
#                rust-analyzer = {
 | 
			
		||||
#                    enable = true;
 | 
			
		||||
#                    installCargo = true;
 | 
			
		||||
#                };
 | 
			
		||||
            };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        telescope.enable = true;
 | 
			
		||||
 | 
			
		||||
        treesitter.enable = true;
 | 
			
		||||
 | 
			
		||||
        luasnip.enable = true;
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user