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"
}
},
"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"

View file

@ -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
];
};

View file

@ -1,12 +1,9 @@
{ 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;
configure = {
customRC = ''
set title
@ -18,9 +15,10 @@
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 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")
@ -29,11 +27,11 @@
else
print('warning: expected value "light" or "dark"')
print(' got:', system_theme)
print(' expected path:', config_file)
print(' expected path:', file)
end
else
print('warning: nvim color scheme not found')
print(' expected path:', config_file)
print(' expected path:', file)
end
EOF
@ -58,15 +56,14 @@
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-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
@ -81,5 +78,4 @@
};
};
};
};
}