authorgravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-05-21 10:44:59-07:00
committergravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-05-21 10:44:59-07:00
log6fea0a1f4e10affd9f1a3fbdec86a1a82564570b
tree247e873d557fb0665c6a7701d888028b0b9466b1
parent10453abfb1d3dd180ecef7c8951f1a88d391c4eb
signature Commit is signed but in an unrecognized format.

nearly at parity with lua-based config


10 files changed, 132 insertions(+), 79 deletions(-)

flake.nix-1
...@@ -49,7 +49,6 @@...@@ -49,7 +49,6 @@
49 }@inputs:49 }@inputs:
50 let50 let
51 lib = nixpkgs.lib;51 lib = nixpkgs.lib;
52
53 # TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere.52 # TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere.
54 overlays = [53 overlays = [
55 inputs.zig.overlays.default54 inputs.zig.overlays.default
lib/mkSystem.nix+1-1
...@@ -7,7 +7,7 @@...@@ -7,7 +7,7 @@
7 mkNeovim,7 mkNeovim,
8}: name: {8}: name: {
9 user, # ./users/{name}9 user, # ./users/{name}
10 host, # ./users/{name}/{host} (optional)10 host, # ./users/{name}/{host}
11 system, # arch-os11 system, # arch-os
12 extraModules ? [],12 extraModules ? [],
13}: let13}: let
modules/macos/homebrew.nix+2-14
...@@ -4,27 +4,15 @@ _: {...@@ -4,27 +4,15 @@ _: {
4 enable = true;4 enable = true;
55
6 onActivation = {6 onActivation = {
7 autoUpdate = true;7 autoUpdate = false;
8 cleanup = "none";8 cleanup = "none";
9 upgrade = true;9 upgrade = false;
10 };10 };
1111
12 brews = [12 brews = [
13 "imagemagick"
14 "opam"
15 ];13 ];
1614
17 casks = [15 casks = [
18 "battle-net"
19 "stremio"
20 "alt-tab"
21 "legcord"
22 "zulip"
23 "zen-browser"
24 "supertuxkart"
25 "sf-symbols"
26
27 "mediosz/tap/swipeaerospace"
28 ];16 ];
2917
30 masApps = {18 masApps = {
modules/neovim/default.nix-3
...@@ -87,9 +87,6 @@...@@ -87,9 +87,6 @@
87 ripgrep.enable = true;87 ripgrep.enable = true;
88 };88 };
89 friendly-snippets.enable = true;89 friendly-snippets.enable = true;
90 setupOpts = {
91 keymap.preset = "super-tab";
92 };
93 };90 };
94 };91 };
95 statusline = {92 statusline = {
users/natalie/desktop/configuration.nix+1
...@@ -9,6 +9,7 @@...@@ -9,6 +9,7 @@
9 # Include the results of the hardware scan.9 # Include the results of the hardware scan.
10 ./hardware-configuration.nix10 ./hardware-configuration.nix
11 ];11 ];
12 documentation.man.generateCaches = false;
12 programs = {13 programs = {
13 gamemode.enable = true;14 gamemode.enable = true;
1415
users/natalie/home.nix+2-2
...@@ -2,8 +2,7 @@...@@ -2,8 +2,7 @@
2 pkgs,2 pkgs,
3 lib,3 lib,
4 ...4 ...
5}@args:5} @ args: {
6{
7 programs = {6 programs = {
8 # sort-lines:start7 # sort-lines:start
9 atuin.enable = true;8 atuin.enable = true;
...@@ -11,6 +10,7 @@...@@ -11,6 +10,7 @@
11 hyfetch.enable = true;10 hyfetch.enable = true;
12 direnv.enable = true;11 direnv.enable = true;
13 fish.enable = true;12 fish.enable = true;
13 man.generateCaches = false;
14 # sort-lines:end14 # sort-lines:end
15 };15 };
1616
users/natalie/laptop/configuration.nix+6-12
...@@ -1,5 +1,4 @@...@@ -1,5 +1,4 @@
1{ pkgs, ... }:1{pkgs, ...}: {
2{
3 environment.systemPackages = with pkgs; [2 environment.systemPackages = with pkgs; [
4 pinentry_mac3 pinentry_mac
5 signal-desktop-bin4 signal-desktop-bin
...@@ -8,7 +7,7 @@...@@ -8,7 +7,7 @@
8 # Custom configuration modules in "modules" are shared between users,7 # Custom configuration modules in "modules" are shared between users,
9 # and can be configured in this "shared" namespace8 # and can be configured in this "shared" namespace
10 shared.darwin = {9 shared.darwin = {
11 macAppStoreApps = [ "wireguard" ];10 macAppStoreApps = ["wireguard"];
12 };11 };
1312
14 # Create /etc/zshrc that loads the nix-darwin environment.13 # Create /etc/zshrc that loads the nix-darwin environment.
...@@ -30,14 +29,6 @@...@@ -30,14 +29,6 @@
3029
31 # Use homebrew to install casks30 # Use homebrew to install casks
32 homebrew = {31 homebrew = {
33 enable = true;
34
35 onActivation = {
36 autoUpdate = true;
37 cleanup = "none";
38 upgrade = true;
39 };
40
41 brews = [32 brews = [
42 "imagemagick"33 "imagemagick"
43 "opam"34 "opam"
...@@ -49,8 +40,11 @@...@@ -49,8 +40,11 @@
49 "alt-tab"40 "alt-tab"
50 "legcord"41 "legcord"
51 "zulip"42 "zulip"
52 "zen-browser"43 "zen"
53 "supertuxkart"44 "supertuxkart"
45 "sf-symbols"
46
47 "mediosz/tap/swipeaerospace"
54 ];48 ];
55 };49 };
56}50}
users/natalie/vim.nix+20-1
...@@ -1,8 +1,27 @@...@@ -1,8 +1,27 @@
1{...}: {1{pkgs, ...}: {
2 imports = [2 imports = [
3 ./vim/default.nix3 ./vim/default.nix
4 ];4 ];
5 vim = {5 vim = {
6 options = {
7 tabstop = 2;
8 softtabstop = 2;
9 shiftwidth = 2;
10 undofile = true;
11 swapfile = false;
12 showmode = false;
13 foldmethod = "expr";
14 foldexpr = "v:lua.vim.treesitter.foldexpr()";
15 };
16
17 autocmds = [
18 {
19 event = ["LspAttach"];
20 pattern = ["*"];
21 desc = "User: Set LSP folding if client supports it";
22 callback = pkgs.lib.generators.mkLuaInline ''function(ctx) local client = assert(vim.lsp.get_client_by_id(ctx.data.client_id)) if client:supports_method("textDocument/foldingRange") then local win = vim.api.nvim_get_current_win() vim.wo[win][0].foldexpr = "v:lua.vim.lsp.foldexpr()" end end'';
23 }
24 ];
6 theme = {25 theme = {
7 name = "catppuccin";26 name = "catppuccin";
8 style = "mocha";27 style = "mocha";
users/natalie/vim/keybinds.nix+5-3
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1{...}: let1{ ... }:
2let
2 mkKeymap = mode: key: action: desc: {3 mkKeymap = mode: key: action: desc: {
3 inherit4 inherit
4 mode5 mode
...@@ -7,7 +8,8 @@...@@ -7,7 +8,8 @@
7 desc8 desc
8 ;9 ;
9 };10 };
10in {11in
12{
11 vim = {13 vim = {
12 keymaps = [14 keymaps = [
13 (mkKeymap "n" "<leader>e" ":lua require('snacks').explorer()<CR>" "File Explorer")15 (mkKeymap "n" "<leader>e" ":lua require('snacks').explorer()<CR>" "File Explorer")
...@@ -17,7 +19,7 @@ in {...@@ -17,7 +19,7 @@ in {
17 (mkKeymap "n" "<leader>ff" ":lua require('snacks').picker.files()<CR>" "Find File")19 (mkKeymap "n" "<leader>ff" ":lua require('snacks').picker.files()<CR>" "Find File")
18 (mkKeymap "n" "<leader>fg" ":lua require('snacks').picker.grep()<CR>" "Grep Files")20 (mkKeymap "n" "<leader>fg" ":lua require('snacks').picker.grep()<CR>" "Grep Files")
19 # Lsp21 # Lsp
20 (mkKeymap "n" "K" ":lua vim.lsp.buf.hover()<CR>" "Hover docs")22 (mkKeymap "n" "K" ":Lspsaga hover_doc<CR>" "Hover docs")
21 (mkKeymap "n" "lr" ":lua vim.lsp.buf.rename()<CR>" "Rename")23 (mkKeymap "n" "lr" ":lua vim.lsp.buf.rename()<CR>" "Rename")
22 # (mkKeymap "n" "<leader>th" ":lua function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) end<CR>" "Toggle Inlay Hints")24 # (mkKeymap "n" "<leader>th" ":lua function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) end<CR>" "Toggle Inlay Hints")
23 ];25 ];
users/natalie/vim/languages.nix+95-42
...@@ -1,63 +1,95 @@...@@ -1,63 +1,95 @@
1{1{
2 flake,2 flake,
3 userConfig,3 user,
4 host,
4 pkgs,5 pkgs,
5 ...6 ...
6}: {7}: let
8 darwin =
9 if host.darwin
10 then "darwin"
11 else "nixos";
12 flakePath = "/${
13 if host.darwin
14 then "Users"
15 else "home"
16 }/${user.username}/.dotfiles";
17
18 # BIG HACK DO NOT DO PLS
19
20 hostname =
21 if host.darwin
22 then "Natalies-MacBook-Air"
23 else "nixos";
24in {
7 vim = {25 vim = {
8 extraPackages = with pkgs; [26 extraPackages = with pkgs; [
9 python312Packages.pylatexenc27 python312Packages.pylatexenc
10 ];28 ];
11 lsp = {29 lsp = {
30 lightbulb.enable = false;
31 lspsaga = {
32 enable = true;
33 setupOpts = {
34 lightbulb = {
35 virtual_text = false;
36 };
37 };
38 };
12 nvim-docs-view.enable = true;39 nvim-docs-view.enable = true;
13 inlayHints.enable = true;40 inlayHints.enable = true;
14 servers.nixd.settings = {41 servers.nixd.settings.nixd = {
15 nixd.nixpkgs.expr = ''import "${flake.inputs.nixpkgs}" { }'';42 nixpkgs.expr = ''import "<nixpkgs>" { }'';
16 options = {43 options =
17 nixos = {44 {
18 expr = ''45 home-manager = {
19 (let pkgs = import "${flake.inputs.nixpkgs}" {}; inherit (pkgs) lib; in (lib.evalModules { modules = (import "${flake.inputs.nixpkgs}/nixos/modules/module-list.nix"); check = false;})).options'';46 expr = ''(builtins.getFlake "${flakePath}").${darwin}Configurations.${hostname}.options.home-manager.users.type.getSubOptions [ ]'';
20 };47 };
21 nix_darwin = {48 }
22 expr = ''49 // pkgs.lib.optionalAttrs host.darwin {
23 (let pkgs = import "${flake.inputs.nixpkgs}" {}; inherit (pkgs) lib; in (lib.evalModules { modules = import ("${flake.inputs.darwin}/modules/module-list.nix"); check = false;})).options'';50 nix-darwin = {
51 expr = ''(builtins.getFlake "${flakePath}").darwinConfigurations.${hostname}.options'';
52 };
53 }
54 // pkgs.lib.optionalAttrs host.linux {
55 nixos = {
56 expr = ''(builtins.getFlake "${flakePath}").nixosConfigurations.${hostname}.options'';
57 };
24 };58 };
25 home_manager = {59 };
26 expr = ''60 mappings = {
27 (let pkgs = import "${flake.inputs.nixpkgs}" {}; lib = import "${flake.inputs.home-manager}/modules/lib/stdlib-extended.nix" pkgs.lib; in (lib.evalModules { modules = (import "${flake.inputs.home-manager}/modules/modules.nix") { inherit lib pkgs; check = false; };})).options'';61 codeAction = "<leader>ca";
28 };62 goToDeclaration = "gD";
29 };63 goToDefinition = "gd";
30 mappings = {64 listReferences = "gr";
31 codeAction = "<leader>ca";65 goToType = "gy";
32 goToDeclaration = "gD";66 hover = null;
33 goToDefinition = "gd";67 nextDiagnostic = "<leader>d";
34 listReferences = "gr";68 openDiagnosticFloat = "<leader>df";
35 goToType = "gy";69 renameSymbol = "rn";
36 hover = "K";70 documentHighlight = null;
37 nextDiagnostic = "<leader>d";71 listDocumentSymbols = null;
38 openDiagnosticFloat = "<leader>df";72 listImplementations = null;
39 renameSymbol = "rn";73 listWorkspaceFolders = null;
40 documentHighlight = null;74 previousDiagnostic = null;
41 listDocumentSymbols = null;75 removeWorkspaceFolder = null;
42 listImplementations = null;76 signatureHelp = null;
43 listWorkspaceFolders = null;77 toggleFormatOnSave = null;
44 previousDiagnostic = null;
45 removeWorkspaceFolder = null;
46 signatureHelp = null;
47 toggleFormatOnSave = null;
48 };
49 };78 };
50 };79 };
51 languages = {80 languages = {
52 enableDAP = true;81 enableDAP = true;
53 # haskell.enable = true;
54 lua.enable = true;82 lua.enable = true;
55 python.enable = true;83 python.enable = true;
56 python.format.type = "ruff";84 python.format.type = "ruff";
57 markdown.extensions.render-markdown-nvim = {85 markdown = {
58 enable = true;86 enable = true;
87 extensions.render-markdown-nvim = {
88 enable = true;
89 };
59 };90 };
60 };91 };
92
61 formatter.conform-nvim = {93 formatter.conform-nvim = {
62 enable = true;94 enable = true;
63 setupOpts = {95 setupOpts = {
...@@ -84,9 +116,13 @@...@@ -84,9 +116,13 @@
84 additionalVimRegexHighlighting = true;116 additionalVimRegexHighlighting = true;
85 };117 };
86118
87 context.enable = true;119 grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
120 markdown_inline
121 markdown
122 ];
123
88 highlight.enable = true;124 highlight.enable = true;
89 indent.enable = true;125 indent.enable = false;
90 };126 };
91127
92 visuals = {128 visuals = {
...@@ -98,13 +134,30 @@...@@ -98,13 +134,30 @@
98 };134 };
99 autocomplete.blink-cmp = {135 autocomplete.blink-cmp = {
100 enable = true;136 enable = true;
101 # mappings = {137 mappings = {
102 # };138 close = null;
139 complete = null;
140 confirm = null;
141 next = null;
142 previous = null;
143 scrollDocsDown = null;
144 scrollDocsUp = null;
145 };
103146
104 setupOpts = {147 setupOpts = {
148 keymap = {
149 preset = "super-tab";
150 };
105 completion = {151 completion = {
106 ghost_text.enabled = false;152 ghost_text.enabled = false;
107 list.selection.preselect = true;153 list.selection.preselect = true;
154 trigger = {
155 show_in_snippet = true;
156 };
157 accept.auto_brackets.enabled = true;
158 };
159 signature = {
160 enabled = true;
108 };161 };
109 };162 };
110 };163 };