mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
feat: NixOS + darwin equality. feat: vim overhaul.
This commit is contained in:
parent
5879913b51
commit
2606e1d874
48 changed files with 463 additions and 918 deletions
|
|
@ -1,25 +0,0 @@
|
|||
{ tf, config, lib, pkgs, inputs, ... }: with lib;
|
||||
|
||||
let
|
||||
doom-emacs = pkgs.callPackage inputs.nix-doom-emacs {
|
||||
doomPrivateDir = "${./doom.d}";
|
||||
emacsPackages = pkgs.emacsPackagesFor pkgs.emacsPgtkGcc;
|
||||
bundledPackages = false;
|
||||
emacsPackagesOverlay = self: super: {
|
||||
magit-delta = super.magit-delta.overrideAttrs (esuper: {
|
||||
buildInputs = esuper.buildInputs ++ [ pkgs.git ];
|
||||
});
|
||||
straight = self.straightBuild {
|
||||
pname = "straight";
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
optionalAttrs (builtins.getEnv "CI_PLATFORM" == "impure" && builtins.getEnv "TF_IN_AUTOMATION" != "") {
|
||||
home.packages = [ doom-emacs pkgs.sqlite ];
|
||||
|
||||
home.file.".emacs.d/init.el".text = ''
|
||||
(load "default.el")
|
||||
(load-theme 'base16-${elemAt (splitString "." config.base16.alias.default) 1} t)
|
||||
'';
|
||||
}
|
||||
|
|
@ -3,7 +3,6 @@
|
|||
{
|
||||
home.packages = with pkgs; [
|
||||
jq
|
||||
apache-directory-studio
|
||||
hyperfine
|
||||
hexyl
|
||||
tokei
|
||||
|
|
|
|||
|
|
@ -1,76 +1,20 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
initvim = pkgs.callPackage
|
||||
({ stdenv, nodejs }: stdenv.mkDerivation {
|
||||
name = "init.vim";
|
||||
src = ./init.vim;
|
||||
inherit nodejs;
|
||||
buildInputs = [
|
||||
nodejs
|
||||
];
|
||||
phases = [ "buildPhase" ];
|
||||
buildPhase = ''
|
||||
substituteAll $src $out
|
||||
'';
|
||||
})
|
||||
{ };
|
||||
cocvim = pkgs.callPackage
|
||||
({ stdenv, elinks, nodejs }: stdenv.mkDerivation {
|
||||
name = "coc.vim";
|
||||
src = ./coc.vim;
|
||||
inherit nodejs;
|
||||
buildInputs = [
|
||||
nodejs
|
||||
];
|
||||
phases = [ "buildPhase" ];
|
||||
buildPhase = ''
|
||||
substituteAll $src $out
|
||||
'';
|
||||
})
|
||||
{ };
|
||||
in
|
||||
{
|
||||
programs.neovim = {
|
||||
extraConfig = ''
|
||||
source ${initvim}
|
||||
source ${cocvim}
|
||||
luafile ${./init.lua}
|
||||
'';
|
||||
extraPackages = with pkgs; [
|
||||
terraform-ls
|
||||
];
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
neorg
|
||||
nvim-cmp
|
||||
plenary-nvim
|
||||
nvim-base16
|
||||
nvim-web-devicons
|
||||
telescope-nvim
|
||||
coc-yaml
|
||||
coc-git
|
||||
coc-css
|
||||
coc-html
|
||||
coc-nvim
|
||||
coc-rust-analyzer
|
||||
coc-yank
|
||||
coc-python
|
||||
coc-json
|
||||
coc-fzf
|
||||
nvim-lspconfig
|
||||
];
|
||||
coc = {
|
||||
enable = true;
|
||||
settings = {
|
||||
"rust.rustfmt_path" = "${pkgs.rustfmt}/bin/rustfmt";
|
||||
"rust-analyzer.serverPath" = "rust-analyzer";
|
||||
"rust-analyzer.updates.prompt" = false;
|
||||
"rust-analyzer.notifications.cargoTomlNotFound" = false;
|
||||
"rust-analyzer.notifications.workspaceLoaded" = false;
|
||||
"rust-analyzer.procMacro.enable" = true;
|
||||
"rust-analyzer.cargo.loadOutDirsFromCheck" = true;
|
||||
"rust-analyzer.cargo-watch.enable" = true;
|
||||
"rust-analyzer.completion.addCallParenthesis" = false; # consider using this?
|
||||
"rust-analyzer.hoverActions.linksInHover" = true;
|
||||
"rust-analyzer.diagnostics.disabled" = [
|
||||
"inactive-code" # it has strange cfg support..?
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
51
config/users/kat/dev/vim/init.lua
Normal file
51
config/users/kat/dev/vim/init.lua
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
local api = vim.api
|
||||
local cmp = require'cmp'
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Plugins
|
||||
-----------------------------------------------------------
|
||||
|
||||
-- nvim-cmp
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'neorg' },
|
||||
}
|
||||
})
|
||||
|
||||
-- lspconfig
|
||||
require'lspconfig'.terraformls.setup{}
|
||||
api.nvim_create_autocmd('BufWritePre', {
|
||||
pattern = '*.tf',
|
||||
command = 'lua vim.lsp.buf.formatting_sync()'
|
||||
})
|
||||
|
||||
-- neorg
|
||||
require('neorg').setup {
|
||||
-- Tell Neorg what modules to load
|
||||
load = {
|
||||
['core.defaults'] = {}, -- Load all the default modules
|
||||
['core.norg.concealer'] = {}, -- Allows for use of icons
|
||||
['core.norg.dirman'] = { -- Manage your directories with Neorg
|
||||
config = {
|
||||
engine = 'nvim-cmp',
|
||||
workspaces = {
|
||||
home = '~/neorg'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
-- telescope
|
||||
api.nvim_set_keymap('n', '<leader>ff', '<cmd>Telescope find_files<cr>', { noremap = true, silent = true })
|
||||
api.nvim_set_keymap('n', '<leader>fg', '<cmd>Telescope live_grep<cr>', { noremap = true, silent = true })
|
||||
api.nvim_set_keymap('n', '<leader>fb', '<cmd>Telescope buffers<cr>', { noremap = true, silent = true })
|
||||
api.nvim_set_keymap('n', '<leader>fh', '<cmd>Telescope help_tags<cr>', { noremap = true, silent = true })
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
lua << EOF
|
||||
local cmp = require'cmp'
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'neorg' },
|
||||
}
|
||||
})
|
||||
|
||||
require('neorg').setup {
|
||||
-- Tell Neorg what modules to load
|
||||
load = {
|
||||
["core.defaults"] = {}, -- Load all the default modules
|
||||
["core.norg.concealer"] = {}, -- Allows for use of icons
|
||||
["core.norg.dirman"] = { -- Manage your directories with Neorg
|
||||
config = {
|
||||
engine = "nvim-cmp",
|
||||
workspaces = {
|
||||
home = "~/neorg"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
EOF
|
||||
|
||||
nnoremap <leader>ff <cmd>Telescope find_files<cr>
|
||||
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
|
||||
nnoremap <leader>fb <cmd>Telescope buffers<cr>
|
||||
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
|
||||
Loading…
Add table
Add a link
Reference in a new issue