Flake for my NixOS devices

More Neovim Config!

bwc9876.dev 623a9bec 4a4049ab

verified
+208 -20
+194 -20
roles/dev/nvim.nix
··· 26 26 settings.flavor = config.catppuccin.flavor; 27 27 }; 28 28 29 + autoGroups = { 30 + restore_cursor = {}; 31 + }; 32 + 33 + opts = { 34 + number = true; 35 + smartindent = true; 36 + cursorline = true; 37 + showtabline = 2; 38 + breakindent = true; 39 + foldenable = true; 40 + }; 41 + 42 + autoCmd = [ 43 + { 44 + group = "restore_cursor"; 45 + event = ["BufReadPost"]; 46 + pattern = "*"; 47 + callback = { 48 + __raw = '' 49 + function() 50 + if 51 + vim.fn.line "'\"" > 1 52 + and vim.fn.line "'\"" <= vim.fn.line "$" 53 + and vim.bo.filetype ~= "commit" 54 + and vim.fn.index({ "xxd", "gitrebase" }, vim.bo.filetype) == -1 55 + then 56 + vim.cmd "normal! g`\"" 57 + end 58 + end 59 + ''; 60 + }; 61 + } 62 + ]; 63 + 29 64 performance = { 30 65 byteCompileLua = { 31 66 enable = true; 32 67 nvimRuntime = true; 33 - plugins = true; 68 + plugins = false; 34 69 }; 35 70 combinePlugins = { 36 71 enable = true; 72 + standalonePlugins = ["telescope-nvim"]; 37 73 }; 38 74 }; 39 75 ··· 43 79 key = "<C-.>"; 44 80 options.desc = "Open Code Actions"; 45 81 } 82 + { 83 + action = "<cmd>Telescope<cr>"; 84 + key = "<leader><leader>"; 85 + options.desc = "Telescope Launch"; 86 + } 87 + { 88 + action = "<cmd>Navbuddy<cr>"; 89 + key = "<leader>j"; 90 + options.desc = "Jump To..."; 91 + } 46 92 ]; 47 93 48 94 plugins = { ··· 53 99 }; 54 100 extensions = { 55 101 file-browser.enable = true; 56 - frecency.enable = true; 57 102 ui-select.enable = true; 58 103 }; 59 - keymaps = { 60 - "<leader>ff" = { 104 + keymaps = lib.fix (self: { 105 + "<leader>p" = { 106 + action = "projects"; 107 + options.desc = "Projects"; 108 + }; 109 + "<leader>c" = { 110 + action = "commands"; 111 + options.desc = "Browse Commands"; 112 + }; 113 + "<leader>x" = { 114 + action = "keymaps"; 115 + options.desc = "Keymaps"; 116 + }; 117 + "<leader>w" = { 118 + action = "spell_suggest"; 119 + options.desc = "Spell Suggest"; 120 + }; 121 + "<leader>s" = { 122 + action = "treesitter"; 123 + options.desc = "Treesitter Symbols"; 124 + }; 125 + "<leader>b" = { 126 + action = "file_browser"; 127 + options.desc = "File Browser"; 128 + }; 129 + "<leader>f" = { 61 130 action = "find_files"; 62 - options.desc = "Find files with Telescope"; 131 + options.desc = "Files"; 63 132 }; 64 - "<leader>fr" = { 65 - action = "frecency"; 66 - options.desc = "Open Recently Edited File"; 67 - }; 68 - "<leader>fgs" = { 133 + "<leader>gs" = { 69 134 action = "git_status"; 70 - options.desc = "Get Git Status"; 135 + options.desc = "Git Status"; 71 136 }; 72 - "<leader>fgb" = { 137 + "<leader>gb" = { 73 138 action = "git_branches"; 74 - options.desc = "View Git Branches"; 139 + options.desc = "Git Branches"; 75 140 }; 76 - "<leader>fgc" = { 141 + "<leader>gc" = { 77 142 action = "git_commits"; 78 - options.desc = "View Git Commits"; 143 + options.desc = "Git Commits"; 79 144 }; 145 + "<leader>r" = { 146 + action = "oldfiles"; 147 + options.desc = "Recent Files"; 148 + }; 149 + 150 + "<leader>l" = self."<C-S-F>"; 80 151 "<C-S-F>" = { 81 152 action = "live_grep"; 82 153 options.desc = "Live Grep"; 83 154 }; 84 - }; 155 + }); 85 156 }; 86 157 87 - dashboard.enable = true; 158 + alpha = { 159 + enable = true; 160 + opts = { 161 + position = "center"; 162 + }; 163 + layout = let 164 + o = {position = "center";}; 165 + txt = s: { 166 + type = "text"; 167 + val = s; 168 + opts = {hl = "Keyword";} // o; 169 + }; 170 + grp = g: { 171 + type = "group"; 172 + val = g; 173 + opts.spacing = 1; 174 + }; 175 + btn = { 176 + val, 177 + onClick, 178 + ... 179 + }: { 180 + type = "button"; 181 + inherit val; 182 + opts = o; 183 + on_press.__raw = "function() vim.cmd[[${onClick}]] end"; 184 + }; 185 + cmd = { 186 + command, 187 + width, 188 + height, 189 + }: { 190 + type = "terminal"; 191 + inherit command width height; 192 + opts = o; 193 + }; 194 + pad = { 195 + type = "padding"; 196 + val = 2; 197 + }; 198 + in 199 + [pad pad pad] 200 + ++ (lib.intersperse pad [ 201 + (let 202 + banner = pkgs.runCommand "nvim-banner" {} ''${pkgs.toilet}/bin/toilet " NIXVIM " -f mono12 -F border > $out''; 203 + bannerText = builtins.readFile banner; 204 + in 205 + cmd { 206 + command = ''mut i = 1; loop { let s = (open ${banner}) | ${pkgs.lolcat}/bin/lolcat -f -S $i; clear; print -n -r $s; sleep 100ms; $i += 3; }''; 207 + width = (builtins.stringLength (lib.trim (builtins.elemAt (lib.splitString "\n" bannerText) 1))) - 3; 208 + height = (builtins.length (lib.splitString "\n" bannerText)) - 1; 209 + }) 210 + (grp [ 211 + (btn { 212 + val = " 󰉋 Open Project"; 213 + onClick = "Telescope projects"; 214 + shortcut = "<leader>p"; 215 + }) 216 + (btn { 217 + val = " 󱋡 Open Recent File"; 218 + onClick = "Telescope oldfiles"; 219 + shortcut = "<leader>r"; 220 + }) 221 + (btn { 222 + val = " 󰅙 Quit"; 223 + onClick = "q"; 224 + shortcut = "q"; 225 + }) 226 + ]) 227 + (txt "::<シ>") 228 + ]) 229 + ++ [pad]; 230 + }; 88 231 89 232 trouble = { 90 233 enable = true; ··· 103 246 104 247 treesitter = { 105 248 enable = true; 106 - settings.highlight.enable = true; 249 + settings = { 250 + highlight.enable = true; 251 + folding.enable = true; 252 + }; 107 253 }; 108 254 109 255 illuminate.enable = true; 110 256 cursorline.enable = true; 111 257 112 - neocord.enable = true; 258 + navbuddy = { 259 + enable = true; 260 + lsp.autoAttach = true; 261 + mappings = { 262 + "<Left>" = "parent"; 263 + "<Right>" = "children"; 264 + "<Up>" = "previous_sibling"; 265 + "<Down>" = "next_sibling"; 266 + "<C-Left>" = "root"; 267 + }; 268 + }; 269 + 270 + neocord = { 271 + enable = true; 272 + settings.logo = "https://raw.githubusercontent.com/IogaMaster/neovim/main/.github/assets/nixvim-dark.webp"; 273 + }; 113 274 114 275 barbar = { 115 276 enable = true; ··· 121 282 }; 122 283 }; 123 284 285 + statuscol = { 286 + enable = true; 287 + }; 288 + 289 + lualine = { 290 + enable = true; 291 + settings = { 292 + extensions = [ 293 + "trouble" 294 + "toggleterm" 295 + ]; 296 + }; 297 + }; 298 + 124 299 project-nvim = { 125 300 enable = true; 126 301 enableTelescope = true; ··· 129 304 web-devicons.enable = true; 130 305 131 306 guess-indent.enable = true; 132 - indent-blankline.enable = true; 133 307 intellitab.enable = true; 134 308 135 309 which-key = {
+14
roles/graphics/apps.nix
··· 8 8 Icon=htop 9 9 ''; 10 10 11 + programs.kdeconnect.enable = true; 12 + 13 + systemd.user.services.kdeconnect = { 14 + description = "Adds communication between your desktop and your smartphone"; 15 + after = ["graphical-session-pre.target"]; 16 + partOf = ["graphical-session.target"]; 17 + wantedBy = ["graphical-session.target"]; 18 + serviceConfig = { 19 + # Environment = "PATH=${config.home.profileDirectory}/bin"; 20 + ExecStart = "${pkgs.libsForQt5.kdeconnect-kde}/libexec/kdeconnectd"; 21 + Restart = "on-abort"; 22 + }; 23 + }; 24 + 11 25 environment.systemPackages = with pkgs; [ 12 26 chromium 13 27