From ce8580e840c9f822335915858ddc02f6da84909d Mon Sep 17 00:00:00 2001 From: chloe caruso Date: Sun, 17 Aug 2025 21:37:26 -0700 Subject: [PATCH 1/4] chore: add mailmap file --- .mailmap | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .mailmap diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000000000000000000000000000000000000..e386ca3bd8d2c2c5243c60eca9fb27fcd0db795c --- /dev/null +++ b/.mailmap @@ -0,0 +1,3 @@ +# To learn more about git's mailmap: https://ntietz.com/blog/git-mailmap-for-name-changes +chloe caruso +Natalie Marks -- 2.54.0 From 6cb28f1a2d717ec69b30a80d9504702e54721f59 Mon Sep 17 00:00:00 2001 From: chloe caruso Date: Mon, 18 Aug 2025 00:25:23 -0700 Subject: [PATCH 2/4] feat: nix keybind system, delete snacks, add lazygit/fzf i've had issues with snacks' file tree, to the point where the delete operation would corrupt my editor state. the worst of which being a bug that caused my entire project to get deleted when pressing 'd' on a directory with corrupt state[1]. it's unacceptable, and i no longer trust any of the 'snacks.nvim' project. the neotree plugin is much nicer in my opinion, and what's great about it is there is a easy command list by pressing '?' on the file view. the big part of this commit is introducing 'vim.keybinds' (not to be confused with the existing 'keymaps' array). we now have a centralized system for defining keyboard shortcuts. in theory, user configs can override my default keymap, but i think the current users will appreciate these default settings. theres a handful of built-in keybinds for activating the newly added fzf-lua plugin (replaces telescope and snacks' pickers, losing no functionality). as one bonus treat, leader g g for integrated lazygit! [1]: https://paperclover.dev/clo/sitegen/commit/af60d1172fd981344cfb3c119a68d9b88b0a8dbd --- modules/neovim/default.nix | 140 +++++++++++++------------------------ modules/neovim/keybind.nix | 83 ++++++++++++++++++++++ modules/neovim/lib.lua | 27 +++++++ 3 files changed, 160 insertions(+), 90 deletions(-) create mode 100644 modules/neovim/keybind.nix create mode 100644 modules/neovim/lib.lua diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix index 80bd3a11d2307dbb0ea0f5be5c87d650ffb252ab..734dd030eed4694a880def43111531c0e0a9e66f 100644 --- a/modules/neovim/default.nix +++ b/modules/neovim/default.nix @@ -6,8 +6,9 @@ }: { imports = [ - ./options.nix ./formatter.nix + ./keybind.nix + ./options.nix ]; # based on default options from upstream: # https://github.com/NotAShelf/nvf/blob/main/configuration.nix @@ -18,6 +19,10 @@ # override level 999 is used to not conflict with mkDefault as used by nvf. # which allows user configurations to disable/override anything here. config.vim = lib.mkOverride 999 { + extraLuaFiles = [ + ./lib.lua + ]; + theme = { enable = true; }; @@ -60,8 +65,8 @@ listReferences = "gr"; goToType = "gy"; hover = "K"; - nextDiagnostic = "d"; - openDiagnosticFloat = "df"; + nextDiagnostic = null; # ]d + openDiagnosticFloat = "d"; renameSymbol = "rn"; documentHighlight = null; listDocumentSymbols = null; @@ -78,11 +83,9 @@ enable = true; addDefaultGrammars = true; }; - debugger = { - nvim-dap = { - enable = true; - ui.enable = true; - }; + debugger.nvim-dap = { + enable = true; + ui.enable = true; }; languages = { enableFormat = true; @@ -96,36 +99,58 @@ clang.enable = true; css.enable = true; html.enable = true; + lua.enable = true; markdown.enable = true; + nix.enable = true; python.enable = true; rust.crates.enable = true; rust.enable = true; ts.enable = true; zig.enable = true; - lua.enable = true; # sort-lines: off - - nix = { - enable = true; - format.type = "nixfmt"; # looks so much nicer - }; }; - filetree = { - neo-tree = { - enable = false; + filetree.neo-tree = { + enable = true; + setupOpts = { + enable_cursor_hijack = true; + git_status_async = true; }; }; - tabline = { - nvimBufferline.enable = true; + fzf-lua = { + enable = true; + setupOpts = { + fzf_colors = true; + }; }; - autocomplete = { - blink-cmp = { - enable = true; - sourcePlugins = { - ripgrep.enable = true; + autocomplete.blink-cmp = { + enable = true; + mappings = { + close = null; + complete = null; + confirm = null; + next = null; + previous = null; + scrollDocsDown = null; + scrollDocsUp = null; + }; + setupOpts = { + keymap = { + preset = "super-tab"; }; - friendly-snippets.enable = true; + completion = { + ghost_text.enabled = false; + list.selection.preselect = true; + trigger = { + show_in_snippet = true; + }; + accept.auto_brackets.enabled = true; + }; + signature.enabled = true; + }; + sourcePlugins = { + ripgrep.enable = true; }; + friendly-snippets.enable = true; }; statusline = { lualine = { @@ -137,71 +162,6 @@ }; }; }; - - utility = { - snacks-nvim = { - enable = true; - setupOpts = { - bigfile.enable = true; - dashboard = { - preset.keys = [ - { - icon = " "; - key = "n"; - desc = "New File"; - action = ":ene | startinsert"; - } - { - icon = " "; - key = "r"; - desc = "Recent Files"; - action = ":lua Snacks.dashboard.pick('oldfiles')"; - } - ]; - sections = [ - { section = "header"; } - { - section = "keys"; - indent = 2; - padding = 1; - } - { - icon = " "; - title = "Projects"; - section = "projects"; - indent = 2; - padding = 1; - } - { - icon = " "; - title = "Git"; - section = "terminal"; - enabled = lib.options.literalExpression '' - function() - return Snacks.git.get_root() ~= nil - end - ''; - cmd = "git status --short --branch --renames"; - height = 10; - padding = 1; - ttl = 5 * 60; - indent = 3; - } - ]; - }; - image = { - enable = true; - math.enabled = false; - }; - notifier.timeout = 3000; - picker = { - enable = true; - sources = { - }; - }; - }; - }; - }; binds = { whichKey.enable = true; cheatsheet.enable = true; diff --git a/modules/neovim/keybind.nix b/modules/neovim/keybind.nix new file mode 100644 index 0000000000000000000000000000000000000000..f5b2d0f994003d57e0621956b21dec43a05416ed --- /dev/null +++ b/modules/neovim/keybind.nix @@ -0,0 +1,83 @@ +# this file implements a keybind system, which is a higher level system +# to configure vim.keymaps (note the different name bind vs map) +{ + pkgs, + lib, + config, + ... +}: +let + keyRemap = mode: key: action: { inherit mode key action; }; + keyCmd = + mode: key: cmd: + keyRemap mode key ":${cmd}"; +in +{ + # default binds + config.vim.keybinds = { + search-commands = keyCmd "n" "?" "FzfLua keymaps"; + + # user interface + toggle-explorer = keyCmd "n" "e" "Neotree toggle"; + reveal-active-file = keyCmd "n" "E" "Neotree reveal:Neotree focus"; + lazygit = keyCmd "n" "gg" "FullscreenTerm ${pkgs.lazygit}/bin/lazygit"; + + # pickers + pick-file = keyCmd "n" "" "FzfLua files"; + pick-mark = keyCmd "n" "'" "FzfLua marks"; + #pick-buffer = keyCmd "n" "b" "FzfLua buffers"; + pick-grep = keyCmd "n" "ff" "FzfLua grep_project"; + pick-recent-command = keyCmd "n" "fc" "FzfLua command_history"; + pick-other = keyCmd "n" "f?" "FzfLua builtin"; # picker of Fzf pickers + + # lsp + code-action = + keyCmd "n" "ca" + "FzfLua lsp_code_actions winopts.height=15 winopts.backdrop=100 winopts.title=false winopts.preview.title=false winopts.row=1"; + + # subtle nice features + visual-dedent = keyRemap "v" "<" "" ">gv"; # keep selection + clear-search-highlights = keyRemap "n" ""; + }; + + # implementation + options.vim.keybinds = lib.mkOption { + type = lib.types.attrsOf ( + lib.types.nullOr ( + lib.types.submodule { + options = { + mode = lib.mkOption { type = lib.types.str; }; + key = lib.mkOption { type = lib.types.str; }; + action = lib.mkOption { type = lib.types.str; }; + }; + } + ) + ); + default = { }; + }; + config.vim.keymaps = + let + titleCase = + str: + lib.concatStringsSep " " ( + map ( + word: + lib.strings.toUpper (builtins.substring 0 1 word) + + builtins.substring 1 (builtins.stringLength word) word + ) (lib.splitString "-" str) + ); + in + builtins.filter (f: f != null) ( + lib.attrsets.mapAttrsToList ( + desc: bind: + if bind != null then + { + desc = titleCase desc; + inherit (bind) mode key action; + } + else + null + ) config.vim.keybinds + ); +} diff --git a/modules/neovim/lib.lua b/modules/neovim/lib.lua new file mode 100644 index 0000000000000000000000000000000000000000..4daeb6b24689ba466bca4a2f7e56ecf314c1a9f9 --- /dev/null +++ b/modules/neovim/lib.lua @@ -0,0 +1,27 @@ +-- Ported from https://www.reddit.com/r/neovim/comments/vemydn +vim.api.nvim_create_user_command("FullscreenTerm", function(opts) + vim.cmd("tab terminal " .. opts.args) + local laststatus = vim.o.laststatus + local showtabline = vim.o.showtabline + local cmdheight = vim.o.cmdheight + vim.o.laststatus = 0 + vim.o.cmdheight = 0 + vim.o.showtabline = 0 + vim.wo.signcolumn = "no" + vim.wo.relativenumber = false + vim.wo.number = false + vim.cmd( + "autocmd! TermClose " + .. "if !v:event.status" + .. " | exec 'bd! '..expand('')" + .. " | endif" + .. " | checktime" + .. " | set laststatus=" + .. laststatus + .. " | set cmdheight=" + .. cmdheight + .. " | set showtabline=" + .. showtabline + ) + vim.cmd("startinsert") +end, { nargs = "*" }) -- 2.54.0 From 13f07b32b0bb8ab1774e7e32344a4537dd957998 Mon Sep 17 00:00:00 2001 From: chloe caruso Date: Mon, 18 Aug 2025 00:25:46 -0700 Subject: [PATCH 3/4] clover: more treats --- users/chloe/home.nix | 1 + users/chloe/paperback/configuration.nix | 5 ++- users/chloe/paperback/home.nix | 2 +- users/chloe/vim.nix | 47 +------------------------ 4 files changed, 7 insertions(+), 48 deletions(-) diff --git a/users/chloe/home.nix b/users/chloe/home.nix index b46fbf4522864d7a6ccf6977e30fd2bcce7a1f59..3fddc2063a6495e1d9f47399a919fab8a7d40728 100644 --- a/users/chloe/home.nix +++ b/users/chloe/home.nix @@ -21,6 +21,7 @@ in # packages to install for desktop environments (non-server) desktop = [ git-town + lazygit ]; # packages to install on all servers server = [ ]; diff --git a/users/chloe/paperback/configuration.nix b/users/chloe/paperback/configuration.nix index 6fc73ce7beb3226fdae02e56d2e1cb4803d09334..3d94126693f8ab3136a138d8b013d6491e67fee4 100644 --- a/users/chloe/paperback/configuration.nix +++ b/users/chloe/paperback/configuration.nix @@ -1,6 +1,9 @@ _: { homebrew = { enable = true; - casks = [ "eloston-chromium" ]; + casks = [ + "eloston-chromium" + "db-browser-for-sqlite" + ]; }; } diff --git a/users/chloe/paperback/home.nix b/users/chloe/paperback/home.nix index e2ce2a753fd26f13d6f5990ad6ad7547f9e5c535..711130f295df837f03f7c41ca2efc7cc64491798 100644 --- a/users/chloe/paperback/home.nix +++ b/users/chloe/paperback/home.nix @@ -4,7 +4,6 @@ # most of these are needed for my work environment. programs = { bun.enable = true; - zed-editor.enable = true; zsh.profileExtra = '' _bun() { local context state line @@ -14,6 +13,7 @@ }; home.packages = with pkgs; [ doppler + deno nodejs_22 rustup typescript diff --git a/users/chloe/vim.nix b/users/chloe/vim.nix index 4dfae25fd18de645ba52a03c7f6a48d626da3c1a..84bac23ce713af41bcc8bce973f866f8a403b8be 100644 --- a/users/chloe/vim.nix +++ b/users/chloe/vim.nix @@ -5,7 +5,7 @@ _: { }; git = { gitsigns.setupOpts = { - current_line_blame = true; + current_line_blame = false; current_line_blame_opts = { virt_text = true; virt_text_pos = "right_align"; @@ -16,50 +16,5 @@ _: { }; }; }; - autocomplete.blink-cmp = { - enable = true; - mappings = { - close = null; - complete = null; - confirm = null; - next = null; - previous = null; - scrollDocsDown = null; - scrollDocsUp = null; - }; - - setupOpts = { - keymap = { - preset = "super-tab"; - }; - completion = { - ghost_text.enabled = false; - list.selection.preselect = true; - trigger = { - show_in_snippet = true; - }; - accept.auto_brackets.enabled = true; - }; - signature = { - enabled = true; - }; - }; - }; - - keymaps = - let - mkKeymap = mode: key: action: desc: { - inherit mode; - inherit key action desc; - }; - n = mkKeymap "n"; # normal mode - in - [ - # UI - (n "e" ":lua require('snacks').explorer()" "File Explorer") - # Find Files - (n "" ":lua require('snacks').picker.smart()" "Smart Find Files") - (n "f" ":lua require('snacks').picker.grep()" "Grep Files") - ]; }; } -- 2.54.0 From 38a0ff695984d5ff685869202c3892448cf4a0ac Mon Sep 17 00:00:00 2001 From: chloe caruso Date: Mon, 18 Aug 2025 00:44:21 -0700 Subject: [PATCH 4/4] chore: rename chloe -> clover, julia -> fish names are fun. for a few weeks i've been presenting publicly with the name 'clover', and i like it a lot. for me it's sort of a name tier, where friends can call me chloe for short, but my full name is clover. (and for people very close to me, there's more names to unlock). julia to fish is from a misunderstanding. i used the name julia with her a lot because it sounded more like a usual name, so i assumed it was. but no, that's just a nickname. an extra option. her preferred name is fish. simple as. i am sorry for this confusion. --- .mailmap | 2 +- flake.nix | 16 ++++++++-------- nvim | 4 ++-- readme.md | 6 +++--- users/{chloe => clover}/configuration.nix | 2 +- users/{chloe => clover}/home.nix | 0 .../paperback/configuration.nix | 0 users/{chloe => clover}/paperback/home.nix | 0 .../{chloe => clover}/sandwich/configuration.nix | 0 users/{chloe => clover}/user.nix | 9 +-------- users/{chloe => clover}/vim.nix | 0 users/{julia => fish}/cattop/configuration.nix | 0 .../cattop/hardware-configuration.nix | 0 users/{julia => fish}/cattop/home.nix | 0 users/{julia => fish}/cattop/home.nix.old | 0 users/{julia => fish}/configuration.nix | 0 users/{julia => fish}/user.nix | 2 +- users/{julia => fish}/vim.nix | 0 18 files changed, 17 insertions(+), 24 deletions(-) rename users/{chloe => clover}/configuration.nix (94%) rename users/{chloe => clover}/home.nix (100%) rename users/{chloe => clover}/paperback/configuration.nix (100%) rename users/{chloe => clover}/paperback/home.nix (100%) rename users/{chloe => clover}/sandwich/configuration.nix (100%) rename users/{chloe => clover}/user.nix (71%) rename users/{chloe => clover}/vim.nix (100%) rename users/{julia => fish}/cattop/configuration.nix (100%) rename users/{julia => fish}/cattop/hardware-configuration.nix (100%) rename users/{julia => fish}/cattop/home.nix (100%) rename users/{julia => fish}/cattop/home.nix.old (100%) rename users/{julia => fish}/configuration.nix (100%) rename users/{julia => fish}/user.nix (93%) rename users/{julia => fish}/vim.nix (100%) diff --git a/.mailmap b/.mailmap index e386ca3bd8d2c2c5243c60eca9fb27fcd0db795c..86cc929ac8eb7d898915998e44f64260bdfa92e0 100644 --- a/.mailmap +++ b/.mailmap @@ -1,3 +1,3 @@ # To learn more about git's mailmap: https://ntietz.com/blog/git-mailmap-for-name-changes -chloe caruso +clover caruso Natalie Marks diff --git a/flake.nix b/flake.nix index 8f40bd9ed49461870591c375968181f6fa8e5448..24e6c7d79ea873ac00f2801c9d9e13a37620da4a 100644 --- a/flake.nix +++ b/flake.nix @@ -97,9 +97,9 @@ packages = forAllSystems ( { system, pkgs, ... }: { - nvim-chloe = mkNeovim "chloe" pkgs; + nvim-clover = mkNeovim "clover" pkgs; + nvim-fish = mkNeovim "fish" pkgs; nvim-natalie = mkNeovim "natalie" pkgs; - nvim-julia = mkNeovim "julia" pkgs; inherit (pkgs) autofmt; } @@ -122,22 +122,22 @@ system = "aarch64-darwin"; }; - # chloe's mac studio "sandwich" + # clover's mac studio "sandwich" darwinConfigurations.sandwich = mkSystem "sandwich" { - user = "chloe"; + user = "clover"; host = "sandwich"; system = "aarch64-darwin"; }; - # chloe's macbook air "paperback" + # clover's macbook air "paperback" darwinConfigurations.paperback = mkSystem "paperback" { - user = "chloe"; + user = "clover"; host = "paperback"; system = "aarch64-darwin"; }; - # julia's cattop + # fish's cattop nixosConfigurations.cattop = mkSystem "cattop" { - user = "julia"; + user = "fish"; host = "cattop"; system = "x86_64-linux"; }; diff --git a/nvim b/nvim index 417714be8887b7a6f653ffd31474bcb550dbb2ea..9301a343a48c8477771cbaea7b0281277964a5ba 100755 --- a/nvim +++ b/nvim @@ -1,11 +1,11 @@ #!/bin/sh username="$(id -u -n)" if [ "$username" = "clo" ]; then - name="chloe" + name="clover" elif [ "$username" = "nmarks" ]; then name="natalie" elif [ "$username" = "fish" ]; then - name="julia" + name="fish" fi if [ -z "$name" ]; then echo "Configure this wrapper script with your name." >&2 diff --git a/readme.md b/readme.md index 7c7416d44e70df0ed578b1f085592798c93561a1..8a9bd5e518e42d1f5ee2c71a345842dd6bf26540 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@ # nix config -this setup allows natalie and chloe to share common configuration between their -machines, but also share useful modules between each other. +this setup allows natalie, clover, and more to share common configuration +between their machines, but also share useful modules between each other. ``` lib/ # reusable functions @@ -12,7 +12,7 @@ modules/ # reusable modules +-- nixos/ # linux configurations +-- shared/ # shared between nixos-rebuild & darwin-rebuild users/ - +-- chloe/ + +-- clover/ | +-- user.nix # info about her | +-- configuration.nix # for all hosts (system) | +-- home.nix # for all hosts (userspace) diff --git a/users/chloe/configuration.nix b/users/clover/configuration.nix similarity index 94% rename from users/chloe/configuration.nix rename to users/clover/configuration.nix index aa0b4855f6ea0301a2e97d15bacfbf7ac5456ec4..103b011a987ed79def16b4bae7aef256192e681d 100644 --- a/users/chloe/configuration.nix +++ b/users/clover/configuration.nix @@ -1,4 +1,4 @@ -# Configuration applied to all of chloe's machines +# Configuration applied to all of clover's machines { pkgs, ... }: { # packages for all machines diff --git a/users/chloe/home.nix b/users/clover/home.nix similarity index 100% rename from users/chloe/home.nix rename to users/clover/home.nix diff --git a/users/chloe/paperback/configuration.nix b/users/clover/paperback/configuration.nix similarity index 100% rename from users/chloe/paperback/configuration.nix rename to users/clover/paperback/configuration.nix diff --git a/users/chloe/paperback/home.nix b/users/clover/paperback/home.nix similarity index 100% rename from users/chloe/paperback/home.nix rename to users/clover/paperback/home.nix diff --git a/users/chloe/sandwich/configuration.nix b/users/clover/sandwich/configuration.nix similarity index 100% rename from users/chloe/sandwich/configuration.nix rename to users/clover/sandwich/configuration.nix diff --git a/users/chloe/user.nix b/users/clover/user.nix similarity index 71% rename from users/chloe/user.nix rename to users/clover/user.nix index 284592d7f6f6a36b7441b3911bafd2298cdd338d..e76aec6abba1dc2ba7c1e2b574aa089ad0057b73 100644 --- a/users/chloe/user.nix +++ b/users/clover/user.nix @@ -1,18 +1,11 @@ # This definition is used by modules to customize as needed. { username = "clo"; # username - name = "chloe caruso"; + name = "clover caruso"; email = "account@paperclover.net"; timeZone = "America/Los_Angeles"; - dotfilesDir = "~/config"; # absolute path of the local repo - - # Stylix/Theming - theme = null; - #font sexuality = "lesbian"; # hyfetch - - # Default terminal command. NOTE: ghostty is not installed for you term = "ghostty"; # preferred $TERMINAL editor = "nvim"; # preferred $EDITOR } diff --git a/users/chloe/vim.nix b/users/clover/vim.nix similarity index 100% rename from users/chloe/vim.nix rename to users/clover/vim.nix diff --git a/users/julia/cattop/configuration.nix b/users/fish/cattop/configuration.nix similarity index 100% rename from users/julia/cattop/configuration.nix rename to users/fish/cattop/configuration.nix diff --git a/users/julia/cattop/hardware-configuration.nix b/users/fish/cattop/hardware-configuration.nix similarity index 100% rename from users/julia/cattop/hardware-configuration.nix rename to users/fish/cattop/hardware-configuration.nix diff --git a/users/julia/cattop/home.nix b/users/fish/cattop/home.nix similarity index 100% rename from users/julia/cattop/home.nix rename to users/fish/cattop/home.nix diff --git a/users/julia/cattop/home.nix.old b/users/fish/cattop/home.nix.old similarity index 100% rename from users/julia/cattop/home.nix.old rename to users/fish/cattop/home.nix.old diff --git a/users/julia/configuration.nix b/users/fish/configuration.nix similarity index 100% rename from users/julia/configuration.nix rename to users/fish/configuration.nix diff --git a/users/julia/user.nix b/users/fish/user.nix similarity index 93% rename from users/julia/user.nix rename to users/fish/user.nix index edb5aeaa3bf8c240b32728cd167ea92061fb8e42..f515195d33940a28ddd793d7a1c121f8987e4e2e 100644 --- a/users/julia/user.nix +++ b/users/fish/user.nix @@ -1,6 +1,6 @@ rec { username = "fish"; # username - name = "Julia"; # name/identifier + name = "Fish"; # name/identifier email = "fish@fishcat.fish"; # email (used for certain configurations) dotfilesDir = "~/config"; # absolute path of the local repo theme = "catppuccin-mocha"; # name of theme that stylix will use diff --git a/users/julia/vim.nix b/users/fish/vim.nix similarity index 100% rename from users/julia/vim.nix rename to users/fish/vim.nix -- 2.54.0