diff --git a/modules/darwin/home-manager.nix b/modules/darwin/home-manager.nix index 75d4ae5..2b67b92 100644 --- a/modules/darwin/home-manager.nix +++ b/modules/darwin/home-manager.nix @@ -61,7 +61,7 @@ in "Affinity Publisher 2" = 1606941598; # "DaisyDisk" = 409907375; # (4.32) # Don't use this, we need the official version that is not sandboxed "Fantastical - Calendar" = 975937182; - " Fedistar" = 6445863996; # (1.13.1) + "Fedistar" = 6445863996; # (1.13.1) "Home Assistant" = 1099568401; # (2025.7.1) "Ice Cubes for Mastodon" = 6444915884; # (1.11.3) "LibreOffice" = 1630474372; @@ -93,12 +93,120 @@ in home = { enableNixpkgsReleaseCheck = false; packages = pkgs.callPackage ./packages.nix { inherit llm-agents; }; - file = additionalFiles // { "emacs-launcher.command".source = myEmacsLauncher; }; - + file = additionalFiles // { + "emacs-launcher.command".source = myEmacsLauncher; + }; stateVersion = "23.11"; }; + catppuccin = { + autoEnable = true; + enable = true; + flavor = "mocha"; + }; programs = { - gpg.enable = true; + alacritty = { + enable = true; + settings = { + cursor = { + style = "Block"; + }; + + window = { + opacity = 1.0; + padding = { + x = 24; + y = 24; + }; + }; + + font = { + normal = { + family = "MesloLGS NF"; + style = "Regular"; + }; + size = lib.mkMerge [ + (lib.mkIf pkgs.stdenv.hostPlatform.isLinux 10) + (lib.mkIf pkgs.stdenv.hostPlatform.isDarwin 14) + ]; + }; + + dynamic_padding = true; + decorations = "full"; + title = "Terminal"; + class = { + instance = "Alacritty"; + general = "Alacritty"; + }; + + colors = { + primary = { + background = "0x1f2528"; + foreground = "0xc0c5ce"; + }; + + normal = { + black = "0x1f2528"; + red = "0xec5f67"; + green = "0x99c794"; + yellow = "0xfac863"; + blue = "0x6699cc"; + magenta = "0xc594c5"; + cyan = "0x5fb3b3"; + white = "0xc0c5ce"; + }; + + bright = { + black = "0x65737e"; + red = "0xec5f67"; + green = "0x99c794"; + yellow = "0xfac863"; + blue = "0x6699cc"; + magenta = "0xc594c5"; + cyan = "0x5fb3b3"; + white = "0xd8dee9"; + }; + }; + }; + }; + + ssh = { + enable = true; + + enableDefaultConfig = false; + settings = { + "*" = { + forwardAgent = false; + addKeysToAgent = "no"; + compression = false; + serverAliveInterval = 0; + serverAliveCountMax = 3; + hashKnownHosts = false; + userKnownHostsFile = "~/.ssh/known_hosts"; + controlMaster = "no"; + controlPath = "~/.ssh/master-%r@%n:%p"; + controlPersist = "no"; + }; + "moonunit.kolkman.org" = { + hostname = "moonunit.kolkman.org"; + user = "root"; + port = 2222; + }; + }; + includes = [ + (lib.mkIf pkgs.stdenv.hostPlatform.isLinux "/home/${user}/.ssh/config_external") + (lib.mkIf pkgs.stdenv.hostPlatform.isDarwin "/Users/${user}/.ssh/config_external") + ]; + }; + + gpg = { + enable = true; + settings = { + default-key = "01B157D574FEDBB2"; + no-emit-version = true; + auto-key-retrieve = true; + personal-digest-preferences = "SHA512 SHA384 SHA256 SHA224"; + }; + }; zsh = { enable = true; @@ -258,7 +366,7 @@ in let g:airline_powerline_fonts = 1 "" Local keys and such - let mapleader="," + let mapleader="," let maplocalleader=" " "" Change cursor on mode @@ -289,28 +397,128 @@ in nnoremap j nnoremap k nnoremap l + + "" Easier to yank entire line + nnoremap Y y$ + + "" Move buffers + nnoremap :bnext + nnoremap :bprev + + "" Like a boss, sudo AFTER opening the file to write + cmap w!! w !sudo tee % >/dev/null + + let g:startify_lists = [ + \ { 'type': 'dir', 'header': [' Current Directory '. getcwd()] }, + \ { 'type': 'sessions', 'header': [' Sessions'] }, + \ { 'type': 'bookmarks', 'header': [' Bookmarks'] } + \ ] + + let g:startify_bookmarks = [ + \ '~/.local/share/src', + \ ] + + let g:airline_theme='bubblegum' + let g:airline_powerline_fonts = 1 + ''; + }; + + tmux = { + enable = true; + plugins = with pkgs.tmuxPlugins; [ + vim-tmux-navigator + sensible + yank + prefix-highlight + { + plugin = power-theme; + extraConfig = '' + set -g @tmux_power_theme 'gold' + ''; + } + { + plugin = resurrect; # Used by tmux-continuum + + # Use XDG data directory + # https://github.com/tmux-plugins/tmux-resurrect/issues/348 + extraConfig = '' + set -g @resurrect-dir '$HOME/.cache/tmux/resurrect' + set -g @resurrect-capture-pane-contents 'on' + set -g @resurrect-pane-contents-area 'visible' + ''; + } + { + plugin = continuum; + extraConfig = '' + set -g @continuum-restore 'on' + set -g @continuum-save-interval '5' # minutes + ''; + } + ]; + terminal = "screen-256color"; + prefix = "C-x"; + escapeTime = 10; + historyLimit = 50000; + extraConfig = '' + # Remove Vim mode delays + set -g focus-events on + + # Enable full mouse support + set -g mouse on + + # ----------------------------------------------------------------------------- + # Key bindings + # ----------------------------------------------------------------------------- + + # Unbind default keys + unbind C-b + unbind '"' + unbind % + + # Split panes, vertical or horizontal + bind-key x split-window -v + bind-key v split-window -h + + # Move around panes with vim-like bindings (h,j,k,l) + bind-key -n M-k select-pane -U + bind-key -n M-h select-pane -L + bind-key -n M-j select-pane -D + bind-key -n M-l select-pane -R + + # Smart pane switching with awareness of Vim splits. + # This is copy paste from https://github.com/christoomey/vim-tmux-navigator + is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" + bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' + bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' + bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' + bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' + tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' + if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'" + if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'" + + bind-key -T copy-mode-vi 'C-h' select-pane -L + bind-key -T copy-mode-vi 'C-j' select-pane -D + bind-key -T copy-mode-vi 'C-k' select-pane -U + bind-key -T copy-mode-vi 'C-l' select-pane -R + bind-key -T copy-mode-vi 'C-\' select-pane -l ''; }; }; - - catppuccin = { - autoEnable = true; - enable = true; - flavor = "mocha"; - }; - services = { gpg-agent = { enable = true; enableSshSupport = true; extraConfig = '' - default-cache-ttl 600 - max-cache-ttl 7200 - pinentry-program /Users/olaf/.nix-profile/bin/pinentry-mac + default-cache-ttl 600 + max-cache-ttl 7200 + pinentry-program /Users/olaf/.nix-profile/bin/pinentry-mac ''; }; }; - + # Marked broken Oct 20, 2022 check later to remove this # https://github.com/nix-community/home-manager/issues/3344 manual.manpages.enable = false;