Move modules inside /nixos
This commit is contained in:
141
modules/nixos/editors/neovim/default.nix
Normal file
141
modules/nixos/editors/neovim/default.nix
Normal file
@ -0,0 +1,141 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.modules.editors.neovim;
|
||||
in {
|
||||
options.modules.editors.neovim = {
|
||||
enable = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.programs.nixvim.config = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
|
||||
options = {
|
||||
number = true;
|
||||
tabstop = 2;
|
||||
shiftwidth = 2;
|
||||
expandtab = true;
|
||||
foldlevel = 99;
|
||||
splitbelow = true;
|
||||
splitright = true;
|
||||
undofile = true;
|
||||
updatetime = 100;
|
||||
list = true;
|
||||
};
|
||||
|
||||
globals = {
|
||||
mapleader = ",";
|
||||
maplocalleader = ",";
|
||||
};
|
||||
|
||||
clipboard = {
|
||||
register = "unnamedplus";
|
||||
|
||||
providers.wl-copy.enable = true;
|
||||
};
|
||||
|
||||
plugins.comment.enable = true;
|
||||
|
||||
plugins.hmts.enable = true;
|
||||
|
||||
plugins.lightline.enable = true;
|
||||
|
||||
plugins.luasnip.enable = true;
|
||||
|
||||
plugins.lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
bashls.enable = true;
|
||||
ccls.enable = true;
|
||||
cssls.enable = true;
|
||||
eslint.enable = true;
|
||||
gopls.enable = true;
|
||||
html.enable = true;
|
||||
lua_ls.enable = true;
|
||||
pylsp.enable = true;
|
||||
nixd.enable = true;
|
||||
rust_analyzer = {
|
||||
enable = true;
|
||||
installCargo = true;
|
||||
installRustc = true;
|
||||
};
|
||||
ts_ls.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
plugins.nvim-autopairs.enable = true;
|
||||
|
||||
plugins.cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
settings = {
|
||||
sources = [
|
||||
{ name = "nvim_lsp"; }
|
||||
{ name = "path"; }
|
||||
{ name = "buffer"; }
|
||||
];
|
||||
mapping = {
|
||||
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
|
||||
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
|
||||
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
plugins.telescope = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
"<leader>ff" = "find_files";
|
||||
"<leader>fg" = "live_grep";
|
||||
"<leader>b" = "buffers";
|
||||
"<leader>fh" = "help_tags";
|
||||
"<C-p>" = "git_files";
|
||||
"<C-f>" = "live_grep";
|
||||
};
|
||||
};
|
||||
|
||||
plugins.treesitter = {
|
||||
enable = true;
|
||||
|
||||
nixvimInjections = true;
|
||||
|
||||
folding = true;
|
||||
settings.indent.enable = true;
|
||||
};
|
||||
|
||||
plugins.treesitter-refactor = {
|
||||
enable = true;
|
||||
highlightDefinitions = {
|
||||
enable = true;
|
||||
clearOnCursorMove = false;
|
||||
};
|
||||
};
|
||||
|
||||
plugins.undotree.enable = true;
|
||||
|
||||
plugins.web-devicons.enable = true;
|
||||
|
||||
# plugins.gitsigns.enable = true;
|
||||
# plugins.gitgutter.enable = true;
|
||||
# plugins.goyo.enable = true;
|
||||
# plugins.fugitive.enable = true;
|
||||
# plugins.fzf-lua.enable = true;
|
||||
# plugins.neo-tree.enable = true;
|
||||
# plugins.none-ls.enable = true;
|
||||
# plugins.nvim-tree.enable = true;
|
||||
# plugins.oil.enable = true;
|
||||
# plugins.project-nvim.enable = true;
|
||||
# plugins.surround.enable = true;
|
||||
};
|
||||
|
||||
env.EDITOR = "nvim";
|
||||
};
|
||||
}
|
49
modules/nixos/editors/vscode.nix
Normal file
49
modules/nixos/editors/vscode.nix
Normal file
@ -0,0 +1,49 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let cfg = config.modules.editors.vscode;
|
||||
in {
|
||||
options.modules.editors.vscode = {
|
||||
enable = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
home.programs.vscode = {
|
||||
enable = true;
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
asvetliakov.vscode-neovim
|
||||
brettm12345.nixfmt-vscode
|
||||
coolbear.systemd-unit-file
|
||||
editorconfig.editorconfig
|
||||
golang.go
|
||||
graphql.vscode-graphql-syntax
|
||||
mattn.lisp
|
||||
# mkhl.direnv
|
||||
ms-python.vscode-pylance
|
||||
ms-vscode.cpptools
|
||||
ms-vscode.hexeditor
|
||||
piousdeer.adwaita-theme
|
||||
# redhat.java
|
||||
# sumneko.lua
|
||||
];
|
||||
userSettings = {
|
||||
"editor.renderLineHighlight" = "none";
|
||||
"extensions.experimental.affinity" = {
|
||||
"asvetliakov.vscode-neovim" = 1;
|
||||
};
|
||||
"files.autoSave" = "off";
|
||||
"window.autoDetectColorScheme" = true;
|
||||
"window.commandCenter" = true;
|
||||
"window.titleBarStyle" = "custom";
|
||||
"workbench.iconTheme" = null;
|
||||
"workbench.preferredDarkColorTheme" = "Adwaita Dark";
|
||||
"workbench.preferredLightColorTheme" = "Adwaita Light";
|
||||
"workbench.tree.indent" = 12;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user