From 2b7f85b82a67e6eaa49392c49a525171799d61bc Mon Sep 17 00:00:00 2001 From: Salar Rahmanian Date: Fri, 14 Mar 2025 19:24:12 -0700 Subject: [PATCH 1/3] Add jetbrains mono and firacode fonts & flake update --- flake.lock | 24 ++++++++++++------------ home.nix | 2 ++ programs/wezterm/wezterm.lua | 6 +++++- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/flake.lock b/flake.lock index 2ade29b..c197af5 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1741543064, - "narHash": "sha256-AjXyS3ACxWAd+h3NSkrflN+uC0Tq1XFqox472RF6yh0=", + "lastModified": 1741635347, + "narHash": "sha256-2aYfV44h18alHXopyfL4D9GsnpE5XlSVkp4MGe586VU=", "owner": "nix-community", "repo": "home-manager", - "rev": "db4386d686fb0b2788e7422e6a2299deace9c4b1", + "rev": "7fb8678716c158642ac42f9ff7a18c0800fea551", "type": "github" }, "original": { @@ -63,11 +63,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1741402956, - "narHash": "sha256-y2hByvBM03s9T2fpeLjW6iprbxnhV9mJMmSwCHc41ZQ=", + "lastModified": 1741462378, + "narHash": "sha256-ZF3YOjq+vTcH51S+qWa1oGA9FgmdJ67nTNPG2OIlXDc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ed0b1881565c1ffef490c10d663d4f542031dad3", + "rev": "2d9e4457f8e83120c9fdf6f1707ed0bc603e5ac9", "type": "github" }, "original": { @@ -79,11 +79,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1741379970, - "narHash": "sha256-Wh7esNh7G24qYleLvgOSY/7HlDUzWaL/n4qzlBePpiw=", + "lastModified": 1741513245, + "narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "36fd87baa9083f34f7f5027900b62ee6d09b1f2f", + "rev": "e3e32b642a31e6714ec1b712de8c91a3352ce7e1", "type": "github" }, "original": { @@ -100,11 +100,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1741560307, - "narHash": "sha256-sS25HPoonksGtSmQsOyMVESYLDxxUZVmEQGPGlHWHIk=", + "lastModified": 1741670434, + "narHash": "sha256-/HwQwLHJVGHSnxiQJTu6c5m8YwS1tl3KVt3fBVrNkGk=", "owner": "nix-community", "repo": "nur", - "rev": "4ae43b04c54350575c1e0fd6ee1547629b2e06ff", + "rev": "0da9e38262198c1a7b674c8fefdff5184dacaae6", "type": "github" }, "original": { diff --git a/home.nix b/home.nix index 715a86d..0913ae7 100644 --- a/home.nix +++ b/home.nix @@ -49,6 +49,7 @@ gnupg go graphviz + jetbrains-mono jq-lsp luajit lua-language-server @@ -61,6 +62,7 @@ mypy neofetch neovim + nerd-fonts.fira-code nil niv nixd diff --git a/programs/wezterm/wezterm.lua b/programs/wezterm/wezterm.lua index 3d44046..4fc0f07 100644 --- a/programs/wezterm/wezterm.lua +++ b/programs/wezterm/wezterm.lua @@ -19,7 +19,11 @@ return { -- color_scheme = 'tokyonight', color_scheme = 'Tango (terminal.sexy)', -- default_gui_startup_args = { 'connect', 'unix' }, - font = wezterm.font 'SF Mono', + font = wezterm.font_with_fallback { + 'SF Mono', + 'JetBrains Mono', + 'Fira Code', + }, font_size = 16, dpi = 144, scrollback_lines = 50000, From 03cfe695a0e6f6645bb44a535683f564eb6229cc Mon Sep 17 00:00:00 2001 From: Salar Rahmanian Date: Sat, 15 Mar 2025 16:11:29 -0700 Subject: [PATCH 2/3] flake update --- flake.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index c197af5..9527277 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1741635347, - "narHash": "sha256-2aYfV44h18alHXopyfL4D9GsnpE5XlSVkp4MGe586VU=", + "lastModified": 1742588233, + "narHash": "sha256-Fi5g8H5FXMSRqy+mU6gPG0v+C9pzjYbkkiePtz8+PpA=", "owner": "nix-community", "repo": "home-manager", - "rev": "7fb8678716c158642ac42f9ff7a18c0800fea551", + "rev": "296ddc64627f4a6a4eb447852d7346b9dd16197d", "type": "github" }, "original": { @@ -48,11 +48,11 @@ ] }, "locked": { - "lastModified": 1741229100, - "narHash": "sha256-0HwrTDXp9buEwal/1ymK9uQmzUD5ozIA7CJGqnT/gLs=", + "lastModified": 1742595055, + "narHash": "sha256-cEetDber6LF8W4ThmRc4rwKs/o8y2GH0pUdX7e6CnAQ=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "adf5c88ba1fe21af5c083b4d655004431f20c5ab", + "rev": "e9f41de2a81f04390afd106959adf352a207628f", "type": "github" }, "original": { @@ -63,11 +63,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1741462378, - "narHash": "sha256-ZF3YOjq+vTcH51S+qWa1oGA9FgmdJ67nTNPG2OIlXDc=", + "lastModified": 1742578646, + "narHash": "sha256-GiQ40ndXRnmmbDZvuv762vS+gew1uDpFwOfgJ8tLiEs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2d9e4457f8e83120c9fdf6f1707ed0bc603e5ac9", + "rev": "94c4dbe77c0740ebba36c173672ca15a7926c993", "type": "github" }, "original": { @@ -79,11 +79,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1741513245, - "narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=", + "lastModified": 1742422364, + "narHash": "sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e3e32b642a31e6714ec1b712de8c91a3352ce7e1", + "rev": "a84ebe20c6bc2ecbcfb000a50776219f48d134cc", "type": "github" }, "original": { @@ -100,11 +100,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1741670434, - "narHash": "sha256-/HwQwLHJVGHSnxiQJTu6c5m8YwS1tl3KVt3fBVrNkGk=", + "lastModified": 1742621235, + "narHash": "sha256-+zILWE0iMAb/U7P/WK+3+ami9F13zLAYT5bwt69veww=", "owner": "nix-community", "repo": "nur", - "rev": "0da9e38262198c1a7b674c8fefdff5184dacaae6", + "rev": "c72c4acc9a04d2d242c9dadfee75d358d75a9e38", "type": "github" }, "original": { From c08179669964d62269b716875af9e9eca4b38996 Mon Sep 17 00:00:00 2001 From: Salar Rahmanian Date: Sat, 22 Mar 2025 22:36:33 -0700 Subject: [PATCH 3/3] remove wezterm,tmux,ghostty and add kitty back --- flake.lock | 12 ++-- home.nix | 20 ++++++ programs/default.nix | 2 - programs/ghostty/default.nix | 21 ------ programs/tmux/default.nix | 30 -------- programs/tmux/tmux.conf | 110 ---------------------------- programs/wezterm/default.nix | 11 --- programs/wezterm/wezterm.lua | 134 ----------------------------------- 8 files changed, 26 insertions(+), 314 deletions(-) delete mode 100644 programs/ghostty/default.nix delete mode 100644 programs/tmux/default.nix delete mode 100644 programs/tmux/tmux.conf delete mode 100644 programs/wezterm/default.nix delete mode 100644 programs/wezterm/wezterm.lua diff --git a/flake.lock b/flake.lock index 9527277..d4975f3 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1742588233, - "narHash": "sha256-Fi5g8H5FXMSRqy+mU6gPG0v+C9pzjYbkkiePtz8+PpA=", + "lastModified": 1742670145, + "narHash": "sha256-xQ2F9f+ICAGBp/nNv3ddD2U4ZvzuLOci0u/5lyMXPvk=", "owner": "nix-community", "repo": "home-manager", - "rev": "296ddc64627f4a6a4eb447852d7346b9dd16197d", + "rev": "63e77d09a133ac641a0c204e7cfb0c97e133706d", "type": "github" }, "original": { @@ -100,11 +100,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1742621235, - "narHash": "sha256-+zILWE0iMAb/U7P/WK+3+ami9F13zLAYT5bwt69veww=", + "lastModified": 1742679909, + "narHash": "sha256-t00hcdDSGhMKd6hhQo0zOkQ5mTOPlim4HKX3l3l0b9M=", "owner": "nix-community", "repo": "nur", - "rev": "c72c4acc9a04d2d242c9dadfee75d358d75a9e38", + "rev": "635036ec7ec1fce48d678acfbc84b83c4d44ec41", "type": "github" }, "original": { diff --git a/home.nix b/home.nix index 0913ae7..fc90df3 100644 --- a/home.nix +++ b/home.nix @@ -192,6 +192,26 @@ enable = true; }; + programs.kitty = { + enable = true; + keybindings = { + "kitty_mod+enter" = "new_window_with_cwd"; + }; + themeFile = "Tango_Dark"; + font = { + name = "SF Mono"; + size = 16; + }; + settings = { + copy_on_select = true; + enabled_layouts = "*"; + macos_quit_when_last_window_closed = true; + scrollback_lines = 100000; + kitty_mod = "cmd+option"; + }; + shellIntegration.enableFishIntegration = true; + }; + programs.lazygit = { enable = true; }; diff --git a/programs/default.nix b/programs/default.nix index dd508ca..5ea8a15 100644 --- a/programs/default.nix +++ b/programs/default.nix @@ -4,8 +4,6 @@ ./fish ./git ./jujutsu - ./tmux - ./wezterm ./vscode ./zed ] diff --git a/programs/ghostty/default.nix b/programs/ghostty/default.nix deleted file mode 100644 index 16fe39e..0000000 --- a/programs/ghostty/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ pkgs, ... }: -let - mySettings = { - copy-on-select = "clipboard"; - font-family = "SF Mono"; - font-size = 16; - macos-title-bar-style = "transparent"; - theme = "Builtin Tango Dark"; - window-inherit-working-directory = true; - working-directory = "home"; - }; -in -{ - programs.ghostty = { - enable = true; - enableFishIntegration = true; - installBatSyntax = true; - installVimSyntax = true; - settings = mySettings; - }; -} diff --git a/programs/tmux/default.nix b/programs/tmux/default.nix deleted file mode 100644 index eb1d2ea..0000000 --- a/programs/tmux/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ pkgs, ... }: - -let - tmuxConfig = builtins.readFile ./tmux.conf; -in -{ - programs.tmux = { - enable = true; - baseIndex = 1; - escapeTime = 10; - historyLimit = 10000; - keyMode = "vi"; - prefix = "C-a"; - terminal = "xterm-256color"; - extraConfig = tmuxConfig; - plugins = with pkgs; [ - { - plugin = tmuxPlugins.resurrect; - extraConfig = "set -g @resurrect-strategy-nvim 'session'"; - } - { - plugin = tmuxPlugins.continuum; - extraConfig = "set -g @continuum-restore 'on'"; - } - { plugin = tmuxPlugins.sensible; } - { plugin = tmuxPlugins.vim-tmux-navigator; } - { plugin = tmuxPlugins.onedark-theme; } - ]; - }; -} diff --git a/programs/tmux/tmux.conf b/programs/tmux/tmux.conf deleted file mode 100644 index e2b72b3..0000000 --- a/programs/tmux/tmux.conf +++ /dev/null @@ -1,110 +0,0 @@ -########################## -# Configuration -########################### - -# use 256 xterm for pretty colors. This enables same colors from iTerm2 within tmux. -# This is recommended in neovim :healthcheck -# set -g default-terminal "screen-256color" -# set -ga terminal-overrides ",xterm-256color:Tc" - -# disable mouse -set -g mouse off - -# decrease command delay (increases vim responsiveness) -set -sg escape-time 1 - -# increase repeat time for repeatable commands -set -g repeat-time 1000 - -# start pane index at 1 instead of 0 -setw -g pane-base-index 1 - -# highlight window when it has new activity -setw -g monitor-activity on -set -g visual-activity on - -# re-number windows when one is closed -set -g renumber-windows on - -# enable pbcopy and pbpaste -# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/blob/master/README.md -# set-option -g default-command "reattach-to-user-namespace -l zsh" - -########################### -# Key Bindings -########################### - -# Tmux prefix -# Current solution is to keep the default -# and have term map C-; to C-b. This is the nicest -# bind I've found and this is the only way to enable it in tmux -# unbind C-b -# set -g prefix C-a -# bind C-a send-prefix - -# Copy vim style -# create 'v' alias for selecting text -bind Escape copy-mode -bind C-[ copy-mode -bind -T copy-mode-vi 'v' send -X begin-selection -# copy with 'enter' or 'y' and send to mac os clipboard: http://goo.gl/2Bfn8 -unbind -T copy-mode-vi Enter -bind -T copy-mode-vi Enter send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" -bind -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" -# paste -bind p paste-buffer -# paste from system clipboard MacOS -# bind C-v run \"tmux set-buffer \"$(reattach-to-user-namespace pbpaste)\"; tmux paste-buffer" - -# panes: window splitting -unbind % -bind | split-window -h -unbind '"' -bind - split-window -v - -# Switch panes with hjkl -bind h select-pane -L -bind j select-pane -D -bind k select-pane -U -bind l select-pane -R - -# Quick window selection -bind -r C-h select-window -t :- -bind -r C-l select-window -t :+ - -# resize panes -bind -r H resize-pane -L 5 -bind -r J resize-pane -D 5 -bind -r K resize-pane -U 5 -bind -r L resize-pane -R 5 - -## Quickly switch panes -unbind ^J -bind ^J select-pane -t :.+ - -############################ -## Status Bar -############################ - -# enable UTF-8 support in status bar -set -gq status-utf8 on - -# center the status bar -set -g status-justify centre - -# show session, window, pane in left status bar -set -g status-left-length 40 -set -g status-left '#[fg=green] #S #[fg=yellow]#I/#[fg=cyan]#P ' - -# update status bar info -set -g status-interval 60 - -########################### -# Colors -########################### - -# onedark color scheme -set -g @onedark_widgets "#(date +%s)" -set -g @onedark_time_format "%I:%M %p" -set -g @onedark_date_format "%D" - diff --git a/programs/wezterm/default.nix b/programs/wezterm/default.nix deleted file mode 100644 index c63a016..0000000 --- a/programs/wezterm/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: - -let - weztermConfig = builtins.readFile ./wezterm.lua; -in -{ - programs.wezterm = { - enable = true; - extraConfig = weztermConfig; - }; -} diff --git a/programs/wezterm/wezterm.lua b/programs/wezterm/wezterm.lua deleted file mode 100644 index 4fc0f07..0000000 --- a/programs/wezterm/wezterm.lua +++ /dev/null @@ -1,134 +0,0 @@ -local wezterm = require 'wezterm' -local mux = wezterm.mux -local act = wezterm.action - -wezterm.on('update-right-status', function(window, pane) - window:set_right_status(window:active_workspace()) -end) - -wezterm.on('gui-startup', function(cmd) - local tab, pane, window = mux.spawn_window(cmd or {}) - window:gui_window():maximize() - pane:split { size = 0.2 } -end) - -return { - adjust_window_size_when_changing_font_size = false, - check_for_updates = false, - -- color_scheme = "Gruvbox Light"; - -- color_scheme = 'tokyonight', - color_scheme = 'Tango (terminal.sexy)', - -- default_gui_startup_args = { 'connect', 'unix' }, - font = wezterm.font_with_fallback { - 'SF Mono', - 'JetBrains Mono', - 'Fira Code', - }, - font_size = 16, - dpi = 144, - scrollback_lines = 50000, - initial_cols = 400, - initial_rows = 80, - leader = { key = 'b', mods = 'SUPER', timeout_milliseconds = 1000 }, - default_prog = { '/etc/profiles/per-user/salar/bin/fish' }, - window_decorations = 'RESIZE', - -- window_background_image = '/Users/salar/.config/nixpkgs/programs/wezterm/bridge.jpg', - ssh_domains = { - { - name = 'hcloud1', - remote_address = 'hcloud1.softinio.net', - username = 'salar', - remote_wezterm_path = '/run/current-system/sw/bin/wezterm', - }, - }, - unix_domains = { - { - name = 'unix', - proxy_command = { 'nc', '-U', '/Users/salar/.local/share/wezterm/sock' }, - }, - }, - keys = { - { key = '-', mods = 'LEADER', action = wezterm.action { SplitVertical = { domain = 'CurrentPaneDomain' } } }, - { key = "'", mods = 'LEADER', action = wezterm.action { SplitHorizontal = { domain = 'CurrentPaneDomain' } } }, - { key = 'k', mods = 'SUPER', action = act.TogglePaneZoomState }, - { key = 'h', mods = 'LEADER', action = wezterm.action { ActivatePaneDirection = 'Left' } }, - { key = 'j', mods = 'LEADER', action = wezterm.action { ActivatePaneDirection = 'Down' } }, - { key = 'k', mods = 'LEADER', action = wezterm.action { ActivatePaneDirection = 'Up' } }, - { key = 'l', mods = 'LEADER', action = wezterm.action { ActivatePaneDirection = 'Right' } }, - { key = 'H', mods = 'LEADER|SHIFT', action = wezterm.action { AdjustPaneSize = { 'Left', 5 } } }, - { key = 'J', mods = 'LEADER|SHIFT', action = wezterm.action { AdjustPaneSize = { 'Down', 5 } } }, - { key = 'K', mods = 'LEADER|SHIFT', action = wezterm.action { AdjustPaneSize = { 'Up', 5 } } }, - { key = 'L', mods = 'LEADER|SHIFT', action = wezterm.action { AdjustPaneSize = { 'Right', 5 } } }, - { key = '1', mods = 'LEADER', action = wezterm.action { ActivateTab = 0 } }, - { key = '2', mods = 'LEADER', action = wezterm.action { ActivateTab = 1 } }, - { key = '3', mods = 'LEADER', action = wezterm.action { ActivateTab = 2 } }, - { key = '4', mods = 'LEADER', action = wezterm.action { ActivateTab = 3 } }, - { key = '5', mods = 'LEADER', action = wezterm.action { ActivateTab = 4 } }, - { key = '6', mods = 'LEADER', action = wezterm.action { ActivateTab = 5 } }, - { key = '7', mods = 'LEADER', action = wezterm.action { ActivateTab = 6 } }, - { key = '8', mods = 'LEADER', action = wezterm.action { ActivateTab = 7 } }, - { key = '9', mods = 'LEADER', action = wezterm.action { ActivateTab = 8 } }, - { key = '&', mods = 'LEADER', action = wezterm.action { CloseCurrentTab = { confirm = true } } }, - { key = 'x', mods = 'LEADER', action = wezterm.action { CloseCurrentPane = { confirm = true } } }, - { key = 'Enter', mods = 'ALT', action = act.DisableDefaultAssignment }, - { key = 'c', mods = 'SUPER', action = act.CopyTo 'Clipboard' }, - { key = 'v', mods = 'SUPER', action = act.PasteFrom 'Clipboard' }, - { key = 'n', mods = 'SUPER', action = act.SpawnWindow }, - { key = 't', mods = 'SUPER', action = act.SpawnTab 'CurrentPaneDomain' }, - { key = 'h', mods = 'SUPER', action = act { SpawnCommandInNewTab = { cwd = wezterm.home_dir } } }, - { key = 'q', mods = 'SUPER', action = act.QuitApplication }, - { key = 'i', mods = 'CTRL|SHIFT', action = act.SwitchToWorkspace }, - { - key = '8', - mods = 'ALT', - action = wezterm.action_callback(function(window, pane) - -- Here you can dynamically construct a longer list if needed - - local home = wezterm.home_dir - local workspaces = { - { id = home, label = 'Home' }, - { id = home .. '/Projects', label = 'My Projects' }, - { id = home .. '/OpenSource', label = 'Open Source Projects' }, - { id = home .. '/.config/nixpkgs', label = 'Nix Config' }, - { id = home .. '/Projects/scalanews', label = 'Scala News' }, - } - - window:perform_action( - act.InputSelector { - action = wezterm.action_callback(function(inner_window, inner_pane, id, label) - if not id and not label then - wezterm.log_info 'cancelled' - else - wezterm.log_info('id = ' .. id) - wezterm.log_info('label = ' .. label) - inner_window:perform_action( - act.SwitchToWorkspace { - name = label, - spawn = { - label = 'Workspace: ' .. label, - cwd = id, - }, - }, - inner_pane - ) - end - end), - title = 'Choose Workspace', - choices = workspaces, - fuzzy = true, - fuzzy_description = 'Fuzzy find and/or make a workspace', - }, - pane - ) - end), - }, - { - key = '9', - mods = 'ALT', - action = act.ShowLauncherArgs { - flags = 'FUZZY|WORKSPACES', - }, - }, - { key = 'Tab', mods = 'CTRL', action = wezterm.action.DisableDefaultAssignment }, - }, -}