chore: revert neovim changes, remove tmux + fish from nix-darwin 🔨

This commit is contained in:
DannyDannyDanny 2025-09-08 20:41:49 +02:00
parent b7f63f305d
commit 7544e12117
3 changed files with 94 additions and 74 deletions

22
nixos/flake.lock generated
View file

@ -34,6 +34,27 @@
"type": "github" "type": "github"
} }
}, },
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1757130842,
"narHash": "sha256-4i7KKuXesSZGUv0cLPLfxbmF1S72Gf/3aSypgvVkwuA=",
"owner": "nix-darwin",
"repo": "nix-darwin",
"rev": "15f067638e2887c58c4b6ba1bdb65a0b61dc58c5",
"type": "github"
},
"original": {
"owner": "nix-darwin",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
},
"nixos-wsl": { "nixos-wsl": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@ -102,6 +123,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nix-darwin": "nix-darwin",
"nixos-wsl": "nixos-wsl", "nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"vscode-server": "vscode-server" "vscode-server": "vscode-server"

View file

@ -57,8 +57,10 @@
darwinConfigurations."Daniel-Macbook-Air" = nix-darwin.lib.darwinSystem { darwinConfigurations."Daniel-Macbook-Air" = nix-darwin.lib.darwinSystem {
modules = [ modules = [
./hosts/macos.nix ./hosts/macos.nix
./tmux.nix # TODO: nix-darwin lacks tmux options; move to Home Manager.x
./neovim.nix # ./tmux.nix
# TODO: add neovim via homemanager, that should work the same for NixOS as Nix-Darwin
# ./neovim.nix # NOTE: Option only exists on NixOS.
./fish.nix ./fish.nix
]; ];
}; };

View file

@ -1,84 +1,80 @@
{ lib, config, pkgs, ... }: { config, pkgs, ... }:
{ {
# Only apply the Neovim NixOS module options on Linux. programs.neovim = {
config = lib.mkIf pkgs.stdenv.isLinux { enable = true;
programs.neovim = { defaultEditor = true;
enable = true; configure = {
defaultEditor = true; customRC = ''
set title
set go=a
set mouse=a
set nohlsearch
set number
let mapleader=","
configure = { lua << EOF
customRC = '' local config_file = os.getenv("HOME")..'/.local/share/nvim_color_scheme'
set title local f=io.open(config_file, "r")
set go=a if f~=nil then
set mouse=a local system_theme = f:read()
set nohlsearch -- f:close()
set number io.close(f)
let mapleader="," 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:', file)
end
else
print('warning: nvim color scheme not found')
print(' expected path:', file)
end
EOF
lua << EOF colorscheme catppuccin " catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha
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
" netrw (dir listing) settings set listchars=tab:\ ,space:·,nbsp:,trail:,eol:,precedes:«,extends:»
let g:netrw_liststyle = 3 set clipboard+=unnamedplus
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:» " Replace-all is aliased to S.
set clipboard+=unnamedplus nnoremap S :%s//g<Left><Left>
" Replace-all is aliased to S. " save file with ,w
nnoremap S :%s//g<Left><Left> map <leader>w :w<cr><Space>
" save file with ,w " spellcheck
map <leader>w :w<cr><Space> set spell spelllang=en_us
setlocal spell! spelllang=en_us
" spellcheck '';
set spell spelllang=en_us # vimPlugins inspired from Alexnortung
setlocal spell! spelllang=en_us # https://discourse.nixos.org/t/neovim-no-longer-uses-config-or-plugins/13399/4
''; packages.nix = with pkgs.vimPlugins; {
start = [
# vimPlugins inspired from Alexnortung vim-surround # shortcuts for setting () {} etc.
# https://discourse.nixos.org/t/neovim-no-longer-uses-config-or-plugins/13399/4 vim-gitgutter # git diff in sign column
packages.nix = with pkgs.vimPlugins; { # vim-airline # nice and light status bar # doesn't work nicely with tmux
start = [ # coc-nvim coc-git coc-highlight coc-python coc-rls coc-vetur coc-vimtex coc-yaml coc-html coc-json # auto completion
vim-surround # shortcuts for setting () {} etc. vim-nix # nix highlight
vim-gitgutter # git diff in sign column vimtex # latex stuff
# vim-airline # nice and light status bar (disabled for tmux) fzf-vim # fuzzy finder through vim
# coc-nvim coc-* plugins (disabled for now) nerdtree # file structure inside nvim
vim-nix # nix highlight rainbow # color parenthesis
vimtex # latex stuff # gruvbox-nvim # theme
fzf-vim # fuzzy finder through vim catppuccin-nvim # theme
nerdtree # file structure inside nvim goyo-vim # write prose
rainbow # color parenthesis limelight-vim # prose paragraph highlighter
# gruvbox-nvim # theme ];
catppuccin-nvim # theme opt = [];
goyo-vim # write prose
limelight-vim # prose paragraph highlighter
];
opt = [];
};
}; };
}; };
}; };