diff --git a/flake.nix b/flake.nix index cd9366c..9427884 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,10 @@ url = "github:ISnortPennies/suckless"; inputs.nixpkgs.follows = "nixpkgs"; }; + nvim-config = { + url = "github:ISnortPennies/nvim-config"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, diff --git a/home-manager/home.nix b/home-manager/home.nix index 2f28c3c..6c2fedf 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -16,10 +16,7 @@ lib.lists.forEach modules ( m: ./. + ("/" + m + ".nix") - ) - ++ [ - ./neovim - ]; + ); xsession.numlock.enable = true; home = { homeDirectory = "/home/${settings.username}"; diff --git a/home-manager/neovim/config/init.lua b/home-manager/neovim/config/init.lua deleted file mode 100644 index bbfd8e0..0000000 --- a/home-manager/neovim/config/init.lua +++ /dev/null @@ -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", "s", "Telescope find_files") --- show tree -vim.keymap.set("n", "t", ":NvimTreeToggle") - --- lightnline load colorscheme -vim.g.lightline = { colorscheme = "moonfly" } diff --git a/home-manager/neovim/config/lspconfig.lua b/home-manager/neovim/config/lspconfig.lua deleted file mode 100644 index 65f8edc..0000000 --- a/home-manager/neovim/config/lspconfig.lua +++ /dev/null @@ -1,3 +0,0 @@ -local lspc = require("lspconfig") --- lspc.rust_analyzer.setup{} --- lspc.clangd.setup{} diff --git a/home-manager/neovim/config/nvim-cmp.lua b/home-manager/neovim/config/nvim-cmp.lua deleted file mode 100644 index 6d506c0..0000000 --- a/home-manager/neovim/config/nvim-cmp.lua +++ /dev/null @@ -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 = { - [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif vim.fn["vsnip#available"](1) == 1 then - feedkey("(vsnip-expand-or-jump)", "") - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { - "i", - "s", - }), - - [""] = cmp.mapping(function() - if cmp.visible() then - cmp.select_prev_item() - elseif vim.fn["vsnip#jumpable"](-1) == 1 then - feedkey("(vsnip-jump-prev)", "") - end - end, { - "i", - "s", - }), - }, -}) diff --git a/home-manager/neovim/default.nix b/home-manager/neovim/default.nix deleted file mode 100644 index e66e707..0000000 --- a/home-manager/neovim/default.nix +++ /dev/null @@ -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 - - ''; - }; -} diff --git a/home-manager/root.nix b/home-manager/root.nix index c48f821..dcbb469 100644 --- a/home-manager/root.nix +++ b/home-manager/root.nix @@ -11,10 +11,7 @@ lib.lists.forEach modules ( m: ./. + ("/" + m + ".nix") - ) - ++ [ - ./neovim - ]; + ); home = { username = "root"; homeDirectory = "/root"; diff --git a/modules/packages.nix b/modules/packages.nix index da4c242..fff4a2a 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -1,6 +1,7 @@ { config, pkgs, + inputs, ... }: { environment.systemPackages = with pkgs; [ @@ -31,5 +32,6 @@ nix-tree #view packages bc #terminal calculator page #use nvim as a pager + inputs.nvim-config.packages.${pkgs.system}.default #my custom nvim flake ]; } diff --git a/systems/desktop.nix b/systems/desktop.nix index dcc63f1..768ad7a 100644 --- a/systems/desktop.nix +++ b/systems/desktop.nix @@ -41,7 +41,8 @@ boot = { initrd = { 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; }; }; @@ -51,11 +52,17 @@ device = "/dev/disk/by-id/nvme-Samsung_SSD_980_500GB_S64ENJ0R607785J-part2"; fsType = "ext4"; label = "nixos"; + noCheck = false; + mountPoint = "/"; + neededForBoot = true; }; "/boot" = { device = "/dev/disk/by-id/nvme-Samsung_SSD_980_500GB_S64ENJ0R607785J-part1"; fsType = "vfat"; label = "BOOT"; + noCheck = false; + mountPoint = "/boot"; + neededForBoot = true; }; }; }