From 7a34ccfc7f060c3b5f3bd9e25340982a4845d043 Mon Sep 17 00:00:00 2001 From: DannyDannyDanny Date: Sun, 11 Jan 2026 15:04:22 +0100 Subject: [PATCH] refactor: neovim config out of home-manager :art: --- nixos/flake.nix | 6 ++-- nixos/home/danny/home.nix | 71 ++------------------------------------- 2 files changed, 6 insertions(+), 71 deletions(-) diff --git a/nixos/flake.nix b/nixos/flake.nix index dc6ea8b..d8303d6 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -31,7 +31,8 @@ vscode-server.nixosModules.default ./hosts/wsl.nix ./tmux.nix - ./neovim.nix + # TODO: handle all user-level programs via home-manager + # ./neovim.nix # Now handled via home-manager ./fish.nix # home-manager.nixosModules.default ]; @@ -46,7 +47,8 @@ ./hosts/macbookair.nix ./hardware-configuration.nix ./tmux.nix - ./neovim.nix + # TODO: handle all user-level programs via home-manager + # ./neovim.nix # Now handled via home-manager ./fish.nix # home-manager.nixosModules.default ]; diff --git a/nixos/home/danny/home.nix b/nixos/home/danny/home.nix index ef1874d..ee74dd3 100644 --- a/nixos/home/danny/home.nix +++ b/nixos/home/danny/home.nix @@ -6,75 +6,8 @@ programs.home-manager.enable = true; - # Neovim (user-level, works great on macOS) - programs.neovim = { - enable = true; - defaultEditor = true; - # extraLuaConfig is also available; we’ll keep your Vimscript as-is: - extraConfig = '' - set title - set mouse=a - set nohlsearch - set number - let mapleader="," - - lua << EOF - local config_file = os.getenv("HOME")..'/.local/share/nvim_color_scheme' - local f = io.open(config_file, "r") - if f ~= nil then - local system_theme = f:read() - io.close(f) - if system_theme == 'dark' then - vim.cmd("set bg=dark") - elseif system_theme == 'light' then - vim.cmd("set bg=light") - else - print('warning: expected value "light" or "dark"') - print(' got:', system_theme) - print(' expected path:', config_file) - end - else - print('warning: nvim color scheme not found') - print(' expected path:', config_file) - end - EOF - - colorscheme catppuccin " catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha - - " netrw (dir listing) settings - let g:netrw_liststyle = 3 - let g:netrw_banner = 0 - let g:netrw_browse_split = 3 - let g:netrw_winsize = 25 " % of page - - set listchars=tab:→\ ,space:·,nbsp:␣,trail:•,eol:¶,precedes:«,extends:» - set clipboard+=unnamedplus - - " Replace-all is aliased to S. - nnoremap S :%s//g - - " save file with ,w - map w :w - - " spellcheck - set spell spelllang=en_us - setlocal spell! spelllang=en_us - ''; - - plugins = with pkgs.vimPlugins; [ - vim-surround - vim-gitgutter - vim-nix - # vimtex - disabled due to build check issue with fzf-lua dependency - # vimtex-fixed - fzf-lua - nerdtree - rainbow - catppuccin-nvim - goyo-vim - limelight-vim - ]; - }; + # Import neovim configuration + imports = [ ../../neovim.nix ]; # tmux (user-level; same config on macOS and NixOS if you reuse this file) programs.tmux = {