diff --git a/flake.nix b/flake.nix index 67c5189..4c52873 100644 --- a/flake.nix +++ b/flake.nix @@ -29,19 +29,5 @@ inherit nixpkgs; }; }; - # nixosConfigurations.drew-desktop = nixpkgs.lib.nixosSystem { - # system = "x86_64-linux"; - # modules = [ - # ./configuration.nix - # ./hardware-configuration.nix - # inputs.home-manager.nixosModules.home-manager - # { - # home-manager.useGlobalPkgs = true; - # home-manager.users.drew = import ./home-manager/drew.nix; - # home-manager.extraSpecialArgs = { inherit inputs; }; - # } - # ]; - # specialArgs = { inherit inputs; }; - # }; }; } diff --git a/home-manager/drew.nix b/home-manager/drew.nix index c593e05..3bc33ef 100644 --- a/home-manager/drew.nix +++ b/home-manager/drew.nix @@ -5,6 +5,7 @@ ./features/shell.nix ./features/terminal.nix ./features/hyprland.nix + ./features/neovim.nix ]; home.username = "drew"; @@ -14,7 +15,6 @@ home.packages = with pkgs; [ # Development - neovim git nix-prefetch-github diff --git a/home-manager/features/config/neovim/.XCompose b/home-manager/features/config/neovim/.XCompose new file mode 100644 index 0000000..d10c368 --- /dev/null +++ b/home-manager/features/config/neovim/.XCompose @@ -0,0 +1,6 @@ +include "%L" + + : "α" + : "β" + : "γ" +

: "π" diff --git a/home-manager/features/config/neovim/ftplugin/lua.vim b/home-manager/features/config/neovim/ftplugin/lua.vim new file mode 100644 index 0000000..22f747d --- /dev/null +++ b/home-manager/features/config/neovim/ftplugin/lua.vim @@ -0,0 +1,3 @@ +set shiftwidth=4 +set tabstop=4 +set softtabstop=4 diff --git a/home-manager/features/config/neovim/init.lua b/home-manager/features/config/neovim/init.lua new file mode 100644 index 0000000..2d3b785 --- /dev/null +++ b/home-manager/features/config/neovim/init.lua @@ -0,0 +1 @@ +require("periodic") \ No newline at end of file diff --git a/home-manager/features/config/neovim/lua/periodic/init.lua b/home-manager/features/config/neovim/lua/periodic/init.lua new file mode 100644 index 0000000..9bcdb36 --- /dev/null +++ b/home-manager/features/config/neovim/lua/periodic/init.lua @@ -0,0 +1,37 @@ +vim.g.mapleader = "," + +vim.cmd [[ +colorscheme decay-dark +set autoindent +set expandtab +set smartindent +set shiftwidth=2 +set tabstop=2 +set softtabstop=2 +filetype on + +]] + +-- Make sure sesssion options includes `localoptions` so that auto-sessions will start properly +vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" + +local telescope = require('telescope.builtin') + +vim.keymap.set("n", "", "RnvimrToggle", { noremap = true, silent = true }) +vim.keymap.set("n", "", "TabNext", { noremap = true, silent = true }) +vim.keymap.set("n", "", telescope.find_files, { desc = "Telescope find files" }) +vim.keymap.set("n", "", telescope.buffers, { desc = "Telescope buffers" }) + + +vim.filetype.add { + extension = { + rasi = 'rasi', + }, + pattern = { + -- Some common config files and their types + ['.*/waybar/config'] = 'jsonc', + ['.*/mako/config'] = 'dosini', + ['.*/kitty/*.conf'] = 'bash', + ['.*/hypr/.*%.conf'] = 'hyprlang', + }, +} diff --git a/home-manager/features/neovim.nix b/home-manager/features/neovim.nix new file mode 100644 index 0000000..a6bacab --- /dev/null +++ b/home-manager/features/neovim.nix @@ -0,0 +1,42 @@ +{ pkgs, lib, ... }: +let + fromGitHub = repo: ref: rev: pkgs.vimUtils.buildVimPlugin { + pname = "${lib.strings.sanitizeDerivationName repo}"; + version = ref; + src = builtins.fetchGit { + url = "https://github.com/${repo}.git"; + ref = ref; + rev = rev; + }; + }; +in +{ + home.file.".config/nvim" = { + source = ./config/neovim; + recursive = true; + }; + + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + defaultEditor = true; + + plugins = with pkgs.vimPlugins; [ + nvim-treesitter + surround-nvim + telescope-nvim + plenary-nvim # dependency of telescope + rnvimr + (fromGitHub "decaycs/decay.nvim" "HEAD" "457014541ebcfb29bd660592a0b02f22c9e2d0e2") + auto-session + ]; + + extraPackages = with pkgs; [ + gcc # For treesitter complation + ripgrep # Search support + wayclip # Clipboard support + fd # finder for telescope + ]; + }; +}