Added: Nixvim modules

This commit is contained in:
2026-01-27 00:48:01 +01:00
parent de5c0feaa3
commit 3ce95ebe41
12 changed files with 231 additions and 56 deletions

View File

@@ -15,6 +15,7 @@
# nixpkgs is best for CLI tools
casks = [
"element"
"affinity"
];
brews = [ ];

View File

@@ -44,6 +44,7 @@
{ app = "/Users/phil/Applications/Home Manager Apps/Obsidian.app"; }
{ app = "/Users/phil/Applications/Home Manager Apps/OpenSCAD.app"; }
{ app = "/Applications/okular.app"; }
{ app = "/Applications/Affinity.app"; }
{ app = "/System/Applications/Mail.app"; }
{ app = "/System/Applications/Launchpad.app"; }
];

View File

@@ -39,67 +39,67 @@
};
};
skhd = {
enable = true;
skhdConfig = ''
# skhd = {
# enable = true;
# skhdConfig = ''
# Application Bindings
cmd - q : open -a kitty
cmd - e : ${pkgs.kitty}/bin/kitty yazi
cmd - o : open -a "Obsidian"
cmd - i : open -a "Floorp"
cmd - g : open -a "Mail"
# cmd - q : open -a kitty
# cmd - e : ${pkgs.kitty}/bin/kitty yazi
# cmd - o : open -a "Obsidian"
# cmd - i : open -a "Floorp"
# cmd - g : open -a "Mail"
# Window Management (using yabai if installed, otherwise basic macOS)
cmd + shift - c : yabai -m window --close || osascript -e 'tell application "System Events" to keystroke "w" using command down'
cmd + shift - v : yabai -m window --toggle float
#cmd + shift - c : yabai -m window --close || osascript -e 'tell application "System Events" to keystroke "w" using command down'
#cmd + shift - v : yabai -m window --toggle float
# Focus windows (vim-like)
cmd - left : yabai -m window --focus west
cmd - right : yabai -m window --focus east
cmd - up : yabai -m window --focus north
cmd - down : yabai -m window --focus south
# cmd - left : yabai -m window --focus west
# cmd - right : yabai -m window --focus east
# cmd - up : yabai -m window --focus north
# cmd - down : yabai -m window --focus south
# Move windows to spaces (workspaces)
cmd + shift - 1 : yabai -m window --space 1
cmd + shift - 2 : yabai -m window --space 2
cmd + shift - 3 : yabai -m window --space 3
cmd + shift - 4 : yabai -m window --space 4
cmd + shift - 5 : yabai -m window --space 5
cmd + shift - 6 : yabai -m window --space 6
cmd + shift - 7 : yabai -m window --space 7
cmd + shift - 8 : yabai -m window --space 8
cmd + shift - 9 : yabai -m window --space 9
cmd + shift - 0 : yabai -m window --space 10
# cmd + shift - 1 : yabai -m window --space 1
# cmd + shift - 2 : yabai -m window --space 2
# cmd + shift - 3 : yabai -m window --space 3
# cmd + shift - 4 : yabai -m window --space 4
# cmd + shift - 5 : yabai -m window --space 5
# cmd + shift - 6 : yabai -m window --space 6
# cmd + shift - 7 : yabai -m window --space 7
# cmd + shift - 8 : yabai -m window --space 8
# cmd + shift - 9 : yabai -m window --space 9
# cmd + shift - 0 : yabai -m window --space 10
# Switch to spaces (workspaces)
cmd - 1 : yabai -m space --focus 1
cmd - 2 : yabai -m space --focus 2
cmd - 3 : yabai -m space --focus 3
cmd - 4 : yabai -m space --focus 4
cmd - 5 : yabai -m space --focus 5
cmd - 6 : yabai -m space --focus 6
cmd - 7 : yabai -m space --focus 7
cmd - 8 : yabai -m space --focus 8
cmd - 9 : yabai -m space --focus 9
cmd - 0 : yabai -m space --focus 10
# cmd - 1 : yabai -m space --focus 1
# cmd - 2 : yabai -m space --focus 2
# cmd - 3 : yabai -m space --focus 3
# cmd - 4 : yabai -m space --focus 4
# cmd - 5 : yabai -m space --focus 5
# cmd - 6 : yabai -m space --focus 6
# cmd - 7 : yabai -m space --focus 7
# cmd - 8 : yabai -m space --focus 8
# cmd - 9 : yabai -m space --focus 9
# cmd - 0 : yabai -m space --focus 10
# Screenshot (macOS native)
cmd - z : screencapture -i ~/Pictures/Screenshots/$(date +%s).png
cmd - u : screencapture ~/Pictures/Screenshots/$(date +%s).png
# cmd - z : screencapture -i ~/Pictures/Screenshots/$(date +%s).png
# cmd - u : screencapture ~/Pictures/Screenshots/$(date +%s).png
# Launcher (using Raycast or Spotlight as Rofi alternative)
cmd - r : open -a "Raycast" || osascript -e 'tell application "System Events" to keystroke space using command down'
# cmd - r : open -a "Raycast" || osascript -e 'tell application "System Events" to keystroke space using command down'
# Lock screen
cmd - m : pmset displaysleepnow
# cmd - m : pmset displaysleepnow
# Toggle layout (if using yabai)
cmd - j : yabai -m space --layout $(yabai -m query --spaces --space | jq -r 'if .type == "bsp" then "float" else "bsp" end')
cmd - p : yabai -m window --toggle split
# cmd - j : yabai -m space --layout $(yabai -m query --spaces --space | jq -r 'if .type == "bsp" then "float" else "bsp" end')
# cmd - p : yabai -m window --toggle split
# Reload skhd config
cmd + shift - r : skhd --reload
'';
};
# cmd + shift - r : skhd --reload
# '';
# };
};
}

View File

@@ -7,6 +7,7 @@
inputs.nixvim.homeModules.nixvim
./neovim
./python.nix
inputs.nixcord.homeModules.nixcord
./nixcord.nix

View File

@@ -1,6 +1,7 @@
_: {
{ pkgs, ... }: {
programs.sketchybar = {
enable = true;
configType = "lua";
sbarLuaPackage = pkgs.sbarlua;
};
}

View File

@@ -12,6 +12,9 @@
./alpha.nix
./avante.nix
./openscad.nix
./jupytext.nix
./live-server.nix
./which-key.nix
];
programs.nixvim = {

18
home/neovim/jupytext.nix Normal file
View File

@@ -0,0 +1,18 @@
{ ... }: {
# Jupytext: Execute Jupyter notebooks directly in Neovim
programs.nixvim.jupytext = {
enable = true;
settings = {
custom_language_formatting = {
python = {
extension = "md";
force_ft = "markdown";
style = "markdown";
};
};
force_ft = null;
output_extension = "auto";
style = "light";
};
};
}

View File

@@ -0,0 +1,15 @@
{ pkgs, ... }: {
# Live Server: Auto-reload browser for web development
# Uses browser-sync for live reload functionality
programs.nixvim = {
keymaps = [{
mode = "n";
key = "<leader>ls";
action =
"<cmd>terminal browser-sync start --server --files '*.html, *.css, *.js' --no-notify<cr>";
options.desc = "Start live server (browser-sync)";
}];
extraPackages = with pkgs; [ nodePackages.browser-sync ];
};
}

94
home/neovim/which-key.nix Normal file
View File

@@ -0,0 +1,94 @@
{ pkgs, ... }: {
# Which-key: Display available keybindings in popup
# Shows all possible key combinations after pressing leader or other prefix keys
programs.nixvim.plugins.which-key = {
enable = true;
settings = {
delay = 500; # Time in ms before popup shows
icons = {
breadcrumb = "»";
separator = "";
group = "+";
};
# Organize keymaps into named groups
spec = [
# Leader key groups
{
__unkeyed-1 = "<leader>a";
group = "Avante AI";
icon = "🤖";
}
{
__unkeyed-1 = "<leader>f";
group = "Find/Files/Terminal";
icon = "🔍";
}
{
__unkeyed-1 = "<leader>m";
group = "Molten (Jupyter)";
icon = "📓";
}
{
__unkeyed-1 = "<leader>o";
group = "OpenSCAD";
icon = "🔧";
}
# Bracket navigation groups
{
__unkeyed-1 = "[";
group = "Previous";
icon = "";
}
{
__unkeyed-1 = "]";
group = "Next";
icon = "";
}
# g prefix groups
{
__unkeyed-1 = "g";
group = "Go/LSP";
icon = "🎯";
}
{
__unkeyed-1 = "gr";
group = "LSP References/Rename";
icon = "🔗";
}
{
__unkeyed-1 = "gc";
group = "Comments";
icon = "💬";
}
# l prefix
{
__unkeyed-1 = "<leader>l";
group = "Live Server";
icon = "🌐";
}
# z prefix
{
__unkeyed-1 = "z";
group = "Folds/Spell";
icon = "📋";
}
];
# Hide specific mappings to reduce clutter
disable = {
builtin_keys = {
# Hide these default vim keys from which-key
i = [ "<C-R>" "<C-W>" ];
n = [ "<C-W>" ];
};
};
};
};
}

View File

@@ -10,6 +10,7 @@
ripgrep
gh # Move to git
zoxide # Move to fish
unrar
# programming languages
#mise # node, deno, bun, rust, python, etc.

26
home/python.nix Normal file
View File

@@ -0,0 +1,26 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
# Python 3.13 (newest stable)
python313
python313Packages.pip
python313Packages.virtualenv
# Additional useful tools
python313Packages.pipx # Install Python apps in isolated environments
uv # Fast Python package installer (alternative to pip)
];
# Set up default Python version
home.sessionVariables = { PYTHON = "${pkgs.python313}/bin/python3"; };
# Shell aliases for convenience
programs.zsh.shellAliases = {
venv = "python3 -m venv";
activate = "source venv/bin/activate";
};
programs.fish.shellAliases = {
venv = "python3 -m venv";
activate = "source venv/bin/activate.fish";
};
}

View File

@@ -7,6 +7,9 @@
tree
fastfetch # system stats
tabiew # Table viewer
glow # MD Viewer
llm # LLM in the Terminal
# Fun stuff
lolcat
@@ -87,7 +90,12 @@
"sudo darwin-rebuild switch --flake ~/.config/nix#cyper-mac";
};
initContent = "fastfetch";
initContent = ''
fastfetch
ai() {
llm -m groq/groq/compound "$@" | glow
}
'';
};
programs.fish = {
@@ -109,6 +117,12 @@
fastfetch
end
'';
functions.ai = {
body = ''
llm -m groq/groq/compound $argv | glow
'';
};
};
programs.starship = {