Flake for my NixOS devices

Neovim more binds and add image properly, update

bwc9876.dev af211e01 53b0f819

verified
+421 -336
+25 -25
flake.lock
··· 31 31 ] 32 32 }, 33 33 "locked": { 34 - "lastModified": 1751021896, 35 - "narHash": "sha256-L9u68mNPPiuW7+OV5BKbXaj/AENTiiuEx8+QnMBjRlU=", 34 + "lastModified": 1751880463, 35 + "narHash": "sha256-aSQllMKqsTYAUp4yhpspZn0Hj5yIj7Mh4UD5iyk5iMM=", 36 36 "owner": "catppuccin", 37 37 "repo": "nix", 38 - "rev": "a6b0e34d083c79f08efabb1fd6ccf12b882daae6", 38 + "rev": "9474347c69e93e392f194dda7a57c641ba4b998e", 39 39 "type": "github" 40 40 }, 41 41 "original": { ··· 286 286 ] 287 287 }, 288 288 "locked": { 289 - "lastModified": 1751384836, 290 - "narHash": "sha256-7xRbl/VLXxE5DzJmk1wdKWJmPx8rAfNC/a6mXtqp5cc=", 289 + "lastModified": 1751824240, 290 + "narHash": "sha256-aDDC0CHTlL7QDKWWhdbEgVPK6KwWt+ca0QkmHYZxMzI=", 291 291 "owner": "nix-community", 292 292 "repo": "home-manager", 293 - "rev": "479f8889675770881033878a1c114fbfc6de7a4d", 293 + "rev": "fd9e55f5fac45a26f6169310afca64d56b681935", 294 294 "type": "github" 295 295 }, 296 296 "original": { ··· 374 374 ] 375 375 }, 376 376 "locked": { 377 - "lastModified": 1751170039, 378 - "narHash": "sha256-3EKpUmyGmHYA/RuhZjINTZPU+OFWko0eDwazUOW64nw=", 377 + "lastModified": 1751774635, 378 + "narHash": "sha256-DuOznGdgMxeSlPpUu6Wkq0ZD5e2Cfv9XRZeZlHWMd1s=", 379 379 "owner": "nix-community", 380 380 "repo": "nix-index-database", 381 - "rev": "9c932ae632d6b5150515e5749b198c175d8565db", 381 + "rev": "85686025ba6d18df31cc651a91d5adef63378978", 382 382 "type": "github" 383 383 }, 384 384 "original": { ··· 389 389 }, 390 390 "nixos-hardware": { 391 391 "locked": { 392 - "lastModified": 1751379130, 393 - "narHash": "sha256-TObxiGbuX/4FbOnzDRvznfMUjIgS+d71+BetT35EOB8=", 392 + "lastModified": 1751432711, 393 + "narHash": "sha256-136MeWtckSHTN9Z2WRNRdZ8oRP3vyx3L8UxeBYE+J9w=", 394 394 "owner": "NixOS", 395 395 "repo": "nixos-hardware", 396 - "rev": "8b1f894089789eb39eacf0d6891d1e17cc3a84ab", 396 + "rev": "497ae1357f1ac97f1aea31a4cb74ad0d534ef41f", 397 397 "type": "github" 398 398 }, 399 399 "original": { ··· 404 404 }, 405 405 "nixpkgs": { 406 406 "locked": { 407 - "lastModified": 1751271578, 408 - "narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=", 407 + "lastModified": 1751792365, 408 + "narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=", 409 409 "owner": "NixOS", 410 410 "repo": "nixpkgs", 411 - "rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df", 411 + "rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb", 412 412 "type": "github" 413 413 }, 414 414 "original": { ··· 428 428 "systems": "systems_2" 429 429 }, 430 430 "locked": { 431 - "lastModified": 1751144320, 432 - "narHash": "sha256-KJsKiGfkfXFB23V26NQ1p+UPsexI6NKtivnrwSlWWdQ=", 431 + "lastModified": 1751824405, 432 + "narHash": "sha256-8lgBIofI1lQXs4skivRnPJ/S8Tqduv4bXq/8Rc/ns8o=", 433 433 "owner": "nix-community", 434 434 "repo": "nixvim", 435 - "rev": "ceb52aece5d571b37096945c2815604195a04eb4", 435 + "rev": "28f818b57bb68d91891d23952490b1e19055d63c", 436 436 "type": "github" 437 437 }, 438 438 "original": { ··· 607 607 ] 608 608 }, 609 609 "locked": { 610 - "lastModified": 1751338093, 611 - "narHash": "sha256-/yd9nPcTfUZPFtwjRbdB5yGLdt3LTPqz6Ja63Joiahs=", 610 + "lastModified": 1751856221, 611 + "narHash": "sha256-/QE1eV0ckFvgRMcKjZqgdJDoXFNwSMepwRoBjaw2MCk=", 612 612 "owner": "oxalica", 613 613 "repo": "rust-overlay", 614 - "rev": "6cfb7821732dac2d3e2dea857a5613d3b856c20c", 614 + "rev": "34cae4b56929c5b340e1c5b10d9a98a425b2a51e", 615 615 "type": "github" 616 616 }, 617 617 "original": { ··· 641 641 }, 642 642 "locked": { 643 643 "dir": "nixos-config", 644 - "lastModified": 1750565116, 645 - "narHash": "sha256-ym0mwQJK/Orgp7MIUrQdm4b+4/9OTKCGwDDutrgkJ5w=", 644 + "lastModified": 1751767439, 645 + "narHash": "sha256-3PmSn32ObGz2Ajjrk9u7MUIX2GF4rQn/Wsqzph2CRvI=", 646 646 "ref": "refs/heads/main", 647 - "rev": "2791917b3837fbeedb67a0a2ce7d9118291aea43", 648 - "revCount": 172, 647 + "rev": "4fb2f73992c18c230f0194709a296e32046f1cec", 648 + "revCount": 175, 649 649 "type": "git", 650 650 "url": "https://codeberg.org/spoonbaker/mono" 651 651 },
+146 -75
nixosModules/dev/nvim.nix
··· 110 110 foldlevel = 10; 111 111 foldlevelstart = 10; 112 112 foldenable = true; 113 + mouse = ""; 113 114 }; 114 115 115 116 autoCmd = [ ··· 160 161 }; 161 162 }; 162 163 163 - keymaps = [ 164 - { 165 - action = "<cmd>Lspsaga code_action code_action<cr>"; 166 - key = "<C-.>a"; 167 - options.desc = "Code Actions"; 168 - } 169 - { 170 - action = "<cmd>Lspsaga rename<cr>"; 171 - key = "<C-.>r"; 172 - options.desc = "LSP Rename"; 173 - } 174 - { 175 - action = "<cmd>Lspsaga diagnostic_jump_next<cr>"; 176 - key = "<C-.>e"; 177 - options.desc = "Next Diagnostic"; 178 - } 179 - { 180 - action = "<cmd>Lspsaga diagnostic_jump_previous<cr>"; 181 - key = "<C-.>E"; 182 - options.desc = "Previous Diagnostic"; 183 - } 184 - { 185 - action = "<cmd>Lspsaga goto_definition<cr>"; 186 - key = "<C-.>d"; 187 - options.desc = "Jump to Definition"; 188 - } 189 - { 190 - action = "<cmd>Lspsaga peek_definition<cr>"; 191 - key = "<C-.>D"; 192 - options.desc = "Peek Definition"; 193 - } 194 - { 195 - action = "<cmd>Lspsaga finder ref<cr>"; 196 - key = "<C-.>fr"; 197 - options.desc = "Find References"; 198 - } 199 - { 200 - action = "<cmd>Lspsaga finder imp<cr>"; 201 - key = "<C-.>fi"; 202 - options.desc = "Find Implementations"; 203 - } 204 - { 205 - action = "<cmd>Lspsaga finder def<cr>"; 206 - key = "<C-.>fd"; 207 - options.desc = "Find Definitions"; 208 - } 209 - { 210 - action = "<cmd>Lspsaga finder<cr>"; 211 - key = "<C-.>ff"; 212 - options.desc = "Finder"; 213 - } 214 - { 215 - action = "<cmd>Lspsaga hover_doc<cr>"; 216 - key = "<C-.>h"; 217 - options.desc = "Hover Doc"; 218 - } 219 - { 220 - action = "<cmd>Telescope<cr>"; 221 - key = "<leader><leader>"; 222 - options.desc = "Telescope Launch"; 223 - } 224 - { 225 - action = "<cmd>Navbuddy<cr>"; 226 - key = "<leader>j"; 227 - options.desc = "Jump To..."; 228 - } 229 - ]; 164 + keymaps = 165 + let 166 + prefixMap = 167 + pre: maps: 168 + builtins.map (k: { 169 + action = "<cmd>${k.action}<cr>"; 170 + key = "${pre}${k.key}"; 171 + options = k.options; 172 + }) maps; 173 + in 174 + lib.lists.flatten ( 175 + builtins.map (g: if builtins.hasAttr "group" g then prefixMap g.prefix g.keys else g) [ 176 + { 177 + group = "Tab Navigation"; 178 + prefix = "<Tab>"; 179 + keys = [ 180 + { 181 + action = "BufferLineCycleNext"; 182 + key = "e"; 183 + options.desc = "Next Tab"; 184 + } 185 + { 186 + action = "BufferLineCyclePrev"; 187 + key = "q"; 188 + options.desc = "Previous Tab"; 189 + } 190 + { 191 + action = "BufferLinePick"; 192 + key = "<Tab>"; 193 + options.desc = "Pick Tab and Switch"; 194 + } 195 + ]; 196 + } 197 + { 198 + group = "Tab Closing"; 199 + prefix = "<S-Tab>"; 200 + keys = [ 201 + { 202 + action = "BufferLineCloseLeft"; 203 + key = "q"; 204 + options.desc = "Close Tab Left"; 205 + } 206 + { 207 + action = "BufferLineCloseRight"; 208 + key = "e"; 209 + options.desc = "Close Tab Right"; 210 + } 211 + { 212 + action = "BufferLinePickClose"; 213 + key = "<Tab>"; 214 + options.desc = "Pick Tab and Close"; 215 + } 216 + { 217 + action = "BufferLineCloseOthers"; 218 + key = "w"; 219 + options.desc = "Close Other Tabs"; 220 + } 221 + ]; 222 + } 223 + { 224 + action = "<cmd>Bdelete<cr>"; 225 + key = "<C-q>"; 226 + options.desc = "Close Current Buffer"; 227 + } 228 + { 229 + group = "LSP Actions"; 230 + prefix = "<C-.>"; 231 + keys = [ 232 + { 233 + action = "Lspsaga code_action code_action"; 234 + key = "a"; 235 + options.desc = "Code Actions"; 236 + } 237 + { 238 + action = "Lspsaga rename"; 239 + key = "r"; 240 + options.desc = "LSP Rename"; 241 + } 242 + { 243 + action = "Lspsaga diagnostic_jump_next"; 244 + key = "e"; 245 + options.desc = "Next Diagnostic"; 246 + } 247 + { 248 + action = "Lspsaga diagnostic_jump_previous"; 249 + key = "E"; 250 + options.desc = "Previous Diagnostic"; 251 + } 252 + { 253 + action = "Lspsaga goto_definition"; 254 + key = "d"; 255 + options.desc = "Jump to Definition"; 256 + } 257 + { 258 + action = "Lspsaga peek_definition"; 259 + key = "D"; 260 + options.desc = "Peek Definition"; 261 + } 262 + { 263 + action = "Lspsaga finder ref"; 264 + key = "fr"; 265 + options.desc = "Find References"; 266 + } 267 + { 268 + action = "Lspsaga finder imp"; 269 + key = "fi"; 270 + options.desc = "Find Implementations"; 271 + } 272 + { 273 + action = "Lspsaga finder def"; 274 + key = "fd"; 275 + options.desc = "Find Definitions"; 276 + } 277 + { 278 + action = "Lspsaga finder"; 279 + key = "ff"; 280 + options.desc = "Finder"; 281 + } 282 + { 283 + action = "Lspsaga hover_doc"; 284 + key = "h"; 285 + options.desc = "Hover Doc"; 286 + } 287 + ]; 288 + } 289 + { 290 + action = "<cmd>Telescope<cr>"; 291 + key = "<leader><leader>"; 292 + options.desc = "Telescope Launch"; 293 + } 294 + ] 295 + ); 230 296 231 297 extraPlugins = with pkgs.vimPlugins; [ 232 298 { plugin = pkgs.nvim-mdx; } ··· 264 330 options.desc = "Spell Suggest"; 265 331 }; 266 332 "<leader>s" = { 333 + action = "lsp_document_symbols"; 334 + options.desc = "LSP Symbols"; 335 + }; 336 + "<leader>t" = { 267 337 action = "treesitter"; 268 338 options.desc = "Treesitter Symbols"; 269 - }; 270 - "<leader>b" = { 271 - action = "file_browser"; 272 - options.desc = "File Browser"; 273 339 }; 274 340 "<leader>f" = { 275 341 action = "find_files"; ··· 291 357 action = "oldfiles"; 292 358 options.desc = "Recent Files"; 293 359 }; 294 - 295 360 "<leader>l" = self."<C-S-F>"; 296 361 "<C-S-F>" = { 297 362 action = "live_grep"; ··· 505 570 ''; 506 571 settings.options = { 507 572 indicator.style = "none"; 508 - close_icon = ""; 509 - buffer_close_icon = ""; 573 + show_buffer_close_icons = false; 574 + show_close_icon = false; 510 575 offsets = [ 511 576 { 512 577 filetype = "neo-tree"; ··· 648 713 }; 649 714 }; 650 715 651 - # image.enable = true; 716 + image = { 717 + luaConfig = { 718 + pre = "if not vim.g.neovide then"; 719 + post = "end"; 720 + }; 721 + enable = true; 722 + }; 652 723 web-devicons.enable = true; 653 724 654 725 guess-indent.enable = true;
+250 -236
nixosModules/graphics/floorp.nix
··· 2 2 lib, 3 3 pkgs, 4 4 ... 5 - }: { 5 + }: 6 + { 6 7 environment.systemPackages = with pkgs; [ 7 8 floorp 8 9 ]; ··· 16 17 ]; 17 18 }; 18 19 19 - home-manager.users.bean.programs.floorp = { 20 - enable = true; 21 - policies = { 22 - DisableTelemetry = true; 23 - DisableFirefoxStudies = true; 24 - DisableSetDesktopBackground = true; 25 - DontCheckDefaultBrowser = true; 26 - AppAutoUpdate = false; 27 - DNSOverHTTPS.Enabled = true; 28 - ShowHomeButton = true; 29 - DisplayBookmarksToolbar = "always"; 30 - DisableProfileImport = true; 31 - DisablePocket = true; 32 - DisableFirefoxAccounts = true; 33 - OfferToSaveLoginsDefault = false; 34 - OverrideFirstRunPage = ""; 35 - NoDefaultBookmarks = true; 36 - PasswordManagerEnabled = false; 37 - SearchBar = "unified"; 38 - EncryptedMediaExtensions = true; 20 + home-manager.users.bean = { 21 + catppuccin.floorp.profiles = { 22 + default.enable = false; 23 + floorp-default.enable = false; 24 + }; 25 + programs.floorp = { 26 + enable = true; 27 + policies = { 28 + DisableTelemetry = true; 29 + DisableFirefoxStudies = true; 30 + DisableSetDesktopBackground = true; 31 + DontCheckDefaultBrowser = true; 32 + AppAutoUpdate = false; 33 + DNSOverHTTPS.Enabled = true; 34 + ShowHomeButton = true; 35 + DisplayBookmarksToolbar = "always"; 36 + DisableProfileImport = true; 37 + DisablePocket = true; 38 + DisableFirefoxAccounts = true; 39 + OfferToSaveLoginsDefault = false; 40 + OverrideFirstRunPage = ""; 41 + NoDefaultBookmarks = true; 42 + PasswordManagerEnabled = false; 43 + SearchBar = "unified"; 44 + EncryptedMediaExtensions = true; 39 45 40 - EnableTrackingProtection = { 41 - Value = true; 42 - Locked = true; 43 - Cryptomining = true; 44 - Fingerprinting = true; 45 - EmailTracking = true; 46 - }; 47 - 48 - Preferences = let 49 - lock = val: { 50 - Value = val; 51 - Status = "locked"; 46 + EnableTrackingProtection = { 47 + Value = true; 48 + Locked = true; 49 + Cryptomining = true; 50 + Fingerprinting = true; 51 + EmailTracking = true; 52 52 }; 53 - in { 54 - # General 55 - "browser.aboutConfig.showWarning" = lock false; 56 - "media.eme.enabled" = lock true; # Encrypted Media Extensions (DRM) 57 - "layout.css.prefers-color-scheme.content-override" = lock 0; 58 - "browser.startup.page" = 3; # Restore previous session 59 - "toolkit.telemetry.server" = lock ""; 53 + 54 + Preferences = 55 + let 56 + lock = val: { 57 + Value = val; 58 + Status = "locked"; 59 + }; 60 + in 61 + { 62 + # General 63 + "browser.aboutConfig.showWarning" = lock false; 64 + "media.eme.enabled" = lock true; # Encrypted Media Extensions (DRM) 65 + "layout.css.prefers-color-scheme.content-override" = lock 0; 66 + "browser.startup.page" = 3; # Restore previous session 67 + "toolkit.telemetry.server" = lock ""; 60 68 61 - # New Tab 62 - "browser.newtabpage.activity-stream.showSponsored" = lock false; 63 - "browser.newtabpage.activity-stream.system.showSponsored" = lock false; 64 - "browser.newtabpage.activity-stream.feeds.section.topstories" = lock false; 65 - "browser.newtabpage.activity-stream.feeds.topsites" = lock false; 66 - "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock false; 67 - "browser.newtabpage.activity-stream.showWeather" = lock false; 68 - "browser.newtabpage.activity-stream.system.showWeather" = lock false; 69 - "browser.newtabpage.activity-stream.feeds.weatherfeed" = lock false; 70 - "browser.newtabpage.activity-stream.feeds.telemetry" = lock false; 71 - "browser.newtabpage.activity-stream.telemetry" = lock false; 72 - "browser.newtabpage.activity-stream.telemetry.structuredIngestion.endpoint" = lock ""; 73 - "browser.newtabpage.pinned" = lock []; 74 - "browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.havePinned" = lock ""; 75 - "browser.urlbar.suggest.weather" = lock false; 76 - "browser.urlbar.quicksuggest.scenario" = lock "offline"; 77 - "browser.urlbar.suggest.quicksuggest.nonsponsored" = lock false; 78 - "browser.urlbar.suggest.quicksuggest.sponsored" = lock false; 69 + # New Tab 70 + "browser.newtabpage.activity-stream.showSponsored" = lock false; 71 + "browser.newtabpage.activity-stream.system.showSponsored" = lock false; 72 + "browser.newtabpage.activity-stream.feeds.section.topstories" = lock false; 73 + "browser.newtabpage.activity-stream.feeds.topsites" = lock false; 74 + "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock false; 75 + "browser.newtabpage.activity-stream.showWeather" = lock false; 76 + "browser.newtabpage.activity-stream.system.showWeather" = lock false; 77 + "browser.newtabpage.activity-stream.feeds.weatherfeed" = lock false; 78 + "browser.newtabpage.activity-stream.feeds.telemetry" = lock false; 79 + "browser.newtabpage.activity-stream.telemetry" = lock false; 80 + "browser.newtabpage.activity-stream.telemetry.structuredIngestion.endpoint" = lock ""; 81 + "browser.newtabpage.pinned" = lock [ ]; 82 + "browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.havePinned" = lock ""; 83 + "browser.urlbar.suggest.weather" = lock false; 84 + "browser.urlbar.quicksuggest.scenario" = lock "offline"; 85 + "browser.urlbar.suggest.quicksuggest.nonsponsored" = lock false; 86 + "browser.urlbar.suggest.quicksuggest.sponsored" = lock false; 79 87 80 - # Devtools 81 - "devtools.theme" = lock "dark"; 82 - "devtools.dom.enabled" = lock true; 83 - "devtools.command-button-rulers.enabled" = lock true; 84 - "devtools.command-button-measure.enabled" = lock true; 85 - "devtools.command-button-screenshot.enabled" = lock true; 86 - "devtools.toolbox.host" = lock "right"; 87 - "devtools.webconsole.persistlog" = lock true; 88 - "devtools.webconsole.timestampMessages" = lock true; 88 + # Devtools 89 + "devtools.theme" = lock "dark"; 90 + "devtools.dom.enabled" = lock true; 91 + "devtools.command-button-rulers.enabled" = lock true; 92 + "devtools.command-button-measure.enabled" = lock true; 93 + "devtools.command-button-screenshot.enabled" = lock true; 94 + "devtools.toolbox.host" = lock "right"; 95 + "devtools.webconsole.persistlog" = lock true; 96 + "devtools.webconsole.timestampMessages" = lock true; 89 97 90 - # Privacy 91 - "dom.private-attribution.submission.enabled" = lock false; 92 - "privacy.globalprivacycontrol.enabled" = lock true; 93 - }; 98 + # Privacy 99 + "dom.private-attribution.submission.enabled" = lock false; 100 + "privacy.globalprivacycontrol.enabled" = lock true; 101 + }; 94 102 95 - Extensions.Install = 96 - map (x: "https://addons.mozilla.org/firefox/downloads/latest/${x}/latest.xpi") 97 - [ 98 - # Appearance 99 - "catppuccin-mocha-green" 100 - "darkreader" 101 - "material-icons-for-github" 102 - "refined-github-" 103 + Extensions.Install = 104 + map (x: "https://addons.mozilla.org/firefox/downloads/latest/${x}/latest.xpi") 105 + [ 106 + # Appearance 107 + "catppuccin-mocha-green" 108 + "darkreader" 109 + "material-icons-for-github" 110 + "refined-github-" 103 111 104 - # Security / Privacy 105 - "privacy-badger17" 106 - "decentraleyes" 107 - "canvasblocker" 108 - "facebook-container" 112 + # Security / Privacy 113 + "privacy-badger17" 114 + "decentraleyes" 115 + "canvasblocker" 116 + "facebook-container" 109 117 110 - ## Ads / Youtube 111 - "adnauseam" 112 - "sponsorblock" 113 - "youtube-shorts-block" 114 - "dearrow" 118 + ## Ads / Youtube 119 + "adnauseam" 120 + "sponsorblock" 121 + "youtube-shorts-block" 122 + "dearrow" 115 123 116 - # Information 117 - "flagfox" 118 - "awesome-rss" 124 + # Information 125 + "flagfox" 126 + "awesome-rss" 119 127 120 - # Devtools 121 - "react-devtools" 122 - "open-graph-preview-and-debug" 123 - "wave-accessibility-tool" 124 - "styl-us" 128 + # Devtools 129 + "react-devtools" 130 + "open-graph-preview-and-debug" 131 + "wave-accessibility-tool" 132 + "styl-us" 125 133 126 - # Misc 127 - "plasma-integration" # integration with MPRIS & KDE Connect 128 - "keepassxc-browser" # integration with KeepassXC 129 - "meowad" # Replace ads on Twitter with :3 130 - ]; 134 + # Misc 135 + "plasma-integration" # integration with MPRIS & KDE Connect 136 + "keepassxc-browser" # integration with KeepassXC 137 + "meowad" # Replace ads on Twitter with :3 138 + ]; 131 139 132 - ExtensionSettings."*" = { 133 - default_area = "menupanel"; 134 - }; 135 - }; 136 - profiles.floorp-default.search = { 137 - force = true; 138 - default = "ddg@search.mozilla.orgdefault"; 139 - privateDefault = "ddg@search.mozilla.orgdefault"; 140 - engines = let 141 - mkEngineForceFavicon = aliases: queryUrl: iconUrl: { 142 - definedAliases = aliases; 143 - icon = iconUrl; 144 - urls = [{template = queryUrl;}]; 140 + ExtensionSettings."*" = { 141 + default_area = "menupanel"; 145 142 }; 146 - mkEngine = aliases: queryUrl: iconExt: (mkEngineForceFavicon aliases queryUrl ( 143 + }; 144 + profiles.floorp-default.search = { 145 + force = true; 146 + default = "ddg@search.mozilla.orgdefault"; 147 + privateDefault = "ddg@search.mozilla.orgdefault"; 148 + engines = 147 149 let 148 - noPath = lib.strings.concatStrings ( 149 - lib.strings.intersperse "/" (lib.lists.take 3 (lib.strings.splitString "/" queryUrl)) 150 - ); 151 - in "${noPath}/favicon.${iconExt}" 152 - )); 153 - in { 154 - # Dev 155 - "GitHub Repos" = 156 - mkEngineForceFavicon ["@gh" "@github"] 157 - "https://github.com/search?type=repositories&q={searchTerms}" 158 - "https://github.githubassets.com/favicons/favicon-dark.svg"; 159 - "SourceGraph" = mkEngine [ 160 - "@sg" 161 - "@sourcegraph" 162 - ] "https://sourcegraph.com/search?q={searchTerms}" "png"; 150 + mkEngineForceFavicon = aliases: queryUrl: iconUrl: { 151 + definedAliases = aliases; 152 + icon = iconUrl; 153 + urls = [ { template = queryUrl; } ]; 154 + }; 155 + mkEngine = 156 + aliases: queryUrl: iconExt: 157 + (mkEngineForceFavicon aliases queryUrl ( 158 + let 159 + noPath = lib.strings.concatStrings ( 160 + lib.strings.intersperse "/" (lib.lists.take 3 (lib.strings.splitString "/" queryUrl)) 161 + ); 162 + in 163 + "${noPath}/favicon.${iconExt}" 164 + )); 165 + in 166 + { 167 + # Dev 168 + "GitHub Repos" = 169 + mkEngineForceFavicon [ "@gh" "@github" ] 170 + "https://github.com/search?type=repositories&q={searchTerms}" 171 + "https://github.githubassets.com/favicons/favicon-dark.svg"; 172 + "SourceGraph" = mkEngine [ 173 + "@sg" 174 + "@sourcegraph" 175 + ] "https://sourcegraph.com/search?q={searchTerms}" "png"; 163 176 164 - ## Web 165 - "MDN Web Docs" = mkEngine [ 166 - "@mdn" 167 - ] "https://developer.mozilla.org/en-US/search?q={searchTerms}" "ico"; 168 - "Web.Dev" = 169 - mkEngineForceFavicon ["@webdev" "@lighthouse"] "https://web.dev/s/results?q={searchTerms}" 170 - "https://www.gstatic.com/devrel-devsite/prod/vc7080045e84cd2ce1faf7f7a3876037748d52d088e5100df2e949d051a784791/web/images/favicon.png"; 171 - "Can I Use" = mkEngineForceFavicon [ 172 - "@ciu" 173 - "@baseline" 174 - ] "https://caniuse.com/?search={searchTerms}" "https://caniuse.com/img/favicon-128.png"; 175 - "NPM" = 176 - mkEngineForceFavicon ["@npm"] "https://www.npmjs.com/search?q={searchTerms}" 177 - "https://static-production.npmjs.com/3dc95981de4241b35cd55fe126ab6b2c.png"; 178 - "Iconify" = mkEngine [ 179 - "@iconify" 180 - "@icons" 181 - ] "https://icon-sets.iconify.design/?query={searchTerms}" "ico"; 182 - "Astro" = mkEngineForceFavicon [ 183 - "@astro" 184 - ] "https://a.stro.cc/{searchTerms}" "https://docs.astro.build/favicon.svg"; 185 - "Porkbun" = mkEngine ["@porkbun"] "https://porkbun.com/checkout/search?q={searchTerms}" "ico"; 186 - "Http.Cat" = mkEngine ["@cat" "@hcat" "@httpcat"] "https://http.cat/{searchTerms}" "ico"; 177 + ## Web 178 + "MDN Web Docs" = mkEngine [ 179 + "@mdn" 180 + ] "https://developer.mozilla.org/en-US/search?q={searchTerms}" "ico"; 181 + "Web.Dev" = 182 + mkEngineForceFavicon [ "@webdev" "@lighthouse" ] "https://web.dev/s/results?q={searchTerms}" 183 + "https://www.gstatic.com/devrel-devsite/prod/vc7080045e84cd2ce1faf7f7a3876037748d52d088e5100df2e949d051a784791/web/images/favicon.png"; 184 + "Can I Use" = mkEngineForceFavicon [ 185 + "@ciu" 186 + "@baseline" 187 + ] "https://caniuse.com/?search={searchTerms}" "https://caniuse.com/img/favicon-128.png"; 188 + "NPM" = 189 + mkEngineForceFavicon [ "@npm" ] "https://www.npmjs.com/search?q={searchTerms}" 190 + "https://static-production.npmjs.com/3dc95981de4241b35cd55fe126ab6b2c.png"; 191 + "Iconify" = mkEngine [ 192 + "@iconify" 193 + "@icons" 194 + ] "https://icon-sets.iconify.design/?query={searchTerms}" "ico"; 195 + "Astro" = mkEngineForceFavicon [ 196 + "@astro" 197 + ] "https://a.stro.cc/{searchTerms}" "https://docs.astro.build/favicon.svg"; 198 + "Porkbun" = mkEngine [ "@porkbun" ] "https://porkbun.com/checkout/search?q={searchTerms}" "ico"; 199 + "Http.Cat" = mkEngine [ "@cat" "@hcat" "@httpcat" ] "https://http.cat/{searchTerms}" "ico"; 187 200 188 - ## Rust 189 - "Crates.io" = mkEngine [ 190 - "@crates" 191 - "@cratesio" 192 - "@cargo" 193 - ] "https://crates.io/search?q={searchTerms}" "ico"; 194 - "Rust Docs" = 195 - mkEngineForceFavicon ["@rust" "@rustdocs" "@ruststd"] 196 - "https://doc.rust-lang.org/std/index.html?search={searchTerms}" 197 - "https://doc.rust-lang.org/static.files/favicon-2c020d218678b618.svg"; 198 - "Docsrs" = mkEngine ["@docsrs"] "https://docs.rs/releases/search?query={searchTerms}" "ico"; 201 + ## Rust 202 + "Crates.io" = mkEngine [ 203 + "@crates" 204 + "@cratesio" 205 + "@cargo" 206 + ] "https://crates.io/search?q={searchTerms}" "ico"; 207 + "Rust Docs" = 208 + mkEngineForceFavicon [ "@rust" "@rustdocs" "@ruststd" ] 209 + "https://doc.rust-lang.org/std/index.html?search={searchTerms}" 210 + "https://doc.rust-lang.org/static.files/favicon-2c020d218678b618.svg"; 211 + "Docsrs" = mkEngine [ "@docsrs" ] "https://docs.rs/releases/search?query={searchTerms}" "ico"; 199 212 200 - ## Python 201 - "PyPI" = mkEngineForceFavicon [ 202 - "@pypi" 203 - "@pip" 204 - ] "https://pypi.org/search/?q={searchTerms}" "https://pypi.org/static/images/favicon.35549fe8.ico"; 213 + ## Python 214 + "PyPI" = mkEngineForceFavicon [ 215 + "@pypi" 216 + "@pip" 217 + ] "https://pypi.org/search/?q={searchTerms}" "https://pypi.org/static/images/favicon.35549fe8.ico"; 205 218 206 - ## .NET 207 - "NuGet" = mkEngine ["@nuget"] "https://www.nuget.org/packages?q={searchTerms}" "ico"; 219 + ## .NET 220 + "NuGet" = mkEngine [ "@nuget" ] "https://www.nuget.org/packages?q={searchTerms}" "ico"; 208 221 209 - ## Linux Stuff 210 - "Kernel Docs" = mkEngine [ 211 - "@lnx" 212 - "@linux" 213 - "@kernel" 214 - ] "https://www.kernel.org/doc/html/latest/search.html?q={searchTerms}" "ico"; 215 - "Arch Wiki" = mkEngine [ 216 - "@aw" 217 - "@arch" 218 - ] "https://wiki.archlinux.org/index.php?title=Special%3ASearch&search={searchTerms}" "ico"; 219 - "Nerd Fonts" = 220 - mkEngineForceFavicon ["@nf" "@nerdfonts"] "https://www.nerdfonts.com/cheat-sheet?q={searchTerms}" 221 - "https://www.nerdfonts.com/assets/img/favicon.ico"; 222 + ## Linux Stuff 223 + "Kernel Docs" = mkEngine [ 224 + "@lnx" 225 + "@linux" 226 + "@kernel" 227 + ] "https://www.kernel.org/doc/html/latest/search.html?q={searchTerms}" "ico"; 228 + "Arch Wiki" = mkEngine [ 229 + "@aw" 230 + "@arch" 231 + ] "https://wiki.archlinux.org/index.php?title=Special%3ASearch&search={searchTerms}" "ico"; 232 + "Nerd Fonts" = 233 + mkEngineForceFavicon [ "@nf" "@nerdfonts" ] "https://www.nerdfonts.com/cheat-sheet?q={searchTerms}" 234 + "https://www.nerdfonts.com/assets/img/favicon.ico"; 222 235 223 - ### Nix 224 - "Nix Packages" = mkEngine [ 225 - "@nixpkgs" 226 - ] "https://search.nixos.org/packages?channel=unstable&size=500&query={searchTerms}" "png"; 227 - "NixOS Options" = mkEngine [ 228 - "@nixos" 229 - ] "https://search.nixos.org/options?channel=unstable&size=500&query={searchTerms}" "png"; 230 - "NixOS Wiki" = mkEngine ["@nixwiki"] "https://nixos.wiki/index.php?search={searchTerms}" "png"; 231 - "Home Manager Options" = 232 - mkEngineForceFavicon ["@hm"] 233 - "https://home-manager-options.extranix.com/?release=master&query={searchTerms}" 234 - "https://home-manager-options.extranix.com/images/favicon.png"; 235 - "Noogle" = mkEngine [ 236 - "@noogle" 237 - "@nixlib" 238 - ] "https://noogle.dev/q?limit=100&term={searchTerms}" "png"; 239 - "SourceGraph Nix" = 240 - mkEngine ["@sgn" "@yoink"] 241 - "https://sourcegraph.com/search?q=lang:Nix+-repo:NixOS/*+-repo:nix-community/*+{searchTerms}" 242 - "png"; 243 - "Nixpkgs Issues" = 244 - mkEngineForceFavicon ["@nixissues"] 245 - "https://github.com/NixOS/nixpkgs/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen+{searchTerms}" 246 - "https://github.githubassets.com/favicons/favicon-dark.svg"; 247 - "NixVim Options" = 248 - mkEngineForceFavicon ["@nixvim"] 249 - "https://nix-community.github.io/nixvim/search/?option_scope=0&query={searchTerms}" 250 - "https://nix-community.github.io/nixvim/search/favicon.ico"; 236 + ### Nix 237 + "Nix Packages" = mkEngine [ 238 + "@nixpkgs" 239 + ] "https://search.nixos.org/packages?channel=unstable&size=500&query={searchTerms}" "png"; 240 + "NixOS Options" = mkEngine [ 241 + "@nixos" 242 + ] "https://search.nixos.org/options?channel=unstable&size=500&query={searchTerms}" "png"; 243 + "NixOS Wiki" = mkEngine [ "@nixwiki" ] "https://nixos.wiki/index.php?search={searchTerms}" "png"; 244 + "Home Manager Options" = 245 + mkEngineForceFavicon [ "@hm" ] 246 + "https://home-manager-options.extranix.com/?release=master&query={searchTerms}" 247 + "https://home-manager-options.extranix.com/images/favicon.png"; 248 + "Noogle" = mkEngine [ 249 + "@noogle" 250 + "@nixlib" 251 + ] "https://noogle.dev/q?limit=100&term={searchTerms}" "png"; 252 + "SourceGraph Nix" = 253 + mkEngine [ "@sgn" "@yoink" ] 254 + "https://sourcegraph.com/search?q=lang:Nix+-repo:NixOS/*+-repo:nix-community/*+{searchTerms}" 255 + "png"; 256 + "Nixpkgs Issues" = 257 + mkEngineForceFavicon [ "@nixissues" ] 258 + "https://github.com/NixOS/nixpkgs/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen+{searchTerms}" 259 + "https://github.githubassets.com/favicons/favicon-dark.svg"; 260 + "NixVim Options" = 261 + mkEngineForceFavicon [ "@nixvim" ] 262 + "https://nix-community.github.io/nixvim/search/?option_scope=0&query={searchTerms}" 263 + "https://nix-community.github.io/nixvim/search/favicon.ico"; 251 264 252 - # Media 253 - "youtube" = mkEngine ["@yt"] "https://www.youtube.com/results?search_query={searchTerms}" "ico"; 254 - "Spotify" = 255 - mkEngineForceFavicon ["@sp" "@spotify"] "https://open.spotify.com/search/{searchTerms}" 256 - "https://open.spotifycdn.com/cdn/images/favicon16.1c487bff.png"; 257 - "Netflix" = mkEngine ["@nfx"] "https://www.netflix.com/search?q={searchTerms}" "ico"; 258 - "IMDb" = mkEngine ["@imdb"] "https://www.imdb.com/find?q={searchTerms}" "ico"; 265 + # Media 266 + "youtube" = mkEngine [ "@yt" ] "https://www.youtube.com/results?search_query={searchTerms}" "ico"; 267 + "Spotify" = 268 + mkEngineForceFavicon [ "@sp" "@spotify" ] "https://open.spotify.com/search/{searchTerms}" 269 + "https://open.spotifycdn.com/cdn/images/favicon16.1c487bff.png"; 270 + "Netflix" = mkEngine [ "@nfx" ] "https://www.netflix.com/search?q={searchTerms}" "ico"; 271 + "IMDb" = mkEngine [ "@imdb" ] "https://www.imdb.com/find?q={searchTerms}" "ico"; 259 272 260 - # Misc 261 - "Firefox Add-ons" = mkEngine [ 262 - "@addons" 263 - ] "https://addons.mozilla.org/en-US/firefox/search/?q={searchTerms}" "ico"; 264 - "Urban Dictionary" = mkEngine [ 265 - "@ud" 266 - "@urban" 267 - ] "https://www.urbandictionary.com/define.php?term={searchTerms}" "ico"; 273 + # Misc 274 + "Firefox Add-ons" = mkEngine [ 275 + "@addons" 276 + ] "https://addons.mozilla.org/en-US/firefox/search/?q={searchTerms}" "ico"; 277 + "Urban Dictionary" = mkEngine [ 278 + "@ud" 279 + "@urban" 280 + ] "https://www.urbandictionary.com/define.php?term={searchTerms}" "ico"; 268 281 269 - # Overrides 270 - "History".metaData.alias = "@h"; 271 - "Bookmarks".metaData.alias = "@b"; 272 - "Tabs".metaData.alias = "@t"; 273 - "bing@search.mozilla.orgdefault".metaData.hidden = true; 274 - "amazondotcom-us@search.mozilla.orgdefault".metaData.alias = "@amz"; 275 - "google@search.mozilla.orgdefault".metaData.alias = "@g"; 276 - "wikipedia@search.mozilla.orgdefault".metaData.alias = "@w"; 282 + # Overrides 283 + "History".metaData.alias = "@h"; 284 + "Bookmarks".metaData.alias = "@b"; 285 + "Tabs".metaData.alias = "@t"; 286 + "bing@search.mozilla.orgdefault".metaData.hidden = true; 287 + "amazondotcom-us@search.mozilla.orgdefault".metaData.alias = "@amz"; 288 + "google@search.mozilla.orgdefault".metaData.alias = "@g"; 289 + "wikipedia@search.mozilla.orgdefault".metaData.alias = "@w"; 290 + }; 277 291 }; 278 292 }; 279 293 };