chore: revert neovim changes, remove tmux + fish from nix-darwin 🔨
This commit is contained in:
parent
b7f63f305d
commit
7544e12117
3 changed files with 94 additions and 74 deletions
22
nixos/flake.lock
generated
22
nixos/flake.lock
generated
|
|
@ -34,6 +34,27 @@
|
|||
"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": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
|
|
@ -102,6 +123,7 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nix-darwin": "nix-darwin",
|
||||
"nixos-wsl": "nixos-wsl",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"vscode-server": "vscode-server"
|
||||
|
|
|
|||
|
|
@ -57,8 +57,10 @@
|
|||
darwinConfigurations."Daniel-Macbook-Air" = nix-darwin.lib.darwinSystem {
|
||||
modules = [
|
||||
./hosts/macos.nix
|
||||
./tmux.nix
|
||||
./neovim.nix
|
||||
# TODO: nix-darwin lacks tmux options; move to Home Manager.x
|
||||
# ./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
|
||||
];
|
||||
};
|
||||
|
|
|
|||
140
nixos/neovim.nix
140
nixos/neovim.nix
|
|
@ -1,84 +1,80 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Only apply the Neovim NixOS module options on Linux.
|
||||
config = lib.mkIf pkgs.stdenv.isLinux {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
configure = {
|
||||
customRC = ''
|
||||
set title
|
||||
set go=a
|
||||
set mouse=a
|
||||
set nohlsearch
|
||||
set number
|
||||
let mapleader=","
|
||||
|
||||
configure = {
|
||||
customRC = ''
|
||||
set title
|
||||
set go=a
|
||||
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()
|
||||
-- f:close()
|
||||
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:', file)
|
||||
end
|
||||
else
|
||||
print('warning: nvim color scheme not found')
|
||||
print(' expected path:', file)
|
||||
end
|
||||
EOF
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
set listchars=tab:→\ ,space:·,nbsp:␣,trail:•,eol:¶,precedes:«,extends:»
|
||||
set clipboard+=unnamedplus
|
||||
" Replace-all is aliased to S.
|
||||
nnoremap S :%s//g<Left><Left>
|
||||
|
||||
" Replace-all is aliased to S.
|
||||
nnoremap S :%s//g<Left><Left>
|
||||
" save file with ,w
|
||||
map <leader>w :w<cr><Space>
|
||||
|
||||
" save file with ,w
|
||||
map <leader>w :w<cr><Space>
|
||||
|
||||
" spellcheck
|
||||
set spell spelllang=en_us
|
||||
setlocal spell! spelllang=en_us
|
||||
'';
|
||||
|
||||
# vimPlugins inspired from Alexnortung
|
||||
# https://discourse.nixos.org/t/neovim-no-longer-uses-config-or-plugins/13399/4
|
||||
packages.nix = with pkgs.vimPlugins; {
|
||||
start = [
|
||||
vim-surround # shortcuts for setting () {} etc.
|
||||
vim-gitgutter # git diff in sign column
|
||||
# vim-airline # nice and light status bar (disabled for tmux)
|
||||
# coc-nvim coc-* plugins (disabled for now)
|
||||
vim-nix # nix highlight
|
||||
vimtex # latex stuff
|
||||
fzf-vim # fuzzy finder through vim
|
||||
nerdtree # file structure inside nvim
|
||||
rainbow # color parenthesis
|
||||
# gruvbox-nvim # theme
|
||||
catppuccin-nvim # theme
|
||||
goyo-vim # write prose
|
||||
limelight-vim # prose paragraph highlighter
|
||||
];
|
||||
opt = [];
|
||||
};
|
||||
" spellcheck
|
||||
set spell spelllang=en_us
|
||||
setlocal spell! spelllang=en_us
|
||||
'';
|
||||
# vimPlugins inspired from Alexnortung
|
||||
# https://discourse.nixos.org/t/neovim-no-longer-uses-config-or-plugins/13399/4
|
||||
packages.nix = with pkgs.vimPlugins; {
|
||||
start = [
|
||||
vim-surround # shortcuts for setting () {} etc.
|
||||
vim-gitgutter # git diff in sign column
|
||||
# vim-airline # nice and light status bar # doesn't work nicely with tmux
|
||||
# coc-nvim coc-git coc-highlight coc-python coc-rls coc-vetur coc-vimtex coc-yaml coc-html coc-json # auto completion
|
||||
vim-nix # nix highlight
|
||||
vimtex # latex stuff
|
||||
fzf-vim # fuzzy finder through vim
|
||||
nerdtree # file structure inside nvim
|
||||
rainbow # color parenthesis
|
||||
# gruvbox-nvim # theme
|
||||
catppuccin-nvim # theme
|
||||
goyo-vim # write prose
|
||||
limelight-vim # prose paragraph highlighter
|
||||
];
|
||||
opt = [];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue