diff --git a/darwin/homebrew.nix b/darwin/homebrew.nix index 757d4dc..e593081 100644 --- a/darwin/homebrew.nix +++ b/darwin/homebrew.nix @@ -15,6 +15,7 @@ # nixpkgs is best for CLI tools casks = [ "element" + "affinity" ]; brews = [ ]; diff --git a/darwin/settings.nix b/darwin/settings.nix index ca23586..a1b619c 100644 --- a/darwin/settings.nix +++ b/darwin/settings.nix @@ -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"; } ]; diff --git a/darwin/yabai.nix b/darwin/yabai.nix index 23f12f8..ba4c085 100644 --- a/darwin/yabai.nix +++ b/darwin/yabai.nix @@ -39,67 +39,67 @@ }; }; - 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" + # 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" - # 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 + # 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 - # 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 + # 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 - # 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 + # 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 - # 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 + # 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 - # Screenshot (macOS native) - cmd - z : screencapture -i ~/Pictures/Screenshots/$(date +%s).png - cmd - u : screencapture ~/Pictures/Screenshots/$(date +%s).png + # Screenshot (macOS native) + # 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' + # 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' - # Lock screen - cmd - m : pmset displaysleepnow + # Lock screen + # 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 + # 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 - # Reload skhd config - cmd + shift - r : skhd --reload - ''; - }; + # Reload skhd config + # cmd + shift - r : skhd --reload + # ''; + # }; }; } diff --git a/home/default.nix b/home/default.nix index 5e3f1b3..78521c9 100644 --- a/home/default.nix +++ b/home/default.nix @@ -7,6 +7,7 @@ inputs.nixvim.homeModules.nixvim ./neovim + ./python.nix inputs.nixcord.homeModules.nixcord ./nixcord.nix diff --git a/home/desktop/sketchybar.nix b/home/desktop/sketchybar.nix index c613eaf..90d3ae4 100644 --- a/home/desktop/sketchybar.nix +++ b/home/desktop/sketchybar.nix @@ -1,6 +1,7 @@ -_: { +{ pkgs, ... }: { programs.sketchybar = { enable = true; - + configType = "lua"; + sbarLuaPackage = pkgs.sbarlua; }; } diff --git a/home/neovim/default.nix b/home/neovim/default.nix index 548e2ee..2cc369b 100644 --- a/home/neovim/default.nix +++ b/home/neovim/default.nix @@ -12,6 +12,9 @@ ./alpha.nix ./avante.nix ./openscad.nix + ./jupytext.nix + ./live-server.nix + ./which-key.nix ]; programs.nixvim = { diff --git a/home/neovim/jupytext.nix b/home/neovim/jupytext.nix new file mode 100644 index 0000000..048ebfc --- /dev/null +++ b/home/neovim/jupytext.nix @@ -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"; + }; + }; +} diff --git a/home/neovim/live-server.nix b/home/neovim/live-server.nix new file mode 100644 index 0000000..20a13f1 --- /dev/null +++ b/home/neovim/live-server.nix @@ -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 = "ls"; + action = + "terminal browser-sync start --server --files '*.html, *.css, *.js' --no-notify"; + options.desc = "Start live server (browser-sync)"; + }]; + + extraPackages = with pkgs; [ nodePackages.browser-sync ]; + }; +} diff --git a/home/neovim/which-key.nix b/home/neovim/which-key.nix new file mode 100644 index 0000000..ade48c6 --- /dev/null +++ b/home/neovim/which-key.nix @@ -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 = "a"; + group = "Avante AI"; + icon = "๐Ÿค–"; + } + { + __unkeyed-1 = "f"; + group = "Find/Files/Terminal"; + icon = "๐Ÿ”"; + } + { + __unkeyed-1 = "m"; + group = "Molten (Jupyter)"; + icon = "๐Ÿ““"; + } + { + __unkeyed-1 = "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 = "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 = [ "" "" ]; + n = [ "" ]; + }; + }; + }; + }; +} diff --git a/home/packages.nix b/home/packages.nix index 297f048..5761119 100644 --- a/home/packages.nix +++ b/home/packages.nix @@ -10,6 +10,7 @@ ripgrep gh # Move to git zoxide # Move to fish + unrar # programming languages #mise # node, deno, bun, rust, python, etc. diff --git a/home/python.nix b/home/python.nix new file mode 100644 index 0000000..be4b85d --- /dev/null +++ b/home/python.nix @@ -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"; + }; +} diff --git a/home/shell.nix b/home/shell.nix index 6ed1481..9c715ad 100644 --- a/home/shell.nix +++ b/home/shell.nix @@ -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 = {