| author | |
| committer | |
| log | bf980b89ceac4295c1ec8a2614b39d6341ea548a |
| tree | 590887e1277abd60be3a6931483925893593e58f |
| parent | 4ecab4b9c4140b5ce5738b4fac2261c0bbc324ad |
| parent | 3b80f030b5e98f38f37725c19088d862d8cbc6c1 |
| signature | Commit is signed but in an unrecognized format. |
34 files changed, 1065 insertions(+), 322 deletions(-)
.gitignore+2-1| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | flake.lock | |
| 2 | 1 | .DS_STORE |
| 2 | .hostname | |
| 3 | flake.lock | |
| 3 | 4 | result |
| 4 | 5 | result-* |
flake.lock+27-27| ... | ... | @@ -9,11 +9,11 @@ |
| 9 | 9 | ] |
| 10 | 10 | }, |
| 11 | 11 | "locked": { |
| 12 | "lastModified": 1754511800, | |
| 13 | "narHash": "sha256-/gYkj4dbzcAV1EWJYy+2ryHGtC57jhIrRwSGQKCT8Gk=", | |
| 12 | "lastModified": 1755807717, | |
| 13 | "narHash": "sha256-x/IcOa+p9VFYlwXmuNhbZ8ce9As24rqy6uABv+tKacU=", | |
| 14 | 14 | "owner": "tadfisher", |
| 15 | 15 | "repo": "android-nixpkgs", |
| 16 | "rev": "5bb0f6e7b112c7be7895c6058925c29db360b205", | |
| 16 | "rev": "4316f29f7f3b34c41f2639ae190022fbed60b850", | |
| 17 | 17 | "type": "github" |
| 18 | 18 | }, |
| 19 | 19 | "original": { |
| ... | ... | @@ -58,11 +58,11 @@ |
| 58 | 58 | ] |
| 59 | 59 | }, |
| 60 | 60 | "locked": { |
| 61 | "lastModified": 1751313918, | |
| 62 | "narHash": "sha256-HsJM3XLa43WpG+665aGEh8iS8AfEwOIQWk3Mke3e7nk=", | |
| 61 | "lastModified": 1755825449, | |
| 62 | "narHash": "sha256-XkiN4NM9Xdy59h69Pc+Vg4PxkSm9EWl6u7k6D5FZ5cM=", | |
| 63 | 63 | "owner": "lnl7", |
| 64 | 64 | "repo": "nix-darwin", |
| 65 | "rev": "e04a388232d9a6ba56967ce5b53a8a6f713cdfcf", | |
| 65 | "rev": "8df64f819698c1fee0c2969696f54a843b2231e8", | |
| 66 | 66 | "type": "github" |
| 67 | 67 | }, |
| 68 | 68 | "original": { |
| ... | ... | @@ -314,11 +314,11 @@ |
| 314 | 314 | ] |
| 315 | 315 | }, |
| 316 | 316 | "locked": { |
| 317 | "lastModified": 1753943136, | |
| 318 | "narHash": "sha256-eiEE5SabVcIlGSTRcRyBjmJMaYAV95SJnjy8YSsVeW4=", | |
| 317 | "lastModified": 1755810213, | |
| 318 | "narHash": "sha256-QdenO8f0PTg+tC6HuSvngKcbRZA5oZKmjUT+MXKOLQg=", | |
| 319 | 319 | "owner": "nix-community", |
| 320 | 320 | "repo": "home-manager", |
| 321 | "rev": "bd82507edd860c453471c46957cbbe3c9fd01b5c", | |
| 321 | "rev": "6911d3e7f475f7b3558b4f5a6aba90fa86099baa", | |
| 322 | 322 | "type": "github" |
| 323 | 323 | }, |
| 324 | 324 | "original": { |
| ... | ... | @@ -363,11 +363,11 @@ |
| 363 | 363 | ] |
| 364 | 364 | }, |
| 365 | 365 | "locked": { |
| 366 | "lastModified": 1753293216, | |
| 367 | "narHash": "sha256-4hAm9PYNHAsR3MxH8MhSZt7mTiR8MlhyQilLJEPdaZs=", | |
| 366 | "lastModified": 1754439168, | |
| 367 | "narHash": "sha256-NcwRidwb/ask65LE86os4RkhyoPQo5sLu0sJs/NboK4=", | |
| 368 | 368 | "owner": "moonlight-mod", |
| 369 | 369 | "repo": "moonlight", |
| 370 | "rev": "297a1b57c14ff18890382b2fe89f493ba349a730", | |
| 370 | "rev": "66b81b113afd6654a88c9adb7edb7fe92839fe84", | |
| 371 | 371 | "type": "github" |
| 372 | 372 | }, |
| 373 | 373 | "original": { |
| ... | ... | @@ -383,11 +383,11 @@ |
| 383 | 383 | ] |
| 384 | 384 | }, |
| 385 | 385 | "locked": { |
| 386 | "lastModified": 1753589988, | |
| 387 | "narHash": "sha256-y1JlcMB2dKFkrr6g+Ucmj8L//IY09BtSKTH/A7OU7mU=", | |
| 386 | "lastModified": 1755404379, | |
| 387 | "narHash": "sha256-Q6ZxZDBmD/B988Jjbx7/NchxOKIpOKBBrx9Yb0zMzpQ=", | |
| 388 | 388 | "owner": "nix-community", |
| 389 | 389 | "repo": "nix-index-database", |
| 390 | "rev": "f0736b09c43028fd726fb70c3eb3d1f0795454cf", | |
| 390 | "rev": "ebbc1c05f786ae39bb5e04e57bf2c10c44a649e3", | |
| 391 | 391 | "type": "github" |
| 392 | 392 | }, |
| 393 | 393 | "original": { |
| ... | ... | @@ -434,11 +434,11 @@ |
| 434 | 434 | }, |
| 435 | 435 | "nixpkgs_2": { |
| 436 | 436 | "locked": { |
| 437 | "lastModified": 1753694789, | |
| 438 | "narHash": "sha256-cKgvtz6fKuK1Xr5LQW/zOUiAC0oSQoA9nOISB0pJZqM=", | |
| 437 | "lastModified": 1755615617, | |
| 438 | "narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=", | |
| 439 | 439 | "owner": "NixOS", |
| 440 | 440 | "repo": "nixpkgs", |
| 441 | "rev": "dc9637876d0dcc8c9e5e22986b857632effeb727", | |
| 441 | "rev": "20075955deac2583bb12f07151c2df830ef346b4", | |
| 442 | 442 | "type": "github" |
| 443 | 443 | }, |
| 444 | 444 | "original": { |
| ... | ... | @@ -540,11 +540,11 @@ |
| 540 | 540 | ] |
| 541 | 541 | }, |
| 542 | 542 | "locked": { |
| 543 | "lastModified": 1753930086, | |
| 544 | "narHash": "sha256-Os6Ta5zamfAllmQNlvkbGZLHn06zJy3hVXRk+Dy2yMo=", | |
| 543 | "lastModified": 1755830208, | |
| 544 | "narHash": "sha256-fMa/Hcg+4O2h+kl3gNPjtGSWPI8NtCl3LYMsejK6qGA=", | |
| 545 | 545 | "owner": "oxalica", |
| 546 | 546 | "repo": "rust-overlay", |
| 547 | "rev": "17b672c10c1798696a516cb879edbc2ebd0f58a4", | |
| 547 | "rev": "802a7b97f8ff672ba2dec70c9e354f51f844e796", | |
| 548 | 548 | "type": "github" |
| 549 | 549 | }, |
| 550 | 550 | "original": { |
| ... | ... | @@ -749,11 +749,11 @@ |
| 749 | 749 | ] |
| 750 | 750 | }, |
| 751 | 751 | "locked": { |
| 752 | "lastModified": 1753676490, | |
| 753 | "narHash": "sha256-XeifEftxYGP/gzp6O1yO1S1W+MEx4Xvrgeu84ryRPNQ=", | |
| 752 | "lastModified": 1754886070, | |
| 753 | "narHash": "sha256-MZDmxOkVKL1HY72bliN8Gxh0SYkHUa3W/1fTU2ke36I=", | |
| 754 | 754 | "owner": "youwen5", |
| 755 | 755 | "repo": "zen-browser-flake", |
| 756 | "rev": "77024f4557204bb4d526893d42db2e6f50727fab", | |
| 756 | "rev": "e37d2b326311320c8571111b3ef89b29d26d4b64", | |
| 757 | 757 | "type": "github" |
| 758 | 758 | }, |
| 759 | 759 | "original": { |
| ... | ... | @@ -769,11 +769,11 @@ |
| 769 | 769 | "nixpkgs": "nixpkgs_3" |
| 770 | 770 | }, |
| 771 | 771 | "locked": { |
| 772 | "lastModified": 1753963984, | |
| 773 | "narHash": "sha256-JPiCLZHuNk11XYYCqoLoKYIgdUu2WpNccTzl4ljycTQ=", | |
| 772 | "lastModified": 1755605615, | |
| 773 | "narHash": "sha256-J0Cxren2QLeI0ZvRZw4XGcMm4q3uPIZHM+eJnaZfXX8=", | |
| 774 | 774 | "owner": "mitchellh", |
| 775 | 775 | "repo": "zig-overlay", |
| 776 | "rev": "45772b76cdb103bd300abac4a85a34518dee65a0", | |
| 776 | "rev": "714fae26049a263ff2e4641ce7c973f371f4b005", | |
| 777 | 777 | "type": "github" |
| 778 | 778 | }, |
| 779 | 779 | "original": { |
flake.nix+6-1| ... | ... | @@ -91,7 +91,6 @@ |
| 91 | 91 | mkSystem = import ./lib/mkSystem.nix { inherit inputs mkNeovim overlays; }; |
| 92 | 92 | in |
| 93 | 93 | rec { |
| 94 | inherit self; | |
| 95 | 94 | # "nix fmt" |
| 96 | 95 | formatter = forAllSystems (inputs: inputs.pkgs.autofmt); |
| 97 | 96 | packages = forAllSystems ( |
| ... | ... | @@ -134,6 +133,12 @@ |
| 134 | 133 | host = "paperback"; |
| 135 | 134 | system = "aarch64-darwin"; |
| 136 | 135 | }; |
| 136 | # clover's work macbook pro | |
| 137 | darwinConfigurations.clover-work-mac = mkSystem "clover-work-mac" { | |
| 138 | user = "clover"; | |
| 139 | host = "work"; | |
| 140 | system = "aarch64-darwin"; | |
| 141 | }; | |
| 137 | 142 | |
| 138 | 143 | # fish's cattop |
| 139 | 144 | nixosConfigurations.cattop = mkSystem "cattop" { |
lib/mkNeovim.nix+14-12| ... | ... | @@ -10,16 +10,18 @@ let |
| 10 | 10 | |
| 11 | 11 | userDir = ../users + "/${user}"; |
| 12 | 12 | userConfig = import (userDir + "/user.nix"); |
| 13 | in | |
| 14 | (inputs.nvf.lib.neovimConfiguration { | |
| 15 | inherit pkgs; | |
| 16 | modules = builtins.filter (f: f != null) [ | |
| 17 | (../users + ("/" + user + "/vim.nix")) | |
| 18 | ../modules/neovim | |
| 19 | ]; | |
| 20 | extraSpecialArgs = { | |
| 21 | inherit host; | |
| 22 | flake = self; | |
| 23 | user = userConfig; | |
| 13 | ||
| 14 | config = inputs.nvf.lib.neovimConfiguration { | |
| 15 | inherit pkgs; | |
| 16 | modules = builtins.filter (f: f != null) [ | |
| 17 | (../users + ("/" + user + "/vim.nix")) | |
| 18 | ../modules/neovim | |
| 19 | ]; | |
| 20 | extraSpecialArgs = { | |
| 21 | inherit host; | |
| 22 | flake = self; | |
| 23 | user = userConfig; | |
| 24 | }; | |
| 24 | 25 | }; |
| 25 | }).neovim | |
| 26 | in | |
| 27 | config.neovim // { input = config; } |
modules/home/default.nix+39-7| ... | ... | @@ -77,6 +77,7 @@ in |
| 77 | 77 | # ViM and Neovim |
| 78 | 78 | ".*.swp" |
| 79 | 79 | ".nvimlog" |
| 80 | ".jj" | |
| 80 | 81 | ]; |
| 81 | 82 | }; |
| 82 | 83 | |
| ... | ... | @@ -120,16 +121,47 @@ in |
| 120 | 121 | inherit (pkgs.fishPlugins.bang-bang) src; |
| 121 | 122 | } |
| 122 | 123 | ]; |
| 123 | shellAliases = { | |
| 124 | } | |
| 125 | // lib.optionalAttrs (!host.darwin) { | |
| 126 | reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now"; | |
| 127 | }; | |
| 128 | 124 | shellInit = '' |
| 129 | batman --export-env | source | |
| 130 | test -r '/Users/${user.username}/.opam/opam-init/init.fish' && source '/Users/${user.username}/.opam/opam-init/init.fish' > /dev/null 2> /dev/null; or true | |
| 125 | if type -q batman | |
| 126 | batman --export-env | source | |
| 127 | end | |
| 128 | test -r "$HOME"'/.opam/opam-init/init.fish' && source "$HOME"'/.opam/opam-init/init.fish' > /dev/null 2> /dev/null; or true | |
| 131 | 129 | ''; |
| 132 | 130 | }; |
| 131 | zsh = { | |
| 132 | enableCompletion = true; | |
| 133 | autosuggestion.enable = true; | |
| 134 | syntaxHighlighting.enable = true; | |
| 135 | autocd = true; | |
| 136 | history.size = 10000; | |
| 137 | }; | |
| 138 | jujutsu = { | |
| 139 | settings = { | |
| 140 | user = { | |
| 141 | email = config.programs.git.userEmail; | |
| 142 | name = config.programs.git.userName; | |
| 143 | }; | |
| 144 | signing = { | |
| 145 | behavior = "own"; | |
| 146 | backend = "ssh"; | |
| 147 | key = "~/.ssh/id_ed25519.pub"; | |
| 148 | }; | |
| 149 | git = { | |
| 150 | sign-on-push = true; | |
| 151 | push-new-bookmarks = true; | |
| 152 | }; | |
| 153 | ui = { | |
| 154 | default-command = "log"; | |
| 155 | diff-formatter = [ | |
| 156 | "${pkgs.difftastic}/bin/difft" | |
| 157 | "--color=always" | |
| 158 | "$left" | |
| 159 | "$right" | |
| 160 | ]; | |
| 161 | pager = "${pkgs.bat}/bin/bat --style=plain"; | |
| 162 | }; | |
| 163 | }; | |
| 164 | }; | |
| 133 | 165 | |
| 134 | 166 | ghostty.settings.custom-shader = lib.mkIf ( |
| 135 | 167 | cfg.ghostty.shader != null |
modules/neovim/blink-cmp.nix created+33| ... | ... | @@ -0,0 +1,33 @@ |
| 1 | { lib, ... }: | |
| 2 | { | |
| 3 | vim.autocomplete.blink-cmp = { | |
| 4 | enable = true; | |
| 5 | mappings = { | |
| 6 | close = null; | |
| 7 | complete = null; | |
| 8 | confirm = null; | |
| 9 | next = null; | |
| 10 | previous = null; | |
| 11 | scrollDocsDown = null; | |
| 12 | scrollDocsUp = null; | |
| 13 | }; | |
| 14 | setupOpts = { | |
| 15 | keymap = { | |
| 16 | preset = "super-tab"; | |
| 17 | "<C-.>" = [ "show" ]; | |
| 18 | }; | |
| 19 | completion = { | |
| 20 | ghost_text.enabled = false; | |
| 21 | list.selection.preselect = true; | |
| 22 | trigger = { | |
| 23 | show_in_snippet = true; | |
| 24 | }; | |
| 25 | }; | |
| 26 | signature.enabled = true; | |
| 27 | }; | |
| 28 | sourcePlugins = { | |
| 29 | ripgrep.enable = true; | |
| 30 | }; | |
| 31 | friendly-snippets.enable = true; | |
| 32 | }; | |
| 33 | } |
modules/neovim/commands/FullscreenTerm.lua created+27| ... | ... | @@ -0,0 +1,27 @@ |
| 1 | -- Ported from https://www.reddit.com/r/neovim/comments/vemydn | |
| 2 | vim.api.nvim_create_user_command("FullscreenTerm", function(opts) | |
| 3 | 	vim.cmd("tab terminal " .. opts.args) | |
| 4 | 	local laststatus = vim.o.laststatus | |
| 5 | 	local showtabline = vim.o.showtabline | |
| 6 | 	local cmdheight = vim.o.cmdheight | |
| 7 | 	vim.o.laststatus = 0 | |
| 8 | 	vim.o.cmdheight = 0 | |
| 9 | 	vim.o.showtabline = 0 | |
| 10 | 	vim.wo.signcolumn = "no" | |
| 11 | 	vim.wo.relativenumber = false | |
| 12 | 	vim.wo.number = false | |
| 13 | 	vim.cmd( | |
| 14 | 		"autocmd! TermClose <buffer=abuf> " | |
| 15 | 			.. "if !v:event.status" | |
| 16 | 			.. " | exec 'bd! '..expand('<abuf>')" | |
| 17 | 			.. " | endif" | |
| 18 | 			.. " | checktime" | |
| 19 | 			.. " | set laststatus=" | |
| 20 | 			.. laststatus | |
| 21 | 			.. " | set cmdheight=" | |
| 22 | 			.. cmdheight | |
| 23 | 			.. " | set showtabline=" | |
| 24 | 			.. showtabline | |
| 25 | 	) | |
| 26 | 	vim.cmd("startinsert") | |
| 27 | end, { nargs = "*" }) |
modules/neovim/commands/SmartQuit.lua created+96| ... | ... | @@ -0,0 +1,96 @@ |
| 1 | vim.api.nvim_create_user_command("SmartQuit", function(opts) | |
| 2 | -- scan all buffers for unsaved buffers | |
| 3 | 	local unsaved = {} | |
| 4 | 	local saved = {} | |
| 5 | 	for _, buf in ipairs(vim.api.nvim_list_bufs()) do | |
| 6 | 		if vim.api.nvim_buf_is_loaded(buf) and vim.api.nvim_buf_get_option(buf, "buflisted") then | |
| 7 | 			if vim.api.nvim_buf_get_option(buf, "modified") then | |
| 8 | 				table.insert(unsaved, buf) | |
| 9 | 			else | |
| 10 | 				table.insert(saved, buf) | |
| 11 | 			end | |
| 12 | 		end | |
| 13 | 	end | |
| 14 | ||
| 15 | 	if #unsaved == 0 then | |
| 16 | 		vim.cmd("qa") | |
| 17 | 		return | |
| 18 | 	end | |
| 19 | ||
| 20 | 	-- gui for resolving unsaved files | |
| 21 | 	local lines = {} | |
| 22 | 	for _, buf in ipairs(unsaved) do | |
| 23 | 		local full_path = vim.api.nvim_buf_get_name(buf) | |
| 24 | 		local name = full_path == "" and ("[No Name] #" .. buf) or vim.fn.fnamemodify(full_path, ":~:.") | |
| 25 | 		table.insert(lines, " • " .. name) | |
| 26 | 	end | |
| 27 | 	table.insert(lines, "") | |
| 28 | 	table.insert(lines, " s - Save all and quit") | |
| 29 | 	table.insert(lines, " c - Close saved; leave unsaved open") | |
| 30 | 	table.insert(lines, " d - DISCARD ALL") | |
| 31 | ||
| 32 | 	local buf = vim.api.nvim_create_buf(false, true) | |
| 33 | 	vim.api.nvim_buf_set_lines(buf, 0, -1, false, lines) | |
| 34 | vim.api.nvim_buf_set_option(buf, "readonly", true) | |
| 35 | 	local width = math.max(unpack(vim.tbl_map(function(l) return #l end, lines))) | |
| 36 | 	local height = #lines | |
| 37 | 	local win = vim.api.nvim_open_win(buf, true, { | |
| 38 | 		relative = "editor", | |
| 39 | 		width = width + 1, | |
| 40 | 		height = height, | |
| 41 | 		row = (vim.o.lines - height) / 2 - 1, | |
| 42 | 		col = (vim.o.columns - width) / 2, | |
| 43 | 		style = "minimal", | |
| 44 | 		border = "rounded", | |
| 45 | 		title = { | |
| 46 | 			{ #unsaved .. " Unsaved Buffer" .. (#unsaved ~= 1 and "s" or "") .. "!", "ErrorMsg" }, | |
| 47 | 		}, | |
| 48 | 		title_pos = "center", | |
| 49 | 	}) | |
| 50 | ||
| 51 | 	vim.wo[win].winhighlight = "Normal:Normal,FloatBorder:ErrorMsg" | |
| 52 | 	vim.api.nvim_win_set_option(win, "cursorline", false) | |
| 53 | ||
| 54 | local hl = vim.api.nvim_get_hl_by_name('Cursor', true) | |
| 55 | hl.blend = 100 | |
| 56 | vim.api.nvim_set_hl(0, 'Cursor', hl) | |
| 57 | vim.opt.guicursor:append('a:Cursor/lCursor') | |
| 58 | ||
| 59 | function close() | |
| 60 | local hl = vim.api.nvim_get_hl_by_name('Cursor', true) | |
| 61 | hl.blend = 0 | |
| 62 | vim.api.nvim_set_hl(0, 'Cursor', hl) | |
| 63 | vim.opt.guicursor:remove('a:Cursor/lCursor') | |
| 64 | vim.api.nvim_win_close(win, true) | |
| 65 | end | |
| 66 | ||
| 67 | 	-- keyboard event handlers | |
| 68 | 	vim.keymap.set("n", "s", function() | |
| 69 | 		for _, buf in ipairs(unsaved) do | |
| 70 | 			vim.api.nvim_buf_call(buf, function() | |
| 71 | 				vim.cmd("write") | |
| 72 | 			end) | |
| 73 | 		end | |
| 74 | close() | |
| 75 | 		vim.cmd("qa") | |
| 76 | 	end, { buffer = buf }) | |
| 77 | 	vim.keymap.set("n", "c", function() | |
| 78 | 		for _, buf in ipairs(saved) do | |
| 79 | 			vim.api.nvim_buf_delete(buf, {}) | |
| 80 | 		end | |
| 81 | close() | |
| 82 | 	end, { buffer = buf }) | |
| 83 | 	vim.keymap.set("n", "d", function() | |
| 84 | 		vim.cmd("qa!") | |
| 85 | 	end, { buffer = buf }) | |
| 86 | 	vim.keymap.set("n", "<esc>", function() | |
| 87 | close() | |
| 88 | 	end, { buffer = buf }) | |
| 89 | ||
| 90 | vim.api.nvim_create_autocmd({ 'WinLeave' }, { | |
| 91 | buffer = buf, | |
| 92 | callback = close, | |
| 93 | }) | |
| 94 | end, { nargs = 0 }) | |
| 95 | ||
| 96 | vim.api.nvim_set_hl(0, "QuitPopUpBorder", { fg = "red" }) |
modules/neovim/default.nix+40-43| ... | ... | @@ -9,6 +9,7 @@ |
| 9 | 9 | ./formatter.nix |
| 10 | 10 | ./keybind.nix |
| 11 | 11 | ./options.nix |
| 12 | ./blink-cmp.nix | |
| 12 | 13 | ]; |
| 13 | 14 | # based on default options from upstream: |
| 14 | 15 | # https://github.com/NotAShelf/nvf/blob/main/configuration.nix |
| ... | ... | @@ -20,13 +21,12 @@ |
| 20 | 21 | # which allows user configurations to disable/override anything here. |
| 21 | 22 | config.vim = lib.mkOverride 999 { |
| 22 | 23 | extraLuaFiles = [ |
| 23 | ./lib.lua | |
| 24 | ]; | |
| 25 | ||
| 26 | theme = { | |
| 27 | enable = true; | |
| 28 | }; | |
| 24 | ./commands/FullscreenTerm.lua | |
| 25 | ./commands/SmartQuit.lua | |
| 29 | 26 | |
| 27 | ./extra.lua | |
| 28 | ]; | |
| 29 | theme.enable = true; | |
| 30 | 30 | visuals = { |
| 31 | 31 | # notification system |
| 32 | 32 | # https://github.com/j-hui/fidget.nvim |
| ... | ... | @@ -57,17 +57,19 @@ |
| 57 | 57 | lspkind.enable = config.vim.autocomplete.blink-cmp.enable; |
| 58 | 58 | # Enables inlay hints (types info in rust and shit) |
| 59 | 59 | inlayHints.enable = true; |
| 60 | #Nice mappings that i use :3 | |
| 60 | # Nice mappings that I use :3 | |
| 61 | 61 | mappings = { |
| 62 | codeAction = "<leader>ca"; | |
| 62 | codeAction = null; # in keymaps | |
| 63 | 63 | goToDeclaration = "gD"; |
| 64 | 64 | goToDefinition = "gd"; |
| 65 | listReferences = "gr"; | |
| 66 | goToType = "gy"; | |
| 65 | # TODO: changing these works but there is something else defining stuff | |
| 66 | # like grn, grr, grt, etc | |
| 67 | listReferences = "grr"; | |
| 68 | goToType = "grt"; | |
| 67 | 69 | hover = "K"; |
| 68 | 70 | nextDiagnostic = null; # ]d |
| 69 | 71 | openDiagnosticFloat = "<leader>d"; |
| 70 | renameSymbol = "rn"; | |
| 72 | renameSymbol = "grn"; | |
| 71 | 73 | documentHighlight = null; |
| 72 | 74 | listDocumentSymbols = null; |
| 73 | 75 | listImplementations = null; |
| ... | ... | @@ -82,6 +84,14 @@ |
| 82 | 84 | treesitter = { |
| 83 | 85 | enable = true; |
| 84 | 86 | addDefaultGrammars = true; |
| 87 | # this is buggy and keybind.nix overwrites its keymaps anyways | |
| 88 | incrementalSelection.enable = false; | |
| 89 | mappings.incrementalSelection = { | |
| 90 | decrementByNode = null; | |
| 91 | incrementByNode = null; | |
| 92 | incrementByScope = null; | |
| 93 | init = null; | |
| 94 | }; | |
| 85 | 95 | }; |
| 86 | 96 | debugger.nvim-dap = { |
| 87 | 97 | enable = true; |
| ... | ... | @@ -99,8 +109,6 @@ |
| 99 | 109 | clang.enable = true; |
| 100 | 110 | css.enable = true; |
| 101 | 111 | html.enable = true; |
| 102 | lua.enable = true; | |
| 103 | markdown.enable = true; | |
| 104 | 112 | nix.enable = true; |
| 105 | 113 | python.enable = true; |
| 106 | 114 | rust.crates.enable = true; |
| ... | ... | @@ -108,12 +116,30 @@ |
| 108 | 116 | ts.enable = true; |
| 109 | 117 | zig.enable = true; |
| 110 | 118 | # sort-lines: off |
| 119 | ||
| 120 | nix.lsp.servers = "nixd"; | |
| 111 | 121 | }; |
| 112 | 122 | filetree.neo-tree = { |
| 113 | 123 | enable = true; |
| 114 | 124 | setupOpts = { |
| 115 | 125 | enable_cursor_hijack = true; |
| 116 | 126 | git_status_async = true; |
| 127 | close_if_last_window = true; | |
| 128 | window.width = 30; | |
| 129 | filesystem.filtered_items = { | |
| 130 | # dotfiles are often used for project configuration | |
| 131 | hide_dotfiles = false; | |
| 132 | never_show = [ | |
| 133 | ".git" | |
| 134 | ".jj" | |
| 135 | ".DS_Store" # macOS | |
| 136 | "thumbs.db" # Windows | |
| 137 | ]; | |
| 138 | never_show_by_pattern = [ | |
| 139 | ".*.swp" | |
| 140 | "._*" # macOS | |
| 141 | ]; | |
| 142 | }; | |
| 117 | 143 | }; |
| 118 | 144 | }; |
| 119 | 145 | fzf-lua = { |
| ... | ... | @@ -125,36 +151,6 @@ |
| 125 | 151 | }; |
| 126 | 152 | }; |
| 127 | 153 | }; |
| 128 | autocomplete.blink-cmp = { | |
| 129 | enable = true; | |
| 130 | mappings = { | |
| 131 | close = null; | |
| 132 | complete = null; | |
| 133 | confirm = null; | |
| 134 | next = null; | |
| 135 | previous = null; | |
| 136 | scrollDocsDown = null; | |
| 137 | scrollDocsUp = null; | |
| 138 | }; | |
| 139 | setupOpts = { | |
| 140 | keymap = { | |
| 141 | preset = "super-tab"; | |
| 142 | }; | |
| 143 | completion = { | |
| 144 | ghost_text.enabled = false; | |
| 145 | list.selection.preselect = true; | |
| 146 | trigger = { | |
| 147 | show_in_snippet = true; | |
| 148 | }; | |
| 149 | accept.auto_brackets.enabled = true; | |
| 150 | }; | |
| 151 | signature.enabled = true; | |
| 152 | }; | |
| 153 | sourcePlugins = { | |
| 154 | ripgrep.enable = true; | |
| 155 | }; | |
| 156 | friendly-snippets.enable = true; | |
| 157 | }; | |
| 158 | 154 | statusline = { |
| 159 | 155 | lualine = { |
| 160 | 156 | enable = true; |
| ... | ... | @@ -188,6 +184,7 @@ |
| 188 | 184 | gitsigns.enable = true; |
| 189 | 185 | gitsigns.codeActions.enable = false; # throws an annoying debug message |
| 190 | 186 | }; |
| 187 | utility.undotree.enable = true; | |
| 191 | 188 | # Better help docs |
| 192 | 189 | lazy.plugins."helpview.nvim" = { |
| 193 | 190 | enabled = true; |
modules/neovim/extra.lua created+2| ... | ... | @@ -0,0 +1,2 @@ |
| 1 | -- not sure how to add this in nix | |
| 2 | require("fzf-lua").register_ui_select() |
modules/neovim/keybind.nix+3-1| ... | ... | @@ -21,6 +21,7 @@ in |
| 21 | 21 | toggle-explorer = keyCmd "n" "<leader>e" "Neotree toggle"; |
| 22 | 22 | reveal-active-file = keyCmd "n" "<leader>E" "Neotree reveal<CR>:Neotree focus"; |
| 23 | 23 | lazygit = keyCmd "n" "<leader>gg" "FullscreenTerm ${pkgs.lazygit}/bin/lazygit"; |
| 24 | smart-quit = keyCmd "n" "<leader>q" "SmartQuit"; | |
| 24 | 25 | |
| 25 | 26 | # pickers |
| 26 | 27 | pick-file = keyCmd "n" "<leader><leader>" "FzfLua files"; |
| ... | ... | @@ -34,11 +35,12 @@ in |
| 34 | 35 | # lsp |
| 35 | 36 | code-action = |
| 36 | 37 | keyCmd "n" "<leader>ca" |
| 37 | "FzfLua lsp_code_actions winopts.height=15 winopts.backdrop=100 winopts.title=false winopts.preview.title=false winopts.row=1"; | |
| 38 | "FzfLua lsp_code_actions winopts.height=8 winopts.width=50 winopts.backdrop=100 winopts.title=false winopts.preview.title=false winopts.row=1 winopts.preview.hidden=true silent=true"; | |
| 38 | 39 | |
| 39 | 40 | # subtle nice features |
| 40 | 41 | visual-dedent = keyRemap "v" "<" "<gv"; # keep selection |
| 41 | 42 | visual-indent = keyRemap "v" ">" ">gv"; # keep selection |
| 43 | visual-overwrite = keyRemap "v" "p" "pgvygv<esc>"; # re-yank text | |
| 42 | 44 | clear-search-highlights = keyRemap "n" "<esc>" ":noh<Return><esc>"; |
| 43 | 45 | }; |
| 44 | 46 |
modules/neovim/lib.lua deleted-27| ... | ... | @@ -1,27 +0,0 @@ |
| 1 | -- Ported from https://www.reddit.com/r/neovim/comments/vemydn | |
| 2 | vim.api.nvim_create_user_command("FullscreenTerm", function(opts) | |
| 3 | 	vim.cmd("tab terminal " .. opts.args) | |
| 4 | 	local laststatus = vim.o.laststatus | |
| 5 | 	local showtabline = vim.o.showtabline | |
| 6 | 	local cmdheight = vim.o.cmdheight | |
| 7 | 	vim.o.laststatus = 0 | |
| 8 | 	vim.o.cmdheight = 0 | |
| 9 | 	vim.o.showtabline = 0 | |
| 10 | 	vim.wo.signcolumn = "no" | |
| 11 | 	vim.wo.relativenumber = false | |
| 12 | 	vim.wo.number = false | |
| 13 | 	vim.cmd( | |
| 14 | 		"autocmd! TermClose <buffer=abuf> " | |
| 15 | 			.. "if !v:event.status" | |
| 16 | 			.. " | exec 'bd! '..expand('<abuf>')" | |
| 17 | 			.. " | endif" | |
| 18 | 			.. " | checktime" | |
| 19 | 			.. " | set laststatus=" | |
| 20 | 			.. laststatus | |
| 21 | 			.. " | set cmdheight=" | |
| 22 | 			.. cmdheight | |
| 23 | 			.. " | set showtabline=" | |
| 24 | 			.. showtabline | |
| 25 | 	) | |
| 26 | 	vim.cmd("startinsert") | |
| 27 | end, { nargs = "*" }) |
packages/autofmt/autofmt.js+52-9| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | #!/usr/bin/env node |
| 2 | // autofmt v1 by paper clover | |
| 2 | // autofmt v2 by paper clover | |
| 3 | 3 | // https://paperclover.dev/nix/config/src/branch/main/packages/autofmt/autofmt.js |
| 4 | 4 | // |
| 5 | 5 | // Different codebases use different formatters. Autofmt looks for project |
| ... | ... | @@ -25,6 +25,10 @@ |
| 25 | 25 | // } |
| 26 | 26 | // }, |
| 27 | 27 | // |
| 28 | // CHANGELOG | |
| 29 | // v2: added 'prettierd' as a supported formatter option. | |
| 30 | // v1: initial release | |
| 31 | // | |
| 28 | 32 | // @ts-nocheck |
| 29 | 33 | |
| 30 | 34 | // -- definitions -- |
| ... | ... | @@ -72,6 +76,15 @@ const formatters = { |
| 72 | 76 | cmd: ["deno", "fmt", "--", "$files"], |
| 73 | 77 | stdin: (file) => ["deno", "fmt", "--ext", path.extname(file).slice(1), "-"], |
| 74 | 78 | }, |
| 79 | prettierd: { | |
| 80 | // keep in mind that pretterd never exits. | |
| 81 | // https://github.com/fsouza/prettierd/issues/645 | |
| 82 | languages: ["javascript", "markdown", "json", "yaml", "mdx", "html", "css"], | |
| 83 | mustMatchFile: true, | |
| 84 | files: { "node_modules/.bin/prettier": () => which("prettierd") }, | |
| 85 | cmd: null, | |
| 86 | stdin: (file) => ["prettierd", file], | |
| 87 | }, | |
| 75 | 88 | prettier: { |
| 76 | 89 | languages: ["javascript", "markdown", "json", "yaml", "mdx", "html", "css"], |
| 77 | 90 | files: ["node_modules/.bin/prettier"], |
| ... | ... | @@ -91,7 +104,7 @@ const formatters = { |
| 91 | 104 | "nixfmt-rfc-style": { |
| 92 | 105 | languages: ["nix"], |
| 93 | 106 | files: { |
| 94 | "flake.nix": (contents) => contents.includes("nixfmt"), | |
| 107 | "flake.nix": ({ text }) => text.includes("nixfmt"), | |
| 95 | 108 | }, |
| 96 | 109 | cmd: ["nixfmt", "--", "$files"], |
| 97 | 110 | stdin: (file) => ["nixfmt", `--filename=${file}`], |
| ... | ... | @@ -99,7 +112,7 @@ const formatters = { |
| 99 | 112 | alejandra: { |
| 100 | 113 | languages: ["nix"], |
| 101 | 114 | files: { |
| 102 | "flake.nix": (contents) => contents.includes("alejandra"), | |
| 115 | "flake.nix": ({ text }) => text.includes("alejandra"), | |
| 103 | 116 | }, |
| 104 | 117 | cmd: ["alejandra", "--", "$files"], |
| 105 | 118 | stdin: () => ["alejandra"], |
| ... | ... | @@ -498,24 +511,31 @@ function pickFormatter(file) { |
| 498 | 511 | return walkUp(dir, (x) => { |
| 499 | 512 | const children = readDir(x); |
| 500 | 513 | for (const fmt of order) { |
| 514 | if (formatters[fmt][stdio ? "stdin" : "cmd"] == null) continue; | |
| 515 | ||
| 501 | 516 | let matches = false; |
| 502 | 517 | if (formatters[fmt].files === true) { |
| 503 | 518 | matches = true; |
| 504 | 519 | } |
| 505 | 520 | if (!matches) { |
| 506 | 521 | const filesToCheck = Array.isArray(formatters[fmt].files) |
| 507 | ? formatters[fmt].files.map((base) => ({ base, contents: true })) | |
| 522 | ? formatters[fmt].files.map((base) => ({ base, check: true })) | |
| 508 | 523 | : Object.entries(formatters[fmt].files) |
| 509 | .map(([base, contents]) => ({ base, contents })); | |
| 510 | for (const { base, contents } of filesToCheck) { | |
| 524 | .map(([base, check]) => ({ base, check })); | |
| 525 | for (const { base, check } of filesToCheck) { | |
| 511 | 526 | if (base.includes("/")) { |
| 512 | 527 | matches = readDir(path.join(x, path.dirname(base))) // |
| 513 | 528 | .includes(path.basename(base)); |
| 514 | 529 | } else { |
| 515 | 530 | matches = children.includes(base); |
| 516 | 531 | } |
| 517 | if (matches && typeof contents === "function") { | |
| 518 | matches = !!contents(fs.readFileSync(path.join(x, base), "utf-8")); | |
| 532 | if (matches && typeof check === "function") { | |
| 533 | let text; | |
| 534 | matches = !!check({ | |
| 535 | get text() { | |
| 536 | return text ??= fs.readFileSync(path.join(x, base), "utf-8"); | |
| 537 | }, | |
| 538 | }); | |
| 519 | 539 | } |
| 520 | 540 | } |
| 521 | 541 | } |
| ... | ... | @@ -526,7 +546,7 @@ function pickFormatter(file) { |
| 526 | 546 | return formatterId; |
| 527 | 547 | } |
| 528 | 548 | } |
| 529 | }) ?? possible[0]; | |
| 549 | }) ?? possible.find((fmt) => !formatters[fmt].mustMatchFile); | |
| 530 | 550 | } |
| 531 | 551 | |
| 532 | 552 | /** @param dir {string} @param find {(x: string) => any} */ |
| ... | ... | @@ -581,6 +601,29 @@ function readGitIgnore(dir) { |
| 581 | 601 | } |
| 582 | 602 | } |
| 583 | 603 | |
| 604 | /** @param {string} name @returns {string | null} */ | |
| 605 | export function which(name) { | |
| 606 | const paths = | |
| 607 | process.env.PATH?.split(process.platform === "win32" ? ";" : ":") ?? []; | |
| 608 | const exts = process.platform === "win32" | |
| 609 | ? (process.env.PATHEXT?.split(";") ?? [".exe", ".cmd", ".bat", ".com"]) | |
| 610 | : [""]; | |
| 611 | ||
| 612 | for (const dir of paths) { | |
| 613 | if (!dir) continue; | |
| 614 | try { | |
| 615 | const entries = readDir(dir); | |
| 616 | for (const ext of exts) { | |
| 617 | const target = name + ext; | |
| 618 | if (entries.includes(target)) { | |
| 619 | return dir + sep + target; | |
| 620 | } | |
| 621 | } | |
| 622 | } catch {} | |
| 623 | } | |
| 624 | return null; | |
| 625 | } | |
| 626 | ||
| 584 | 627 | function escapeGlob(str) { |
| 585 | 628 | return str.replace(/[\\*,{}]/g, "\\$&"); |
| 586 | 629 | } |
packages/autofmt/default.nix+4-3| ... | ... | @@ -3,12 +3,13 @@ pkgs.writeShellApplication { |
| 3 | 3 | name = "autofmt"; |
| 4 | 4 | runtimeInputs = with pkgs; [ |
| 5 | 5 | # include only a couple of formatters by default |
| 6 | clang-tools | |
| 6 | 7 | deno |
| 7 | nixfmt-rfc-style | |
| 8 | 8 | dprint |
| 9 | nixfmt-rfc-style | |
| 10 | prettierd # autofmt only runs on a local build of prettier | |
| 9 | 11 | rustfmt |
| 10 | 12 | zig |
| 11 | clang-tools | |
| 12 | 13 | ]; |
| 13 | text = ''exec deno run -A ${./autofmt.js} "$@"''; | |
| 14 | text = ''exec ${pkgs.nodejs}/bin/node ${./autofmt.js} "$@"''; | |
| 14 | 15 | } |
switch+16-5| ... | ... | @@ -1,12 +1,23 @@ |
| 1 | 1 | #!/bin/sh |
| 2 | 2 | nh_subcommand="os" |
| 3 | 3 | fallback_command="nixos-rebuild" |
| 4 | if [ "$(uname -o)" = "darwin" ]; then | |
| 5 | nh_subcommand="darwin" | |
| 6 | fallback_command="nix run .#darwin-rebuild" | |
| 4 | hostname_file="$(dirname "$0")/.hostname" | |
| 5 | if [ -n "$1" ]; then | |
| 6 | hostname="$1" | |
| 7 | elif [ -f "$hostname_file" ]; then | |
| 8 | hostname=$(cat "$hostname_file") | |
| 9 | fi | |
| 10 | if [ -z "$hostname" ]; then | |
| 11 | hostname="$(hostname)" | |
| 12 | fi | |
| 13 | printf "%s" "$hostname" >"$hostname_file" | |
| 14 | if [ "$(uname -o)" = "Darwin" ]; then | |
| 15 | nh_subcommand="darwin" | |
| 16 | fallback_command="nix run .#darwin-rebuild" | |
| 17 | hostname="darwinConfigurations.$hostname" | |
| 7 | 18 | fi |
| 8 | 19 | if command -v nh >/dev/null; then |
| 9 | nh $nh_subcommand switch . | |
| 20 | nh $nh_subcommand switch '.#'"$hostname" | |
| 10 | 21 | else |
| 11 | $fallback_command -- switch --flake . | |
| 22 | $fallback_command -- switch --flake '.#'"$hostname" | |
| 12 | 23 | fi |
users/clover/home.nix+195-19| ... | ... | @@ -10,9 +10,7 @@ in |
| 10 | 10 | let |
| 11 | 11 | # packages to always install |
| 12 | 12 | all = [ |
| 13 | (ffmpeg.override { | |
| 14 | withSvtav1 = true; | |
| 15 | }) | |
| 13 | ffmpeg-full | |
| 16 | 14 | ripgrep |
| 17 | 15 | uv |
| 18 | 16 | nh |
| ... | ... | @@ -22,6 +20,7 @@ in |
| 22 | 20 | desktop = [ |
| 23 | 21 | git-town |
| 24 | 22 | lazygit |
| 23 | jjui | |
| 25 | 24 | ]; |
| 26 | 25 | # packages to install on all servers |
| 27 | 26 | server = [ ]; |
| ... | ... | @@ -49,10 +48,9 @@ in |
| 49 | 48 | shader = "cursor-smear-black.glsl"; |
| 50 | 49 | package = null; |
| 51 | 50 | settings = { |
| 52 | theme = "light:catppuccin-latte,dark:catppuccin-macchiato"; | |
| 51 | theme = "light:Farmhouse Light,dark:Challenger Deep"; | |
| 53 | 52 | font-family = "AT Name Mono"; |
| 54 | 53 | adjust-cursor-thickness = 1; |
| 55 | minimum-contrast = 1.1; | |
| 56 | 54 | background-opacity = 0.9; |
| 57 | 55 | background-blur = true; |
| 58 | 56 | }; |
| ... | ... | @@ -61,14 +59,12 @@ in |
| 61 | 59 | # zsh is the shell i use |
| 62 | 60 | zsh = { |
| 63 | 61 | enable = true; |
| 64 | enableCompletion = true; | |
| 65 | autosuggestion.enable = true; | |
| 66 | syntaxHighlighting.enable = true; | |
| 67 | ||
| 68 | history.size = 10000; | |
| 69 | ||
| 70 | 62 | shellAliases = { |
| 71 | switch = "nh darwin switch ~/config"; | |
| 63 | switch = "~/config/switch"; | |
| 64 | gg = "lazygit"; | |
| 65 | ga = "git add"; | |
| 66 | g = "git status"; | |
| 67 | gp = "git pull --rebase && git push"; | |
| 72 | 68 | }; |
| 73 | 69 | profileExtra = '' |
| 74 | 70 | function python() { |
| ... | ... | @@ -84,6 +80,193 @@ in |
| 84 | 80 | # use a git-specific email |
| 85 | 81 | git.userEmail = "git@paperclover.net"; |
| 86 | 82 | |
| 83 | jujutsu = { | |
| 84 | enable = true; | |
| 85 | # my workflow is based on creating changes and editing them. while they | |
| 86 | # are in progress the description starts with "WIP: " | |
| 87 | settings = rec { | |
| 88 | colors = { | |
| 89 | bookmark = "green"; | |
| 90 | bookmarks = colors.bookmark; | |
| 91 | local_bookmarks = colors.bookmarks; | |
| 92 | remote_bookmarks = colors.bookmark; | |
| 93 | "working_copy bookmark" = "bright green"; | |
| 94 | "working_copy bookmarks" = colors."working_copy bookmark"; | |
| 95 | "working_copy local_bookmarks" = colors."working_copy bookmark"; | |
| 96 | "working_copy remote_bookmarks" = colors."working_copy bookmark"; | |
| 97 | ||
| 98 | "author" = { | |
| 99 | fg = "white"; | |
| 100 | bold = false; | |
| 101 | italic = true; | |
| 102 | }; | |
| 103 | "working_copy author" = colors.author; | |
| 104 | ||
| 105 | desc = { | |
| 106 | bold = false; | |
| 107 | fg = "bright white"; | |
| 108 | }; | |
| 109 | description = colors.desc; | |
| 110 | cc_wip = { | |
| 111 | fg = "bright yellow"; | |
| 112 | bold = true; | |
| 113 | reverse = true; | |
| 114 | }; | |
| 115 | cc_header = { | |
| 116 | bold = true; | |
| 117 | fg = "bright white"; | |
| 118 | }; | |
| 119 | cc_feat = "green"; | |
| 120 | cc_fix = "red"; | |
| 121 | cc_hotfix = "red"; | |
| 122 | cc_chore = "yellow"; | |
| 123 | cc_test = "blue"; | |
| 124 | cc_other = "blue"; | |
| 125 | cc_scope = { | |
| 126 | fg = "cyan"; | |
| 127 | bold = false; | |
| 128 | italic = true; | |
| 129 | }; | |
| 130 | ||
| 131 | active_marker = { | |
| 132 | fg = "bright magenta"; | |
| 133 | bold = true; | |
| 134 | reverse = true; | |
| 135 | }; | |
| 136 | conflict_marker = { | |
| 137 | fg = "bright red"; | |
| 138 | bold = true; | |
| 139 | reverse = true; | |
| 140 | }; | |
| 141 | ||
| 142 | timestamp = "bright black"; | |
| 143 | commit_id = { | |
| 144 | fg = "bright black"; | |
| 145 | bold = false; | |
| 146 | }; | |
| 147 | muted = "bright black"; | |
| 148 | }; | |
| 149 | # ui.graph.style = "square"; | |
| 150 | revsets = { | |
| 151 | log = "ancestors(description(regex:\"^(WIP:|\\\\s*$)\"), 3) | ancestors(immutable_heads(), 2) | ancestors(visible_heads(), 2)"; | |
| 152 | short-prefixes = "(trunk()..@)::"; | |
| 153 | }; | |
| 154 | templates.log = "hl_wip(self)"; | |
| 155 | ||
| 156 | template-aliases = { | |
| 157 | # log template, highlighting the WIP commits by making everything else faded out | |
| 158 | "hl_wip(commit)" = '' | |
| 159 | if(commit.root(), format_root_commit(commit), | |
| 160 | label("__commit__", | |
| 161 | format_short_commit_header(commit) ++ "\n" ++ | |
| 162 | format_commit_description(commit) | |
| 163 | ) | |
| 164 | ) | |
| 165 | ''; | |
| 166 | ||
| 167 | "format_commit_description(commit)" = '' | |
| 168 | label("desc", format_commit_firstline(commit.description().first_line())) ++ | |
| 169 | "\n" ++ if( | |
| 170 | commit.description().starts_with("WIP:") || commit.current_working_copy(), | |
| 171 | commit.description().remove_prefix(commit.description().first_line()).remove_prefix("\n").trim_end() ++ "\n ", | |
| 172 | if(commit.description().remove_prefix(commit.description().first_line()).trim().len() > 0, | |
| 173 | label("muted", lines_collapsed(commit.description().lines().filter(|x| x.trim().len() > 0).len() - 1)), | |
| 174 | " " | |
| 175 | ) | |
| 176 | ) | |
| 177 | ''; | |
| 178 | "lines_collapsed(count)" = | |
| 179 | ''("[" ++ stringify(count ++ " line" ++ if(count == 1, "", "s")) ++ " collapsed]\n")''; | |
| 180 | "format_commit_firstline(line)" = '' | |
| 181 | if(line.starts_with("WIP:"), | |
| 182 | label("cc_wip", " WIP ") ++ " " ++ format_commit_firstline_a_wip(line.remove_prefix("WIP:").trim()), | |
| 183 | format_commit_firstline_a_wip(line) | |
| 184 | ) | |
| 185 | ''; | |
| 186 | "format_commit_firstline_a_wip(line)" = '' | |
| 187 | if(line.starts_with("feat:") || line.starts_with("feat("), | |
| 188 | label("cc_feat", "feat") ++ format_commit_firstline_a_cc_type(line.remove_prefix("feat")), | |
| 189 | if(line.starts_with("fix:") || line.starts_with("fix("), | |
| 190 | label("cc_fix", "fix") ++ format_commit_firstline_a_cc_type(line.remove_prefix("fix")), | |
| 191 | if(line.starts_with("hotfix:") || line.starts_with("hotfix("), | |
| 192 | label("cc_hotfix", "hotfix") ++ format_commit_firstline_a_cc_type(line.remove_prefix("hotfix")), | |
| 193 | if(line.starts_with("chore:") || line.starts_with("chore("), | |
| 194 | label("cc_chore", "chore") ++ format_commit_firstline_a_cc_type(line.remove_prefix("chore")), | |
| 195 | if(line.starts_with("test:") || line.starts_with("test("), | |
| 196 | label("cc_other", "test") ++ format_commit_firstline_a_cc_type(line.remove_prefix("test")), | |
| 197 | if(line.starts_with("refactor:") || line.starts_with("refactor("), | |
| 198 | label("cc_other", "refactor") ++ format_commit_firstline_a_cc_type(line.remove_prefix("refactor")), | |
| 199 | if(line.starts_with("perf:") || line.starts_with("perf("), | |
| 200 | label("cc_other", "perf") ++ format_commit_firstline_a_cc_type(line.remove_prefix("perf")), | |
| 201 | if(line.starts_with("lib:") || line.starts_with("lib("), | |
| 202 | label("cc_other", "lib") ++ format_commit_firstline_a_cc_type(line.remove_prefix("lib")), | |
| 203 | label("cc_header", line) | |
| 204 | )))))))) | |
| 205 | ''; | |
| 206 | "format_commit_firstline_a_cc_type(rest)" = '' | |
| 207 | if(rest.starts_with("(") && rest.contains(")"), | |
| 208 | format_firstline_cc_scope(rest, index_of_close_paren(rest)), | |
| 209 | format_firstline_a_cc(rest)) | |
| 210 | ''; | |
| 211 | "format_firstline_cc_scope(rest, index)" = '' | |
| 212 | label("cc_scope", rest.substr(0, index)) ++ format_firstline_a_cc(rest.substr(index, rest.len())) | |
| 213 | ''; | |
| 214 | "format_firstline_a_cc(rest)" = '' | |
| 215 | if(rest.starts_with(":"), | |
| 216 | label("muted", ":") ++ label("cc_header", rest.remove_prefix(":")), | |
| 217 | label("cc_header", rest) | |
| 218 | ) | |
| 219 | ''; | |
| 220 | # sorry! | |
| 221 | "index_of_close_paren(line)" = '' | |
| 222 | stringify(if(line.substr(1, 2) == ")", "A", | |
| 223 | if(line.substr(2, 3) == ")", "AA", | |
| 224 | if(line.substr(3, 4) == ")", "AAA", | |
| 225 | if(line.substr(4, 5) == ")", "AAAA", | |
| 226 | if(line.substr(5, 6) == ")", "AAAAA", | |
| 227 | if(line.substr(6, 7) == ")", "AAAAAA", | |
| 228 | if(line.substr(7, 8) == ")", "AAAAAAA", | |
| 229 | if(line.substr(8, 9) == ")", "AAAAAAAA", | |
| 230 | if(line.substr(9, 10) == ")","AAAAAAAAA", | |
| 231 | if(line.substr(10, 11) == ")", "AAAAAAAAAA", | |
| 232 | if(line.substr(11, 12) == ")", "AAAAAAAAAAA", | |
| 233 | if(line.substr(12, 13) == ")", "AAAAAAAAAAAA", | |
| 234 | if(line.substr(13, 14) == ")", "AAAAAAAAAAAAA", | |
| 235 | if(line.substr(14, 15) == ")", "AAAAAAAAAAAAAA", | |
| 236 | if(line.substr(15, 16) == ")", "AAAAAAAAAAAAAAA", | |
| 237 | if(line.substr(16, 17) == ")", "AAAAAAAAAAAAAAAA", | |
| 238 | if(line.substr(17, 18) == ")", "AAAAAAAAAAAAAAAAA", | |
| 239 | if(line.substr(18, 19) == ")", "AAAAAAAAAAAAAAAAAA", | |
| 240 | if(line.substr(19, 20) == ")", "AAAAAAAAAAAAAAAAAAA", | |
| 241 | if(line.substr(20, 21) == ")", "AAAAAAAAAAAAAAAAAAAA", | |
| 242 | "AAAAAAAAAAAAAAAAAAAAA" | |
| 243 | ))))))))))))))))))))).len() + 1 | |
| 244 | ''; | |
| 245 | ||
| 246 | "format_short_signature(signature)" = "signature.name()"; | |
| 247 | "format_timestamp(timestamp)" = "timestamp.ago()"; | |
| 248 | "format_short_commit_header(commit)" = '' | |
| 249 | separate(" ", | |
| 250 | if(commit.current_working_copy(), label("active_marker", " ACTIVE ")), | |
| 251 | if(commit.conflict(), label("conflict_marker", " CONFLICT ")), | |
| 252 | format_short_change_id_with_hidden_and_divergent_info(commit), | |
| 253 | format_short_signature(commit.author()), | |
| 254 | label("muted", "|"), | |
| 255 | if(commit.description().trim().len() > 0, label("muted", format_timestamp(commit_timestamp(commit)))), | |
| 256 | commit.bookmarks(), | |
| 257 | commit.tags(), | |
| 258 | commit.working_copies(), | |
| 259 | label("muted", "(") ++ | |
| 260 | format_short_commit_id(commit.commit_id()) ++ | |
| 261 | label("muted", ")"), | |
| 262 | if(config("ui.show-cryptographic-signatures").as_boolean(), | |
| 263 | format_short_cryptographic_signature(commit.signature())), | |
| 264 | ) | |
| 265 | ''; | |
| 266 | }; | |
| 267 | }; | |
| 268 | }; | |
| 269 | ||
| 87 | 270 | ssh = { |
| 88 | 271 | enable = true; |
| 89 | 272 | matchBlocks = rec { |
| ... | ... | @@ -94,12 +277,5 @@ in |
| 94 | 277 | "nas.paperclover.net" = zenith; |
| 95 | 278 | }; |
| 96 | 279 | }; |
| 97 | neovide = { | |
| 98 | enable = !hostServer; | |
| 99 | settings = { | |
| 100 | font.normal = "AT Name Mono"; | |
| 101 | font.size = 13; | |
| 102 | }; | |
| 103 | }; | |
| 104 | 280 | }; |
| 105 | 281 | } |
users/clover/paperback/configuration.nix-1| ... | ... | @@ -2,7 +2,6 @@ _: { |
| 2 | 2 | homebrew = { |
| 3 | 3 | enable = true; |
| 4 | 4 | casks = [ |
| 5 | "eloston-chromium" | |
| 6 | 5 | "db-browser-for-sqlite" |
| 7 | 6 | ]; |
| 8 | 7 | }; |
users/clover/paperback/home.nix-4| ... | ... | @@ -3,7 +3,6 @@ |
| 3 | 3 | # these programs are not globally installed to reduce distractions. |
| 4 | 4 | # most of these are needed for my work environment. |
| 5 | 5 | programs = { |
| 6 | bun.enable = true; | |
| 7 | 6 | zsh.profileExtra = '' |
| 8 | 7 | _bun() { |
| 9 | 8 | local context state line |
| ... | ... | @@ -12,7 +11,6 @@ |
| 12 | 11 | ''; |
| 13 | 12 | }; |
| 14 | 13 | home.packages = with pkgs; [ |
| 15 | doppler | |
| 16 | 14 | deno |
| 17 | 15 | nodejs_22 |
| 18 | 16 | rustup |
| ... | ... | @@ -22,7 +20,5 @@ |
| 22 | 20 | yt-dlp |
| 23 | 21 | spotdl |
| 24 | 22 | zig |
| 25 | ssm-session-manager-plugin | |
| 26 | awscli | |
| 27 | 23 | ]; |
| 28 | 24 | } |
users/clover/vim.nix+18-15| ... | ... | @@ -1,20 +1,23 @@ |
| 1 | _: { | |
| 1 | { lib, ... }: | |
| 2 | { | |
| 2 | 3 | vim = { |
| 3 | options = { | |
| 4 | linebreak = true; | |
| 5 | }; | |
| 6 | git = { | |
| 7 | gitsigns.setupOpts = { | |
| 8 | current_line_blame = false; | |
| 9 | current_line_blame_opts = { | |
| 10 | virt_text = true; | |
| 11 | virt_text_pos = "right_align"; | |
| 12 | delay = 25; | |
| 13 | ignore_whitespace = true; | |
| 14 | virt_text_priority = 100; | |
| 15 | use_focus = true; | |
| 16 | }; | |
| 4 | languages.lua.enable = lib.mkForce true; | |
| 5 | options.linebreak = true; | |
| 6 | git.gitsigns.setupOpts = { | |
| 7 | current_line_blame = false; | |
| 8 | current_line_blame_opts = { | |
| 9 | virt_text = true; | |
| 10 | virt_text_pos = "right_align"; | |
| 11 | delay = 25; | |
| 12 | ignore_whitespace = true; | |
| 13 | virt_text_priority = 100; | |
| 14 | use_focus = true; | |
| 17 | 15 | }; |
| 18 | 16 | }; |
| 17 | # filetree.neo-tree.setupOpts.default_component_configs.indent = { | |
| 18 | # padding = 0; | |
| 19 | # indent_marker = "|"; | |
| 20 | # last_indent_marker = "+"; | |
| 21 | # }; | |
| 19 | 22 | }; |
| 20 | 23 | } |
users/clover/work/home.nix created+27| ... | ... | @@ -0,0 +1,27 @@ |
| 1 | { pkgs, ... }: | |
| 2 | { | |
| 3 | programs = { | |
| 4 | zsh.profileExtra = '' | |
| 5 | _bun() { | |
| 6 | local context state line | |
| 7 | _arguments -C '*:file:_files' | |
| 8 | } | |
| 9 | ''; | |
| 10 | }; | |
| 11 | home.packages = with pkgs; [ | |
| 12 | (bun.overrideAttrs (_: rec { | |
| 13 | version = "1.1.17"; | |
| 14 | src = fetchurl { | |
| 15 | url = "https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-darwin-aarch64.zip"; | |
| 16 | hash = "sha256-aULgRZ9evcGUhKJ6slLJOg3IEzUeNfIkJF8RDP3YUlo="; | |
| 17 | }; | |
| 18 | })) | |
| 19 | doppler | |
| 20 | deno | |
| 21 | nodejs_24 | |
| 22 | rustup | |
| 23 | typescript | |
| 24 | ssm-session-manager-plugin | |
| 25 | awscli | |
| 26 | ]; | |
| 27 | } |
users/fish/cattop/configuration.nix+58-63| ... | ... | @@ -1,115 +1,116 @@ |
| 1 | 1 | # Edit this configuration file to define what should be installed on |
| 2 | 2 | # your system. Help is available in the configuration.nix(5) man page, on |
| 3 | 3 | # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). |
| 4 | ||
| 5 | 4 | { |
| 6 | config, | |
| 7 | lib, | |
| 8 | 5 | pkgs, |
| 9 | 6 | ... |
| 10 | 7 | }: |
| 11 | ||
| 12 | 8 | { |
| 13 | 9 | imports = [ |
| 14 | # Include the results of the hardware scan. | |
| 15 | 10 | ./hardware-configuration.nix |
| 16 | 11 | ]; |
| 17 | 12 | |
| 18 | # Use the systemd-boot EFI boot loader. | |
| 19 | 13 | boot.loader.efi.canTouchEfiVariables = true; |
| 20 | 14 | |
| 21 | # networking.hostName = "nixos"; # Define your hostname. | |
| 22 | # Pick only one of the below networking options. | |
| 23 | # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. | |
| 15 | networking.hostName = "cattop"; | |
| 24 | 16 | # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. |
| 25 | 17 | |
| 26 | # Set your time zone. | |
| 27 | # time.timeZone = "Europe/Amsterdam"; | |
| 28 | ||
| 29 | # Configure network proxy if necessary | |
| 30 | # networking.proxy.default = "http://user:password@proxy:port/"; | |
| 31 | # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; | |
| 32 | ||
| 33 | # Select internationalisation properties. | |
| 34 | # i18n.defaultLocale = "en_US.UTF-8"; | |
| 35 | # console = { | |
| 36 | # font = "Lat2-Terminus16"; | |
| 37 | # keyMap = "us"; | |
| 38 | # useXkbConfig = true; # use xkb.options in tty. | |
| 39 | # }; | |
| 40 | ||
| 41 | # Enable the X11 windowing system. | |
| 42 | 18 | services.xserver.enable = true; |
| 43 | 19 | |
| 44 | # Enable the GNOME Desktop Environment. | |
| 45 | services.xserver.displayManager.gdm.enable = true; | |
| 46 | services.xserver.desktopManager.gnome.enable = true; | |
| 20 | services.displayManager.gdm.enable = true; | |
| 21 | services.desktopManager.gnome.enable = true; | |
| 47 | 22 | environment.gnome.excludePackages = ( |
| 48 | 23 | with pkgs; |
| 49 | 24 | [ |
| 50 | atomix | |
| 51 | cheese | |
| 25 | adwaita-fonts | |
| 26 | adwaita-icon-theme | |
| 27 | baobab | |
| 28 | decibels | |
| 52 | 29 | epiphany |
| 30 | evince | |
| 31 | file-roller | |
| 53 | 32 | geary |
| 54 | gedit | |
| 33 | gnome-backgrounds | |
| 34 | gnome-calculator | |
| 35 | gnome-calendar | |
| 55 | 36 | gnome-characters |
| 37 | gnome-clocks | |
| 38 | gnome-connections | |
| 39 | gnome-console | |
| 40 | gnome-contacts | |
| 41 | gnome-disk-utility | |
| 42 | gnome-font-viewer | |
| 43 | gnome-logs | |
| 44 | gnome-maps | |
| 56 | 45 | gnome-music |
| 57 | gnome-photos | |
| 58 | gnome-terminal | |
| 46 | gnome-shell-extensions | |
| 47 | gnome-system-monitor | |
| 48 | gnome-screenshot | |
| 49 | gnome-text-editor | |
| 50 | gnome-themes-extra | |
| 59 | 51 | gnome-tour |
| 60 | hitori | |
| 61 | iagno | |
| 52 | gnome-user-docs | |
| 53 | gnome-weather | |
| 54 | loupe | |
| 55 | nautilus | |
| 56 | orca | |
| 57 | seahorse | |
| 58 | simple-scan | |
| 59 | snapshot | |
| 60 | sushi | |
| 62 | 61 | totem |
| 63 | ||
| 62 | yelp | |
| 64 | 63 | ] |
| 65 | 64 | ); |
| 66 | 65 | |
| 67 | # Configure keymap in X11 | |
| 68 | # services.xserver.xkb.layout = "us"; | |
| 69 | # services.xserver.xkb.options = "eurosign:e,caps:escape"; | |
| 70 | ||
| 71 | # Enable CUPS to print documents. | |
| 72 | # services.printing.enable = true; | |
| 66 | services.printing.enable = true; | |
| 73 | 67 | |
| 74 | 68 | # Enable sound. |
| 75 | # services.pulseaudio.enable = true; | |
| 76 | # OR | |
| 77 | # services.pipewire = { | |
| 78 | # enable = true; | |
| 79 | # pulse.enable = true; | |
| 80 | # }; | |
| 69 | services.pulseaudio.enable = false; | |
| 70 | security.rtkit.enable = true; | |
| 71 | services.pipewire = { | |
| 72 | enable = true; | |
| 73 | alsa.enable = true; | |
| 74 | alsa.support32Bit = true; | |
| 75 | pulse.enable = true; | |
| 76 | }; | |
| 81 | 77 | |
| 82 | 78 | # Enable touchpad support (enabled default in most desktopManager). |
| 83 | 79 | # services.libinput.enable = true; |
| 84 | 80 | |
| 85 | # Define a user account. Don't forget to set a password with ‘passwd’. | |
| 86 | 81 | users.users.fish = { |
| 87 | 82 | isNormalUser = true; |
| 88 | 83 | extraGroups = [ |
| 89 | "wheel" # Enable ‘sudo’ for the user. | |
| 90 | "dialout" # Enable serial access for the user. | |
| 84 | "wheel" | |
| 85 | "dialout" | |
| 86 | "audio" | |
| 91 | 87 | ]; |
| 92 | 88 | packages = with pkgs; [ |
| 93 | 89 | tree |
| 94 | 90 | git |
| 95 | 91 | nh |
| 96 | 92 | vim |
| 97 | fish | |
| 98 | 93 | ]; |
| 99 | 94 | }; |
| 95 | programs.git = { | |
| 96 | enable = true; | |
| 97 | # extraConfig = { | |
| 98 | # push = { | |
| 99 | # autoSetupRemote = true; | |
| 100 | # }; | |
| 101 | # }; | |
| 102 | }; | |
| 100 | 103 | |
| 101 | 104 | programs.firefox.enable = true; |
| 102 | programs.neovim.defaultEditor.enable = true; | |
| 105 | programs.neovim.enable = true; | |
| 106 | #programs.neovim.defaultEditor.enable = true; | |
| 103 | 107 | |
| 104 | 108 | # List packages installed in system profile. |
| 105 | # You can use https://search.nixos.org/ to find more packages (and options). | |
| 106 | 109 | environment.systemPackages = with pkgs; [ |
| 107 | vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. | |
| 110 | vim | |
| 108 | 111 | wget |
| 109 | 112 | ]; |
| 110 | 113 | |
| 111 | # Some programs need SUID wrappers, can be configured further or are | |
| 112 | # started in user sessions. | |
| 113 | 114 | programs.mtr.enable = true; |
| 114 | 115 | programs.gnupg.agent = { |
| 115 | 116 | enable = true; |
| ... | ... | @@ -121,12 +122,6 @@ |
| 121 | 122 | # Enable the OpenSSH daemon. |
| 122 | 123 | # services.openssh.enable = true; |
| 123 | 124 | |
| 124 | # Open ports in the firewall. | |
| 125 | # networking.firewall.allowedTCPPorts = [ ... ]; | |
| 126 | # networking.firewall.allowedUDPPorts = [ ... ]; | |
| 127 | # Or disable the firewall altogether. | |
| 128 | # networking.firewall.enable = false; | |
| 129 | ||
| 130 | 125 | # Copy the NixOS configuration file and link it from the resulting system |
| 131 | 126 | # (/run/current-system/configuration.nix). This is useful in case you |
| 132 | 127 | # accidentally delete configuration.nix. |
users/fish/cattop/hardware-configuration.nix+17-31| ... | ... | @@ -1,46 +1,32 @@ |
| 1 | 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ |
| 2 | 2 | # and may be overwritten by future invocations. Please make changes |
| 3 | 3 | # to /etc/nixos/configuration.nix instead. |
| 4 | { | |
| 5 | config, | |
| 6 | lib, | |
| 7 | pkgs, | |
| 8 | modulesPath, | |
| 9 | ... | |
| 10 | }: | |
| 4 | { config, lib, pkgs, modulesPath, ... }: | |
| 11 | 5 | |
| 12 | 6 | { |
| 13 | imports = [ | |
| 14 | (modulesPath + "/installer/scan/not-detected.nix") | |
| 15 | ]; | |
| 7 | imports = | |
| 8 | [ (modulesPath + "/installer/scan/not-detected.nix") | |
| 9 | ]; | |
| 16 | 10 | |
| 17 | boot.initrd.availableKernelModules = [ | |
| 18 | "xhci_pci" | |
| 19 | "thunderbolt" | |
| 20 | "vmd" | |
| 21 | "nvme" | |
| 22 | ]; | |
| 11 | boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" ]; | |
| 23 | 12 | boot.initrd.kernelModules = [ ]; |
| 24 | 13 | boot.kernelModules = [ "kvm-intel" ]; |
| 25 | 14 | boot.extraModulePackages = [ ]; |
| 26 | 15 | |
| 27 | fileSystems."/" = { | |
| 28 | device = "/dev/disk/by-uuid/8eb0d6a2-b8cf-4ef2-ba2a-e25a5555b0bc"; | |
| 29 | fsType = "ext4"; | |
| 30 | }; | |
| 16 | fileSystems."/" = | |
| 17 | { device = "/dev/disk/by-uuid/d434c90f-e135-426e-b237-ead2f44e37c6"; | |
| 18 | fsType = "ext4"; | |
| 19 | }; | |
| 31 | 20 | |
| 32 | fileSystems."/boot/efi" = { | |
| 33 | device = "/dev/disk/by-uuid/3B51-4A1C"; | |
| 34 | fsType = "vfat"; | |
| 35 | options = [ | |
| 36 | "fmask=0077" | |
| 37 | "dmask=0077" | |
| 38 | ]; | |
| 39 | }; | |
| 21 | fileSystems."/boot/EFI" = | |
| 22 | { device = "/dev/disk/by-uuid/473A-B8FD"; | |
| 23 | fsType = "vfat"; | |
| 24 | options = [ "fmask=0077" "dmask=0077" ]; | |
| 25 | }; | |
| 40 | 26 | |
| 41 | swapDevices = [ | |
| 42 | { device = "/dev/disk/by-uuid/58ee9d19-292f-49b5-9979-341b42e8e09d"; } | |
| 43 | ]; | |
| 27 | swapDevices = | |
| 28 | [ { device = "/dev/disk/by-uuid/e0cac471-0e32-4d5a-bf85-e8f93b304356"; } | |
| 29 | ]; | |
| 44 | 30 | |
| 45 | 31 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking |
| 46 | 32 | # (the default) this is the recommended approach. When using systemd-networkd it's |
users/fish/cattop/home.nix+21-24| ... | ... | @@ -1,13 +1,4 @@ |
| 1 | { | |
| 2 | inputs, | |
| 3 | config, | |
| 4 | pkgs, | |
| 5 | lib, | |
| 6 | userSettings, | |
| 7 | systemSettings, | |
| 8 | ... | |
| 9 | }: | |
| 10 | ||
| 1 | { pkgs, ... }: | |
| 11 | 2 | { |
| 12 | 3 | home = { |
| 13 | 4 | stateVersion = "23.05"; # Don't change this unless upgrading Home Manager versions |
| ... | ... | @@ -15,17 +6,14 @@ |
| 15 | 6 | packages = with pkgs; [ |
| 16 | 7 | # General applications |
| 17 | 8 | ghostty |
| 18 | stremio | |
| 19 | julia | |
| 20 | calibre | |
| 21 | mpv | |
| 22 | 9 | signal-desktop |
| 23 | python3 | |
| 24 | gh | |
| 25 | 10 | spotify |
| 11 | equibop | |
| 26 | 12 | |
| 27 | 13 | # Gaming |
| 28 | 14 | (prismlauncher.override { gamemodeSupport = true; }) |
| 15 | #bsdgames | |
| 16 | space-cadet-pinball | |
| 29 | 17 | |
| 30 | 18 | # System & desktop tools |
| 31 | 19 | wofi |
| ... | ... | @@ -37,18 +25,19 @@ |
| 37 | 25 | ethtool |
| 38 | 26 | grub2 |
| 39 | 27 | efibootmgr |
| 40 | distrobox | |
| 41 | 28 | pqiv |
| 29 | imagemagick | |
| 30 | toybox | |
| 42 | 31 | |
| 43 | 32 | # Dev tools |
| 44 | legcord | |
| 45 | 33 | hyfetch |
| 46 | kicad | |
| 34 | python3 | |
| 35 | gh | |
| 36 | cmake | |
| 37 | ripgrep | |
| 47 | 38 | |
| 48 | 39 | # Unsorted |
| 49 | ripgrep | |
| 50 | busybox | |
| 51 | imagemagick | |
| 40 | kicad | |
| 52 | 41 | ]; |
| 53 | 42 | }; |
| 54 | 43 | |
| ... | ... | @@ -61,7 +50,15 @@ |
| 61 | 50 | gitCredentialHelper.enable = true; |
| 62 | 51 | }; |
| 63 | 52 | |
| 64 | # Uncomment if you want to use MangoHud system-wide | |
| 65 | # mangohud.enable = true; | |
| 53 | ghostty = { | |
| 54 | enable = true; | |
| 55 | shader = "cursor-smear-black.glsl"; | |
| 56 | settings = { | |
| 57 | theme = "citruszest"; | |
| 58 | adjust-cursor-thickness = 1; | |
| 59 | background-opacity = 0.95; | |
| 60 | background-blur = true; | |
| 61 | }; | |
| 62 | }; | |
| 66 | 63 | }; |
| 67 | 64 | } |
users/fish/user.nix+1-1| ... | ... | @@ -4,7 +4,7 @@ rec { |
| 4 | 4 | email = "77413091+JulianBarbera@users.noreply.github.com"; # email (used for certain configurations) |
| 5 | 5 | dotfilesDir = "~/config"; # absolute path of the local repo |
| 6 | 6 | theme = "catppuccin-mocha"; # name of theme that stylix will use |
| 7 | browser = "firefox"; # Default browser; must select one from ./user/app/browser/ | |
| 7 | browser = "zen-browser"; # Default browser; must select one from ./user/app/browser/ | |
| 8 | 8 | term = "ghostty"; # Default terminal command; |
| 9 | 9 | font = "iosevka"; # Selected font |
| 10 | 10 | editor = "neovim"; # Default editor; |
users/fish/vim.nix+38-1| ... | ... | @@ -1,3 +1,40 @@ |
| 1 | { ... }: | |
| 1 | { pkgs, ... }: | |
| 2 | 2 | { |
| 3 | imports = [ | |
| 4 | ./vim/default.nix | |
| 5 | ]; | |
| 6 | ||
| 7 | vim = { | |
| 8 | #enable python provider | |
| 9 | withPython3 = true; | |
| 10 | python3Packages = [ "pynvim" ]; | |
| 11 | ||
| 12 | autocmds = [ | |
| 13 | #Autocommand to fall back to treesitter folding if LSP doesnt support it | |
| 14 | { | |
| 15 | event = [ "LspAttach" ]; | |
| 16 | callback = pkgs.lib.generators.mkLuaInline '' | |
| 17 | function(args) | |
| 18 | local client = vim.lsp.get_client_by_id(args.data.client_id) | |
| 19 | if client:supports_method('textDocument/foldingRange') then | |
| 20 | local win = vim.api.nvim_get_current_win() | |
| 21 | vim.wo[win][0].foldexpr = 'v:lua.vim.lsp.foldexpr()' | |
| 22 | end | |
| 23 | end | |
| 24 | ''; | |
| 25 | } | |
| 26 | ]; | |
| 27 | ||
| 28 | tabline = { | |
| 29 | nvimBufferline.enable = true; | |
| 30 | }; | |
| 31 | startPlugins = [ | |
| 32 | "nui-nvim" | |
| 33 | ]; | |
| 34 | theme = { | |
| 35 | name = "catppuccin"; | |
| 36 | style = "mocha"; | |
| 37 | }; | |
| 38 | hideSearchHighlight = true; | |
| 39 | }; | |
| 3 | 40 | } |
users/fish/vim/default.nix created+9| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | { ... }: | |
| 2 | { | |
| 3 | imports = [ | |
| 4 | ./languages.nix | |
| 5 | ./latex.nix | |
| 6 | ./visuals.nix | |
| 7 | ./mini.nix | |
| 8 | ]; | |
| 9 | } |
users/fish/vim/languages.nix created+155| ... | ... | @@ -0,0 +1,155 @@ |
| 1 | { | |
| 2 | flake, | |
| 3 | user, | |
| 4 | host, | |
| 5 | pkgs, | |
| 6 | ... | |
| 7 | }: | |
| 8 | { | |
| 9 | vim = { | |
| 10 | extraPackages = with pkgs; [ | |
| 11 | python312Packages.pylatexenc | |
| 12 | ]; | |
| 13 | languages = { | |
| 14 | lua.lsp.enable = true; | |
| 15 | lua.lsp.lazydev.enable = true; | |
| 16 | python = { | |
| 17 | format.type = "ruff"; | |
| 18 | }; | |
| 19 | markdown = { | |
| 20 | enable = true; | |
| 21 | extensions.render-markdown-nvim = { | |
| 22 | enable = true; | |
| 23 | }; | |
| 24 | }; | |
| 25 | nix = { | |
| 26 | lsp.servers = [ | |
| 27 | "nil" | |
| 28 | "nixd" | |
| 29 | ]; | |
| 30 | }; | |
| 31 | }; | |
| 32 | ||
| 33 | formatter.conform-nvim = { | |
| 34 | enable = true; | |
| 35 | setupOpts = { | |
| 36 | formatters_by_ft = { | |
| 37 | fish = [ "fish_indent" ]; | |
| 38 | tex = [ "latexindent" ]; | |
| 39 | }; | |
| 40 | }; | |
| 41 | }; | |
| 42 | diagnostics = { | |
| 43 | enable = true; | |
| 44 | config = { | |
| 45 | virtual_text = { | |
| 46 | format = pkgs.lib.generators.mkLuaInline '' | |
| 47 | function(diagnostic) | |
| 48 | return string.format("%s (%s)", diagnostic.message, diagnostic.source) | |
| 49 | end | |
| 50 | ''; | |
| 51 | }; | |
| 52 | }; | |
| 53 | nvim-lint = { | |
| 54 | enable = true; | |
| 55 | linters_by_ft = { | |
| 56 | nix = [ "statix" ]; | |
| 57 | tex = [ "chktex" ]; | |
| 58 | haskell = [ "hlint" ]; | |
| 59 | }; | |
| 60 | ||
| 61 | linters = { | |
| 62 | chktex = { | |
| 63 | ignore_exitcode = true; | |
| 64 | }; | |
| 65 | }; | |
| 66 | }; | |
| 67 | }; | |
| 68 | treesitter = { | |
| 69 | enable = true; | |
| 70 | fold = true; | |
| 71 | addDefaultGrammars = true; | |
| 72 | highlight = { | |
| 73 | additionalVimRegexHighlighting = true; | |
| 74 | }; | |
| 75 | ||
| 76 | grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [ | |
| 77 | markdown_inline | |
| 78 | markdown | |
| 79 | ]; | |
| 80 | ||
| 81 | highlight.enable = true; | |
| 82 | indent.enable = false; | |
| 83 | }; | |
| 84 | ||
| 85 | visuals = { | |
| 86 | fidget-nvim = { | |
| 87 | setupOpts = { | |
| 88 | logger.level = "trace"; | |
| 89 | }; | |
| 90 | }; | |
| 91 | }; | |
| 92 | ||
| 93 | ui = { | |
| 94 | nvim-ufo = { | |
| 95 | enable = true; | |
| 96 | }; | |
| 97 | }; | |
| 98 | autocomplete.blink-cmp = { | |
| 99 | enable = true; | |
| 100 | mappings = { | |
| 101 | close = null; | |
| 102 | complete = null; | |
| 103 | confirm = null; | |
| 104 | next = null; | |
| 105 | previous = null; | |
| 106 | scrollDocsDown = null; | |
| 107 | scrollDocsUp = null; | |
| 108 | }; | |
| 109 | ||
| 110 | setupOpts = { | |
| 111 | keymap = { | |
| 112 | preset = "super-tab"; | |
| 113 | }; | |
| 114 | completion = { | |
| 115 | ghost_text.enabled = false; | |
| 116 | list.selection.preselect = true; | |
| 117 | trigger = { | |
| 118 | show_in_snippet = true; | |
| 119 | }; | |
| 120 | accept.auto_brackets.enabled = true; | |
| 121 | }; | |
| 122 | signature = { | |
| 123 | enabled = true; | |
| 124 | }; | |
| 125 | }; | |
| 126 | }; | |
| 127 | ||
| 128 | lazy.plugins."blink.pairs" = { | |
| 129 | enabled = true; | |
| 130 | package = pkgs.vimPlugins.blink-pairs; | |
| 131 | setupModule = "blink.pairs"; | |
| 132 | setupOpts = { | |
| 133 | mappings = { | |
| 134 | # -- you can call require("blink.pairs.mappings").enable() and require("blink.pairs.mappings").disable() to enable/disable mappings at runtime | |
| 135 | enabled = true; | |
| 136 | # -- see the defaults: https://github.com/Saghen/blink.pairs/blob/main/lua/blink/pairs/config/mappings.lua#L10 | |
| 137 | pairs = [ ]; | |
| 138 | }; | |
| 139 | highlights = { | |
| 140 | enabled = true; | |
| 141 | groups = [ | |
| 142 | "BlinkPairsOrange" | |
| 143 | "BlinkPairsPurple" | |
| 144 | "BlinkPairsBlue" | |
| 145 | ]; | |
| 146 | matchparen = { | |
| 147 | enabled = true; | |
| 148 | group = "MatchParen"; | |
| 149 | }; | |
| 150 | }; | |
| 151 | debug = false; | |
| 152 | }; | |
| 153 | }; | |
| 154 | }; | |
| 155 | } |
users/fish/vim/latex.nix created+118| ... | ... | @@ -0,0 +1,118 @@ |
| 1 | { pkgs, host, ... }: | |
| 2 | { | |
| 3 | vim = { | |
| 4 | extraPackages = with pkgs; [ | |
| 5 | texliveFull | |
| 6 | ]; | |
| 7 | lazy.plugins.cmp-vimtex = { | |
| 8 | enabled = true; | |
| 9 | package = pkgs.vimPlugins.cmp-vimtex; | |
| 10 | lazy = false; | |
| 11 | ||
| 12 | }; | |
| 13 | lazy.plugins.vimtex = { | |
| 14 | enabled = true; | |
| 15 | package = pkgs.vimPlugins.vimtex; | |
| 16 | lazy = false; | |
| 17 | }; | |
| 18 | ||
| 19 | globals = { | |
| 20 | tex_flavor = "latex"; | |
| 21 | maplocalleader = "\\"; | |
| 22 | vimtex_compiler_method = "latexmk"; | |
| 23 | vimtex_view_method = if host.darwin then "skim" else "zathura"; | |
| 24 | vimtex_view_automatic = 1; | |
| 25 | vimtex_compiler_latexmk = { | |
| 26 | callback = 1; | |
| 27 | continuous = 1; | |
| 28 | executable = "latexmk"; | |
| 29 | hooks = [ ]; | |
| 30 | options = [ | |
| 31 | "-verbose" | |
| 32 | "-file-line-error" | |
| 33 | "-synctex=1" | |
| 34 | "-interaction=nonstopmode" | |
| 35 | "-shell-escape" | |
| 36 | ]; | |
| 37 | }; | |
| 38 | vimtex_log_ignore = [ | |
| 39 | "Underfull" | |
| 40 | "Overfull" | |
| 41 | "specifier changed to" | |
| 42 | "Token not allowed in a PDF string" | |
| 43 | ]; | |
| 44 | vimtex_quickfix_ignore_filters = [ | |
| 45 | "Underfull" | |
| 46 | "Overfull" | |
| 47 | ]; | |
| 48 | }; | |
| 49 | ||
| 50 | autocomplete.blink-cmp = { | |
| 51 | sourcePlugins = { | |
| 52 | "blink.compat" = { | |
| 53 | enable = true; | |
| 54 | package = "blink-compat"; | |
| 55 | module = "blink.compat.source"; | |
| 56 | }; | |
| 57 | }; | |
| 58 | setupOpts = { | |
| 59 | sources = { | |
| 60 | default = [ "vimtex" ]; | |
| 61 | providers = { | |
| 62 | vimtex = { | |
| 63 | name = "vimtex"; | |
| 64 | module = "blink.compat.source"; | |
| 65 | score_offset = 100; | |
| 66 | }; | |
| 67 | }; | |
| 68 | }; | |
| 69 | }; | |
| 70 | }; | |
| 71 | ||
| 72 | augroups = [ | |
| 73 | { | |
| 74 | name = "VimTeX Events"; | |
| 75 | } | |
| 76 | ]; | |
| 77 | autocmds = [ | |
| 78 | { | |
| 79 | pattern = [ "VimtexEventViewReverse" ]; | |
| 80 | event = [ "User" ]; | |
| 81 | desc = "Return to nvim after reverse search"; | |
| 82 | command = "call b:vimtex.viewer.xdo_focus_vim()"; | |
| 83 | group = "VimTeX Events"; | |
| 84 | } | |
| 85 | { | |
| 86 | pattern = [ "VimtexEventQuit" ]; | |
| 87 | event = [ "User" ]; | |
| 88 | desc = "Close pdf after exiting nvim"; | |
| 89 | command = "VimtexClean"; | |
| 90 | group = "VimTeX Events"; | |
| 91 | } | |
| 92 | ||
| 93 | { | |
| 94 | pattern = [ "VimtexEventInitPost" ]; | |
| 95 | event = [ "User" ]; | |
| 96 | desc = "Start compiling when opening nvim to a tex file"; | |
| 97 | command = "VimtexCompile"; | |
| 98 | group = "VimTeX Events"; | |
| 99 | } | |
| 100 | ||
| 101 | ]; | |
| 102 | ||
| 103 | lsp = { | |
| 104 | servers = { | |
| 105 | texlab = { | |
| 106 | enable = true; | |
| 107 | cmd = [ "${pkgs.texlab}/bin/texlab" ]; | |
| 108 | filetypes = [ "tex" ]; | |
| 109 | }; | |
| 110 | }; | |
| 111 | }; | |
| 112 | treesitter = { | |
| 113 | grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [ | |
| 114 | latex | |
| 115 | ]; | |
| 116 | }; | |
| 117 | }; | |
| 118 | } |
users/fish/vim/mini.nix created+10| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | { pkgs, ... }: | |
| 2 | { | |
| 3 | vim = { | |
| 4 | mini = { | |
| 5 | icons.enable = true; | |
| 6 | ai.enable = true; | |
| 7 | surround.enable = true; | |
| 8 | }; | |
| 9 | }; | |
| 10 | } |
users/fish/vim/visuals.nix created+27| ... | ... | @@ -0,0 +1,27 @@ |
| 1 | { pkgs, ... }: | |
| 2 | { | |
| 3 | vim = { | |
| 4 | ui = { | |
| 5 | noice = { | |
| 6 | enable = true; | |
| 7 | setupOpts = { | |
| 8 | lsp = { | |
| 9 | progress.enabled = false; | |
| 10 | signature.enabled = true; | |
| 11 | }; | |
| 12 | presets = { | |
| 13 | lsp_doc_border = true; | |
| 14 | long_message_to_split = true; | |
| 15 | inc_rename = false; | |
| 16 | command_palette = false; | |
| 17 | bottom_search = true; | |
| 18 | }; | |
| 19 | }; | |
| 20 | }; | |
| 21 | borders = { | |
| 22 | enable = true; | |
| 23 | }; | |
| 24 | }; | |
| 25 | ||
| 26 | }; | |
| 27 | } |
users/natalie/home.nix+9-7| ... | ... | @@ -1,11 +1,5 @@ |
| 1 | { lib, host, ... }@args: | |
| 1 | 2 | { |
| 2 | pkgs, | |
| 3 | lib, | |
| 4 | options, | |
| 5 | ... | |
| 6 | }@args: | |
| 7 | { | |
| 8 | ||
| 9 | 3 | programs = { |
| 10 | 4 | # sort-lines:start |
| 11 | 5 | atuin.enable = true; |
| ... | ... | @@ -29,6 +23,14 @@ |
| 29 | 23 | }; |
| 30 | 24 | }; |
| 31 | 25 | # sort-lines:end |
| 26 | ||
| 27 | fish = { | |
| 28 | shellAliases = | |
| 29 | { } | |
| 30 | // lib.optionalAttrs (!host.darwin) { | |
| 31 | reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now"; | |
| 32 | }; | |
| 33 | }; | |
| 32 | 34 | }; |
| 33 | 35 | |
| 34 | 36 | home.packages = import ./packages.nix args; |
users/natalie/vim/default.nix-1| ... | ... | @@ -1,7 +1,6 @@ |
| 1 | 1 | { ... }: |
| 2 | 2 | { |
| 3 | 3 | imports = [ |
| 4 | ./keybinds.nix | |
| 5 | 4 | ./languages.nix |
| 6 | 5 | ./latex.nix |
| 7 | 6 | ./visuals.nix |
users/natalie/vim/keybinds.nix deleted-19| ... | ... | @@ -1,19 +0,0 @@ |
| 1 | { ... }: | |
| 2 | let | |
| 3 | mkKeymap = mode: key: action: desc: { | |
| 4 | inherit mode; | |
| 5 | inherit key action desc; | |
| 6 | }; | |
| 7 | n = mkKeymap "n"; # normal mode | |
| 8 | in | |
| 9 | { | |
| 10 | vim = { | |
| 11 | keymaps = [ | |
| 12 | (n "<leader>e" ":lua require('snacks').explorer()<CR>" "File Explorer") | |
| 13 | # Snacks Picker Replaces Telescope!? | |
| 14 | (n "<leader><space>" ":lua require('snacks').picker.smart()<CR>" "Smart Find Files") | |
| 15 | (n "<leader>ff" ":lua require('snacks').picker.files()<CR>" "Find File") | |
| 16 | (n "<leader>fg" ":lua require('snacks').picker.grep()<CR>" "Grep Files") | |
| 17 | ]; | |
| 18 | }; | |
| 19 | } |
users/natalie/vim/languages.nix+1| ... | ... | @@ -11,6 +11,7 @@ |
| 11 | 11 | python312Packages.pylatexenc |
| 12 | 12 | ]; |
| 13 | 13 | languages = { |
| 14 | lua.lsp.enable = true; | |
| 14 | 15 | lua.lsp.lazydev.enable = true; |
| 15 | 16 | python = { |
| 16 | 17 | format.type = "ruff"; |