moved neovim to flake, small filesystem config changes

This commit is contained in:
ISnortPennies 2023-01-27 20:43:32 -05:00
parent aea8d79274
commit 6143e3ff50
9 changed files with 16 additions and 227 deletions

View file

@ -13,6 +13,10 @@
url = "github:ISnortPennies/suckless"; url = "github:ISnortPennies/suckless";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nvim-config = {
url = "github:ISnortPennies/nvim-config";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { outputs = {
self, self,

View file

@ -16,10 +16,7 @@
lib.lists.forEach modules ( lib.lists.forEach modules (
m: m:
./. + ("/" + m + ".nix") ./. + ("/" + m + ".nix")
) );
++ [
./neovim
];
xsession.numlock.enable = true; xsession.numlock.enable = true;
home = { home = {
homeDirectory = "/home/${settings.username}"; homeDirectory = "/home/${settings.username}";

View file

@ -1,77 +0,0 @@
-- settings
-- keybind modifier
vim.g.mapleader = "'"
vim.opt.updatetime = 300
vim.opt.incsearch = true
-- backups bad
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.writebackup = false
--formatting
vim.opt.expandtab = true
vim.opt.shiftwidth = 2
vim.opt.tabstop = 2
-- pretty numbers
vim.opt.signcolumn = "yes:2"
vim.opt.number = true
vim.opt.relativenumber = true
-- mouse
vim.opt.mouse = "a"
-- no wrapping bs
vim.wo.wrap = false
-- dark background
vim.opt.background = "dark"
vim.opt.termguicolors = true
-- hide bottom bar for lightling
vim.g.noshowmode = true
-- stop hiding double quotes in json files
vim.g.indentLine_setConceal = 0
-- plugin setups
-- file expolorer
vim.g.loaded = 1
vim.g.loaded_netrwPlugin = 1
require("nvim-tree").setup {
open_on_setup = false,
sort_by = "case_sensitive",
view = {
adaptive_size = true,
},
actions = {
open_file = {
quit_on_open = true,
},
},
}
require("nvim-web-devicons").setup()
-- language support
require("nvim-treesitter.configs").setup {
ensure_installed = "",
sync_install = true,
auto_install = false,
highlight = {
enable = true,
additional_vim_regex_highlighting = false
},
rainbow = {
enable = true,
extended_mode = true,
max_file_lines = nil,
},
}
-- shapes and colors
vim.cmd[[colorscheme moonfly]]
-- pretty colors
require("colorizer").setup()
require("telescope").load_extension("fzy_native")
require("gitsigns").setup {
current_line_blame = true,
}
require("nvim-autopairs").setup()
-- telescope keybinds
vim.keymap.set( "n", "<Leader>s", "<cmd>Telescope find_files<cr>")
-- show tree
vim.keymap.set("n", "<Leader>t", ":NvimTreeToggle<CR>")
-- lightnline load colorscheme
vim.g.lightline = { colorscheme = "moonfly" }

View file

@ -1,3 +0,0 @@
local lspc = require("lspconfig")
-- lspc.rust_analyzer.setup{}
-- lspc.clangd.setup{}

View file

@ -1,72 +0,0 @@
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local feedkey = function(key, mode)
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
end
local cmp = require("cmp")
local lspkind = require("lspkind")
cmp.setup({
sources = {
{ name = "nvim_lsp" },
{ name = "cmp_tabnine" },
{ name = "treesitter" },
{ name = "buffer" },
{ name = "path" },
{ name = "vsnip" },
},
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
formatting = {
format = lspkind.cmp_format({
with_text = true,
menu = {
buffer = "[Buf]",
nvim_lsp = "[LSP]",
nvim_lua = "[Lua]",
latex_symbols = "[Latex]",
treesitter = "[TS]",
cmp_tabnine = "[TN]",
vsnip = "[Snip]",
},
}),
},
mapping = {
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif vim.fn["vsnip#available"](1) == 1 then
feedkey("<Plug>(vsnip-expand-or-jump)", "")
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, {
"i",
"s",
}),
["<S-Tab>"] = cmp.mapping(function()
if cmp.visible() then
cmp.select_prev_item()
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
feedkey("<Plug>(vsnip-jump-prev)", "")
end
end, {
"i",
"s",
}),
},
})

View file

@ -1,66 +0,0 @@
{pkgs, ...}: let
vim-moonfly = pkgs.vimUtils.buildVimPlugin {
pname = "vim-moonfly";
version = "1.0.0";
src = pkgs.fetchFromGitHub {
owner = "bluz71";
repo = "vim-moonfly-colors";
rev = "ae3db6fe9a6d8ee6b22e28a19754a721d777df44";
sha256 = "sha256-2EUkTrPVERGmyWfq1a41xYCNHjFVUSrPUsYkWY9Igyc=";
};
};
in {
# home.packages = with pkgs; [rustc cargo rust-analyzer clang-tools];
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
extraPackages = with pkgs; [gcc ripgrep fd];
plugins = with pkgs.vimPlugins; [
nvim-treesitter.withAllGrammars
rainbow
nvim-ts-rainbow # rainbow for tree-sitter
nvim-colorizer-lua # colors
nvim-tree-lua # file browser
nvim-web-devicons # for tree-lua
vim-smoothie #smooth scrolling
undotree # better undotree
indentLine # indentlines
vim-smoothie #smooth scrolling
#non-trash auto completion
nvim-cmp
cmp-buffer
cmp-nvim-lsp
cmp-path
cmp-spell
cmp-treesitter
cmp-vsnip
vim-vsnip
lspkind-nvim
nvim-lspconfig
nvim-autopairs # auto brackets
telescope-nvim #search feature
telescope-fzy-native-nvim # search plugin
gitsigns-nvim #in buffer git blame
vim-moonfly #color scheme
lightline-vim #bottom bar
];
extraConfig = let
luaRequire = module:
builtins.readFile (builtins.toString
./config
+ "/${module}.lua");
luaConfig = builtins.concatStringsSep "\n" (map luaRequire [
"init"
"lspconfig"
"nvim-cmp"
]);
in ''
lua << EOF
${luaConfig}
EOF
'';
};
}

View file

@ -11,10 +11,7 @@
lib.lists.forEach modules ( lib.lists.forEach modules (
m: m:
./. + ("/" + m + ".nix") ./. + ("/" + m + ".nix")
) );
++ [
./neovim
];
home = { home = {
username = "root"; username = "root";
homeDirectory = "/root"; homeDirectory = "/root";

View file

@ -1,6 +1,7 @@
{ {
config, config,
pkgs, pkgs,
inputs,
... ...
}: { }: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@ -31,5 +32,6 @@
nix-tree #view packages nix-tree #view packages
bc #terminal calculator bc #terminal calculator
page #use nvim as a pager page #use nvim as a pager
inputs.nvim-config.packages.${pkgs.system}.default #my custom nvim flake
]; ];
} }

View file

@ -41,7 +41,8 @@
boot = { boot = {
initrd = { initrd = {
kernelModules = ["amdgpu"]; kernelModules = ["amdgpu"];
availableKernelModules = ["nvme" "ext4" "vfat" "xhci_pci" "ahci" "usbhid" "sd_mod"]; availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"];
supportedFilesystems = ["ext4" "vfat"];
includeDefaultModules = false; includeDefaultModules = false;
}; };
}; };
@ -51,11 +52,17 @@
device = "/dev/disk/by-id/nvme-Samsung_SSD_980_500GB_S64ENJ0R607785J-part2"; device = "/dev/disk/by-id/nvme-Samsung_SSD_980_500GB_S64ENJ0R607785J-part2";
fsType = "ext4"; fsType = "ext4";
label = "nixos"; label = "nixos";
noCheck = false;
mountPoint = "/";
neededForBoot = true;
}; };
"/boot" = { "/boot" = {
device = "/dev/disk/by-id/nvme-Samsung_SSD_980_500GB_S64ENJ0R607785J-part1"; device = "/dev/disk/by-id/nvme-Samsung_SSD_980_500GB_S64ENJ0R607785J-part1";
fsType = "vfat"; fsType = "vfat";
label = "BOOT"; label = "BOOT";
noCheck = false;
mountPoint = "/boot";
neededForBoot = true;
}; };
}; };
} }