enable neovim with home-manager options

This commit is contained in:
Adithya 2024-02-10 18:19:26 +05:30
parent efb946dd75
commit 355d99ed2b
Signed by: adtya
GPG key ID: 48FC9915FFD326D0
5 changed files with 20 additions and 410 deletions

View file

@ -37,22 +37,6 @@
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
@ -74,27 +58,6 @@
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1706830856,
"narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@ -113,24 +76,6 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
@ -153,28 +98,6 @@
"type": "github"
}
},
"gitignore_2": {
"inputs": {
"nixpkgs": [
"nixvim",
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1703887061,
"narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -238,27 +161,6 @@
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1706833576,
"narHash": "sha256-w7BL0EWRts+nD1lbLECIuz6fRzmmV+z8oWwoY7womR0=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "bdbae6ecff8fcc322bf6b9053c0b984912378af7",
"type": "github"
},
"original": {
"owner": "lnl7",
"repo": "nix-darwin",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1707268954,
@ -291,60 +193,6 @@
"type": "github"
}
},
"nixvim": {
"inputs": {
"flake-parts": "flake-parts_2",
"home-manager": [
"home-manager"
],
"nix-darwin": "nix-darwin",
"nixpkgs": [
"nixpkgs"
],
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1707516359,
"narHash": "sha256-uDIEvKg0LOozL93UluLu0atEtP711E84+WVXsIfJ+LE=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "92c623a436604b548b295536ba8888dd5e184a84",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixvim",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2",
"gitignore": "gitignore_2",
"nixpkgs": [
"nixvim",
"nixpkgs"
],
"nixpkgs-stable": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1706424699,
"narHash": "sha256-Q3RBuOpZNH2eFA1e+IHgZLAOqDD9SKhJ/sszrL8bQD4=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "7c54e08a689b53c8a1e5d70169f2ec9e2a68ffaf",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"pre-commit-hooks-nix": {
"inputs": {
"flake-compat": [
@ -382,8 +230,7 @@
"home-manager": "home-manager",
"impermanence": "impermanence",
"lanzaboote": "lanzaboote",
"nixpkgs": "nixpkgs",
"nixvim": "nixvim"
"nixpkgs": "nixpkgs"
}
},
"rust-overlay": {
@ -425,21 +272,6 @@
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View file

@ -26,14 +26,6 @@
nixpkgs.follows = "nixpkgs";
};
};
nixvim = {
url = "github:nix-community/nixvim";
inputs = {
home-manager.follows = "home-manager";
nixpkgs.follows = "nixpkgs";
};
};
};
outputs =
@ -43,7 +35,6 @@
, home-manager
, impermanence
, lanzaboote
, nixvim
,
} @ inputs:
let
@ -82,7 +73,6 @@
users.${secrets.users.primary.userName} = { pkgs, ... }: {
imports = [
impermanence.nixosModules.home-manager.impermanence
nixvim.homeManagerModules.nixvim
./home
];
};

View file

@ -11,7 +11,7 @@
./gnupg.nix
./kitty.nix
./mpv.nix
./neovim.nix
./neovim
./ssh.nix
./starship.nix
./tmux.nix

View file

@ -1,230 +0,0 @@
{ pkgs, ... }: {
xdg.desktopEntries = {
"nvim".name = "Neovim wrapper";
"nvim".exec = "nvim %F";
"nvim".noDisplay = true;
};
programs.nixvim = {
enable = true;
viAlias = true;
vimAlias = true;
clipboard.providers.wl-copy.enable = true;
colorschemes.dracula = {
enable = true;
fullSpecialAttrsSupport = true;
};
extraPackages = with pkgs; [
fd
ripgrep
];
extraConfigLuaPre = ''
vim.opt.listchars:append "space:"
vim.opt.listchars:append "eol:"
'';
options = {
autowrite = true;
background = "dark";
clipboard = "unnamedplus";
expandtab = true;
laststatus = 2;
list = true;
number = true;
relativenumber = true;
shiftwidth = 2;
showmode = false;
signcolumn = "yes";
smartindent = true;
splitbelow = true;
splitright = true;
swapfile = false;
tabstop = 2;
termguicolors = true;
updatetime = 100;
wrap = true;
};
keymaps = [
{
mode = "n";
key = "<C-a>";
options.silent = true;
action = "<cmd>bp<Return>";
}
{
mode = "n";
key = "<C-d>";
options.silent = true;
action = "<cmd>bn<Return>";
}
{
mode = "n";
key = "<C-h>";
options.silent = true;
action = "<cmd>noh<Return>";
}
{
mode = "n";
key = "<leader>w";
options.silent = true;
action = "<cmd>bdelete<Return><cmd>bnext<Return>";
}
{
mode = "n";
key = "<leader>`";
options.silent = true;
action = "<cmd>:ToggleTerm<Return>";
}
{
mode = "n";
key = "<leader>1";
options.silent = true;
action = "<cmd>:Neotree toggle<Return>";
}
{
mode = "n";
key = "<leader>ff";
options.silent = true;
action = "<cmd>:Telescope find_files<Return>";
}
{
mode = "n";
key = "<leader>fg";
options.silent = true;
action = "<cmd>:Telescope live_grep<Return>";
}
{
mode = "n";
key = "<leader>pp";
options.silent = true;
action = "<cmd>:MarkdownPreview<Return>";
}
{
mode = "n";
key = "<leader>po";
options.silent = true;
action = "<cmd>:MarkdownPreviewStop<Return>";
}
];
plugins = {
bufferline = {
enable = true;
diagnostics = "nvim_lsp";
offsets = [
{
filetype = "neo-tree";
text = "File Explorer";
separator = true;
}
];
separatorStyle = "slant";
};
cmp-buffer.enable = true;
cmp-nvim-lsp.enable = true;
cmp-nvim-lsp-document-symbol.enable = true;
cmp-nvim-lsp-signature-help.enable = true;
cmp-treesitter.enable = true;
cmp_luasnip.enable = true;
gitblame = {
enable = true;
dateFormat = "%r";
};
gitsigns.enable = true;
indent-blankline.enable = true;
lastplace.enable = true;
lsp = {
enable = true;
servers = {
bashls.enable = true;
dartls = {
enable = true;
installLanguageServer = false;
};
eslint = {
enable = true;
installLanguageServer = false;
};
gopls = {
enable = true;
installLanguageServer = false;
};
hls = {
enable = true;
installLanguageServer = false;
};
html = {
enable = true;
installLanguageServer = false;
};
jsonls.enable = true;
nixd.enable = true;
pyright = {
enable = true;
installLanguageServer = false;
};
rust-analyzer = {
enable = true;
installCargo = false;
installRustc = false;
};
yamlls.enable = true;
};
};
lsp-lines.enable = true;
lualine = {
enable = true;
globalstatus = true;
theme = "dracula";
};
markdown-preview = {
enable = true;
browser = "${pkgs.ungoogled-chromium}/bin/chromium";
theme = "light";
};
neo-tree = {
enable = true;
addBlankLineAtTop = true;
enableDiagnostics = true;
enableGitStatus = true;
closeIfLastWindow = false;
filesystem = {
followCurrentFile = {
enabled = true;
leaveDirsOpen = false;
};
filteredItems.visible = true;
useLibuvFileWatcher = true;
};
};
nvim-cmp = {
enable = true;
snippet.expand = "luasnip";
sources = [
{ name = "nvim_lsp"; }
{ name = "luasnip"; }
{ name = "buffers"; }
{ name = "treesitter"; }
];
};
telescope = {
enable = true;
extensions = {
fzf-native = {
enable = true;
caseMode = "smart_case";
fuzzy = true;
};
};
};
toggleterm = {
enable = true;
};
treesitter = {
enable = true;
};
treesitter-refactor = {
enable = true;
highlightDefinitions.enable = true;
navigation.enable = true;
};
};
};
}

View file

@ -0,0 +1,18 @@
{ pkgs, ... }: {
xdg = {
desktopEntries = {
"nvim".name = "Neovim wrapper";
"nvim".exec = "nvim %F";
"nvim".noDisplay = true;
};
};
programs.neovim = {
enable = true;
withNodeJs = true;
withPython3 = true;
withRuby = true;
viAlias = true;
vimAlias = true;
defaultEditor = true;
};
}