authorgravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-10-01 17:21:25-07:00
committergravatar for nmarks413@gmail.comNatalie Marks <nmarks413@gmail.com> 2025-10-01 17:21:25-07:00
logbf980b89ceac4295c1ec8a2614b39d6341ea548a
tree590887e1277abd60be3a6931483925893593e58f
parent4ecab4b9c4140b5ce5738b4fac2261c0bbc324ad
parent3b80f030b5e98f38f37725c19088d862d8cbc6c1
signature Commit is signed but in an unrecognized format.

Merge branch 'main' of paperclover.dev:nix/config


34 files changed, 1065 insertions(+), 322 deletions(-)

.gitignore+2-1
......@@ -1,4 +1,5 @@
1flake.lock
21.DS_STORE
2.hostname
3flake.lock
34result
45result-*
flake.lock+27-27
......@@ -9,11 +9,11 @@
99 ]
1010 },
1111 "locked": {
12 "lastModified": 1754511800,
13 "narHash": "sha256-/gYkj4dbzcAV1EWJYy+2ryHGtC57jhIrRwSGQKCT8Gk=",
12 "lastModified": 1755807717,
13 "narHash": "sha256-x/IcOa+p9VFYlwXmuNhbZ8ce9As24rqy6uABv+tKacU=",
1414 "owner": "tadfisher",
1515 "repo": "android-nixpkgs",
16 "rev": "5bb0f6e7b112c7be7895c6058925c29db360b205",
16 "rev": "4316f29f7f3b34c41f2639ae190022fbed60b850",
1717 "type": "github"
1818 },
1919 "original": {
......@@ -58,11 +58,11 @@
5858 ]
5959 },
6060 "locked": {
61 "lastModified": 1751313918,
62 "narHash": "sha256-HsJM3XLa43WpG+665aGEh8iS8AfEwOIQWk3Mke3e7nk=",
61 "lastModified": 1755825449,
62 "narHash": "sha256-XkiN4NM9Xdy59h69Pc+Vg4PxkSm9EWl6u7k6D5FZ5cM=",
6363 "owner": "lnl7",
6464 "repo": "nix-darwin",
65 "rev": "e04a388232d9a6ba56967ce5b53a8a6f713cdfcf",
65 "rev": "8df64f819698c1fee0c2969696f54a843b2231e8",
6666 "type": "github"
6767 },
6868 "original": {
......@@ -314,11 +314,11 @@
314314 ]
315315 },
316316 "locked": {
317 "lastModified": 1753943136,
318 "narHash": "sha256-eiEE5SabVcIlGSTRcRyBjmJMaYAV95SJnjy8YSsVeW4=",
317 "lastModified": 1755810213,
318 "narHash": "sha256-QdenO8f0PTg+tC6HuSvngKcbRZA5oZKmjUT+MXKOLQg=",
319319 "owner": "nix-community",
320320 "repo": "home-manager",
321 "rev": "bd82507edd860c453471c46957cbbe3c9fd01b5c",
321 "rev": "6911d3e7f475f7b3558b4f5a6aba90fa86099baa",
322322 "type": "github"
323323 },
324324 "original": {
......@@ -363,11 +363,11 @@
363363 ]
364364 },
365365 "locked": {
366 "lastModified": 1753293216,
367 "narHash": "sha256-4hAm9PYNHAsR3MxH8MhSZt7mTiR8MlhyQilLJEPdaZs=",
366 "lastModified": 1754439168,
367 "narHash": "sha256-NcwRidwb/ask65LE86os4RkhyoPQo5sLu0sJs/NboK4=",
368368 "owner": "moonlight-mod",
369369 "repo": "moonlight",
370 "rev": "297a1b57c14ff18890382b2fe89f493ba349a730",
370 "rev": "66b81b113afd6654a88c9adb7edb7fe92839fe84",
371371 "type": "github"
372372 },
373373 "original": {
......@@ -383,11 +383,11 @@
383383 ]
384384 },
385385 "locked": {
386 "lastModified": 1753589988,
387 "narHash": "sha256-y1JlcMB2dKFkrr6g+Ucmj8L//IY09BtSKTH/A7OU7mU=",
386 "lastModified": 1755404379,
387 "narHash": "sha256-Q6ZxZDBmD/B988Jjbx7/NchxOKIpOKBBrx9Yb0zMzpQ=",
388388 "owner": "nix-community",
389389 "repo": "nix-index-database",
390 "rev": "f0736b09c43028fd726fb70c3eb3d1f0795454cf",
390 "rev": "ebbc1c05f786ae39bb5e04e57bf2c10c44a649e3",
391391 "type": "github"
392392 },
393393 "original": {
......@@ -434,11 +434,11 @@
434434 },
435435 "nixpkgs_2": {
436436 "locked": {
437 "lastModified": 1753694789,
438 "narHash": "sha256-cKgvtz6fKuK1Xr5LQW/zOUiAC0oSQoA9nOISB0pJZqM=",
437 "lastModified": 1755615617,
438 "narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=",
439439 "owner": "NixOS",
440440 "repo": "nixpkgs",
441 "rev": "dc9637876d0dcc8c9e5e22986b857632effeb727",
441 "rev": "20075955deac2583bb12f07151c2df830ef346b4",
442442 "type": "github"
443443 },
444444 "original": {
......@@ -540,11 +540,11 @@
540540 ]
541541 },
542542 "locked": {
543 "lastModified": 1753930086,
544 "narHash": "sha256-Os6Ta5zamfAllmQNlvkbGZLHn06zJy3hVXRk+Dy2yMo=",
543 "lastModified": 1755830208,
544 "narHash": "sha256-fMa/Hcg+4O2h+kl3gNPjtGSWPI8NtCl3LYMsejK6qGA=",
545545 "owner": "oxalica",
546546 "repo": "rust-overlay",
547 "rev": "17b672c10c1798696a516cb879edbc2ebd0f58a4",
547 "rev": "802a7b97f8ff672ba2dec70c9e354f51f844e796",
548548 "type": "github"
549549 },
550550 "original": {
......@@ -749,11 +749,11 @@
749749 ]
750750 },
751751 "locked": {
752 "lastModified": 1753676490,
753 "narHash": "sha256-XeifEftxYGP/gzp6O1yO1S1W+MEx4Xvrgeu84ryRPNQ=",
752 "lastModified": 1754886070,
753 "narHash": "sha256-MZDmxOkVKL1HY72bliN8Gxh0SYkHUa3W/1fTU2ke36I=",
754754 "owner": "youwen5",
755755 "repo": "zen-browser-flake",
756 "rev": "77024f4557204bb4d526893d42db2e6f50727fab",
756 "rev": "e37d2b326311320c8571111b3ef89b29d26d4b64",
757757 "type": "github"
758758 },
759759 "original": {
......@@ -769,11 +769,11 @@
769769 "nixpkgs": "nixpkgs_3"
770770 },
771771 "locked": {
772 "lastModified": 1753963984,
773 "narHash": "sha256-JPiCLZHuNk11XYYCqoLoKYIgdUu2WpNccTzl4ljycTQ=",
772 "lastModified": 1755605615,
773 "narHash": "sha256-J0Cxren2QLeI0ZvRZw4XGcMm4q3uPIZHM+eJnaZfXX8=",
774774 "owner": "mitchellh",
775775 "repo": "zig-overlay",
776 "rev": "45772b76cdb103bd300abac4a85a34518dee65a0",
776 "rev": "714fae26049a263ff2e4641ce7c973f371f4b005",
777777 "type": "github"
778778 },
779779 "original": {
flake.nix+6-1
......@@ -91,7 +91,6 @@
9191 mkSystem = import ./lib/mkSystem.nix { inherit inputs mkNeovim overlays; };
9292 in
9393 rec {
94 inherit self;
9594 # "nix fmt"
9695 formatter = forAllSystems (inputs: inputs.pkgs.autofmt);
9796 packages = forAllSystems (
......@@ -134,6 +133,12 @@
134133 host = "paperback";
135134 system = "aarch64-darwin";
136135 };
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 };
137142
138143 # fish's cattop
139144 nixosConfigurations.cattop = mkSystem "cattop" {
lib/mkNeovim.nix+14-12
......@@ -10,16 +10,18 @@ let
1010
1111 userDir = ../users + "/${user}";
1212 userConfig = import (userDir + "/user.nix");
13in
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 };
2425 };
25}).neovim
26in
27config.neovim // { input = config; }
modules/home/default.nix+39-7
......@@ -77,6 +77,7 @@ in
7777 # ViM and Neovim
7878 ".*.swp"
7979 ".nvimlog"
80 ".jj"
8081 ];
8182 };
8283
......@@ -120,16 +121,47 @@ in
120121 inherit (pkgs.fishPlugins.bang-bang) src;
121122 }
122123 ];
123 shellAliases = {
124 }
125 // lib.optionalAttrs (!host.darwin) {
126 reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now";
127 };
128124 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
131129 '';
132130 };
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 };
133165
134166 ghostty.settings.custom-shader = lib.mkIf (
135167 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
2vim.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")
27end, { nargs = "*" })
modules/neovim/commands/SmartQuit.lua created+96
......@@ -0,0 +1,96 @@
1vim.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 })
94end, { nargs = 0 })
95
96vim.api.nvim_set_hl(0, "QuitPopUpBorder", { fg = "red" })
modules/neovim/default.nix+40-43
......@@ -9,6 +9,7 @@
99 ./formatter.nix
1010 ./keybind.nix
1111 ./options.nix
12 ./blink-cmp.nix
1213 ];
1314 # based on default options from upstream:
1415 # https://github.com/NotAShelf/nvf/blob/main/configuration.nix
......@@ -20,13 +21,12 @@
2021 # which allows user configurations to disable/override anything here.
2122 config.vim = lib.mkOverride 999 {
2223 extraLuaFiles = [
23 ./lib.lua
24 ];
25
26 theme = {
27 enable = true;
28 };
24 ./commands/FullscreenTerm.lua
25 ./commands/SmartQuit.lua
2926
27 ./extra.lua
28 ];
29 theme.enable = true;
3030 visuals = {
3131 # notification system
3232 # https://github.com/j-hui/fidget.nvim
......@@ -57,17 +57,19 @@
5757 lspkind.enable = config.vim.autocomplete.blink-cmp.enable;
5858 # Enables inlay hints (types info in rust and shit)
5959 inlayHints.enable = true;
60 #Nice mappings that i use :3
60 # Nice mappings that I use :3
6161 mappings = {
62 codeAction = "<leader>ca";
62 codeAction = null; # in keymaps
6363 goToDeclaration = "gD";
6464 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";
6769 hover = "K";
6870 nextDiagnostic = null; # ]d
6971 openDiagnosticFloat = "<leader>d";
70 renameSymbol = "rn";
72 renameSymbol = "grn";
7173 documentHighlight = null;
7274 listDocumentSymbols = null;
7375 listImplementations = null;
......@@ -82,6 +84,14 @@
8284 treesitter = {
8385 enable = true;
8486 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 };
8595 };
8696 debugger.nvim-dap = {
8797 enable = true;
......@@ -99,8 +109,6 @@
99109 clang.enable = true;
100110 css.enable = true;
101111 html.enable = true;
102 lua.enable = true;
103 markdown.enable = true;
104112 nix.enable = true;
105113 python.enable = true;
106114 rust.crates.enable = true;
......@@ -108,12 +116,30 @@
108116 ts.enable = true;
109117 zig.enable = true;
110118 # sort-lines: off
119
120 nix.lsp.servers = "nixd";
111121 };
112122 filetree.neo-tree = {
113123 enable = true;
114124 setupOpts = {
115125 enable_cursor_hijack = true;
116126 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 };
117143 };
118144 };
119145 fzf-lua = {
......@@ -125,36 +151,6 @@
125151 };
126152 };
127153 };
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 };
158154 statusline = {
159155 lualine = {
160156 enable = true;
......@@ -188,6 +184,7 @@
188184 gitsigns.enable = true;
189185 gitsigns.codeActions.enable = false; # throws an annoying debug message
190186 };
187 utility.undotree.enable = true;
191188 # Better help docs
192189 lazy.plugins."helpview.nvim" = {
193190 enabled = true;
modules/neovim/extra.lua created+2
......@@ -0,0 +1,2 @@
1-- not sure how to add this in nix
2require("fzf-lua").register_ui_select()
modules/neovim/keybind.nix+3-1
......@@ -21,6 +21,7 @@ in
2121 toggle-explorer = keyCmd "n" "<leader>e" "Neotree toggle";
2222 reveal-active-file = keyCmd "n" "<leader>E" "Neotree reveal<CR>:Neotree focus";
2323 lazygit = keyCmd "n" "<leader>gg" "FullscreenTerm ${pkgs.lazygit}/bin/lazygit";
24 smart-quit = keyCmd "n" "<leader>q" "SmartQuit";
2425
2526 # pickers
2627 pick-file = keyCmd "n" "<leader><leader>" "FzfLua files";
......@@ -34,11 +35,12 @@ in
3435 # lsp
3536 code-action =
3637 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";
3839
3940 # subtle nice features
4041 visual-dedent = keyRemap "v" "<" "<gv"; # keep selection
4142 visual-indent = keyRemap "v" ">" ">gv"; # keep selection
43 visual-overwrite = keyRemap "v" "p" "pgvygv<esc>"; # re-yank text
4244 clear-search-highlights = keyRemap "n" "<esc>" ":noh<Return><esc>";
4345 };
4446
modules/neovim/lib.lua deleted-27
......@@ -1,27 +0,0 @@
1-- Ported from https://www.reddit.com/r/neovim/comments/vemydn
2vim.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")
27end, { nargs = "*" })
packages/autofmt/autofmt.js+52-9
......@@ -1,5 +1,5 @@
11#!/usr/bin/env node
2// autofmt v1 by paper clover
2// autofmt v2 by paper clover
33// https://paperclover.dev/nix/config/src/branch/main/packages/autofmt/autofmt.js
44//
55// Different codebases use different formatters. Autofmt looks for project
......@@ -25,6 +25,10 @@
2525// }
2626// },
2727//
28// CHANGELOG
29// v2: added 'prettierd' as a supported formatter option.
30// v1: initial release
31//
2832// @ts-nocheck
2933
3034// -- definitions --
......@@ -72,6 +76,15 @@ const formatters = {
7276 cmd: ["deno", "fmt", "--", "$files"],
7377 stdin: (file) => ["deno", "fmt", "--ext", path.extname(file).slice(1), "-"],
7478 },
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 },
7588 prettier: {
7689 languages: ["javascript", "markdown", "json", "yaml", "mdx", "html", "css"],
7790 files: ["node_modules/.bin/prettier"],
......@@ -91,7 +104,7 @@ const formatters = {
91104 "nixfmt-rfc-style": {
92105 languages: ["nix"],
93106 files: {
94 "flake.nix": (contents) => contents.includes("nixfmt"),
107 "flake.nix": ({ text }) => text.includes("nixfmt"),
95108 },
96109 cmd: ["nixfmt", "--", "$files"],
97110 stdin: (file) => ["nixfmt", `--filename=${file}`],
......@@ -99,7 +112,7 @@ const formatters = {
99112 alejandra: {
100113 languages: ["nix"],
101114 files: {
102 "flake.nix": (contents) => contents.includes("alejandra"),
115 "flake.nix": ({ text }) => text.includes("alejandra"),
103116 },
104117 cmd: ["alejandra", "--", "$files"],
105118 stdin: () => ["alejandra"],
......@@ -498,24 +511,31 @@ function pickFormatter(file) {
498511 return walkUp(dir, (x) => {
499512 const children = readDir(x);
500513 for (const fmt of order) {
514 if (formatters[fmt][stdio ? "stdin" : "cmd"] == null) continue;
515
501516 let matches = false;
502517 if (formatters[fmt].files === true) {
503518 matches = true;
504519 }
505520 if (!matches) {
506521 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 }))
508523 : 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) {
511526 if (base.includes("/")) {
512527 matches = readDir(path.join(x, path.dirname(base))) //
513528 .includes(path.basename(base));
514529 } else {
515530 matches = children.includes(base);
516531 }
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 });
519539 }
520540 }
521541 }
......@@ -526,7 +546,7 @@ function pickFormatter(file) {
526546 return formatterId;
527547 }
528548 }
529 }) ?? possible[0];
549 }) ?? possible.find((fmt) => !formatters[fmt].mustMatchFile);
530550}
531551
532552/** @param dir {string} @param find {(x: string) => any} */
......@@ -581,6 +601,29 @@ function readGitIgnore(dir) {
581601 }
582602}
583603
604/** @param {string} name @returns {string | null} */
605export 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
584627function escapeGlob(str) {
585628 return str.replace(/[\\*,{}]/g, "\\$&");
586629}
packages/autofmt/default.nix+4-3
......@@ -3,12 +3,13 @@ pkgs.writeShellApplication {
33 name = "autofmt";
44 runtimeInputs = with pkgs; [
55 # include only a couple of formatters by default
6 clang-tools
67 deno
7 nixfmt-rfc-style
88 dprint
9 nixfmt-rfc-style
10 prettierd # autofmt only runs on a local build of prettier
911 rustfmt
1012 zig
11 clang-tools
1213 ];
13 text = ''exec deno run -A ${./autofmt.js} "$@"'';
14 text = ''exec ${pkgs.nodejs}/bin/node ${./autofmt.js} "$@"'';
1415}
switch+16-5
......@@ -1,12 +1,23 @@
11#!/bin/sh
22nh_subcommand="os"
33fallback_command="nixos-rebuild"
4if [ "$(uname -o)" = "darwin" ]; then
5 nh_subcommand="darwin"
6 fallback_command="nix run .#darwin-rebuild"
4hostname_file="$(dirname "$0")/.hostname"
5if [ -n "$1" ]; then
6 hostname="$1"
7elif [ -f "$hostname_file" ]; then
8 hostname=$(cat "$hostname_file")
9fi
10if [ -z "$hostname" ]; then
11 hostname="$(hostname)"
12fi
13printf "%s" "$hostname" >"$hostname_file"
14if [ "$(uname -o)" = "Darwin" ]; then
15 nh_subcommand="darwin"
16 fallback_command="nix run .#darwin-rebuild"
17 hostname="darwinConfigurations.$hostname"
718fi
819if command -v nh >/dev/null; then
9 nh $nh_subcommand switch .
20 nh $nh_subcommand switch '.#'"$hostname"
1021else
11 $fallback_command -- switch --flake .
22 $fallback_command -- switch --flake '.#'"$hostname"
1223fi
users/clover/home.nix+195-19
......@@ -10,9 +10,7 @@ in
1010 let
1111 # packages to always install
1212 all = [
13 (ffmpeg.override {
14 withSvtav1 = true;
15 })
13 ffmpeg-full
1614 ripgrep
1715 uv
1816 nh
......@@ -22,6 +20,7 @@ in
2220 desktop = [
2321 git-town
2422 lazygit
23 jjui
2524 ];
2625 # packages to install on all servers
2726 server = [ ];
......@@ -49,10 +48,9 @@ in
4948 shader = "cursor-smear-black.glsl";
5049 package = null;
5150 settings = {
52 theme = "light:catppuccin-latte,dark:catppuccin-macchiato";
51 theme = "light:Farmhouse Light,dark:Challenger Deep";
5352 font-family = "AT Name Mono";
5453 adjust-cursor-thickness = 1;
55 minimum-contrast = 1.1;
5654 background-opacity = 0.9;
5755 background-blur = true;
5856 };
......@@ -61,14 +59,12 @@ in
6159 # zsh is the shell i use
6260 zsh = {
6361 enable = true;
64 enableCompletion = true;
65 autosuggestion.enable = true;
66 syntaxHighlighting.enable = true;
67
68 history.size = 10000;
69
7062 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";
7268 };
7369 profileExtra = ''
7470 function python() {
......@@ -84,6 +80,193 @@ in
8480 # use a git-specific email
8581 git.userEmail = "git@paperclover.net";
8682
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
87270 ssh = {
88271 enable = true;
89272 matchBlocks = rec {
......@@ -94,12 +277,5 @@ in
94277 "nas.paperclover.net" = zenith;
95278 };
96279 };
97 neovide = {
98 enable = !hostServer;
99 settings = {
100 font.normal = "AT Name Mono";
101 font.size = 13;
102 };
103 };
104280 };
105281}
users/clover/paperback/configuration.nix-1
......@@ -2,7 +2,6 @@ _: {
22 homebrew = {
33 enable = true;
44 casks = [
5 "eloston-chromium"
65 "db-browser-for-sqlite"
76 ];
87 };
users/clover/paperback/home.nix-4
......@@ -3,7 +3,6 @@
33 # these programs are not globally installed to reduce distractions.
44 # most of these are needed for my work environment.
55 programs = {
6 bun.enable = true;
76 zsh.profileExtra = ''
87 _bun() {
98 local context state line
......@@ -12,7 +11,6 @@
1211 '';
1312 };
1413 home.packages = with pkgs; [
15 doppler
1614 deno
1715 nodejs_22
1816 rustup
......@@ -22,7 +20,5 @@
2220 yt-dlp
2321 spotdl
2422 zig
25 ssm-session-manager-plugin
26 awscli
2723 ];
2824}
users/clover/vim.nix+18-15
......@@ -1,20 +1,23 @@
1_: {
1{ lib, ... }:
2{
23 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;
1715 };
1816 };
17 # filetree.neo-tree.setupOpts.default_component_configs.indent = {
18 # padding = 0;
19 # indent_marker = "|";
20 # last_indent_marker = "+";
21 # };
1922 };
2023}
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 @@
11# Edit this configuration file to define what should be installed on
22# your system. Help is available in the configuration.nix(5) man page, on
33# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
4
54{
6 config,
7 lib,
85 pkgs,
96 ...
107}:
11
128{
139 imports = [
14 # Include the results of the hardware scan.
1510 ./hardware-configuration.nix
1611 ];
1712
18 # Use the systemd-boot EFI boot loader.
1913 boot.loader.efi.canTouchEfiVariables = true;
2014
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";
2416 # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
2517
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.
4218 services.xserver.enable = true;
4319
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;
4722 environment.gnome.excludePackages = (
4823 with pkgs;
4924 [
50 atomix
51 cheese
25 adwaita-fonts
26 adwaita-icon-theme
27 baobab
28 decibels
5229 epiphany
30 evince
31 file-roller
5332 geary
54 gedit
33 gnome-backgrounds
34 gnome-calculator
35 gnome-calendar
5536 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
5645 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
5951 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
6261 totem
63
62 yelp
6463 ]
6564 );
6665
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;
7367
7468 # 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 };
8177
8278 # Enable touchpad support (enabled default in most desktopManager).
8379 # services.libinput.enable = true;
8480
85 # Define a user account. Don't forget to set a password with ‘passwd’.
8681 users.users.fish = {
8782 isNormalUser = true;
8883 extraGroups = [
89 "wheel" # Enable ‘sudo’ for the user.
90 "dialout" # Enable serial access for the user.
84 "wheel"
85 "dialout"
86 "audio"
9187 ];
9288 packages = with pkgs; [
9389 tree
9490 git
9591 nh
9692 vim
97 fish
9893 ];
9994 };
95 programs.git = {
96 enable = true;
97 # extraConfig = {
98 # push = {
99 # autoSetupRemote = true;
100 # };
101 # };
102 };
100103
101104 programs.firefox.enable = true;
102 programs.neovim.defaultEditor.enable = true;
105 programs.neovim.enable = true;
106 #programs.neovim.defaultEditor.enable = true;
103107
104108 # List packages installed in system profile.
105 # You can use https://search.nixos.org/ to find more packages (and options).
106109 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
108111 wget
109112 ];
110113
111 # Some programs need SUID wrappers, can be configured further or are
112 # started in user sessions.
113114 programs.mtr.enable = true;
114115 programs.gnupg.agent = {
115116 enable = true;
......@@ -121,12 +122,6 @@
121122 # Enable the OpenSSH daemon.
122123 # services.openssh.enable = true;
123124
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
130125 # Copy the NixOS configuration file and link it from the resulting system
131126 # (/run/current-system/configuration.nix). This is useful in case you
132127 # accidentally delete configuration.nix.
users/fish/cattop/hardware-configuration.nix+17-31
......@@ -1,46 +1,32 @@
11# Do not modify this file! It was generated by ‘nixos-generate-config’
22# and may be overwritten by future invocations. Please make changes
33# to /etc/nixos/configuration.nix instead.
4{
5 config,
6 lib,
7 pkgs,
8 modulesPath,
9 ...
10}:
4{ config, lib, pkgs, modulesPath, ... }:
115
126{
13 imports = [
14 (modulesPath + "/installer/scan/not-detected.nix")
15 ];
7 imports =
8 [ (modulesPath + "/installer/scan/not-detected.nix")
9 ];
1610
17 boot.initrd.availableKernelModules = [
18 "xhci_pci"
19 "thunderbolt"
20 "vmd"
21 "nvme"
22 ];
11 boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" ];
2312 boot.initrd.kernelModules = [ ];
2413 boot.kernelModules = [ "kvm-intel" ];
2514 boot.extraModulePackages = [ ];
2615
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 };
3120
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 };
4026
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 ];
4430
4531 # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
4632 # (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, ... }:
112{
123 home = {
134 stateVersion = "23.05"; # Don't change this unless upgrading Home Manager versions
......@@ -15,17 +6,14 @@
156 packages = with pkgs; [
167 # General applications
178 ghostty
18 stremio
19 julia
20 calibre
21 mpv
229 signal-desktop
23 python3
24 gh
2510 spotify
11 equibop
2612
2713 # Gaming
2814 (prismlauncher.override { gamemodeSupport = true; })
15 #bsdgames
16 space-cadet-pinball
2917
3018 # System & desktop tools
3119 wofi
......@@ -37,18 +25,19 @@
3725 ethtool
3826 grub2
3927 efibootmgr
40 distrobox
4128 pqiv
29 imagemagick
30 toybox
4231
4332 # Dev tools
44 legcord
4533 hyfetch
46 kicad
34 python3
35 gh
36 cmake
37 ripgrep
4738
4839 # Unsorted
49 ripgrep
50 busybox
51 imagemagick
40 kicad
5241 ];
5342 };
5443
......@@ -61,7 +50,15 @@
6150 gitCredentialHelper.enable = true;
6251 };
6352
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 };
6663 };
6764}
users/fish/user.nix+1-1
......@@ -4,7 +4,7 @@ rec {
44 email = "77413091+JulianBarbera@users.noreply.github.com"; # email (used for certain configurations)
55 dotfilesDir = "~/config"; # absolute path of the local repo
66 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/
88 term = "ghostty"; # Default terminal command;
99 font = "iosevka"; # Selected font
1010 editor = "neovim"; # Default editor;
users/fish/vim.nix+38-1
......@@ -1,3 +1,40 @@
1{ ... }:
1{ pkgs, ... }:
22{
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 };
340}
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:
12{
2 pkgs,
3 lib,
4 options,
5 ...
6}@args:
7{
8
93 programs = {
104 # sort-lines:start
115 atuin.enable = true;
......@@ -29,6 +23,14 @@
2923 };
3024 };
3125 # 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 };
3234 };
3335
3436 home.packages = import ./packages.nix args;
users/natalie/vim/default.nix-1
......@@ -1,7 +1,6 @@
11{ ... }:
22{
33 imports = [
4 ./keybinds.nix
54 ./languages.nix
65 ./latex.nix
76 ./visuals.nix
users/natalie/vim/keybinds.nix deleted-19
......@@ -1,19 +0,0 @@
1{ ... }:
2let
3 mkKeymap = mode: key: action: desc: {
4 inherit mode;
5 inherit key action desc;
6 };
7 n = mkKeymap "n"; # normal mode
8in
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 @@
1111 python312Packages.pylatexenc
1212 ];
1313 languages = {
14 lua.lsp.enable = true;
1415 lua.lsp.lazydev.enable = true;
1516 python = {
1617 format.type = "ruff";