├── .envrc ├── .gitignore ├── LICENSE ├── README.md ├── flake.lock ├── flake.nix ├── home ├── cli.nix ├── default.nix ├── editors │ ├── default.nix │ ├── emacs │ │ └── default.nix │ ├── helix │ │ ├── default.nix │ │ └── languages.nix │ ├── kakoune │ │ ├── default+.kak │ │ ├── default.nix │ │ └── kak-lsp.toml │ └── neovim │ │ └── default.nix ├── files │ ├── config │ │ ├── wofi │ │ │ └── config │ │ └── youtube-dl │ │ │ └── config │ ├── default.nix │ └── wofi.nix ├── games.nix ├── media.nix ├── profiles │ ├── astro-nu │ │ └── default.nix │ └── default.nix ├── shell │ ├── bash.nix │ ├── default.nix │ ├── fish.nix │ ├── nix-completions.sh │ ├── nix.nix │ ├── starship.nix │ └── zsh.nix ├── terminals.nix └── wms │ ├── default.nix │ ├── hyprland │ ├── config.nix │ └── default.nix │ ├── river │ ├── config.nix │ └── default.nix │ ├── sway │ └── default.nix │ └── wayfire │ └── default.nix ├── hosts ├── default.nix ├── deploy.nix └── nu │ ├── default.nix │ └── hardware-configuration.nix ├── lib ├── colors.nix ├── default.nix ├── gradientWall.nix ├── gtkIcon.nix ├── gtkTheme.nix ├── home.nix ├── repl.nix └── system.nix ├── modules ├── desktop.nix ├── gamemode.nix ├── gnome.nix ├── greetd.nix ├── iso.nix ├── kde.nix ├── main.kbd ├── minimal.nix ├── school.nix └── security.nix ├── pkgs ├── default.nix ├── discord │ └── default.nix ├── gdb-frontend │ └── default.nix ├── patches │ ├── xwayland-hidpi.patch │ └── xwayland-vsync.patch ├── plymouth-themes │ └── default.nix ├── repl │ └── default.nix ├── sway-borders │ └── default.nix └── waterfox │ ├── default.nix │ └── waterfox-bin.nix └── schemes ├── catppuccin-latte.nix ├── gruvbox-dark-hard.nix ├── gruvbox-dark-medium.nix ├── gruvbox-light-medium.nix ├── gruvbox-material-dark-hard.nix ├── kanagawa.nix ├── rose-pine.nix └── tokyonight.nix /.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .direnv 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NixOS & HM Configuration 2 | 3 | [![built with nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org) 4 | 5 | Fully fetured NixOS and Home Manager config with some bits borrowed from others. Using [flakes](https://nixos.wiki/wiki/Flakes). 6 | 7 | You can check out all this flake has to offer with 8 | `nix flake show github:narutoxy/dots`. 9 | 10 | ## People 11 | 12 | These are the people whom I've taken inspiration from while writing these 13 | configs. There surely are more but I tend to forget. Regardless, I am thankful 14 | to all of them. 15 | 16 | - [gytis-ivaskevicius](https://github.com/gytis-ivaskevicius) 17 | - [DieracDelta](https://github.com/DieracDelta) 18 | - [NobbZ](https://github.com/NobbZ) 19 | - [hlissner](https://github.com/hlissner) 20 | - [tadeokondrak](https://github.com/tadeokondrak) 21 | - [fufexan](https://github.com/fufexan) 22 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "base16-schemes": { 4 | "flake": false, 5 | "locked": { 6 | "lastModified": 1654895891, 7 | "narHash": "sha256-xYYmZkHnyLCUBAkqkZ7v1Lc5m39857MukQLMRtGuvdk=", 8 | "owner": "base16-project", 9 | "repo": "base16-schemes", 10 | "rev": "7c247f734eac7f04518c6e28d098635ee8dcabf5", 11 | "type": "github" 12 | }, 13 | "original": { 14 | "owner": "base16-project", 15 | "repo": "base16-schemes", 16 | "type": "github" 17 | } 18 | }, 19 | "cachix": { 20 | "locked": { 21 | "lastModified": 1635350005, 22 | "narHash": "sha256-tAMJnUwfaDEB2aa31jGcu7R7bzGELM9noc91L2PbVjg=", 23 | "owner": "nixos", 24 | "repo": "nixpkgs", 25 | "rev": "1c1f5649bb9c1b0d98637c8c365228f57126f361", 26 | "type": "github" 27 | }, 28 | "original": { 29 | "owner": "nixos", 30 | "ref": "nixos-20.09", 31 | "repo": "nixpkgs", 32 | "type": "github" 33 | } 34 | }, 35 | "devshell": { 36 | "inputs": { 37 | "flake-utils": "flake-utils", 38 | "nixpkgs": "nixpkgs" 39 | }, 40 | "locked": { 41 | "lastModified": 1663445644, 42 | "narHash": "sha256-+xVlcK60x7VY1vRJbNUEAHi17ZuoQxAIH4S4iUFUGBA=", 43 | "owner": "numtide", 44 | "repo": "devshell", 45 | "rev": "e3dc3e21594fe07bdb24bdf1c8657acaa4cb8f66", 46 | "type": "github" 47 | }, 48 | "original": { 49 | "owner": "numtide", 50 | "repo": "devshell", 51 | "type": "github" 52 | } 53 | }, 54 | "doom-emacs": { 55 | "flake": false, 56 | "locked": { 57 | "lastModified": 1660901074, 58 | "narHash": "sha256-3apl0eQlfBj3y0gDdoPp2M6PXYnhxs0QWOHp8B8A9sc=", 59 | "owner": "doomemacs", 60 | "repo": "doomemacs", 61 | "rev": "c44bc81a05f3758ceaa28921dd9c830b9c571e61", 62 | "type": "github" 63 | }, 64 | "original": { 65 | "owner": "doomemacs", 66 | "ref": "master", 67 | "repo": "doomemacs", 68 | "type": "github" 69 | } 70 | }, 71 | "doom-snippets": { 72 | "flake": false, 73 | "locked": { 74 | "lastModified": 1662645711, 75 | "narHash": "sha256-XKpPCtECGZQ5bFPPDUX3oAltXOJNwAI/OktxiLnADRE=", 76 | "owner": "doomemacs", 77 | "repo": "snippets", 78 | "rev": "03a62fe7edf7e87fdbd925713fbd3bf292d14b00", 79 | "type": "github" 80 | }, 81 | "original": { 82 | "owner": "doomemacs", 83 | "repo": "snippets", 84 | "type": "github" 85 | } 86 | }, 87 | "emacs-overlay": { 88 | "inputs": { 89 | "flake-utils": "flake-utils_2", 90 | "nixpkgs": "nixpkgs_2" 91 | }, 92 | "locked": { 93 | "lastModified": 1666502500, 94 | "narHash": "sha256-r8xtx6BMx3hfWlMx5ddI7BoB0oB+RL1DiPfci62SqwE=", 95 | "owner": "nix-community", 96 | "repo": "emacs-overlay", 97 | "rev": "4bf8caf3960ec720088711cc24a541b5180dd83f", 98 | "type": "github" 99 | }, 100 | "original": { 101 | "owner": "nix-community", 102 | "repo": "emacs-overlay", 103 | "type": "github" 104 | } 105 | }, 106 | "emacs-overlay_2": { 107 | "flake": false, 108 | "locked": { 109 | "lastModified": 1666298449, 110 | "narHash": "sha256-y1SRRRK2eTVuh/HRCxwDSInMwGv0d5cPIp4YDlbcM30=", 111 | "owner": "nix-community", 112 | "repo": "emacs-overlay", 113 | "rev": "b8e24cec99ff68f8a875b6f842a10b6b2ab398d3", 114 | "type": "github" 115 | }, 116 | "original": { 117 | "owner": "nix-community", 118 | "repo": "emacs-overlay", 119 | "type": "github" 120 | } 121 | }, 122 | "emacs-so-long": { 123 | "flake": false, 124 | "locked": { 125 | "lastModified": 1575031854, 126 | "narHash": "sha256-xIa5zO0ZaToDrec1OFjBK6l39AbA4l/CE4LInVu2hi0=", 127 | "owner": "hlissner", 128 | "repo": "emacs-so-long", 129 | "rev": "ed666b0716f60e8988c455804de24b55919e71ca", 130 | "type": "github" 131 | }, 132 | "original": { 133 | "owner": "hlissner", 134 | "repo": "emacs-so-long", 135 | "type": "github" 136 | } 137 | }, 138 | "evil-escape": { 139 | "flake": false, 140 | "locked": { 141 | "lastModified": 1588439096, 142 | "narHash": "sha256-aB2Ge5o/93B18tPf4fN1c+O46CNh/nOqwLJbox4c8Gw=", 143 | "owner": "hlissner", 144 | "repo": "evil-escape", 145 | "rev": "819f1ee1cf3f69a1ae920e6004f2c0baeebbe077", 146 | "type": "github" 147 | }, 148 | "original": { 149 | "owner": "hlissner", 150 | "repo": "evil-escape", 151 | "type": "github" 152 | } 153 | }, 154 | "evil-markdown": { 155 | "flake": false, 156 | "locked": { 157 | "lastModified": 1626852210, 158 | "narHash": "sha256-HBBuZ1VWIn6kwK5CtGIvHM1+9eiNiKPH0GUsyvpUVN8=", 159 | "owner": "Somelauw", 160 | "repo": "evil-markdown", 161 | "rev": "8e6cc68af83914b2fa9fd3a3b8472573dbcef477", 162 | "type": "github" 163 | }, 164 | "original": { 165 | "owner": "Somelauw", 166 | "repo": "evil-markdown", 167 | "type": "github" 168 | } 169 | }, 170 | "evil-org-mode": { 171 | "flake": false, 172 | "locked": { 173 | "lastModified": 1607203864, 174 | "narHash": "sha256-JxwqVYDN6OIJEH15MVI6XOZAPtUWUhJQWHyzcrUvrFg=", 175 | "owner": "hlissner", 176 | "repo": "evil-org-mode", 177 | "rev": "a9706da260c45b98601bcd72b1d2c0a24a017700", 178 | "type": "github" 179 | }, 180 | "original": { 181 | "owner": "hlissner", 182 | "repo": "evil-org-mode", 183 | "type": "github" 184 | } 185 | }, 186 | "evil-quick-diff": { 187 | "flake": false, 188 | "locked": { 189 | "lastModified": 1575189609, 190 | "narHash": "sha256-oGzl1ayW9rIuq0haoiFS7RZsS8NFMdEA7K1BSozgnJU=", 191 | "owner": "rgrinberg", 192 | "repo": "evil-quick-diff", 193 | "rev": "69c883720b30a892c63bc89f49d4f0e8b8028908", 194 | "type": "github" 195 | }, 196 | "original": { 197 | "owner": "rgrinberg", 198 | "repo": "evil-quick-diff", 199 | "type": "github" 200 | } 201 | }, 202 | "explain-pause-mode": { 203 | "flake": false, 204 | "locked": { 205 | "lastModified": 1595842060, 206 | "narHash": "sha256-++znrjiDSx+cy4okFBBXUBkRFdtnE2x+trkmqjB3Njs=", 207 | "owner": "lastquestion", 208 | "repo": "explain-pause-mode", 209 | "rev": "2356c8c3639cbeeb9751744dbe737267849b4b51", 210 | "type": "github" 211 | }, 212 | "original": { 213 | "owner": "lastquestion", 214 | "repo": "explain-pause-mode", 215 | "type": "github" 216 | } 217 | }, 218 | "firefox": { 219 | "inputs": { 220 | "cachix": "cachix", 221 | "mozilla": "mozilla", 222 | "nixpkgs": [ 223 | "nixpkgs" 224 | ] 225 | }, 226 | "locked": { 227 | "lastModified": 1666489978, 228 | "narHash": "sha256-feljkDnZL8cmpxvNXtticRvs9UCAAH4sO++iipBF0fk=", 229 | "owner": "colemickens", 230 | "repo": "flake-firefox-nightly", 231 | "rev": "e41212ef6896d89bdcb1d6c29ef0b393dcb74783", 232 | "type": "github" 233 | }, 234 | "original": { 235 | "owner": "colemickens", 236 | "repo": "flake-firefox-nightly", 237 | "type": "github" 238 | } 239 | }, 240 | "fish-async": { 241 | "flake": false, 242 | "locked": { 243 | "lastModified": 1653809859, 244 | "narHash": "sha256-RpZgnB9g+kCkt576Qe4LG5erlUjQl70ibf0Jn2+1F5A=", 245 | "owner": "acomagu", 246 | "repo": "fish-async-prompt", 247 | "rev": "b866f232a4a5ded7e16cda648648c43925c01ba0", 248 | "type": "github" 249 | }, 250 | "original": { 251 | "owner": "acomagu", 252 | "repo": "fish-async-prompt", 253 | "type": "github" 254 | } 255 | }, 256 | "fish-autopair": { 257 | "flake": false, 258 | "locked": { 259 | "lastModified": 1656950411, 260 | "narHash": "sha256-qt3t1iKRRNuiLWiVoiAYOu+9E7jsyECyIqZJ/oRIT1A=", 261 | "owner": "jorgebucaran", 262 | "repo": "autopair.fish", 263 | "rev": "4d1752ff5b39819ab58d7337c69220342e9de0e2", 264 | "type": "github" 265 | }, 266 | "original": { 267 | "owner": "jorgebucaran", 268 | "repo": "autopair.fish", 269 | "type": "github" 270 | } 271 | }, 272 | "fish-pure": { 273 | "flake": false, 274 | "locked": { 275 | "lastModified": 1666193227, 276 | "narHash": "sha256-PFvyPJXUVDA6dQkGhznjTqChp8eXd+HvhvMHX5JIP8Y=", 277 | "owner": "pure-fish", 278 | "repo": "pure", 279 | "rev": "599729e57994c384e5ab073aed04c3be469d5ce7", 280 | "type": "github" 281 | }, 282 | "original": { 283 | "owner": "pure-fish", 284 | "repo": "pure", 285 | "type": "github" 286 | } 287 | }, 288 | "flake-compat": { 289 | "flake": false, 290 | "locked": { 291 | "lastModified": 1650374568, 292 | "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", 293 | "owner": "edolstra", 294 | "repo": "flake-compat", 295 | "rev": "b4a34015c698c7793d592d66adbab377907a2be8", 296 | "type": "github" 297 | }, 298 | "original": { 299 | "owner": "edolstra", 300 | "repo": "flake-compat", 301 | "type": "github" 302 | } 303 | }, 304 | "flake-compat_2": { 305 | "flake": false, 306 | "locked": { 307 | "lastModified": 1650374568, 308 | "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", 309 | "owner": "edolstra", 310 | "repo": "flake-compat", 311 | "rev": "b4a34015c698c7793d592d66adbab377907a2be8", 312 | "type": "github" 313 | }, 314 | "original": { 315 | "owner": "edolstra", 316 | "repo": "flake-compat", 317 | "type": "github" 318 | } 319 | }, 320 | "flake-utils": { 321 | "locked": { 322 | "lastModified": 1642700792, 323 | "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", 324 | "owner": "numtide", 325 | "repo": "flake-utils", 326 | "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", 327 | "type": "github" 328 | }, 329 | "original": { 330 | "owner": "numtide", 331 | "repo": "flake-utils", 332 | "type": "github" 333 | } 334 | }, 335 | "flake-utils_2": { 336 | "locked": { 337 | "lastModified": 1659877975, 338 | "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", 339 | "owner": "numtide", 340 | "repo": "flake-utils", 341 | "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", 342 | "type": "github" 343 | }, 344 | "original": { 345 | "owner": "numtide", 346 | "repo": "flake-utils", 347 | "type": "github" 348 | } 349 | }, 350 | "flake-utils_3": { 351 | "locked": { 352 | "lastModified": 1659877975, 353 | "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", 354 | "owner": "numtide", 355 | "repo": "flake-utils", 356 | "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", 357 | "type": "github" 358 | }, 359 | "original": { 360 | "owner": "numtide", 361 | "repo": "flake-utils", 362 | "type": "github" 363 | } 364 | }, 365 | "flake-utils_4": { 366 | "locked": { 367 | "lastModified": 1659877975, 368 | "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", 369 | "owner": "numtide", 370 | "repo": "flake-utils", 371 | "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", 372 | "type": "github" 373 | }, 374 | "original": { 375 | "owner": "numtide", 376 | "repo": "flake-utils", 377 | "type": "github" 378 | } 379 | }, 380 | "format-all": { 381 | "flake": false, 382 | "locked": { 383 | "lastModified": 1581716637, 384 | "narHash": "sha256-ul7LCe60W8TIvUmUtZtZRo8489TK9iTPDsLHmzxY57M=", 385 | "owner": "lassik", 386 | "repo": "emacs-format-all-the-code", 387 | "rev": "47d862d40a088ca089c92cd393c6dca4628f87d3", 388 | "type": "github" 389 | }, 390 | "original": { 391 | "owner": "lassik", 392 | "repo": "emacs-format-all-the-code", 393 | "rev": "47d862d40a088ca089c92cd393c6dca4628f87d3", 394 | "type": "github" 395 | } 396 | }, 397 | "fu": { 398 | "locked": { 399 | "lastModified": 1659877975, 400 | "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", 401 | "owner": "numtide", 402 | "repo": "flake-utils", 403 | "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", 404 | "type": "github" 405 | }, 406 | "original": { 407 | "owner": "numtide", 408 | "repo": "flake-utils", 409 | "type": "github" 410 | } 411 | }, 412 | "hm": { 413 | "inputs": { 414 | "nixpkgs": [ 415 | "nixpkgs" 416 | ], 417 | "utils": "utils" 418 | }, 419 | "locked": { 420 | "lastModified": 1666463764, 421 | "narHash": "sha256-NmayV9S0s7CgNEA2QbIxDU0VCIiX6bIHu8PCQPnYHDM=", 422 | "owner": "nix-community", 423 | "repo": "home-manager", 424 | "rev": "69d19b9839638fc487b370e0600a03577a559081", 425 | "type": "github" 426 | }, 427 | "original": { 428 | "owner": "nix-community", 429 | "repo": "home-manager", 430 | "type": "github" 431 | } 432 | }, 433 | "hyprland": { 434 | "inputs": { 435 | "nixpkgs": [ 436 | "nixpkgs" 437 | ], 438 | "wlroots": "wlroots" 439 | }, 440 | "locked": { 441 | "lastModified": 1666473034, 442 | "narHash": "sha256-UfnSWkp4gWf2AA6hyru9Gv1Rb5Ixvsx1RkZ2iVhgC3w=", 443 | "owner": "Hyprwm", 444 | "repo": "Hyprland", 445 | "rev": "10303259f7c6f3e64e74e9ca8a31d4223071d5f0", 446 | "type": "github" 447 | }, 448 | "original": { 449 | "owner": "Hyprwm", 450 | "repo": "Hyprland", 451 | "type": "github" 452 | } 453 | }, 454 | "hyprpicker": { 455 | "inputs": { 456 | "nixpkgs": [ 457 | "nixpkgs" 458 | ] 459 | }, 460 | "locked": { 461 | "lastModified": 1662376637, 462 | "narHash": "sha256-btKx3UIEZEi9YuW1rv0HnhM7tO5Jfw7f2zvVpHYEJvg=", 463 | "owner": "Hyprwm", 464 | "repo": "Hyprpicker", 465 | "rev": "69dc644b9fd1cd96b0910ceadf388450982fc73d", 466 | "type": "github" 467 | }, 468 | "original": { 469 | "owner": "Hyprwm", 470 | "repo": "Hyprpicker", 471 | "type": "github" 472 | } 473 | }, 474 | "mozilla": { 475 | "flake": false, 476 | "locked": { 477 | "lastModified": 1664789696, 478 | "narHash": "sha256-UGWJHQShiwLCr4/DysMVFrYdYYHcOqAOVsWNUu+l6YU=", 479 | "owner": "mozilla", 480 | "repo": "nixpkgs-mozilla", 481 | "rev": "80627b282705101e7b38e19ca6e8df105031b072", 482 | "type": "github" 483 | }, 484 | "original": { 485 | "owner": "mozilla", 486 | "repo": "nixpkgs-mozilla", 487 | "type": "github" 488 | } 489 | }, 490 | "neovim-flake": { 491 | "inputs": { 492 | "flake-utils": "flake-utils_3", 493 | "nixpkgs": [ 494 | "neovim-nightly-overlay", 495 | "nixpkgs" 496 | ] 497 | }, 498 | "locked": { 499 | "dir": "contrib", 500 | "lastModified": 1666396419, 501 | "narHash": "sha256-jCFc/dTsDfyyenzmtOm9u3MSZQHsHo46xZ7T+2HiY7c=", 502 | "owner": "neovim", 503 | "repo": "neovim", 504 | "rev": "2f9b94a26836ecb081c717e23913f5b6576cce99", 505 | "type": "github" 506 | }, 507 | "original": { 508 | "dir": "contrib", 509 | "owner": "neovim", 510 | "repo": "neovim", 511 | "type": "github" 512 | } 513 | }, 514 | "neovim-nightly-overlay": { 515 | "inputs": { 516 | "flake-compat": "flake-compat", 517 | "neovim-flake": "neovim-flake", 518 | "nixpkgs": "nixpkgs_3" 519 | }, 520 | "locked": { 521 | "lastModified": 1666426819, 522 | "narHash": "sha256-28rlBhbY+ZX2uUze5HVR4a5y6fVuyPuU9+NWtxmg6dk=", 523 | "owner": "nix-community", 524 | "repo": "neovim-nightly-overlay", 525 | "rev": "72ceb9a0def71a405c97a2b86bc08096c3c49157", 526 | "type": "github" 527 | }, 528 | "original": { 529 | "owner": "nix-community", 530 | "repo": "neovim-nightly-overlay", 531 | "type": "github" 532 | } 533 | }, 534 | "nix-colors": { 535 | "inputs": { 536 | "base16-schemes": "base16-schemes", 537 | "nixpkgs-lib": "nixpkgs-lib" 538 | }, 539 | "locked": { 540 | "lastModified": 1664216202, 541 | "narHash": "sha256-7qXPLkgsXpi2nmxGN14DVZWMFw4QIx7foqEN6GXeTj8=", 542 | "owner": "misterio77", 543 | "repo": "nix-colors", 544 | "rev": "bb56fe29c3e16029a783b7a85354fc14098f2560", 545 | "type": "github" 546 | }, 547 | "original": { 548 | "owner": "misterio77", 549 | "repo": "nix-colors", 550 | "type": "github" 551 | } 552 | }, 553 | "nix-doom-emacs": { 554 | "inputs": { 555 | "doom-emacs": "doom-emacs", 556 | "doom-snippets": "doom-snippets", 557 | "emacs-overlay": "emacs-overlay_2", 558 | "emacs-so-long": "emacs-so-long", 559 | "evil-escape": "evil-escape", 560 | "evil-markdown": "evil-markdown", 561 | "evil-org-mode": "evil-org-mode", 562 | "evil-quick-diff": "evil-quick-diff", 563 | "explain-pause-mode": "explain-pause-mode", 564 | "flake-compat": "flake-compat_2", 565 | "flake-utils": "flake-utils_4", 566 | "format-all": "format-all", 567 | "nix-straight": "nix-straight", 568 | "nixpkgs": "nixpkgs_4", 569 | "nose": "nose", 570 | "ob-racket": "ob-racket", 571 | "org": "org", 572 | "org-contrib": "org-contrib", 573 | "org-yt": "org-yt", 574 | "php-extras": "php-extras", 575 | "revealjs": "revealjs", 576 | "rotate-text": "rotate-text", 577 | "sln-mode": "sln-mode", 578 | "ts-fold": "ts-fold", 579 | "ws-butler": "ws-butler" 580 | }, 581 | "locked": { 582 | "lastModified": 1666441658, 583 | "narHash": "sha256-viSycvYPWInoNoVVzOKcZBtIppK18GuAawqUwGeliKM=", 584 | "owner": "nix-community", 585 | "repo": "nix-doom-emacs", 586 | "rev": "450d891c61eaae70963f319d161c135e401f30c7", 587 | "type": "github" 588 | }, 589 | "original": { 590 | "owner": "nix-community", 591 | "repo": "nix-doom-emacs", 592 | "type": "github" 593 | } 594 | }, 595 | "nix-gaming": { 596 | "inputs": { 597 | "nixpkgs": "nixpkgs_5" 598 | }, 599 | "locked": { 600 | "lastModified": 1661546847, 601 | "narHash": "sha256-sW3kw7ICHeMmh3pG7iptLspA14nUguvM3ZFkHAXgGd0=", 602 | "owner": "fufexan", 603 | "repo": "nix-gaming", 604 | "rev": "042c35a6fac3d9d62f1231f12f378eaff7d2cc1f", 605 | "type": "github" 606 | }, 607 | "original": { 608 | "owner": "fufexan", 609 | "ref": "testing", 610 | "repo": "nix-gaming", 611 | "type": "github" 612 | } 613 | }, 614 | "nix-straight": { 615 | "flake": false, 616 | "locked": { 617 | "lastModified": 1656684255, 618 | "narHash": "sha256-ZefQiv4Ipu2VkLjs1oyelTLU7kBVJgkcQd+yBpJU0yo=", 619 | "owner": "nix-community", 620 | "repo": "nix-straight.el", 621 | "rev": "fb8dd5c44cde70abd13380766e40af7a63888942", 622 | "type": "github" 623 | }, 624 | "original": { 625 | "owner": "nix-community", 626 | "repo": "nix-straight.el", 627 | "type": "github" 628 | } 629 | }, 630 | "nixpkgs": { 631 | "locked": { 632 | "lastModified": 1643381941, 633 | "narHash": "sha256-pHTwvnN4tTsEKkWlXQ8JMY423epos8wUOhthpwJjtpc=", 634 | "owner": "NixOS", 635 | "repo": "nixpkgs", 636 | "rev": "5efc8ca954272c4376ac929f4c5ffefcc20551d5", 637 | "type": "github" 638 | }, 639 | "original": { 640 | "owner": "NixOS", 641 | "ref": "nixpkgs-unstable", 642 | "repo": "nixpkgs", 643 | "type": "github" 644 | } 645 | }, 646 | "nixpkgs-lib": { 647 | "locked": { 648 | "lastModified": 1655599917, 649 | "narHash": "sha256-kjZbt5WdTrnjMxL79okg9TCoRUdADG50x/TWozbyTsE=", 650 | "owner": "nix-community", 651 | "repo": "nixpkgs.lib", 652 | "rev": "5fb55578aa2f1a502d636a8ac71aece57cb730bb", 653 | "type": "github" 654 | }, 655 | "original": { 656 | "owner": "nix-community", 657 | "repo": "nixpkgs.lib", 658 | "type": "github" 659 | } 660 | }, 661 | "nixpkgs_2": { 662 | "locked": { 663 | "lastModified": 1666282307, 664 | "narHash": "sha256-O1T2HGLARLKDLfdOmjPBfn3eC4cSIaQD71wUN4I/6/s=", 665 | "path": "/nix/store/x20avpqcrk6my01n6h1blfslb6l4imw2-source", 666 | "rev": "b7d8c687782c8f9a1d425a7e486eb989654f6468", 667 | "type": "path" 668 | }, 669 | "original": { 670 | "id": "nixpkgs", 671 | "type": "indirect" 672 | } 673 | }, 674 | "nixpkgs_3": { 675 | "locked": { 676 | "lastModified": 1666333455, 677 | "narHash": "sha256-oHXIeLB/sPWxKNcSdV1DQi1ddNVoJ17T1yDiMMeygL4=", 678 | "owner": "nixos", 679 | "repo": "nixpkgs", 680 | "rev": "93e0ac196106dce51878469c9a763c6233af5c57", 681 | "type": "github" 682 | }, 683 | "original": { 684 | "owner": "nixos", 685 | "ref": "nixpkgs-unstable", 686 | "repo": "nixpkgs", 687 | "type": "github" 688 | } 689 | }, 690 | "nixpkgs_4": { 691 | "locked": { 692 | "lastModified": 1666275482, 693 | "narHash": "sha256-P5cxOmp1Yi2miEDLQas8GLQQ4W54zYgHd2frvs+lERQ=", 694 | "owner": "NixOS", 695 | "repo": "nixpkgs", 696 | "rev": "d639b2dfacdb3464faa11936a8c751ea3ff57775", 697 | "type": "github" 698 | }, 699 | "original": { 700 | "id": "nixpkgs", 701 | "ref": "nixpkgs-unstable", 702 | "type": "indirect" 703 | } 704 | }, 705 | "nixpkgs_5": { 706 | "locked": { 707 | "lastModified": 1656401090, 708 | "narHash": "sha256-bUS2nfQsvTQW2z8SK7oEFSElbmoBahOPtbXPm0AL3I4=", 709 | "owner": "NixOS", 710 | "repo": "nixpkgs", 711 | "rev": "16de63fcc54e88b9a106a603038dd5dd2feb21eb", 712 | "type": "github" 713 | }, 714 | "original": { 715 | "owner": "NixOS", 716 | "ref": "nixpkgs-unstable", 717 | "repo": "nixpkgs", 718 | "type": "github" 719 | } 720 | }, 721 | "nixpkgs_6": { 722 | "locked": { 723 | "lastModified": 1666377499, 724 | "narHash": "sha256-dZZCGvWcxc7oGnUgFVf0UeNHsJ4VhkTM0v5JRe8EwR8=", 725 | "owner": "NixOS", 726 | "repo": "nixpkgs", 727 | "rev": "301aada7a64812853f2e2634a530ef5d34505048", 728 | "type": "github" 729 | }, 730 | "original": { 731 | "owner": "NixOS", 732 | "ref": "nixos-unstable", 733 | "repo": "nixpkgs", 734 | "type": "github" 735 | } 736 | }, 737 | "nose": { 738 | "flake": false, 739 | "locked": { 740 | "lastModified": 1400604510, 741 | "narHash": "sha256-daEi8Kta1oGaDEmUUDDQMahTTPOpvNpDKk22rlr7cB0=", 742 | "owner": "emacsattic", 743 | "repo": "nose", 744 | "rev": "f8528297519eba911696c4e68fa88892de9a7b72", 745 | "type": "github" 746 | }, 747 | "original": { 748 | "owner": "emacsattic", 749 | "repo": "nose", 750 | "type": "github" 751 | } 752 | }, 753 | "nur": { 754 | "locked": { 755 | "lastModified": 1666511160, 756 | "narHash": "sha256-TDeV600LPda/RI+2Flz11r8AamzFBZBToSnuLvlKb0s=", 757 | "owner": "nix-community", 758 | "repo": "NUR", 759 | "rev": "0f5061ee4214d46ee0093c39899e6d07efcb1ef6", 760 | "type": "github" 761 | }, 762 | "original": { 763 | "owner": "nix-community", 764 | "repo": "NUR", 765 | "type": "github" 766 | } 767 | }, 768 | "ob-racket": { 769 | "flake": false, 770 | "locked": { 771 | "lastModified": 1584656173, 772 | "narHash": "sha256-rBUYDDCXb+3D4xTPQo9UocbTPZ32kWV1Uya/1DmZknU=", 773 | "owner": "xchrishawk", 774 | "repo": "ob-racket", 775 | "rev": "83457ec9e1e96a29fd2086ed19432b9d75787673", 776 | "type": "github" 777 | }, 778 | "original": { 779 | "owner": "xchrishawk", 780 | "repo": "ob-racket", 781 | "type": "github" 782 | } 783 | }, 784 | "org": { 785 | "flake": false, 786 | "locked": { 787 | "lastModified": 1666258795, 788 | "narHash": "sha256-k2FbWk4OJKZbih3pTvJYxkaXuauWsuaXXthV54UFqCM=", 789 | "owner": "emacs-straight", 790 | "repo": "org-mode", 791 | "rev": "98cae03b7d9a612334d5ea461e73ac0b37b0285d", 792 | "type": "github" 793 | }, 794 | "original": { 795 | "owner": "emacs-straight", 796 | "repo": "org-mode", 797 | "type": "github" 798 | } 799 | }, 800 | "org-contrib": { 801 | "flake": false, 802 | "locked": { 803 | "lastModified": 1664301003, 804 | "narHash": "sha256-8CAq/EB52RMQHNLZM0uc/1N5gKTfxGhf7WFt9sMKoD8=", 805 | "owner": "emacsmirror", 806 | "repo": "org-contrib", 807 | "rev": "aa104c0bbc3113f6d3d167b20bd8d6bf6a285f0f", 808 | "type": "github" 809 | }, 810 | "original": { 811 | "owner": "emacsmirror", 812 | "repo": "org-contrib", 813 | "type": "github" 814 | } 815 | }, 816 | "org-yt": { 817 | "flake": false, 818 | "locked": { 819 | "lastModified": 1527381913, 820 | "narHash": "sha256-dzQ6B7ryzatHCTLyEnRSbWO0VUiX/FHYnpHTs74aVUs=", 821 | "owner": "TobiasZawada", 822 | "repo": "org-yt", 823 | "rev": "40cc1ac76d741055cbefa13860d9f070a7ade001", 824 | "type": "github" 825 | }, 826 | "original": { 827 | "owner": "TobiasZawada", 828 | "repo": "org-yt", 829 | "type": "github" 830 | } 831 | }, 832 | "php-extras": { 833 | "flake": false, 834 | "locked": { 835 | "lastModified": 1573312690, 836 | "narHash": "sha256-r4WyVbzvT0ra4Z6JywNBOw5RxOEYd6Qe2IpebHXkj1U=", 837 | "owner": "arnested", 838 | "repo": "php-extras", 839 | "rev": "d410c5af663c30c01d461ac476d1cbfbacb49367", 840 | "type": "github" 841 | }, 842 | "original": { 843 | "owner": "arnested", 844 | "repo": "php-extras", 845 | "type": "github" 846 | } 847 | }, 848 | "revealjs": { 849 | "flake": false, 850 | "locked": { 851 | "lastModified": 1665992801, 852 | "narHash": "sha256-bqNgaBT6WPfumhdG1VPZ6ngn0QA9RDuVtVJtVwxbOd4=", 853 | "owner": "hakimel", 854 | "repo": "reveal.js", 855 | "rev": "f6f657b627f9703e32414d8d3f16fb49d41031cb", 856 | "type": "github" 857 | }, 858 | "original": { 859 | "owner": "hakimel", 860 | "repo": "reveal.js", 861 | "type": "github" 862 | } 863 | }, 864 | "root": { 865 | "inputs": { 866 | "devshell": "devshell", 867 | "emacs-overlay": "emacs-overlay", 868 | "firefox": "firefox", 869 | "fish-async": "fish-async", 870 | "fish-autopair": "fish-autopair", 871 | "fish-pure": "fish-pure", 872 | "fu": "fu", 873 | "hm": "hm", 874 | "hyprland": "hyprland", 875 | "hyprpicker": "hyprpicker", 876 | "neovim-nightly-overlay": "neovim-nightly-overlay", 877 | "nix-colors": "nix-colors", 878 | "nix-doom-emacs": "nix-doom-emacs", 879 | "nix-gaming": "nix-gaming", 880 | "nixpkgs": "nixpkgs_6", 881 | "nur": "nur", 882 | "wall": "wall" 883 | } 884 | }, 885 | "rotate-text": { 886 | "flake": false, 887 | "locked": { 888 | "lastModified": 1322962747, 889 | "narHash": "sha256-SOeOgSlcEIsKhUiYDJv0p+mLUb420s9E2BmvZQvZ0wk=", 890 | "owner": "debug-ito", 891 | "repo": "rotate-text.el", 892 | "rev": "48f193697db996855aee1ad2bc99b38c6646fe76", 893 | "type": "github" 894 | }, 895 | "original": { 896 | "owner": "debug-ito", 897 | "repo": "rotate-text.el", 898 | "type": "github" 899 | } 900 | }, 901 | "sln-mode": { 902 | "flake": false, 903 | "locked": { 904 | "lastModified": 1423727528, 905 | "narHash": "sha256-XqkqPyEJuTtFslOz1fpTf/Klbd/zA7IGpzpmum/MGao=", 906 | "owner": "sensorflo", 907 | "repo": "sln-mode", 908 | "rev": "0f91d1b957c7d2a7bab9278ec57b54d57f1dbd9c", 909 | "type": "github" 910 | }, 911 | "original": { 912 | "owner": "sensorflo", 913 | "repo": "sln-mode", 914 | "type": "github" 915 | } 916 | }, 917 | "ts-fold": { 918 | "flake": false, 919 | "locked": { 920 | "lastModified": 1663136308, 921 | "narHash": "sha256-FI25RLoHqhcjA2qel75LVmQH4rTkKiAUR2w9QODT1XM=", 922 | "owner": "jcs-elpa", 923 | "repo": "ts-fold", 924 | "rev": "c3da5520b988720f7f6e9e5e11b60746598112e0", 925 | "type": "github" 926 | }, 927 | "original": { 928 | "owner": "jcs-elpa", 929 | "repo": "ts-fold", 930 | "type": "github" 931 | } 932 | }, 933 | "utils": { 934 | "locked": { 935 | "lastModified": 1659877975, 936 | "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", 937 | "owner": "numtide", 938 | "repo": "flake-utils", 939 | "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", 940 | "type": "github" 941 | }, 942 | "original": { 943 | "owner": "numtide", 944 | "repo": "flake-utils", 945 | "type": "github" 946 | } 947 | }, 948 | "wall": { 949 | "flake": false, 950 | "locked": { 951 | "narHash": "sha256-dy3eGam08n+t38dij/9+H3i7wxtQYUVu5BtKWRs3wt0=", 952 | "type": "file", 953 | "url": "https://unsplash.com/photos/FaFZCtl1yug/download?force=true" 954 | }, 955 | "original": { 956 | "type": "file", 957 | "url": "https://unsplash.com/photos/FaFZCtl1yug/download?force=true" 958 | } 959 | }, 960 | "wlroots": { 961 | "flake": false, 962 | "locked": { 963 | "host": "gitlab.freedesktop.org", 964 | "lastModified": 1666466001, 965 | "narHash": "sha256-ZjxAnqtcGmHQHKL1Z9sIraDnzIqrJleWcJXfPtzAm74=", 966 | "owner": "wlroots", 967 | "repo": "wlroots", 968 | "rev": "c2d2773df57750081b16d56da13b5015d752cbd7", 969 | "type": "gitlab" 970 | }, 971 | "original": { 972 | "host": "gitlab.freedesktop.org", 973 | "owner": "wlroots", 974 | "repo": "wlroots", 975 | "type": "gitlab" 976 | } 977 | }, 978 | "ws-butler": { 979 | "flake": false, 980 | "locked": { 981 | "lastModified": 1634511126, 982 | "narHash": "sha256-c0y0ZPtxxICPk+eaNbbQf6t+FRCliNY54CCz9QHQ8ZI=", 983 | "owner": "hlissner", 984 | "repo": "ws-butler", 985 | "rev": "572a10c11b6cb88293de48acbb59a059d36f9ba5", 986 | "type": "github" 987 | }, 988 | "original": { 989 | "owner": "hlissner", 990 | "repo": "ws-butler", 991 | "type": "github" 992 | } 993 | } 994 | }, 995 | "root": "root", 996 | "version": 7 997 | } 998 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Astro Dots"; 3 | 4 | outputs = { 5 | self, 6 | nixpkgs, 7 | ... 8 | } @ inputs: let 9 | lib = import ./lib inputs; 10 | inherit (lib) genSystems; 11 | 12 | overlays.default = import ./pkgs inputs; 13 | 14 | pkgs = genSystems (system: 15 | import nixpkgs { 16 | inherit system; 17 | overlays = [ 18 | inputs.devshell.overlay 19 | inputs.emacs-overlay.overlay 20 | overlays.default 21 | inputs.neovim-nightly-overlay.overlay 22 | ]; 23 | config.allowUnfree = true; 24 | }); 25 | in { 26 | inherit lib overlays pkgs; 27 | 28 | # standalone home-manager config 29 | inherit (import ./home/profiles inputs) homeConfigurations; 30 | 31 | # nixos-configs with home-manager 32 | nixosConfigurations = import ./hosts inputs; 33 | 34 | devShells = genSystems (system: { 35 | default = pkgs.${system}.devshell.mkShell { 36 | packages = with pkgs.${system}; [ 37 | alejandra 38 | nixfmt 39 | git 40 | rnix-lsp 41 | nix-output-monitor 42 | repl 43 | ]; 44 | name = "dots"; 45 | }; 46 | }); 47 | }; 48 | 49 | inputs = { 50 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 51 | nur.url = "github:nix-community/NUR"; 52 | 53 | # flakes 54 | devshell.url = "github:numtide/devshell"; 55 | 56 | emacs-overlay.url = "github:nix-community/emacs-overlay"; 57 | nix-doom-emacs.url = "github:nix-community/nix-doom-emacs"; 58 | 59 | neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; 60 | 61 | fu.url = "github:numtide/flake-utils"; 62 | 63 | hm = { 64 | url = "github:nix-community/home-manager"; 65 | inputs.nixpkgs.follows = "nixpkgs"; 66 | }; 67 | 68 | nix-gaming.url = "github:fufexan/nix-gaming/testing"; 69 | 70 | nix-colors.url = "github:misterio77/nix-colors"; 71 | 72 | # powercord = { 73 | # url = "github:LavaDesu/powercord-overlay"; 74 | # inputs.nixpkgs.follows = "nixpkgs"; 75 | # }; 76 | 77 | # discord-tweaks = { 78 | # url = "github:NurMarvin/discord-tweaks"; 79 | # flake = false; 80 | # }; 81 | 82 | # powercord-image-tools = { 83 | # url = "github:powerfart-plugins/image-tools"; 84 | # flake = false; 85 | # }; 86 | 87 | # Hypr 88 | hyprland = { 89 | url = "github:Hyprwm/Hyprland"; 90 | inputs.nixpkgs.follows = "nixpkgs"; 91 | }; 92 | hyprpicker = { 93 | url = "github:Hyprwm/Hyprpicker"; 94 | inputs.nixpkgs.follows = "nixpkgs"; 95 | }; 96 | 97 | 98 | fish-autopair = { 99 | flake = false; 100 | url = "github:jorgebucaran/autopair.fish"; 101 | }; 102 | 103 | fish-async = { 104 | flake = false; 105 | url = "github:acomagu/fish-async-prompt"; 106 | }; 107 | fish-pure = { 108 | flake = false; 109 | url = "github:pure-fish/pure"; 110 | }; 111 | 112 | firefox = { 113 | flake = true; 114 | url = "github:colemickens/flake-firefox-nightly"; 115 | inputs.nixpkgs.follows = "nixpkgs"; 116 | }; 117 | 118 | wall = { 119 | flake = false; 120 | # url = "https://i.imgur.com/vU1M7C1.jpeg"; # rose pine 121 | # url = "https://9to5mac.com/wp-content/uploads/sites/6/2014/08/yosemite-4.jpg?quality100&strip=all"; # orange mountains 122 | url = "https://unsplash.com/photos/FaFZCtl1yug/download?force=true"; # candy mountains 123 | }; 124 | }; 125 | } 126 | -------------------------------------------------------------------------------- /home/cli.nix: -------------------------------------------------------------------------------- 1 | {pkgs, colors, ...}: let 2 | # minimal config, suitable for servers 3 | inherit (colors) xcolors; 4 | in { 5 | imports = [./shell/zsh.nix]; 6 | 7 | home = { 8 | username = "astro"; 9 | homeDirectory = "/home/astro"; 10 | stateVersion = "21.11"; 11 | }; 12 | 13 | home.packages = with pkgs; [ 14 | # modern coreutils 15 | bat 16 | bottom 17 | du-dust 18 | duf 19 | exa 20 | fd 21 | ripgrep 22 | tealdeer 23 | rm-improved 24 | btop 25 | 26 | glow 27 | 28 | tree 29 | 30 | joshuto 31 | ranger 32 | 33 | lazygit 34 | 35 | # fun 36 | pfetch 37 | cava 38 | 39 | # zips 40 | unzip 41 | 42 | python3 43 | ]; 44 | home.extraOutputsToInstall = ["doc" "info" "devdoc"]; 45 | 46 | programs.home-manager.enable = true; 47 | 48 | programs.zoxide.enable = true; 49 | 50 | programs.gh = { 51 | enable = true; 52 | settings = {git_protocol = "ssh";}; 53 | }; 54 | 55 | programs.fzf = { 56 | enable = true; 57 | enableZshIntegration = true; 58 | enableFishIntegration = true; 59 | defaultCommand = 60 | "${pkgs.fd}/bin/fd --hidden --type f --exclude '.git' --exclude '.pnpm-store' --exclude 'node_modules'"; 61 | changeDirWidgetOptions = [ 62 | "--preview 'exa --icons --git --color always -T -L 3 {} | head -200'" 63 | "--exact" 64 | ]; 65 | defaultOptions = [ 66 | "--prompt='~ '" 67 | "--layout=reverse" 68 | "--multi" 69 | "--sort" 70 | "--color=fg:-1,bg:-1,hl:${xcolors.base0D}" 71 | "--color=fg+:${xcolors.base06},bg+:${xcolors.base01},hl+:${xcolors.base0C}" 72 | "--color=info:${xcolors.base09},prompt:${xcolors.base08},pointer:${xcolors.base08}" 73 | "--color=marker:${xcolors.base0B},spinner:${xcolors.base0D},header:${xcolors.base0C}" 74 | "--bind '?:toggle-preview'" 75 | "--bind 'ctrl-a:select-all'" 76 | "--bind 'ctrl-e:execute(echo {+} | xargs -o nvim)'" 77 | "--height=80%" 78 | "--preview-window=:hidden" 79 | "--info=inline" 80 | "--preview 'bash -c \'([[ -f {} ]] && (bat --style=numbers --color=always {} || cat {})) || ([[ -d {} ]] && (tree -C {} | less)) || echo {} 2> /dev/null | head -200\''" 81 | ]; 82 | changeDirWidgetCommand = 83 | "${pkgs.fd}/bin/fd --type d --hidden --exclude '.git' --exclude '.pnpm-store' --exclude 'node_modules'"; 84 | historyWidgetOptions = [ "--sort" ]; 85 | }; 86 | 87 | programs.ssh.enable = true; 88 | } 89 | -------------------------------------------------------------------------------- /home/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | config, 4 | colors, 5 | inputs, 6 | ... 7 | }: 8 | # graphical session configuration 9 | # includes programs and services that work on both Wayland and X 10 | let 11 | inherit (colors) xcolors theme; 12 | nix-colors-lib = inputs.nix-colors.lib-contrib {inherit pkgs;}; 13 | nur = import inputs.nur { 14 | inherit pkgs; 15 | nurpkgs = pkgs; 16 | }; 17 | in { 18 | imports = [ 19 | ./cli.nix # base config 20 | ./terminals.nix 21 | ]; 22 | 23 | home.pointerCursor = { 24 | package = pkgs.bibata-cursors; 25 | gtk.enable = true; 26 | name = "Bibata-Modern-Ice"; 27 | size = 16; 28 | x11.enable = true; 29 | }; 30 | 31 | home.activation."batCacheBuild" = { 32 | before = []; 33 | after = ["linkGeneration"]; 34 | data = "${pkgs.bat}/bin/bat cache --build"; 35 | }; 36 | home.packages = with pkgs; let 37 | discord-chromium = makeDesktopItem { 38 | name = "discord-canary"; 39 | desktopName = "Discord Canary"; 40 | genericName = "Discord Canary"; 41 | exec = "${config.programs.chromium.package}/bin/chromium --app=\"https://canary.discord.com/app\""; 42 | icon = "discord"; 43 | categories = ["Network" "InstantMessaging"]; 44 | mimeTypes = ["x-scheme-handler/discord"]; 45 | }; 46 | tg-chromium = makeDesktopItem { 47 | name = "telegram"; 48 | desktopName = "Telegram"; 49 | genericName = "Telegram"; 50 | exec = "${config.programs.chromium.package}/bin/chromium --app=\"https://web.telegram.org\""; 51 | icon = "telegram"; 52 | categories = ["Network" "InstantMessaging"]; 53 | mimeTypes = ["x-scheme-handler/telegram"]; 54 | }; 55 | element-chromium = makeDesktopItem { 56 | name = "element"; 57 | desktopName = "Element"; 58 | genericName = "Element"; 59 | exec = "${config.programs.chromium.package}/bin/chromium --app=\"https://app.element.io\""; 60 | icon = "element"; 61 | categories = ["Network" "InstantMessaging"]; 62 | mimeTypes = [ "x-scheme-handler/element" ]; 63 | }; 64 | spotify-chromium = makeDesktopItem { 65 | name = "spotify"; 66 | desktopName = "Spotify"; 67 | genericName = "Spotify"; 68 | exec = "${config.programs.chromium.package}/bin/chromium --app=\"https://open.spotify.com\""; 69 | icon = "spotify"; 70 | categories = ["Network" "Audio"]; 71 | mimeTypes = ["x-scheme-handler/spotify"]; 72 | }; 73 | in [ 74 | # archives 75 | p7zip 76 | unrar 77 | # file downloaders 78 | yt-dlp 79 | # file managers 80 | cinnamon.nemo 81 | # misc 82 | libnotify 83 | libsForQt5.qtstyleplugins 84 | 85 | manix 86 | 87 | # im 88 | discord-chromium 89 | tg-chromium 90 | element-chromium 91 | 92 | # music 93 | spotify-chromium 94 | ]; 95 | 96 | gtk = { 97 | enable = true; 98 | 99 | font = { 100 | name = "JetBrainsMono Nerd Font"; 101 | package = pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; }; 102 | }; 103 | 104 | gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; 105 | 106 | iconTheme = { 107 | name = "Papirus-Dark"; 108 | package = pkgs.papirus-icon-theme.override { color = "grey"; }; 109 | }; 110 | 111 | theme = { 112 | name = "${theme.slug}"; 113 | package = nix-colors-lib.gtkThemeFromScheme {scheme = theme;}; 114 | # name = "Catppuccin-Mocha-Lavender"; 115 | # package = pkgs.catppuccin-gtk; 116 | }; 117 | }; 118 | 119 | programs = { 120 | chromium = { 121 | enable = true; 122 | commandLineArgs = ["--ozone-platform-hint=auto"]; 123 | extensions = [{id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";}]; 124 | }; 125 | firefox = { 126 | enable = true; 127 | package = inputs.firefox.packages.${pkgs.system}.firefox-nightly-bin; 128 | profiles.astro = { 129 | name = "astro"; 130 | id = 0; 131 | settings = { 132 | "browser.aboutConfig.showWarning" = false; 133 | "checkDefaultBrowser" = false; 134 | "browser.startup.page" = 3; 135 | "browser.newtabpage.enabled" = false; 136 | "browser.newtabpage.activity-stream.feeds.telemetry" = false; 137 | "browser.newtabpage.activity-stream.telemetry" = false; 138 | "browser.newtabpage.activity-stream.feeds.snippets" = false; 139 | "browser.newtabpage.activity-stream.feeds.section.topstories" = false; 140 | "browser.newtabpage.activity-stream.section.highlights.includePocket" = 141 | false; 142 | "browser.newtabpage.activity-stream.showSponsored" = false; 143 | "browser.newtabpage.activity-stream.feeds.discoverystreamfeed" = 144 | false; 145 | "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; 146 | "browser.newtabpage.activity-stream.default.sites" = ""; 147 | "extensions.getAddons.showPane" = false; 148 | "extensions.htmlaboutaddons.recommendations.enabled" = false; 149 | "browser.discovery.enabled" = false; 150 | "datareporting.policy.dataSubmissionEnabled" = false; 151 | "datareporting.healthreport.uploadEnabled" = false; 152 | "toolkit.telemetry.unified" = false; 153 | "toolkit.telemetry.enabled" = false; # see [NOTE] 154 | "toolkit.telemetry.server" = "data:,"; 155 | "toolkit.telemetry.archive.enabled" = false; 156 | "toolkit.telemetry.newProfilePing.enabled" = false; # [FF55+] 157 | "toolkit.telemetry.shutdownPingSender.enabled" = false; # [FF55+] 158 | "toolkit.telemetry.updatePing.enabled" = false; # [FF56+] 159 | "toolkit.telemetry.bhrPing.enabled" = 160 | false; # [FF57+] Background Hang Reporter 161 | "toolkit.telemetry.firstShutdownPing.enabled" = false; # [FF57+] 162 | "toolkit.telemetry.coverage.opt-out" = true; 163 | "toolkit.coverage.opt-out" = true; 164 | "toolkit.coverage.endpoint.base" = ""; 165 | "browser.ping-centre.telemetry" = false; 166 | "app.shield.optoutstudies.enabled" = false; 167 | "app.normandy.enabled" = false; 168 | "app.normandy.api_url" = ""; 169 | 170 | "toolkit.legacyUserProfileCustomizations.stylesheets" = true; 171 | }; 172 | isDefault = true; 173 | }; 174 | extensions = with nur.repos.bandithedoge.firefoxAddons; [ 175 | ublock-origin 176 | auto-tab-discard 177 | dont-fuck-with-paste 178 | gitako 179 | github-repo-size 180 | github-code-folding 181 | github-isometric-contributions 182 | imagus 183 | material-icons-for-github 184 | sidebery 185 | reddit-enhancement-suite 186 | sourcegraph 187 | ] ++ [ nur.repos.rycee.firefox-addons.bitwarden ]; 188 | }; 189 | qutebrowser = { 190 | enable = true; 191 | aliases = { 192 | "wq" = "quit --save"; 193 | "w" = "session-save"; 194 | "q" = "quit"; 195 | "tc" = "tab-close"; 196 | }; 197 | settings = { 198 | colors = { 199 | # SOURCE: https://github.com/theova/base16-qutebrowser/ 200 | completion.fg = "${xcolors.base05}"; 201 | completion.odd.bg = "${xcolors.base01}"; 202 | completion.even.bg = "${xcolors.base00}"; 203 | completion.category.fg = "${xcolors.base0A}"; 204 | completion.category.bg = "${xcolors.base00}"; 205 | completion.category.border.top = "${xcolors.base00}"; 206 | completion.category.border.bottom = "${xcolors.base00}"; 207 | completion.item.selected.fg = "${xcolors.base05}"; 208 | completion.item.selected.bg = "${xcolors.base02}"; 209 | completion.item.selected.border.top = "${xcolors.base02}"; 210 | completion.item.selected.border.bottom = "${xcolors.base02}"; 211 | completion.item.selected.match.fg = "${xcolors.base0B}"; 212 | completion.match.fg = "${xcolors.base0B}"; 213 | completion.scrollbar.fg = "${xcolors.base05}"; 214 | completion.scrollbar.bg = "${xcolors.base00}"; 215 | contextmenu.disabled.bg = "${xcolors.base01}"; 216 | contextmenu.disabled.fg = "${xcolors.base04}"; 217 | contextmenu.menu.bg = "${xcolors.base00}"; 218 | contextmenu.menu.fg = "${xcolors.base05}"; 219 | contextmenu.selected.bg = "${xcolors.base02}"; 220 | contextmenu.selected.fg = "${xcolors.base05}"; 221 | downloads.bar.bg = "${xcolors.base00}"; 222 | downloads.start.fg = "${xcolors.base00}"; 223 | downloads.start.bg = "${xcolors.base0D}"; 224 | downloads.stop.fg = "${xcolors.base00}"; 225 | downloads.stop.bg = "${xcolors.base0C}"; 226 | downloads.error.fg = "${xcolors.base08}"; 227 | hints.fg = "${xcolors.base00}"; 228 | hints.bg = "${xcolors.base0A}"; 229 | hints.match.fg = "${xcolors.base05}"; 230 | keyhint.fg = "${xcolors.base05}"; 231 | keyhint.suffix.fg = "${xcolors.base05}"; 232 | keyhint.bg = "${xcolors.base00}"; 233 | messages.error.fg = "${xcolors.base00}"; 234 | messages.error.bg = "${xcolors.base08}"; 235 | messages.error.border = "${xcolors.base08}"; 236 | messages.warning.fg = "${xcolors.base00}"; 237 | messages.warning.bg = "${xcolors.base0E}"; 238 | messages.warning.border = "${xcolors.base0E}"; 239 | messages.info.fg = "${xcolors.base05}"; 240 | messages.info.bg = "${xcolors.base00}"; 241 | messages.info.border = "${xcolors.base00}"; 242 | prompts.fg = "${xcolors.base05}"; 243 | prompts.border = "${xcolors.base00}"; 244 | prompts.bg = "${xcolors.base00}"; 245 | prompts.selected.bg = "${xcolors.base02}"; 246 | prompts.selected.fg = "${xcolors.base05}"; 247 | statusbar.normal.fg = "${xcolors.base05}"; 248 | statusbar.normal.bg = "${xcolors.base00}"; 249 | statusbar.insert.bg = "${xcolors.base00}"; 250 | statusbar.insert.fg = "${xcolors.base0D}"; 251 | statusbar.passthrough.bg = "${xcolors.base00}"; 252 | statusbar.passthrough.fg = "${xcolors.base0C}"; 253 | statusbar.private.fg = "${xcolors.base00}"; 254 | statusbar.private.bg = "${xcolors.base01}"; 255 | statusbar.command.fg = "${xcolors.base05}"; 256 | statusbar.command.bg = "${xcolors.base00}"; 257 | statusbar.command.private.fg = "${xcolors.base05}"; 258 | statusbar.command.private.bg = "${xcolors.base00}"; 259 | statusbar.caret.fg = "${xcolors.base00}"; 260 | statusbar.caret.bg = "${xcolors.base0E}"; 261 | statusbar.caret.selection.fg = "${xcolors.base00}"; 262 | statusbar.caret.selection.bg = "${xcolors.base0D}"; 263 | statusbar.progress.bg = "${xcolors.base0D}"; 264 | statusbar.url.fg = "${xcolors.base05}"; 265 | statusbar.url.error.fg = "${xcolors.base08}"; 266 | statusbar.url.hover.fg = "${xcolors.base05}"; 267 | statusbar.url.success.http.fg = "${xcolors.base0C}"; 268 | statusbar.url.success.https.fg = "${xcolors.base0B}"; 269 | statusbar.url.warn.fg = "${xcolors.base0E}"; 270 | tabs.bar.bg = "${xcolors.base00}"; 271 | tabs.indicator.start = "${xcolors.base0D}"; 272 | tabs.indicator.stop = "${xcolors.base0C}"; 273 | tabs.indicator.error = "${xcolors.base08}"; 274 | tabs.odd.fg = "${xcolors.base05}"; 275 | tabs.odd.bg = "${xcolors.base01}"; 276 | tabs.even.fg = "${xcolors.base05}"; 277 | tabs.even.bg = "${xcolors.base00}"; 278 | tabs.pinned.even.bg = "${xcolors.base0C}"; 279 | tabs.pinned.even.fg = "${xcolors.base07}"; 280 | tabs.pinned.odd.bg = "${xcolors.base0B}"; 281 | tabs.pinned.odd.fg = "${xcolors.base07}"; 282 | tabs.pinned.selected.even.bg = "${xcolors.base02}"; 283 | tabs.pinned.selected.even.fg = "${xcolors.base05}"; 284 | tabs.pinned.selected.odd.bg = "${xcolors.base02}"; 285 | tabs.pinned.selected.odd.fg = "${xcolors.base05}"; 286 | tabs.selected.odd.fg = "${xcolors.base05}"; 287 | tabs.selected.odd.bg = "${xcolors.base02}"; 288 | tabs.selected.even.fg = "${xcolors.base05}"; 289 | tabs.selected.even.bg = "${xcolors.base02}"; 290 | }; 291 | fonts = { 292 | default_family = "JetBrainsMono Nerd Font"; 293 | default_size = "14px"; 294 | web.family.fantasy = "JetBrainsMono Nerd Font"; 295 | }; 296 | tabs.background = true; 297 | content.blocking.adblock.lists = [ 298 | "https://easylist.to/easylist/easylist.txt" 299 | "https://easylist.to/easylist/easyprivacy.txt" 300 | "https://easylist-downloads.adblockplus.org/easylistdutch.txt" 301 | "https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt" 302 | "https://www.i-dont-care-about-cookies.eu/abp/" 303 | "https://secure.fanboy.co.nz/fanboy-cookiemonster.txt" 304 | ]; 305 | 306 | scrolling.smooth = true; 307 | 308 | # DARK MODE 309 | # colors.webpage.preferred_color_schemes = "dark"; 310 | 311 | # CHROMIUM FLAGS 312 | content.canvas_reading = false; 313 | content.prefers_reduced_motion = true; 314 | qt.args = [ 315 | # "enable-gpu-rasterization" 316 | # "ignore-gpu-blocklist" 317 | "enable-accelerated-video-decode" 318 | ]; 319 | }; 320 | keyMappings = { 321 | "" = "back"; 322 | "" = "tab-next"; 323 | "" = "tab-prev"; 324 | "" = "forward"; 325 | "M" = "hint links spawn mpv {hint-url}"; 326 | "Z" = "hint links spawn st -e youtube-dl {hint-url}"; 327 | "xb" = "config-cycle statusbar.show always never"; 328 | "xt" = "config-cycle tabs.show always never"; 329 | "xx" = 330 | "config-cycle statusbar.show always never;; config-cycle tabs.show always never"; 331 | "" = "tab-close"; 332 | "t" = "set-cmd-text -s :open -t"; 333 | ";" = "set-cmd-text -s :"; 334 | }; 335 | }; }; 336 | 337 | programs = { 338 | git = { 339 | enable = true; 340 | delta.enable = true; 341 | ignores = ["*~" "*.swp" "*result*" ".direnv" "node_modules"]; 342 | signing = { 343 | key = "842F9AAB3C7B99DF"; 344 | signByDefault = true; 345 | }; 346 | userEmail = "github@sandy007.anonaddy.com"; 347 | userName = "Astro"; 348 | }; 349 | 350 | gpg = { 351 | enable = true; 352 | homedir = "${config.xdg.dataHome}/gnupg"; 353 | }; 354 | 355 | zathura = { 356 | enable = true; 357 | options = { 358 | recolor = true; 359 | recolor-darkcolor = "#${xcolors.base00}"; 360 | recolor-lightcolor = "rgba(0,0,0,0)"; 361 | default-bg = "rgba(0,0,0,0.7)"; 362 | default-fg = "#${xcolors.base05}"; 363 | }; 364 | }; 365 | 366 | nix-index = { enable = true; }; 367 | }; 368 | 369 | services.gpg-agent = { 370 | enable = true; 371 | extraConfig = '' 372 | pinentry-program ${pkgs.pinentry}/bin/pinentry 373 | ''; 374 | }; 375 | 376 | xdg.configFile = let 377 | gtkconf = '' 378 | decoration, decoration:backdrop, window { 379 | box-shadow: none; 380 | border: none; 381 | margin: 0; 382 | } 383 | ''; 384 | in { 385 | "gtk-3.0/gtk.css".text = gtkconf; 386 | "gtk-4.0/gtk.css".text = gtkconf; 387 | }; 388 | } 389 | -------------------------------------------------------------------------------- /home/editors/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: let 6 | in { 7 | imports = [ 8 | # ./emacs 9 | ./kakoune 10 | ./neovim 11 | ./helix 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /home/editors/emacs/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | programs.doom-emacs = { 3 | enable = true; 4 | doomPrivateDir = ./doom.d; # TODO: Make my own config.el and package.el 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /home/editors/helix/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | programs.helix = { 8 | enable = true; 9 | 10 | languages = import ./languages.nix pkgs; 11 | 12 | settings = { 13 | theme = "catppuccin_mocha"; 14 | editor = { 15 | true-color = true; 16 | cursor-shape = { 17 | insert = "bar"; 18 | normal = "block"; 19 | select = "underline"; 20 | }; 21 | }; 22 | keys.normal.space.u = { 23 | f = ":format"; # format using LSP formatter 24 | a = ["select_all" ":pipe alejandra"]; # format Nix with Alejandra 25 | }; 26 | }; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /home/editors/helix/languages.nix: -------------------------------------------------------------------------------- 1 | pkgs: 2 | with pkgs; [ 3 | { 4 | language-server = {command = "${clang-tools}/bin/clangd";}; 5 | name = "c"; 6 | auto-format = true; 7 | } 8 | { 9 | language-server = {command = "${clang-tools}/bin/clangd";}; 10 | name = "cpp"; 11 | auto-format = true; 12 | } 13 | { 14 | language-server = {command = "${rnix-lsp}/bin/rnix-lsp";}; 15 | name = "nix"; 16 | } 17 | { 18 | language-server = {command = "${haskell-language-server}/bin/haskell-language-server-wrapper";}; 19 | name = "haskell"; 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /home/editors/kakoune/default+.kak: -------------------------------------------------------------------------------- 1 | # Kakoune default color scheme 2 | 3 | # For Code 4 | face global value red 5 | face global type yellow 6 | face global variable green 7 | face global module green 8 | face global function cyan 9 | face global string magenta 10 | face global keyword blue 11 | face global operator yellow 12 | face global attribute green 13 | face global comment cyan+i 14 | face global documentation comment 15 | face global meta magenta 16 | face global builtin default+b 17 | 18 | # For markup 19 | face global title blue 20 | face global header cyan 21 | face global mono green 22 | face global block magenta 23 | face global link cyan 24 | face global bullet cyan 25 | face global list yellow 26 | 27 | # builtin faces 28 | face global Default default,default 29 | face global PrimarySelection white,blue+fg 30 | face global SecondarySelection black,blue+fg 31 | face global PrimaryCursor black,bright-green+fg 32 | face global SecondaryCursor black,bright-yellow+fg 33 | face global PrimaryCursorEol black,red+fg 34 | face global SecondaryCursorEol black,bright-red+fg 35 | face global LineNumbers bright-black 36 | face global LineNumbersWrapped cyan+di 37 | face global LineNumberCursor yellow 38 | face global MenuForeground black,blue 39 | face global MenuBackground blue,black 40 | face global MenuInfo cyan 41 | face global Information black,yellow 42 | face global Error black,red 43 | face global StatusLine cyan,default+b 44 | face global StatusLineMode yellow,default 45 | face global StatusLineInfo blue,default 46 | face global StatusLineValue green,default 47 | face global StatusCursor black,cyan 48 | face global Prompt yellow,default 49 | face global MatchingChar default,default+b 50 | face global Whitespace rgb:5c5c5c,default+f 51 | face global BufferPadding blue,default 52 | 53 | # LSP diagnostics 54 | face global InlayDiagnosticError red+difg 55 | face global InlayDiagnosticWarning yellow+difg 56 | -------------------------------------------------------------------------------- /home/editors/kakoune/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: 2 | # personal kakoune config 3 | { 4 | programs.kakoune = { 5 | enable = true; 6 | config = { 7 | hooks = [ 8 | # languages 9 | { 10 | name = "WinSetOption"; 11 | option = "filetype=(c|cc|cpp)"; 12 | commands = '' 13 | set-option buffer indentwidth 4 14 | set-option buffer tabstop 4 15 | noexpandtab 16 | # get extension 17 | declare-option str ext %sh{echo ""''${kak_bufname##*.}""} 18 | # filename without extension 19 | declare-option str noext "%sh{basename ""$kak_bufname"" .""$kak_opt_ext""}" 20 | # compiling 21 | map buffer normal %{: make %opt{noext}} 22 | # running 23 | map buffer normal %{: terminal sh -c "./%opt{noext}; read"} 24 | 25 | lsp-semantic-tokens 26 | ''; 27 | } 28 | { 29 | name = "WinSetOption"; 30 | option = "filetype=rust"; 31 | commands = '' 32 | set-option buffer softtabstop 4 33 | set-option buffer tabstop 4 34 | set-option buffer indentwidth 4 35 | expandtab 36 | ''; 37 | } 38 | # languages with 2 spaces indentation 39 | { 40 | name = "WinSetOption"; 41 | option = "filetype=(html|javascript|json|nix|sh)"; 42 | commands = '' 43 | expandtab 44 | set-option buffer softtabstop 2 45 | ''; 46 | } 47 | # languages with lsp support 48 | { 49 | name = "WinSetOption"; 50 | option = "filetype=(c|cpp|nix)"; 51 | commands = '' 52 | lsp-enable-window 53 | lsp-inlay-diagnostics-enable window 54 | hook window BufWritePre .* lsp-formatting-sync 55 | ''; 56 | } 57 | ]; 58 | keyMappings = [ 59 | { 60 | key = ""; 61 | mode = "normal"; 62 | effect = "xclip -selection clipboard"; 63 | } 64 | { 65 | key = "l"; 66 | mode = "user"; 67 | effect = ": enter-user-mode lsp"; 68 | docstring = "LSP mode"; 69 | } 70 | ]; 71 | colorScheme = "default+"; 72 | indentWidth = 2; 73 | tabStop = 2; 74 | numberLines = { 75 | enable = true; 76 | highlightCursor = true; 77 | }; 78 | scrollOff = { 79 | columns = 3; 80 | lines = 3; 81 | }; 82 | showMatching = true; 83 | showWhitespace = { 84 | enable = true; 85 | lineFeed = "↵ "; 86 | nonBreakingSpace = " "; 87 | space = " "; 88 | tab = "│"; 89 | }; 90 | wrapLines = { 91 | enable = true; 92 | indent = true; 93 | word = true; 94 | }; 95 | }; 96 | extraConfig = '' 97 | def saveas -params 1 -file-completion %{ rename-buffer -file %arg{1}; write } 98 | eval %sh{ 99 | kak-lsp --kakoune -s $kak_session 100 | } 101 | ''; 102 | plugins = with pkgs.kakounePlugins; [ 103 | # allows kak to talk to lsp servers 104 | kak-lsp 105 | # enables expandtab and other indent options 106 | #smarttab-kak # not in nixpkgs 107 | ]; 108 | }; 109 | 110 | # colorscheme 111 | home.file.".config/kak/colors/default+.kak".source = ./default+.kak; 112 | # LSP config 113 | home.file.".config/kak-lsp/kak-lsp.toml".source = ./kak-lsp.toml; 114 | } 115 | -------------------------------------------------------------------------------- /home/editors/kakoune/kak-lsp.toml: -------------------------------------------------------------------------------- 1 | snippet_support = true 2 | verbosity = 2 3 | 4 | [semantic_tokens] 5 | type = "type" 6 | variable = "variable" 7 | namespace = "module" 8 | function = "function" 9 | string = "string" 10 | keyword = "keyword" 11 | operator = "operator" 12 | comment = "comment" 13 | 14 | [semantic_token_modifiers] 15 | documentation = "documentation" 16 | readonly = "default+d" 17 | 18 | [server] 19 | timeout = 1800 # seconds = 30 minutes 20 | 21 | [language.c_cpp] 22 | filetypes = ["c", "cc", "cpp", "cxx"] 23 | roots = ["compile_commands.json", ".clangd"] 24 | command = "clangd" 25 | 26 | [language.nix] 27 | filetypes = ["nix"] 28 | roots = ["flake.nix", "shell.nix", "default.nix", ".git"] 29 | command = "rnix-lsp" 30 | -------------------------------------------------------------------------------- /home/editors/neovim/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: { 6 | home.packages = [pkgs.neovim-nightly]; 7 | } 8 | -------------------------------------------------------------------------------- /home/files/config/wofi/config: -------------------------------------------------------------------------------- 1 | stylesheet=style.css 2 | show=drun 3 | # matching=fuzzy 4 | no_actions=true 5 | width=450 6 | height=300 7 | always_parse_args=true 8 | show_all=true 9 | print_command=true 10 | layer=overlay 11 | insensitive=true 12 | prompt=Search... 13 | allow_markup=true 14 | allow_images=true 15 | -------------------------------------------------------------------------------- /home/files/config/youtube-dl/config: -------------------------------------------------------------------------------- 1 | # youtube-dl config file 2 | 3 | # use .netrc for logins 4 | -n 5 | 6 | # ignore errors (unavailable videos, etc) 7 | -i 8 | 9 | # don't overwrite 10 | -w 11 | 12 | # make an archive of downloaded videos and only download unlisted items, then list them 13 | # useful for music playlists you update often 14 | --download-archive ~/Music/untagged/ignore.these 15 | 16 | # convert all downloads to 192kbps mp3 17 | -x 18 | --audio-format mp3 #opus 19 | --audio-quality 192K 20 | 21 | # embed thumbnail into audio 22 | #--embed-thumbnail 23 | 24 | # save all music in the following folder and format 25 | -o '~/Music/untagged/%(artist)s - %(title)s.%(ext)s' 26 | -------------------------------------------------------------------------------- /home/files/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | colors, 3 | pkgs, 4 | inputs, 5 | ... 6 | }: 7 | # manage files in ~ 8 | { 9 | home.file = { 10 | ".config" = { 11 | source = ./config; 12 | recursive = true; 13 | }; 14 | # ".face.icon".source = ../../assets/user_icon.png; 15 | }; 16 | xdg.configFile = { 17 | "wayfire.ini".text = import ../wms/wayfire colors; 18 | "wallpaper.png".source = inputs.wall; 19 | "wofi/style.css".text = import ./wofi.nix colors; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /home/files/wofi.nix: -------------------------------------------------------------------------------- 1 | colors: let 2 | inherit (colors) xcolors; 3 | stylesheet = '' 4 | #window { 5 | margin: 0px; 6 | border-radius: 7px; 7 | font-family: "JetBrainsMono Nerd Font"; 8 | font-size: 16px; 9 | background: ${xcolors.base01}; 10 | border: 3px solid ${xcolors.base08}; 11 | } 12 | 13 | #input { 14 | margin: 15px; 15 | border-radius: 10px; 16 | box-shadow: none; 17 | } 18 | 19 | #input:focus { 20 | border-image: none; 21 | } 22 | 23 | #inner-box { 24 | margin: 5px; 25 | border: none; 26 | padding-left: 10px; 27 | padding-right: 10px; 28 | border-radius: 7px; 29 | background-color: inherit; 30 | } 31 | 32 | #outer-box { 33 | margin: 5px; 34 | border: none; 35 | background-color: inherit; 36 | border-radius: 7px; 37 | } 38 | 39 | #scroll { 40 | margin: 0px; 41 | border: none; 42 | } 43 | 44 | #text { 45 | margin: 5px; 46 | border: none; 47 | } 48 | 49 | #entry:selected { 50 | border-radius: 10px; 51 | background-color: ${xcolors.base08}; 52 | } 53 | 54 | #text:selected { 55 | background-color: inherit; 56 | font-weight: normal; 57 | color: ${xcolors.base00}; 58 | } 59 | ''; 60 | in 61 | stylesheet -------------------------------------------------------------------------------- /home/games.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | inputs, 4 | ... 5 | }: 6 | # games 7 | { 8 | home.packages = 9 | (with pkgs; [ 10 | mangohud 11 | gamescope 12 | legendary-gl 13 | ]) 14 | ++ (with inputs.nix-gaming.packages.${pkgs.system}; [ 15 | (inputs.nix-gaming.lib.legendaryBuilder { 16 | games = { 17 | rocket-league = { 18 | desktopName = "Rocket League"; 19 | tricks = ["dxvk" "win10"]; 20 | icon = builtins.fetchurl { 21 | url = "https://img.favpng.com/21/12/21/rocket-league-video-game-psyonix-logo-decal-png-favpng-yYh6A3FRCJNh7JYgYZchHxAia.jpg"; 22 | name = "rocket-league.png"; 23 | sha256 = "0ymisjgcmw8mkarnkm95dsndii2aw9yn5i3vfximi2dchy4ng8ab"; 24 | }; 25 | discordIntegration = false; 26 | }; 27 | }; 28 | inherit (pkgs) system; 29 | }) 30 | .rocket-league 31 | ]); 32 | } 33 | -------------------------------------------------------------------------------- /home/media.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | config, 4 | ... 5 | }: 6 | # media - control and enjoy audio/video 7 | { 8 | home.packages = with pkgs; [ 9 | # audio control 10 | pavucontrol 11 | playerctl 12 | pulsemixer 13 | # images 14 | imv 15 | ]; 16 | 17 | programs = { 18 | mpv = { 19 | enable = true; 20 | defaultProfiles = ["gpu-hq"]; 21 | scripts = [pkgs.mpvScripts.mpris]; 22 | }; 23 | }; 24 | 25 | services = { 26 | easyeffects.enable = true; 27 | playerctld.enable = true; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /home/profiles/astro-nu/default.nix: -------------------------------------------------------------------------------- 1 | {lib, ...}: { 2 | home.keyboard = lib.mkForce null; 3 | 4 | services = let 5 | inherit (lib) mkForce; 6 | in { 7 | dunst.enable = mkForce false; 8 | flameshot.enable = mkForce false; 9 | picom.enable = mkForce false; 10 | polybar.enable = mkForce false; 11 | random-background.enable = mkForce false; 12 | redshift.enable = mkForce false; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /home/profiles/default.nix: -------------------------------------------------------------------------------- 1 | inputs: let 2 | inherit (inputs) self; 3 | inherit (self.lib) mkHome extraSpecialArgs; 4 | 5 | sharedModules = [ 6 | ../. 7 | ../files 8 | ../shell 9 | ../games.nix 10 | ../media.nix 11 | ../editors 12 | 13 | inputs.hyprland.homeManagerModules.default 14 | ]; 15 | 16 | homeImports = { 17 | "astro@nu" = sharedModules ++ [../wms ./astro-nu]; 18 | }; 19 | in { 20 | inherit homeImports extraSpecialArgs; 21 | 22 | homeConfigurations = { 23 | "astro@nu" = mkHome { 24 | username = "astro"; 25 | extraModules = homeImports."astro@nu"; 26 | }; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /home/shell/bash.nix: -------------------------------------------------------------------------------- 1 | {config, ...}: 2 | { 3 | programs.bash.enable = true; 4 | } 5 | -------------------------------------------------------------------------------- /home/shell/default.nix: -------------------------------------------------------------------------------- 1 | {config, ...}: let 2 | h = config.home.homeDirectory; 3 | d = config.xdg.dataHome; 4 | c = config.xdg.configHome; 5 | cache = config.xdg.cacheHome; 6 | in { 7 | imports = [ 8 | ./nix.nix 9 | ./zsh.nix 10 | ./fish.nix 11 | ./starship.nix 12 | ./bash.nix 13 | ]; 14 | 15 | # add locations to $PATH 16 | home.sessionPath = []; 17 | 18 | # add environment variables 19 | home.sessionVariables = { 20 | # clean up ~ 21 | LESSHISTFILE = cache + "/less/history"; 22 | LESSKEY = c + "/less/lesskey"; 23 | WINEPREFIX = d + "/wine"; 24 | XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority"; 25 | 26 | EDITOR = "hx"; 27 | MANPAGER = "sh -c 'col -bx | bat -l man -p'"; 28 | # make java apps work in tiling WMs 29 | _JAVA_AWT_WM_NONREPARENTING = 1; 30 | }; 31 | 32 | xdg = { 33 | enable = true; 34 | cacheHome = __toPath (h + "/.local/cache"); 35 | userDirs = { 36 | enable = true; 37 | createDirectories = true; 38 | }; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /home/shell/fish.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | config, 4 | inputs, 5 | colors, 6 | ... 7 | }: let 8 | inherit (colors) xcolors; 9 | in { 10 | programs.fish = { 11 | enable = true; 12 | shellAliases = { 13 | ls = "exa -laHG --icons --git"; 14 | rebuild = "sudo nixos-rebuild switch --flake ~/.config/nixpkgs"; 15 | top = "btop"; 16 | tmp = "cd (mktemp -d)"; 17 | ".." = "cd .."; 18 | bat = "bat"; 19 | }; 20 | 21 | shellAbbrs = { 22 | e = "$EDITOR"; 23 | ga = "git add"; 24 | gb = "git branch"; 25 | gc = "git commit"; 26 | gca = "git commit --amend"; 27 | gcm = "git commit -m"; 28 | gco = "git checkout"; 29 | gd = "git diff"; 30 | gds = "git diff --staged"; 31 | gp = "git push"; 32 | gpl = "git pull"; 33 | gl = "git log"; 34 | gr = "git rebase"; 35 | gs = "git status --short"; 36 | gss = "git status"; 37 | 38 | us = "systemctl --user"; 39 | 40 | grep = "grep --color"; 41 | ip = "ip --color"; 42 | md = "mkdir -p"; 43 | rm = "rip"; # I am used to rm but rip is :noice: 44 | }; 45 | plugins = [ 46 | { 47 | name = "autopair"; 48 | src = inputs.fish-autopair; 49 | } 50 | # { 51 | # name = "tide"; 52 | # src = inputs.fish-tide; 53 | # } 54 | # { 55 | # name = "pure"; 56 | # src = inputs.fish-pure; 57 | # } 58 | # { 59 | # name = "async"; 60 | # src = inputs.fish-async; 61 | # } 62 | ]; 63 | interactiveShellInit = '' 64 | # colorscript 65 | function fish_greeting 66 | $HOME/.local/bin/pokemon-colorscripts.py -r 67 | end 68 | 69 | # ssh agent 70 | eval (ssh-agent -c) >/dev/null 71 | ssh-add -q ~/.ssh/id_github 72 | 73 | # GPG TTY 74 | export GPG_TTY=(tty) 75 | 76 | set fish_color_normal '${xcolors.base05}' 77 | set fish_color_command '${xcolors.base0D}' --bold 78 | set fish_color_quote '${xcolors.base0B}' 79 | set fish_color_redirection '${xcolors.base0D}' 80 | set fish_color_end '${xcolors.base05}' 81 | set fish_color_error '${xcolors.base08}' 82 | set fish_color_param '${xcolors.base0A}' 83 | set fish_color_comment '${xcolors.base03}' 84 | set fish_color_match '${xcolors.base05}' 85 | set fish_color_selection '${xcolors.base03}' 86 | set fish_color_search_match '${xcolors.base0A}' --bold 87 | set fish_color_operator '${xcolors.base0B}' 88 | set fish_color_escape '${xcolors.base0C}' 89 | set fish_color_cwd '${xcolors.base0D}' --bold 90 | set fish_color_autosuggestion '${xcolors.base03}' 91 | set fish_color_user '${xcolors.base0E}' 92 | set fish_color_host '${xcolors.base0D}' 93 | set fish_color_host_remote '${xcolors.base0A}' 94 | set fish_color_cancel '${xcolors.base08}' 95 | 96 | # Pager colors 97 | set fish_pager_color_background '${xcolors.base01}' 98 | set fish_pager_color_prefix '${xcolors.base0C}' 99 | set fish_pager_color_completion '${xcolors.base0D}' 100 | set fish_pager_color_description '${xcolors.base0E}' 101 | set fish_pager_color_selected_completion '${xcolors.base0A}' --bold 102 | set fish_pager_color_selected_background '${xcolors.base0A}' --bold 103 | set fish_pager_color_selected_description '${xcolors.base0A}' --bold 104 | set fish_pager_color_selected_prefix '${xcolors.base0A}' --bold 105 | set fish_color_valid_path ''; 106 | functions = { 107 | lwhich = { 108 | description = "Show the full path of a command, resolving links along the way"; 109 | body = "readlink -f (which $argv[1])"; 110 | }; 111 | 112 | mkcd = { 113 | description = "Make and enter a directory"; 114 | body = '' 115 | if test (count $argv) -ne 1 116 | echo "mkcd: Expected exactly one argument." 117 | return 127 118 | else 119 | mkdir $argv[1] && cd $argv[1] 120 | end 121 | ''; 122 | }; 123 | }; 124 | }; 125 | } 126 | -------------------------------------------------------------------------------- /home/shell/nix-completions.sh: -------------------------------------------------------------------------------- 1 | function _nix() { 2 | local ifs_bk="$IFS" 3 | local input=("${(Q)words[@]}") 4 | IFS=$'\n' 5 | local res=($(NIX_GET_COMPLETIONS=$((CURRENT - 1)) "$input[@]")) 6 | IFS="$ifs_bk" 7 | local tpe="${${res[1]}%%> *}" 8 | local -a suggestions 9 | declare -a suggestions 10 | for suggestion in ${res:1}; do 11 | # FIXME: This doesn't work properly if the suggestion word contains a `:` 12 | # itself 13 | suggestions+="${suggestion/ /:}" 14 | done 15 | if [[ "$tpe" == filenames ]]; then 16 | compadd -f 17 | fi 18 | _describe 'nix' suggestions 19 | } 20 | 21 | compdef _nix nix 22 | -------------------------------------------------------------------------------- /home/shell/nix.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: 2 | # nix tooling 3 | { 4 | programs.direnv = { 5 | enable = true; 6 | nix-direnv = { 7 | enable = true; 8 | }; 9 | stdlib = '' 10 | # Store .direnv in cache instead of project dir 11 | declare -A direnv_layout_dirs 12 | direnv_layout_dir() { 13 | echo "''${direnv_layout_dirs[$PWD]:=$( 14 | echo -n ~/.cache/direnv/layouts/ 15 | echo -n "$PWD" | sha256sum | cut -d ' ' -f 1 16 | )}" 17 | } 18 | ''; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /home/shell/starship.nix: -------------------------------------------------------------------------------- 1 | {config, ...}: { 2 | programs.starship = { 3 | enable = true; 4 | settings = { 5 | format = "$username$hostname$directory$git_branch$git_state$git_status$cmd_duration$line_break$python$character"; 6 | 7 | directory.style = "blue"; 8 | 9 | character = { 10 | success_symbol = "[❯](purple)"; 11 | error_symbol = "[❯](red)"; 12 | vicmd_symbol = "[❮](green)"; 13 | }; 14 | 15 | git_branch = { 16 | always_show_remote = true; 17 | ignore_branches = ["master" "main"]; 18 | }; 19 | 20 | git_state = { 21 | format = "\([$state( $progress_current of $progress_total)]($style)\) "; 22 | }; 23 | 24 | git_metrics = { 25 | disabled = false; 26 | format = "([ $added]($added_style) )([ $deleted]($deleted_style) )"; 27 | }; 28 | 29 | cmd_duration = { 30 | format = "[$duration]($style) "; 31 | style = "yellow"; 32 | }; 33 | 34 | aws = { 35 | symbol = " "; 36 | }; 37 | 38 | buf = { 39 | symbol = " "; 40 | }; 41 | 42 | c = { 43 | symbol = " "; 44 | }; 45 | 46 | conda = { 47 | symbol = " "; 48 | }; 49 | 50 | dart = { 51 | symbol = " "; 52 | }; 53 | 54 | directory = { 55 | read_only = " "; 56 | }; 57 | 58 | docker_context = { 59 | symbol = " "; 60 | }; 61 | 62 | elixir = { 63 | symbol = " "; 64 | }; 65 | 66 | elm = { 67 | symbol = " "; 68 | }; 69 | 70 | git_branch = { 71 | symbol = " "; 72 | }; 73 | 74 | golang = { 75 | symbol = " "; 76 | }; 77 | 78 | haskell = { 79 | symbol = " "; 80 | }; 81 | 82 | hg_branch = { 83 | symbol = " "; 84 | }; 85 | 86 | java = { 87 | symbol = " "; 88 | }; 89 | 90 | julia = { 91 | symbol = " "; 92 | }; 93 | 94 | lua = { 95 | symbol = " "; 96 | }; 97 | 98 | memory_usage = { 99 | symbol = " "; 100 | }; 101 | 102 | nim = { 103 | symbol = " "; 104 | }; 105 | 106 | nix_shell = { 107 | symbol = " "; 108 | }; 109 | 110 | nodejs = { 111 | symbol = " "; 112 | }; 113 | 114 | package = { 115 | symbol = " "; 116 | }; 117 | 118 | python = { 119 | symbol = " "; 120 | format = "[$virtualenv]($style) "; 121 | style = "bright-black"; 122 | }; 123 | 124 | rlang = { 125 | symbol = "ﳒ "; 126 | }; 127 | 128 | ruby = { 129 | symbol = " "; 130 | }; 131 | 132 | rust = { 133 | symbol = " "; 134 | }; 135 | 136 | scala = { 137 | symbol = " "; 138 | }; 139 | 140 | spack = { 141 | symbol = "🅢 "; 142 | }; 143 | }; 144 | }; 145 | } 146 | -------------------------------------------------------------------------------- /home/shell/zsh.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: { 6 | home.packages = [pkgs.pure-prompt]; 7 | 8 | programs.zsh = { 9 | enable = true; 10 | enableAutosuggestions = true; 11 | autocd = true; 12 | dotDir = ".config/zsh"; 13 | history = { 14 | expireDuplicatesFirst = true; 15 | path = "${config.xdg.dataHome}/zsh_history"; 16 | }; 17 | initExtra = '' 18 | # autoloads 19 | autoload -U history-search-end 20 | 21 | # search history based on what's typed in the prompt 22 | 23 | # group functions 24 | zle -N history-beginning-search-backward-end history-search-end 25 | zle -N history-beginning-search-forward-end history-search-end 26 | 27 | # bind functions to up and down arrow keys 28 | bindkey "^[OA" history-beginning-search-backward-end 29 | bindkey "^[OB" history-beginning-search-forward-end 30 | 31 | # case insensitive tab completion 32 | zstyle ':completion:*' completer _complete _ignored _approximate 33 | zstyle ':completion:*' list-colors '\' 34 | zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s 35 | zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 36 | zstyle ':completion:*' menu select 37 | zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s 38 | zstyle ':completion:*' verbose true 39 | _comp_options+=(globdots) 40 | 41 | # pure prompt 42 | autoload -U promptinit; promptinit 43 | 44 | zstyle :prompt:pure:git:stash show yes 45 | 46 | prompt pure 47 | 48 | gnupg_path=$(ls /run/user/1000/gnupg) 49 | export SSH_AUTH_SOCK="/run/user/1000/gnupg/$gnupg_path/S.gpg-agent.ssh" 50 | 51 | ${builtins.readFile ./nix-completions.sh} 52 | ''; 53 | shellAliases = { 54 | grep = "grep --color"; 55 | ip = "ip --color"; 56 | l = "exa -l"; 57 | la = "exa -la"; 58 | md = "mkdir -p"; 59 | 60 | ga = "git add"; 61 | gb = "git branch"; 62 | gc = "git commit"; 63 | gca = "git commit --amend"; 64 | gcm = "git commit -m"; 65 | gco = "git checkout"; 66 | gd = "git diff"; 67 | gds = "git diff --staged"; 68 | gp = "git push"; 69 | gpl = "git pull"; 70 | gl = "git log"; 71 | gr = "git rebase"; 72 | gs = "git status --short"; 73 | gss = "git status"; 74 | 75 | us = "systemctl --user"; 76 | rs = "sudo systemctl"; 77 | }; 78 | shellGlobalAliases = {exa = "exa --icons --git";}; 79 | }; 80 | } 81 | -------------------------------------------------------------------------------- /home/terminals.nix: -------------------------------------------------------------------------------- 1 | { 2 | colors, 3 | pkgs, 4 | config, 5 | ... 6 | }: 7 | # terminals 8 | let 9 | inherit (colors) xcolors x0Colors baseColors; 10 | font = "JetBrainsMono Nerd Font"; 11 | in { 12 | programs.alacritty = { 13 | enable = true; 14 | settings = { 15 | window = { 16 | decorations = "none"; 17 | dynamic_padding = true; 18 | padding = { 19 | x = 15; 20 | y = 15; 21 | }; 22 | startup_mode = "Maximized"; 23 | }; 24 | 25 | scrolling.history = 1000; 26 | 27 | font = { 28 | normal.family = font; 29 | bold.family = font; 30 | italic.family = font; 31 | size = 12; 32 | }; 33 | 34 | cursor = { 35 | style = { 36 | shape = "Beam"; 37 | blinking = "on"; 38 | }; 39 | }; 40 | 41 | window = {opacity = 1.0;}; 42 | 43 | draw_bold_text_with_bright_colors = true; 44 | colors = rec { 45 | primary = { 46 | background = x0Colors.base00; 47 | foreground = x0Colors.base05; 48 | }; 49 | normal = { 50 | black = x0Colors.base02; 51 | red = x0Colors.base08; 52 | green = x0Colors.base0B; 53 | yellow = x0Colors.base0A; 54 | blue = x0Colors.base0D; 55 | magenta = x0Colors.base0E; 56 | cyan = x0Colors.base0C; 57 | white = x0Colors.base05; 58 | }; 59 | bright = 60 | normal 61 | // { 62 | black = x0Colors.base03; 63 | white = x0Colors.base06; 64 | }; 65 | }; 66 | }; 67 | }; 68 | 69 | programs.kitty = { 70 | enable = true; 71 | font.name = font; 72 | font.size = 12; 73 | settings = { 74 | confirm_os_window_close = 0; 75 | enable_audio_bell = "no"; 76 | visual_bell_duration = "0.1"; 77 | visual_bell_color = xcolors.base05; 78 | 79 | copy_on_select = "clipboard"; 80 | placement_strategy = "center"; 81 | 82 | scrollback_lines = 10000; 83 | window_padding_width = 5; 84 | # tab bar 85 | tab_bar_edge = "bottom"; 86 | tab_bar_style = "powerline"; 87 | tab_powerline_style = "slanted"; 88 | tab_title_template = "{sup.index} {title}"; 89 | 90 | # tab colors 91 | active_tab_foreground = xcolors.base08; 92 | active_tab_background = xcolors.base02; 93 | inactive_tab_background = xcolors.base00; 94 | inactive_tab_foreground = xcolors.base04; 95 | tab_bar_background = xcolors.base00; 96 | 97 | #url 98 | url_color = xcolors.base0D; 99 | 100 | # colors 101 | foreground = xcolors.base05; 102 | background = xcolors.base00; 103 | # black 104 | color0 = xcolors.base02; 105 | color8 = xcolors.base03; 106 | # red 107 | color1 = xcolors.base08; 108 | color9 = xcolors.base08; 109 | # green 110 | color2 = xcolors.base0B; 111 | color10 = xcolors.base0B; 112 | # yellow 113 | color3 = xcolors.base0A; 114 | color11 = xcolors.base0A; 115 | # blue 116 | color4 = xcolors.base0D; 117 | color12 = xcolors.base0D; 118 | # magenta 119 | color5 = xcolors.base0E; 120 | color13 = xcolors.base0E; 121 | # cyan 122 | color6 = xcolors.base0C; 123 | color14 = xcolors.base0C; 124 | # white 125 | color7 = xcolors.base05; 126 | color15 = xcolors.base06; 127 | }; 128 | }; 129 | 130 | programs.foot = { 131 | enable = true; 132 | server.enable = false; 133 | settings = { 134 | main = { 135 | term = "xterm-256color"; 136 | pad = "15x15"; 137 | font = "${font}:size=13"; 138 | dpi-aware = "yes"; 139 | }; 140 | mouse = { 141 | hide-when-typing = "yes"; 142 | }; 143 | colors = { 144 | scrollback-indicator = "${baseColors.base00} ${baseColors.base00}"; 145 | background = baseColors.base00; 146 | foreground = baseColors.base05; 147 | regular0 = baseColors.base01; 148 | regular1 = baseColors.base08; 149 | regular2 = baseColors.base0B; 150 | regular3 = baseColors.base0A; 151 | regular4 = baseColors.base0D; 152 | regular5 = baseColors.base0E; 153 | regular6 = baseColors.base0C; 154 | regular7 = baseColors.base05; 155 | bright0 = baseColors.base03; 156 | bright1 = baseColors.base08; 157 | bright2 = baseColors.base0B; 158 | bright3 = baseColors.base0A; 159 | bright4 = baseColors.base0D; 160 | bright5 = baseColors.base0E; 161 | bright6 = baseColors.base0C; 162 | bright7 = baseColors.base06; 163 | alpha = 1.0; 164 | }; 165 | cursor = { 166 | style = "beam"; 167 | }; 168 | }; 169 | }; 170 | } 171 | -------------------------------------------------------------------------------- /home/wms/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | colors, 6 | ... 7 | }: 8 | # Wayland config 9 | let 10 | inherit (colors) xcolors; 11 | 12 | _ = lib.getExe; 13 | 14 | ocrScript = pkgs.writeShellScriptBin "wl-ocr" '' 15 | ${_ pkgs.grim} -g "$(${_ pkgs.slurp})" -t ppm - | ${_ pkgs.tesseract5} - - | ${pkgs.wl-clipboard}/bin/wl-copy 16 | ''; 17 | in { 18 | imports = [ 19 | # TODO: eww 20 | # ../eww 21 | ./hyprland 22 | ./sway 23 | ./river 24 | ]; 25 | 26 | home.packages = with pkgs; [ 27 | # screenrec 28 | peek 29 | 30 | # wm 31 | wayfire 32 | 33 | # utils 34 | wl-clipboard 35 | wlr-randr 36 | wlogout 37 | 38 | # scripts 39 | ocrScript 40 | 41 | # launchers 42 | wofi 43 | jq # for makoctl and hyprctl 44 | 45 | # utils 46 | swaybg 47 | swaylock-effects 48 | ]; 49 | 50 | home.sessionVariables = { 51 | MOZ_ENABLE_WAYLAND = 1; 52 | SDL_VIDEODRIVER = "wayland"; 53 | QT_QPA_PLATFORM = "wayland"; 54 | QT_WAYLAND_DISABLE_WINDOWDECORATION = 1; 55 | }; 56 | 57 | programs = { 58 | mako = { 59 | enable = true; 60 | sort = "-priority"; 61 | layer = "overlay"; 62 | width = 300; 63 | height = 250; 64 | borderRadius = 7; 65 | borderSize = 3; 66 | borderColor = xcolors.base08; 67 | defaultTimeout = 5000; 68 | font = "JetBrainsMono Nerd Font 12"; 69 | margin = "20,20,0"; 70 | padding = "15,15,15"; 71 | groupBy = "summary"; 72 | backgroundColor = xcolors.base01; 73 | textColor = xcolors.base05; 74 | format = "%s\\n%b"; 75 | 76 | extraConfig = '' 77 | icon-location=right 78 | icon-path=${config.gtk.iconTheme.package}/share/icons/${config.gtk.iconTheme.name} 79 | on-button-middle=exec ${pkgs.mako}/bin/makoctl menu -n "$id" ${pkgs.wofi}/bin/wofi --dmenu 80 | 81 | [grouped] 82 | format=%s\n%b 83 | 84 | [mode=do-not-disturb] 85 | invisible=1 86 | 87 | [urgency="low"] 88 | border-color=${xcolors.base02} 89 | 90 | [urgency="critical"] 91 | text-color=${xcolors.base08} 92 | default-timeout=10000 93 | ''; 94 | }; 95 | }; 96 | 97 | services.wlsunset = { 98 | enable = true; 99 | latitude = "26.84"; 100 | longitude = "80.94"; 101 | }; 102 | programs.swaylock.settings = let 103 | inherit (colors) xcolors; 104 | in { 105 | clock = true; 106 | font = "JetBrainsMono Nerd Font"; 107 | ignore-empty-password = true; 108 | image = "${config.xdg.configHome}/wallpaper.png"; 109 | effect-blur = "30x3"; 110 | indicator = true; 111 | bs-hl-color = xcolors.base08; 112 | key-hl-color = xcolors.base0B; 113 | inside-clear-color = xcolors.base09; 114 | inside-color = xcolors.base00; 115 | inside-ver-color = xcolors.base0B; 116 | inside-wrong-color = xcolors.base08; 117 | line-color = xcolors.base02; 118 | line-ver-color = xcolors.base02; 119 | line-wrong-color = xcolors.base02; 120 | line-clear-color = xcolors.base02; 121 | ring-color = xcolors.base02; 122 | ring-ver-color = xcolors.base02; 123 | ring-wrong-color = xcolors.base02; 124 | ring-clear-color = xcolors.base02; 125 | separator-color = xcolors.base02; 126 | text-color = xcolors.base05; 127 | text-ver-color = xcolors.base00; 128 | text-wrong-color = xcolors.base00; 129 | text-clear-color = xcolors.base00; 130 | }; 131 | 132 | systemd.user.targets.tray = { 133 | Unit = { 134 | Description = "Home Manager System Tray"; 135 | Requires = ["graphical-session-pre.target"]; 136 | }; 137 | }; 138 | } 139 | -------------------------------------------------------------------------------- /home/wms/hyprland/config.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | colors, 4 | ... 5 | }: let 6 | xargb = colors.xargbColors; 7 | 8 | emoji = "${pkgs.wofi-emoji}/bin/wofi-emoji"; 9 | launcher = "wofi"; 10 | term = "${pkgs.foot}/bin/foot"; 11 | term_alt = "${pkgs.alacritty}/bin/alacritty"; 12 | 13 | config = '' 14 | # should be configured per-profile 15 | monitor=,1366x768@60,0x0,1 16 | workspace=VGA-1,1 17 | exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY DISPLAY HYPRLAND_INSTANCE_SIGNATURE 18 | exec-once=systemctl --user start hyprland-session.target 19 | exec-once=env XDG_CUREENT_DESKTOP="Sway" ${pkgs.flameshot}/bin/flameshot 20 | exec-once=swaybg -i ~/.config/wallpaper.png 21 | exec-once=mako 22 | misc { 23 | no_vfr=0 24 | disable_hyprland_logo=1 25 | disable_splash_rendering=1 26 | enable_swallow=1 27 | swallow_regex="foot|kitty|alacritty" 28 | } 29 | input { 30 | kb_layout=ro 31 | sensitivity=0 32 | follow_mouse=1 33 | force_no_accel=1 34 | touchpad { 35 | natural_scroll=1 36 | } 37 | } 38 | general { 39 | sensitivity=1.0 40 | main_mod=SUPER 41 | gaps_in=8 42 | gaps_out=15 43 | border_size=5 44 | col.active_border=0x${xargb.base08} 45 | col.inactive_border=0x${xargb.base02} 46 | damage_tracking=full 47 | } 48 | decoration { 49 | rounding=7 50 | blur=0 51 | blur_new_optimizations=true 52 | blur_size=1 53 | blur_passes=1 54 | blur_new_optimizations=1 55 | drop_shadow=true 56 | shadow_ignore_window=1 57 | shadow_offset=2 2 58 | shadow_range=10 59 | shadow_render_power=1 60 | col.shadow=0x33000000 61 | col.shadow_inactive=0x22000000 62 | } 63 | animations { 64 | enabled=1 65 | bezier=overshot,0.13,0.99,0.29,1.1 66 | animation=windows,1,4,overshot,slide 67 | animation=border,1,10,default 68 | animation=fade,1,10,default 69 | animation=workspaces,1,6,overshot,slidevert 70 | } 71 | dwindle { 72 | pseudotile=1 73 | force_split=0 74 | } 75 | 76 | # Window rules 77 | windowrule=fullscreen,^(flameshot)$ 78 | windowrule=float,title:^(Media viewer)$ 79 | windowrule=float,title:^(Picture-in-Picture)$ 80 | windowrule=pin,title:^(Picture-in-Picture)$ 81 | windowrule=float,title:^(Firefox — Sharing Indicator)$ 82 | windowrule=move 0 0,title:^(Firefox — Sharing Indicator)$ 83 | windowrule=tile,title:Spotify 84 | windowrule=workspace 4,title:Spotify 85 | windowrule=workspace 3,title:Discord 86 | windowrule=workspace 5,title:Telegram 87 | windowrule=workspace 2,^(firefox-nightly)$ 88 | 89 | bind=SUPER,Return,exec,${term} 90 | bind=SUPERSHIFT,Return,exec,${term_alt} 91 | bind=SUPER,Space,exec,pkill .${launcher}-wrapped || ${launcher} 92 | bind=SUPER,Escape,exec,wlogout -p layer-shell 93 | bind=SUPER,E,exec,pkill wofi || ${emoji} 94 | bind=SUPER,Q,killactive, 95 | bind=SUPERSHIFT,E,exec,pkill Hyprland 96 | 97 | 98 | bind=SUPER,G,togglegroup, 99 | bind=SUPERSHIFT,N,changegroupactive,f 100 | bind=SUPERSHIFT,P,changegroupactive,b 101 | 102 | # window resize 103 | bind=SUPER,S,submap,resize 104 | submap=resize 105 | binde=,right,resizeactive,10 0 106 | binde=,left,resizeactive,-10 0 107 | binde=,up,resizeactive,0 -10 108 | binde=,down,resizeactive,0 10 109 | bind=,escape,submap,reset 110 | submap=reset 111 | 112 | bindm=SUPER,mouse:272,movewindow #LMB 113 | bindm=SUPER,mouse:273,resizewindow #RMB 114 | 115 | # layout 116 | bind=SUPER,F,fullscreen, 117 | bind=SUPER,R,togglesplit, 118 | bind=SUPER,T,togglefloating, 119 | bind=SUPER,P,pseudo, 120 | 121 | # utils 122 | bind=SUPER,L,exec,swaylock 123 | bind=SUPER,O,exec,wl-ocr 124 | 125 | # Media keys 126 | bind=,XF86AudioPlay,exec,playerctl play-pause 127 | bind=,XF86AudioPrev,exec,playerctl previous 128 | bind=,XF86AudioNext,exec,playerctl next 129 | bind=,XF86AudioRaiseVolume,exec,pulsemixer --change-volume +6 130 | bind=,XF86AudioLowerVolume,exec,pulsemixer --change-volume -6 131 | bind=,XF86AudioMute,exec,wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle 132 | bind=,XF86AudioMicMute,exec,wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle 133 | bind=,XF86MonBrightnessUp,exec,light -A 5 134 | bind=,XF86MonBrightnessDown,exec,light -U 5 135 | 136 | # screenshot 137 | bind=,Print,exec,env XDG_CURRENT_DESKTOP="Sway" ${pkgs.flameshot}/bin/flameshot gui -p ~/Pictures/Screenshots 138 | bind=SHIFT,Print,exec,env XDG_CURRENT_DESKTOP="Sway" ${pkgs.flameshot}/bin/flameshot gui 139 | 140 | # monitor 141 | bind=CTRL,Print,exec,env XDG_CURRENT_DESKTOP="Sway" ${pkgs.flameshot}/bin/flameshot full -p ~/Pictures/Screenshots 142 | 143 | # color picker 144 | bind=SUPERSHIFT,C,exec,hyperpicker | wl-copy 145 | 146 | # move focus 147 | bind=SUPER,left,movefocus,l 148 | bind=SUPER,right,movefocus,r 149 | bind=SUPER,up,movefocus,u 150 | bind=SUPER,down,movefocus,d 151 | 152 | # workspace management 153 | bind=SUPER,1,workspace,1 154 | bind=SUPER,2,workspace,2 155 | bind=SUPER,3,workspace,3 156 | bind=SUPER,4,workspace,4 157 | bind=SUPER,5,workspace,5 158 | 159 | bind=SUPERSHIFT,1,movetoworkspace,1 160 | bind=SUPERSHIFT,2,movetoworkspace,2 161 | bind=SUPERSHIFT,3,movetoworkspace,3 162 | bind=SUPERSHIFT,4,movetoworkspace,4 163 | bind=SUPERSHIFT,5,movetoworkspace,5 164 | 165 | # scratchpad 166 | bind=SUPERSHIFT,grave,movetoworkspace,special 167 | bind=SUPER,grave,togglespecialworkspace,VGA-1 168 | 169 | # cycle workspaces 170 | bind=SUPERSHIFT,bracketleft,workspace,m-1 171 | bind=SUPERSHIFT,bracketright,workspace,m+1 172 | ''; 173 | in 174 | config -------------------------------------------------------------------------------- /home/wms/hyprland/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | inputs, 4 | lib, 5 | pkgs, 6 | ... 7 | }@args:{ 8 | home.packages = (with pkgs; [ 9 | wf-recorder 10 | xorg.xprop 11 | ]) ++ [ inputs.hyprpicker.packages.${pkgs.system}.hyprpicker 12 | #inputs.hyprland.packages.${pkgs.system}.waybar-hyprland 13 | ]; 14 | 15 | home.sessionVariables.XCURSOR_SIZE = builtins.toString config.home.pointerCursor.size; 16 | 17 | wayland.windowManager.hyprland = { 18 | enable = true; 19 | extraConfig = import ./config.nix args; 20 | }; 21 | 22 | services.swayidle = { 23 | enable = true; 24 | events = [ 25 | { 26 | event = "before-sleep"; 27 | command = "${pkgs.swaylock-effects}/bin/swaylock -fF"; 28 | } 29 | { 30 | event = "lock"; 31 | command = "${pkgs.swaylock-effects}/bin/swaylock -fF"; 32 | } 33 | ]; 34 | timeouts = [ 35 | { 36 | timeout = 300; 37 | command = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off"; 38 | resumeCommand = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on"; 39 | } 40 | { 41 | timeout = 310; 42 | command = "${pkgs.systemd}/bin/loginctl lock-session"; 43 | } 44 | ]; 45 | }; 46 | systemd.user.services.swayidle.Install.WantedBy = lib.mkForce ["hyprland-session.target"]; 47 | } -------------------------------------------------------------------------------- /home/wms/river/config.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | colors, 5 | ... 6 | }: let 7 | x0Colors = colors.x0Colors; 8 | config = '' 9 | #!/bin/sh 10 | 11 | # Super+Return to start an instance of foot (https://codeberg.org/dnkl/foot) 12 | riverctl map normal Super Return spawn foot 13 | 14 | riverctl map normal Menu spawn 'wofi' 15 | 16 | # Super+Q to close the focused view 17 | riverctl map normal Super Q close 18 | 19 | # Super+Shift+E to exit river 20 | riverctl map normal Super+Shift Q exit 21 | 22 | # Super+J and Super+K to focus the next/previous view in the layout stack 23 | riverctl map normal Super J focus-view next 24 | riverctl map normal Super K focus-view previous 25 | 26 | # Super+Shift+J and Super+Shift+K to swap the focused view with the next/previous 27 | # view in the layout stack 28 | riverctl map normal Super+Shift J swap next 29 | riverctl map normal Super+Shift K swap previous 30 | 31 | # Super+Period and Super+Comma to focus the next/previous output 32 | riverctl map normal Super Period focus-output next 33 | riverctl map normal Super Comma focus-output previous 34 | 35 | # Super+Shift+{Period,Comma} to send the focused view to the next/previous output 36 | riverctl map normal Super+Shift Period send-to-output next 37 | riverctl map normal Super+Shift Comma send-to-output previous 38 | 39 | # Super+Shift+Return to bump the focused view to the top of the layout stack 40 | riverctl map normal Super+Shift Return zoom 41 | 42 | # Super+H and Super+L to decrease/increase the main ratio of rivertile(1) 43 | riverctl map normal Super H send-layout-cmd rivertile "main-ratio -0.05" 44 | riverctl map normal Super L send-layout-cmd rivertile "main-ratio +0.05" 45 | 46 | # Super+Shift+H and Super+Shift+L to increment/decrement the main count of rivertile(1) 47 | riverctl map normal Super+Shift H send-layout-cmd rivertile "main-count +1" 48 | riverctl map normal Super+Shift L send-layout-cmd rivertile "main-count -1" 49 | 50 | # Super+Alt+{H,J,K,L} to move views 51 | riverctl map normal Super+Alt H move left 100 52 | riverctl map normal Super+Alt J move down 100 53 | riverctl map normal Super+Alt K move up 100 54 | riverctl map normal Super+Alt L move right 100 55 | 56 | # Super+Alt+Control+{H,J,K,L} to snap views to screen edges 57 | riverctl map normal Super+Alt+Control H snap left 58 | riverctl map normal Super+Alt+Control J snap down 59 | riverctl map normal Super+Alt+Control K snap up 60 | riverctl map normal Super+Alt+Control L snap right 61 | 62 | # Super+Alt+Shift+{H,J,K,L} to resize views 63 | riverctl map normal Super+Alt+Shift H resize horizontal -100 64 | riverctl map normal Super+Alt+Shift J resize vertical 100 65 | riverctl map normal Super+Alt+Shift K resize vertical -100 66 | riverctl map normal Super+Alt+Shift L resize horizontal 100 67 | 68 | # Super + Left Mouse Button to move views 69 | riverctl map-pointer normal Super BTN_LEFT move-view 70 | 71 | # Super + Right Mouse Button to resize views 72 | riverctl map-pointer normal Super BTN_RIGHT resize-view 73 | 74 | for i in $(seq 1 5) 75 | do 76 | tags=$((1 << ($i - 1))) 77 | 78 | # Super+[1-5] to focus tag [0-4] 79 | riverctl map normal Super $i set-focused-tags $tags 80 | 81 | # Super+Shift+[1-5] to tag focused view with tag [0-4] 82 | riverctl map normal Super+Shift $i set-view-tags $tags 83 | 84 | # Super+Ctrl+[1-5] to toggle focus of tag [0-4] 85 | riverctl map normal Super+Control $i toggle-focused-tags $tags 86 | 87 | # Super+Shift+Ctrl+[1-5] to toggle tag [0-4] of focused view 88 | riverctl map normal Super+Shift+Control $i toggle-view-tags $tags 89 | done 90 | 91 | # Super+0 to focus all tags 92 | # Super+Shift+0 to tag focused view with all tags 93 | all_tags=$(((1 << 32) - 1)) 94 | riverctl map normal Super 0 set-focused-tags $all_tags 95 | riverctl map normal Super+Shift 0 set-view-tags $all_tags 96 | 97 | # Super+Space to toggle float 98 | riverctl map normal Super Space toggle-float 99 | 100 | # Super+F to toggle fullscreen 101 | riverctl map normal Super F toggle-fullscreen 102 | 103 | # Super+{Up,Right,Down,Left} to change layout orientation 104 | riverctl map normal Super Up send-layout-cmd rivertile "main-location top" 105 | riverctl map normal Super Right send-layout-cmd rivertile "main-location right" 106 | riverctl map normal Super Down send-layout-cmd rivertile "main-location bottom" 107 | riverctl map normal Super Left send-layout-cmd rivertile "main-location left" 108 | 109 | # Declare a passthrough mode. This mode has only a single mapping to return to 110 | # normal mode. This makes it useful for testing a nested wayland compositor 111 | riverctl declare-mode passthrough 112 | 113 | # Super+F11 to enter passthrough mode 114 | riverctl map normal Super F11 enter-mode passthrough 115 | 116 | # Super+F11 to return to normal mode 117 | riverctl map passthrough Super F11 enter-mode normal 118 | 119 | # Various media key mapping examples for both normal and locked mode which do 120 | # not have a modifier 121 | for mode in normal locked 122 | do 123 | # Eject the optical drive (well if you still have one that is) 124 | riverctl map $mode None XF86Eject spawn 'eject -T' 125 | 126 | # Control pulse audio volume with pamixer (https://github.com/cdemoulins/pamixer) 127 | riverctl map $mode None XF86AudioRaiseVolume spawn 'pulsemixer --change-volume +5' 128 | riverctl map $mode None XF86AudioLowerVolume spawn 'pulsemixer --change-volume -5' 129 | riverctl map $mode None XF86AudioMute spawn 'pamixer --mute' 130 | 131 | # Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl) 132 | riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause' 133 | riverctl map $mode None XF86AudioPlay spawn 'playerctl play-pause' 134 | riverctl map $mode None XF86AudioPrev spawn 'playerctl previous' 135 | riverctl map $mode None XF86AudioNext spawn 'playerctl next' 136 | 137 | # Control screen backlight brightness with light (https://github.com/haikarainen/light) 138 | riverctl map $mode None XF86MonBrightnessUp spawn 'light -A 5' 139 | riverctl map $mode None XF86MonBrightnessDown spawn 'light -U 5' 140 | done 141 | 142 | # Set background and border color 143 | riverctl background-color ${x0Colors.base00} 144 | riverctl border-color-focused ${x0Colors.base0D} 145 | riverctl border-color-unfocused ${x0Colors.base02} 146 | 147 | # Set keyboard repeat rate 148 | riverctl set-repeat 50 300 149 | 150 | # Make certain views start floating 151 | riverctl float-filter-add app-id float 152 | riverctl float-filter-add title "popup title with spaces" 153 | 154 | # Set app-ids and titles of views which should use client side decorations 155 | riverctl csd-filter-add app-id "gedit" 156 | 157 | # Set the default layout generator to be rivertile and start it. 158 | # River will send the process group of the init executable SIGTERM on exit. 159 | riverctl default-layout rivertile 160 | rivertile -view-padding 14 -outer-padding 12 161 | 162 | riverctl spawn '\${pkgs.swaybg}/bin/swaybg -i ~/.config/wallpaper.png' 163 | riverctl spawn 'mako' 164 | riverctl spawm 'systemctl --user import-environment; systemctl --user start graphical-session.target' 165 | ''; 166 | in 167 | config 168 | -------------------------------------------------------------------------------- /home/wms/river/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | config, 4 | ... 5 | } @ args: { 6 | xdg.configFile."river/init" = { 7 | text = import ./config.nix args; 8 | executable = true; 9 | }; 10 | home.packages = with pkgs; [river]; 11 | } 12 | -------------------------------------------------------------------------------- /home/wms/sway/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: { 7 | services.swayidle = { 8 | enable = true; 9 | events = [ 10 | { 11 | event = "before-sleep"; 12 | command = "swaylock -fF"; 13 | } 14 | { 15 | event = "lock"; 16 | command = "swaylock -fF"; 17 | } 18 | ]; 19 | timeouts = [ 20 | { 21 | timeout = 300; 22 | command = "swaymsg output * dpms off"; 23 | resumeCommand = "swaymsg output * dpms on"; 24 | } 25 | { 26 | timeout = 300; 27 | command = "swaylock -fF"; 28 | } 29 | ]; 30 | }; 31 | 32 | wayland.windowManager.sway = { 33 | enable = true; 34 | # package = pkgs.sway-borders; 35 | extraConfig = '' 36 | # Remove text on decorations 37 | for_window [title="."] title_format " " 38 | default_border normal 0 39 | default_floating_border normal 0 40 | for_window [title="."] title_format " " 41 | default_border normal 0 42 | default_floating_border normal 0 43 | ''; 44 | config = { 45 | assigns = { 46 | "1: web" = [{class = "^Firefox$";}]; 47 | "2: chat" = [{class = "^Discord$";}]; 48 | "0: media" = [ 49 | {class = "^Spotify$";} 50 | {class = "^mpv$";} 51 | ]; 52 | }; 53 | 54 | gaps = { 55 | inner = 12; 56 | outer = 12; 57 | }; 58 | 59 | keybindings = let 60 | sway = config.wayland.windowManager.sway.config; 61 | m = sway.modifier; 62 | 63 | # toggle output scaling 64 | output = "VGA-1"; 65 | # toggle-scaling = pkgs.writeShellScript "sway-scale-toggle" '' 66 | # S=$(${pkgs.sway}/bin/swaymsg -t get_outputs | ${pkgs.jq}/bin/jq '.[] | select(any(. == "${output}")).scale') 67 | # [ $S = 2 ] && S=1 || S=2 68 | # swaymsg output "${output}" scale $S 69 | # ''; 70 | in 71 | lib.mkOptionDefault { 72 | "${m}+Return" = "exec ${sway.terminal}"; 73 | "${m}+q" = "kill"; 74 | "${m}+space" = "exec ${sway.menu}"; 75 | # Fn + F7 76 | # "${m}+semicolon" = "exec ${toggle-scaling}"; 77 | # screenshots 78 | "Ctrl+Print" = "exec grim -c - ~/Pictures/ss/$(date '+%F_%T').png"; 79 | "Print" = "exec slurp | grim -g - ~/Pictures/ss/$(date '+%F_%T').png"; 80 | "${m}+Ctrl+Shift+r" = ''exec grim -c - | wl-copy''; 81 | "${m}+Shift+r" = ''exec slurp | grim -g - | wl-copy''; 82 | }; 83 | 84 | keycodebindings = { 85 | "--locked --no-repeat 121" = "exec pulsemixer --toggle-mute"; # mute 86 | "--locked 122" = "exec pulsemixer --change-volume -6"; # vol- 87 | "--locked 123" = "exec pulsemixer --change-volume +6"; # vol+ 88 | "--locked 171" = "exec playerctl next"; # next song 89 | "--locked --no-repeat 172" = "exec playerctl play-pause"; # play/pause 90 | "--locked 173" = "exec playerctl previous"; # prev song 91 | "--locked --no-repeat 198" = "exec amixer set Capture toggle"; # mic mute 92 | "--locked 232" = "exec light -U 5"; # brightness- 93 | "--locked 233" = "exec light -A 5"; # brightness+ 94 | }; 95 | 96 | menu = "wofi"; 97 | terminal = "foot"; 98 | modifier = "Mod4"; 99 | bars = []; 100 | 101 | input = { 102 | "type:pointer" = { 103 | accel_profile = "flat"; 104 | pointer_accel = "0"; 105 | }; 106 | "type:touchpad" = { 107 | click_method = "clickfinger"; 108 | middle_emulation = "enabled"; 109 | natural_scroll = "enabled"; 110 | tap = "enabled"; 111 | }; 112 | }; 113 | 114 | output = { 115 | "*" = { 116 | bg = "~/.config/wallpaper.png fill"; 117 | max_render_time = "7"; 118 | }; 119 | }; 120 | }; 121 | 122 | wrapperFeatures = {gtk = true;}; 123 | }; 124 | } 125 | -------------------------------------------------------------------------------- /home/wms/wayfire/default.nix: -------------------------------------------------------------------------------- 1 | colors: let 2 | inherit (colors) xrgbaColors; 3 | 4 | wayfire-config = '' 5 | [alpha] 6 | min_value = 0.100000 7 | modifier = 8 | 9 | [animate] 10 | close_animation = fade 11 | open_animation = zoom 12 | startup_duration = 300 13 | duration = 300 14 | enabled_for = type equals "toplevel" | (type equals "x-or" & focusable equals true)) 15 | 16 | fade_duration = 400 17 | fade_enabled_for = type equals "overlay" 18 | 19 | fire_duration = 300 20 | fire_enabled_for = none 21 | fire_particle_size = 16.000000 22 | fire_particles = 2000 23 | 24 | zoom_duration = 300 25 | zoom_enabled_for = none 26 | 27 | [autostart] 28 | 0_environment = dbus-update-activation-environment --systemd WAYLAND_DISPLAY DISPLAY XAUTHORITY 29 | 1_hm = systemctl --user start hm-graphical-session.target 30 | 2_eww = eww daemon 31 | 32 | autostart_wf_shell = false 33 | background = swaybg -i ~/.config/wallpaper.png 34 | idle = swayidle -w \ 35 | timeout 360 'swaylock' \ 36 | before-sleep 'swaylock' 37 | panel = eww open bar 38 | 39 | [blur] 40 | blur_by_default = type is "toplevel" 41 | 42 | bokeh_degrade = 1 43 | bokeh_iterations = 5 44 | bokeh_offset = 5.000000 45 | 46 | box_degrade = 1 47 | box_iterations = 2 48 | box_offset = 1.000000 49 | 50 | gaussian_degrade = 1 51 | gaussian_iterations = 2 52 | gaussian_offset = 1.000000 53 | 54 | kawase_degrade = 3 55 | kawase_iterations = 3 56 | kawase_offset = 1.000000 57 | 58 | method = kawase 59 | saturation = 1.000000 60 | #toggle = KEY_B 61 | 62 | [command] 63 | binding_launcher = KEY_SPACE 64 | binding_lock = KEY_L 65 | binding_logout = KEY_ESC 66 | binding_mute = KEY_MUTE 67 | binding_mic_mute = KEY_F20 68 | binding_next = KEY_NEXTSONG 69 | binding_pause = KEY_PLAYPAUSE 70 | binding_prev = KEY_PREVIOUSSONG 71 | binding_screenshot = KEY_PRINT | KEY_R 72 | binding_screenshot_interactive = KEY_PRINT | KEY_R 73 | binding_terminal = KEY_ENTER 74 | 75 | command_launcher = wofi --show=drun --allow-images 76 | command_light_down = light -U 5 77 | command_light_up = light -A 5 78 | command_lock = swaylock 79 | command_logout = wlogout 80 | command_mute = pulsemixer --toggle-mute 81 | command_mic_mute = amixer set Capture toggle 82 | command_next = playerctl next 83 | command_pause = playerctl play-pause 84 | command_prev = playerctl previous 85 | command_screenshot = grim -g "$(slurp -d)" - | wl-copy -t image/png 86 | command_screenshot_interactive = grim -g "$(slurp -d)" - ~/Pictures/ss/$(date '+%F_%T').png | wl-copy -t image/png 87 | command_terminal = alacritty 88 | command_volume_down = pulsemixer --change-volume -6 89 | command_volume_up = pulsemixer --change-volume +6 90 | 91 | repeatable_binding_light_down = KEY_BRIGHTNESSDOWN 92 | repeatable_binding_light_up = KEY_BRIGHTNESSUP 93 | repeatable_binding_volume_down = KEY_VOLUMEDOWN 94 | repeatable_binding_volume_up = KEY_VOLUMEUP 95 | 96 | [core] 97 | background_color = #${xrgbaColors.base00} 98 | close_top_view = KEY_Q | KEY_F4 99 | focus_button_with_modifiers = false 100 | focus_buttons = BTN_LEFT | BTN_MIDDLE | BTN_RIGHT 101 | focus_buttons_passthrough = true 102 | max_render_time = 7 103 | plugins = autostart \ 104 | blur \ 105 | command \ 106 | decoration \ 107 | expo \ 108 | fast-switcher \ 109 | idle \ 110 | matcher \ 111 | move \ 112 | oswitch \ 113 | place \ 114 | resize \ 115 | simple-tile \ 116 | vswipe \ 117 | window-rules \ 118 | wrot \ 119 | zoom 120 | vheight = 3 121 | vwidth = 3 122 | xwayland = true 123 | 124 | [cube] 125 | activate = BTN_LEFT 126 | background = #${xrgbaColors.base00} 127 | background_mode = simple 128 | cubemap_image = 129 | deform = 0 130 | initial_animation = 350 131 | light = true 132 | rotate_left = KEY_LEFT 133 | rotate_right = KEY_RIGHT 134 | skydome_mirror = true 135 | skydome_texture = 136 | speed_spin_horiz = 0.020000 137 | speed_spin_vert = 0.020000 138 | speed_zoom = 0.070000 139 | zoom = 0.100000 140 | 141 | [decoration] 142 | active_color = #${xrgbaColors.base00} 143 | border_size = 0 144 | button_order = minimize maximize close 145 | font = Roboto 146 | ignore_views = none 147 | inactive_color = #${xrgbaColors.base04} 148 | title_height = 20 149 | 150 | [expo] 151 | background = #${xrgbaColors.base00} 152 | duration = 50 153 | offset = 10 154 | select_workspace_1 = KEY_1 155 | select_workspace_2 = KEY_2 156 | select_workspace_3 = KEY_3 157 | select_workspace_4 = KEY_4 158 | select_workspace_5 = KEY_5 159 | select_workspace_6 = KEY_6 160 | select_workspace_7 = KEY_7 161 | select_workspace_8 = KEY_8 162 | select_workspace_9 = KEY_9 163 | toggle = 164 | 165 | [extra-gestures] 166 | close_fingers = 5 167 | move_delay = 500 168 | move_fingers = 3 169 | 170 | [fast-switcher] 171 | activate = KEY_ESC 172 | activate_backward = KEY_ESC 173 | 174 | [fisheye] 175 | radius = 450.000000 176 | toggle = KEY_F 177 | zoom = 7.000000 178 | 179 | [grid] 180 | duration = 300 181 | restore = KEY_DOWN | KEY_KP0 182 | slot_b = KEY_KP2 183 | slot_bl = KEY_KP1 184 | slot_br = KEY_KP3 185 | slot_c = KEY_UP | KEY_KP5 186 | slot_l = KEY_LEFT | KEY_KP4 187 | slot_r = KEY_RIGHT | KEY_KP6 188 | slot_t = KEY_KP8 189 | slot_tl = KEY_KP7 190 | slot_tr = KEY_KP9 191 | type = crossfade 192 | 193 | [idle] 194 | cube_max_zoom = 1.500000 195 | cube_rotate_speed = 1.000000 196 | cube_zoom_speed = 1000 197 | disable_on_fullscreen = true 198 | dpms_timeout = 300 199 | screensaver_timeout = -1 200 | toggle = none 201 | 202 | [input] 203 | click_method = default 204 | cursor_size = 24 205 | cursor_theme = "Bibata-Modern-Classic" 206 | disable_touchpad_while_mouse = false 207 | disable_touchpad_while_typing = false 208 | gesture_sensitivity = 1.000000 209 | middle_emulation = false 210 | modifier_binding_timeout = 400 211 | mouse_accel_profile = flat 212 | natural_scroll = true 213 | touchpad_scroll_speed = 0.3 214 | xkb_layout = ro 215 | xkb_rules = evdev 216 | 217 | [invert] 218 | preserve_hue = false 219 | toggle = KEY_I 220 | 221 | [move] 222 | activate = BTN_LEFT 223 | enable_snap = true 224 | enable_snap_off = true 225 | join_views = false 226 | quarter_snap_threshold = 50 227 | snap_off_threshold = 10 228 | snap_threshold = 10 229 | workspace_switch_after = -1 230 | 231 | [oswitch] 232 | next_output = KEY_O 233 | next_output_with_win = KEY_O 234 | 235 | [output] 236 | mode = auto 237 | position = auto 238 | scale = 1.000000 239 | transform = normal 240 | 241 | [place] 242 | mode = center 243 | 244 | [preserve-output] 245 | last_output_focus_timeout = 10000 246 | 247 | [resize] 248 | activate = BTN_RIGHT 249 | 250 | [scale] 251 | allow_zoom = false 252 | bg_color = #${xrgbaColors.base00} 253 | duration = 750 254 | inactive_alpha = 0.750000 255 | interact = false 256 | middle_click_close = false 257 | spacing = 50 258 | text_color = #${xrgbaColors.base00} 259 | title_font_size = 14 260 | title_overlay = all 261 | title_position = center 262 | toggle = KEY_P 263 | toggle_all = 264 | 265 | [switcher] 266 | next_view = KEY_TAB 267 | prev_view = KEY_TAB 268 | speed = 500 269 | view_thumbnail_scale = 1.000000 270 | 271 | [vswipe] 272 | background = #${xrgbaColors.base00} 273 | duration = 180 274 | enable_smooth_transition = true 275 | enable_vertical = true 276 | fingers = 3 277 | gap = 32.000000 278 | speed_cap = 0.500000 279 | speed_factor = 500.000000 280 | #threshold = 0.250000 281 | 282 | [vswitch] 283 | background = #${xrgbaColors.base00} 284 | binding_down = KEY_DOWN 285 | binding_left = KEY_LEFT 286 | binding_right = KEY_RIGHT 287 | binding_up = KEY_UP 288 | binding_win_down = KEY_DOWN 289 | binding_win_left = KEY_LEFT 290 | binding_win_right = KEY_RIGHT 291 | binding_win_up = KEY_UP 292 | duration = 300 293 | gap = 20 294 | wraparound = false 295 | 296 | [window-rules] 297 | 298 | [wm-actions] 299 | minimize = none 300 | toggle_always_on_top = none 301 | toggle_fullscreen = KEY_F 302 | toggle_maximize = none 303 | toggle_showdesktop = none 304 | toggle_sticky = none 305 | 306 | [wobbly] 307 | friction = 3.000000 308 | grid_resolution = 6 309 | spring_k = 8.000000 310 | 311 | [workarounds] 312 | all_dialogs_modal = true 313 | app_id_mode = stock 314 | dynamic_repaint_delay = false 315 | 316 | [wrot] 317 | activate = BTN_RIGHT 318 | activate-3d = BTN_RIGHT 319 | invert = false 320 | reset = KEY_R 321 | reset-one = KEY_R 322 | reset_radius = 25.000000 323 | sensitivity = 24 324 | 325 | [zoom] 326 | modifier = 327 | smoothing_duration = 300 328 | speed = 0.010000 329 | 330 | [simple-tile] 331 | button_move = BTN_LEFT 332 | button_resize = BTN_RIGHT 333 | inner_gap_size = 2 334 | keep_fullscreen_on_adjacent = true 335 | key_focus_above = KEY_K 336 | key_focus_below = KEY_J 337 | key_focus_left = KEY_H 338 | key_focus_right = KEY_L 339 | key_toggle = KEY_T 340 | tile_by_default = type is "toplevel" 341 | #wm-actions.toggle_always_on_top 342 | ''; 343 | in 344 | wayfire-config 345 | -------------------------------------------------------------------------------- /hosts/default.nix: -------------------------------------------------------------------------------- 1 | inputs: let 2 | inherit (inputs) self; 3 | 4 | sharedModules = [ 5 | {_module.args = {inherit inputs;};} 6 | ../modules/minimal.nix 7 | ../modules/security.nix 8 | inputs.hm.nixosModule 9 | { 10 | home-manager = { 11 | inherit (inputs.self.lib) extraSpecialArgs; 12 | useGlobalPkgs = true; 13 | }; 14 | } 15 | ]; 16 | 17 | desktopModules = [ 18 | inputs.nix-gaming.nixosModules.default 19 | inputs.hyprland.nixosModules.default 20 | ]; 21 | inherit (self.lib) nixosSystem makeOverridable; 22 | inherit (import "${self}/home/profiles" inputs) homeImports; 23 | in { 24 | nu = nixosSystem { 25 | modules = 26 | [ 27 | ./nu 28 | ../modules/desktop.nix 29 | ../modules/gamemode.nix 30 | ../modules/greetd.nix 31 | {home-manager.users.astro = inputs.self.lib.mkMerge [inputs.nix-doom-emacs.hmModule {imports = homeImports."astro@nu";}];} 32 | ] 33 | ++ sharedModules 34 | ++ desktopModules; 35 | 36 | system = "x86_64-linux"; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /hosts/deploy.nix: -------------------------------------------------------------------------------- 1 | inputs: { 2 | nodes = with inputs.deploy-rs.lib.x86_64-linux; { 3 | nu = { 4 | hostname = "nu"; 5 | profiles.system = { 6 | user = "root"; 7 | path = activate.nixos inputs.self.nixosConfigurations.nu; 8 | }; 9 | }; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /hosts/nu/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | inputs, 6 | ... 7 | }: { 8 | imports = [./hardware-configuration.nix]; 9 | 10 | # kernel 11 | boot.kernelModules = []; 12 | boot.kernelPackages = pkgs.linuxPackages_xanmod_latest; 13 | 14 | boot.kernelParams = [ 15 | "libata.noacpi=1" 16 | "fsck.mode=skip" 17 | "random.trust_cpu=on" 18 | "quiet" 19 | "udev.log_level=3" 20 | "loglevel=3" 21 | "systemd.show_status=auto" 22 | "rd.udev.log_level=3" 23 | "vt.global_cursor_default=0" 24 | ]; 25 | 26 | # bootloader 27 | boot = { 28 | loader = { 29 | efi.canTouchEfiVariables = true; 30 | systemd-boot = { 31 | enable = true; 32 | }; 33 | }; 34 | consoleLogLevel = 0; 35 | initrd.verbose = false; 36 | }; 37 | 38 | # hibernate 39 | powerManagement.resumeCommands = "${pkgs.systemd}/bin/systemctl restart systemd-networkd.service"; 40 | 41 | hardware.opengl = { 42 | driSupport = true; 43 | extraPackages = with pkgs; [ 44 | intel-media-driver 45 | intel-compute-runtime 46 | vaapiIntel 47 | vaapiVdpau 48 | libvdpau-va-gl 49 | ]; 50 | }; 51 | 52 | networking = { 53 | hostName = "nu"; 54 | # Ethernet supremacy 55 | wireless.enable = false; 56 | useDHCP = false; 57 | dhcpcd.enable = false; 58 | useNetworkd = true; 59 | }; 60 | 61 | programs = { 62 | adb.enable = true; 63 | steam.enable = true; 64 | }; 65 | 66 | services = { 67 | btrfs.autoScrub.enable = true; 68 | 69 | printing.enable = false; 70 | 71 | xserver.videoDrivers = ["modesetting"]; 72 | }; 73 | 74 | virtualisation.podman = { 75 | enable = true; 76 | }; 77 | 78 | systemd = { 79 | network.enable = true; 80 | network.networks = let 81 | networkConfig = { 82 | DHCP = "yes"; 83 | DNSSEC = "yes"; 84 | DNSOverTLS = "yes"; 85 | DNS = ["1.1.1.1" "1.0.0.1"]; 86 | }; 87 | in { 88 | # Config for all useful interfaces 89 | "40-wired" = { 90 | enable = true; 91 | name = "en*"; 92 | inherit networkConfig; 93 | dhcpV4Config.RouteMetric = 1024; # Better be explicit 94 | }; 95 | "40-wireless" = { 96 | enable = true; 97 | name = "wl*"; 98 | inherit networkConfig; 99 | dhcpV4Config.RouteMetric = 2048; # Prefer wired 100 | }; 101 | }; 102 | services = { 103 | "systemd-networkd-wait-online".enable = false; 104 | NetworkManager-wait-online.enable = false; 105 | systemd-user-sessions.enable = false; 106 | systemd-journal-flush.enable = false; 107 | }; 108 | }; 109 | } 110 | -------------------------------------------------------------------------------- /hosts/nu/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { 5 | config, 6 | lib, 7 | pkgs, 8 | modulesPath, 9 | ... 10 | }: { 11 | imports = [ 12 | (modulesPath + "/installer/scan/not-detected.nix") 13 | ]; 14 | 15 | boot.initrd.availableKernelModules = ["ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod"]; 16 | boot.initrd.kernelModules = ["i915"]; 17 | boot.kernelModules = ["kvm-intel"]; 18 | boot.extraModulePackages = []; 19 | 20 | powerManagement.cpuFreqGovernor = "performance"; 21 | 22 | fileSystems."/" = { 23 | device = "/dev/disk/by-uuid/7a280a05-6d6a-4085-9037-9a277037fa69"; 24 | fsType = "btrfs"; 25 | options = ["subvol=nixos" "noatime" "space_cache=v2" "compress=zstd" "autodefrag"]; 26 | }; 27 | 28 | fileSystems."/home" = { 29 | device = "/dev/disk/by-uuid/7a280a05-6d6a-4085-9037-9a277037fa69"; 30 | fsType = "btrfs"; 31 | options = ["subvol=home" "compress=zstd" "autodefrag" "noatime" "space_cache=v2"]; 32 | }; 33 | 34 | fileSystems."/boot" = { 35 | device = "/dev/disk/by-uuid/B04C-7A33"; 36 | fsType = "vfat"; 37 | }; 38 | 39 | swapDevices = [ 40 | {device = "/dev/disk/by-uuid/f25c14b1-02b2-4bcd-8aa2-035a34838d14";} 41 | ]; 42 | 43 | hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 44 | } 45 | -------------------------------------------------------------------------------- /lib/colors.nix: -------------------------------------------------------------------------------- 1 | lib: 2 | with lib; rec { 3 | # color-related functions 4 | 5 | # convert rrggbb hex to #rrggbb 6 | x = c: "#${c}"; 7 | 8 | # convert rrggbb hex to 0xrrggbb (mostly for alacritty) 9 | x0 = c: "0x${c}"; 10 | 11 | # same as x but adds an alpha channel for transparency 12 | xrgba = c: "${c}88"; 13 | xargb = c: "88${c}"; 14 | 15 | # convert rrggbb hex to rgba(r, g, b, a) css 16 | rgba = c: let 17 | r = toString (hexToDec (__substring 0 2 c)); 18 | g = toString (hexToDec (__substring 2 2 c)); 19 | b = toString (hexToDec (__substring 4 2 c)); 20 | res = "rgba(${r}, ${g}, ${b}, 0.5)"; 21 | in 22 | res; 23 | 24 | # general stuff 25 | 26 | # functions copied from https://gist.github.com/corpix/f761c82c9d6fdbc1b3846b37e1020e11 27 | # convert a hex value to an integer 28 | hexToDec = v: let 29 | hexToInt = { 30 | "0" = 0; 31 | "1" = 1; 32 | "2" = 2; 33 | "3" = 3; 34 | "4" = 4; 35 | "5" = 5; 36 | "6" = 6; 37 | "7" = 7; 38 | "8" = 8; 39 | "9" = 9; 40 | "a" = 10; 41 | "b" = 11; 42 | "c" = 12; 43 | "d" = 13; 44 | "e" = 14; 45 | "f" = 15; 46 | "A" = 10; 47 | "B" = 11; 48 | "C" = 12; 49 | "D" = 13; 50 | "E" = 14; 51 | "F" = 15; 52 | }; 53 | chars = stringToCharacters v; 54 | charsLen = length chars; 55 | in 56 | foldl 57 | (a: v: a + v) 58 | 0 59 | (imap0 60 | (k: v: hexToInt."${v}" * (pow 16 (charsLen - k - 1))) 61 | chars); 62 | 63 | pow = let 64 | pow' = base: exponent: value: 65 | # FIXME: It will silently overflow on values > 2**62 :( 66 | # The value will become negative or zero in this case 67 | if exponent == 0 68 | then 1 69 | else if exponent <= 1 70 | then value 71 | else (pow' base (exponent - 1) (value * base)); 72 | in 73 | base: exponent: pow' base exponent base; 74 | } 75 | -------------------------------------------------------------------------------- /lib/default.nix: -------------------------------------------------------------------------------- 1 | inputs: 2 | # personal lib 3 | let 4 | inherit (inputs.nixpkgs) lib; 5 | 6 | colors = import ./colors.nix lib; 7 | system = import ./system.nix inputs; 8 | home = import ./home.nix inputs; 9 | in 10 | lib // colors // home // system 11 | # adding lib is ugly but easier to keep track of things 12 | 13 | -------------------------------------------------------------------------------- /lib/gradientWall.nix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0oAstro/NixDots/d6286341cbce2e3b5fdc4a62badae9a8441f021e/lib/gradientWall.nix -------------------------------------------------------------------------------- /lib/gtkIcon.nix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0oAstro/NixDots/d6286341cbce2e3b5fdc4a62badae9a8441f021e/lib/gtkIcon.nix -------------------------------------------------------------------------------- /lib/gtkTheme.nix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0oAstro/NixDots/d6286341cbce2e3b5fdc4a62badae9a8441f021e/lib/gtkTheme.nix -------------------------------------------------------------------------------- /lib/home.nix: -------------------------------------------------------------------------------- 1 | inputs: let 2 | inherit (inputs) self; 3 | inherit (inputs.hm.lib) homeManagerConfiguration; 4 | 5 | theme_name = "catppuccin"; 6 | 7 | colors = with self.lib; let 8 | theme = inputs.nix-colors.colorSchemes.${theme_name}; 9 | baseColors = theme.colors; 10 | in { 11 | inherit theme baseColors; 12 | xcolors = mapAttrs (n: x) baseColors; 13 | # rgba hex values 14 | xrgbaColors = mapAttrs (n: xrgba) baseColors; 15 | # argb hex values 16 | xargbColors = mapAttrs (n: xargb) baseColors; 17 | # 0xABCDEF colors (alacritty) 18 | x0Colors = mapAttrs (n: x0) baseColors; 19 | # rgba(,,,) colors (css) 20 | rgbaColors = mapAttrs (n: rgba) baseColors; 21 | }; 22 | 23 | extraSpecialArgs = {inherit colors inputs;}; 24 | 25 | defArgs = { 26 | configuration = {}; 27 | system = "x86_64-linux"; 28 | inherit extraSpecialArgs; 29 | }; 30 | 31 | mkHome = args: 32 | homeManagerConfiguration (defArgs 33 | // args 34 | // { 35 | homeDirectory = "/home/${args.username}"; 36 | pkgs = inputs.self.pkgs.${args.system or defArgs.system}; 37 | }); 38 | in {inherit mkHome extraSpecialArgs;} 39 | -------------------------------------------------------------------------------- /lib/repl.nix: -------------------------------------------------------------------------------- 1 | { 2 | flakePath ? null, 3 | hostnamePath ? "/etc/hostname", 4 | registryPath ? /etc/nix/registry.json, 5 | }: let 6 | inherit (builtins) getFlake head match currentSystem readFile pathExists filter fromJSON; 7 | 8 | selfFlake = 9 | if pathExists registryPath 10 | then filter (it: it.from.id == "self") (fromJSON (readFile registryPath)).flakes 11 | else []; 12 | 13 | flakePath' = 14 | toString 15 | ( 16 | if flakePath != null 17 | then flakePath 18 | else if selfFlake != [] 19 | then (head selfFlake).to.path 20 | else "/etc/nixos" 21 | ); 22 | 23 | flake = 24 | if pathExists flakePath' 25 | then getFlake flakePath' 26 | else {}; 27 | hostname = 28 | if pathExists hostnamePath 29 | then head (match "([a-zA-Z0-9\\-]+)\n" (readFile hostnamePath)) 30 | else ""; 31 | 32 | nixpkgsFromInputsPath = flake.inputs.nixpkgs.outPath or ""; 33 | nixpkgs = 34 | flake.pkgs.${currentSystem}.nixpkgs 35 | or ( 36 | if nixpkgsFromInputsPath != "" 37 | then import nixpkgsFromInputsPath {} 38 | else {} 39 | ); 40 | 41 | nixpkgsOutput = removeAttrs (nixpkgs // nixpkgs.lib or {}) ["options" "config"]; 42 | in 43 | {inherit flake;} 44 | // flake 45 | // builtins 46 | // (flake.nixosConfigurations or {}) 47 | // flake.nixosConfigurations.${hostname} or {} 48 | // nixpkgsOutput 49 | // {getFlake = path: getFlake (toString path);} 50 | -------------------------------------------------------------------------------- /lib/system.nix: -------------------------------------------------------------------------------- 1 | inputs: let 2 | inherit (inputs.nixpkgs) lib; 3 | in rec { 4 | supportedSystems = ["aarch64-linux" "x86_64-linux"]; 5 | 6 | genSystems = lib.genAttrs supportedSystems; 7 | 8 | nixpkgsFor = genSystems (system: overlays: 9 | import inputs.nixpkgs { 10 | inherit system overlays; 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /modules/desktop.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | inputs, 6 | ... 7 | }: { 8 | boot = { 9 | loader.timeout = 1; 10 | }; 11 | fonts = { 12 | fonts = with pkgs; [ 13 | # icon fonts 14 | material-icons 15 | material-design-icons 16 | font-awesome 17 | 18 | # Emoji fonts 19 | twemoji-color-font 20 | 21 | # normal fonts 22 | noto-fonts 23 | noto-fonts-cjk 24 | 25 | # sans and serif font 26 | inter 27 | zilla-slab 28 | 29 | # nerdfonts 30 | (nerdfonts.override {fonts = ["RobotoMono" "FiraCode" "JetBrainsMono" "VictorMono" "CascadiaCode"];}) 31 | ]; 32 | 33 | # use fonts specified by user rather than default ones 34 | enableDefaultFonts = false; 35 | 36 | # user defined fonts 37 | # the reason there's Noto Color Emoji everywhere is to override DejaVu's 38 | # B&W emojis that would sometimes show instead of some Color emojis 39 | fontconfig = { 40 | enable = true; 41 | defaultFonts = { 42 | serif = ["Zilla Slab" "Twitter Color Emoji"]; 43 | sansSerif = ["Inter" "Noto Sans" "Twitter Color Emoji"]; 44 | monospace = [ "JetBrainsMono Nerd Font" "Twitter Color Emoji"]; 45 | emoji = ["Font Awesome 6 Free" "Font Awesome 6 Brands" "Twitter Color Emoji"]; 46 | }; 47 | localConf = '' 48 | 49 | 50 | 51 | 52 | scientifica 53 | false 54 | false 55 | false 56 | hintnone 57 | none 58 | 59 | 60 | ''; }; 61 | }; 62 | 63 | environment.systemPackages = with pkgs; [ 64 | glib 65 | gsettings-desktop-schemas 66 | ]; 67 | 68 | environment.variables.NIXOS_OZONE_WL = "1"; 69 | location.provider = "geoclue2"; 70 | 71 | programs.hyprland = {enable = true; package = null;}; 72 | 73 | networking = { 74 | firewall = { 75 | # for Rocket League 76 | allowedTCPPortRanges = [ 77 | { 78 | from = 27015; 79 | to = 27030; 80 | } 81 | { 82 | from = 27036; 83 | to = 27037; 84 | } 85 | ]; 86 | allowedUDPPorts = [4380 27036 34197]; 87 | allowedUDPPortRanges = [ 88 | { 89 | from = 7000; 90 | to = 9000; 91 | } 92 | { 93 | from = 27000; 94 | to = 27031; 95 | } 96 | ]; 97 | 98 | # Spotify downloaded track sync with other devices 99 | allowedTCPPorts = [57621]; 100 | }; 101 | }; 102 | 103 | # add gaming cache 104 | nix.settings = { 105 | substituters = ["https://nix-gaming.cachix.org" "https://hyprland.cachix.org"]; 106 | trusted-public-keys = ["nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; 107 | }; 108 | 109 | programs.dconf.enable = true; 110 | 111 | sound.enable = true; 112 | 113 | services = { 114 | dbus.packages = [pkgs.gcr]; 115 | 116 | # provide location 117 | geoclue2 = { 118 | enable = true; 119 | }; 120 | 121 | pipewire = { 122 | enable = true; 123 | alsa.enable = true; 124 | alsa.support32Bit = true; 125 | pulse.enable = true; 126 | }; 127 | 128 | xserver = { 129 | enable = true; 130 | libinput = { 131 | enable = true; 132 | # disable mouse acceleration 133 | mouse.accelProfile = "flat"; 134 | mouse.accelSpeed = "0"; 135 | mouse.middleEmulation = false; 136 | }; 137 | }; 138 | 139 | udev.packages = with pkgs; [gnome.gnome-settings-daemon]; 140 | }; 141 | 142 | security.pam.services.swaylock = { 143 | text = '' 144 | auth include login 145 | ''; 146 | }; 147 | 148 | xdg.portal = { 149 | enable = true; 150 | wlr = { 151 | enable = true; 152 | settings.screencast = { 153 | chooser_type = "simple"; 154 | chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or"; 155 | }; 156 | }; 157 | }; 158 | } 159 | -------------------------------------------------------------------------------- /modules/gamemode.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | inputs, 4 | lib, 5 | ... 6 | }: let 7 | programs = lib.makeBinPath (with pkgs; [ 8 | inputs.hyprland.packages.${pkgs.system}.default 9 | systemd 10 | ]); 11 | 12 | startscript = pkgs.writeShellScript "gamemode-start" '' 13 | export PATH=$PATH:${programs} 14 | export HYPRLAND_INSTANCE_SIGNATURE=$(ls -w1 /tmp/hypr | tail -1) 15 | hyprctl --batch 'keyword decoration:blur 0 ; keyword animations:enabled 0 ; keyword misc:no_vfr 1' 16 | status=$(systemctl --user --machine=1000@ is-active easyeffects) 17 | if [[ $status == "active" ]]; then 18 | systemctl --user stop easyeffects 19 | echo "start" > /tmp/gamemodestate 20 | else 21 | echo "stop" > /tmp/gamemodestate 22 | fi 23 | ''; 24 | 25 | endscript = pkgs.writeShellScript "gamemode-end" '' 26 | export PATH=$PATH:${programs} 27 | export HYPRLAND_INSTANCE_SIGNATURE=$(ls -w1 /tmp/hypr | tail -1) 28 | hyprctl --batch 'keyword decoration:blur 1 ; keyword animations:enabled 1 ; keyword misc:no_vfr 0' 29 | action=$(cat /tmp/gamemodestate) 30 | systemctl --user $action easyeffects 31 | ''; 32 | in { 33 | programs.gamemode = { 34 | enable = true; 35 | settings = { 36 | general = { 37 | softrealtime = "auto"; 38 | renice = 15; 39 | }; 40 | custom = { 41 | start = "${startscript}"; 42 | end = "${endscript}"; 43 | }; 44 | }; 45 | }; 46 | } -------------------------------------------------------------------------------- /modules/gnome.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | ... 5 | }: 6 | # GNOME 41 config 7 | { 8 | environment.systemPackages = with pkgs.gnomeExtensions; [ 9 | appindicator 10 | gsconnect 11 | ideapad-mode 12 | vitals 13 | pkgs.gnome.gnome-tweaks 14 | ]; 15 | 16 | # we're using pipewire instead 17 | hardware.pulseaudio.enable = lib.mkForce false; 18 | 19 | networking = { 20 | # for GSConnect 21 | firewall = { 22 | allowedTCPPortRanges = [ 23 | { 24 | from = 1714; 25 | to = 1764; 26 | } 27 | ]; 28 | allowedUDPPortRanges = [ 29 | { 30 | from = 1714; 31 | to = 1764; 32 | } 33 | ]; 34 | }; 35 | }; 36 | 37 | services.gnome.games.enable = true; 38 | services.xserver = { 39 | desktopManager.gnome = { 40 | enable = true; 41 | }; 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /modules/greetd.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | inputs, 4 | ... 5 | }: let 6 | wall = inputs.wall; 7 | theme = "catppuccin"; 8 | colors = inputs.nix-colors.colorschemes.${theme}.colors; 9 | in { 10 | environment.systemPackages = with pkgs; [ 11 | greetd.gtkgreet 12 | ]; 13 | 14 | services.xserver.displayManager.startx.enable = true; 15 | 16 | services.greetd = { 17 | enable = true; 18 | settings = { 19 | default_session.command = let 20 | gtkgreetStyle = pkgs.writeText "greetd-gtkgreet.css" '' 21 | window { 22 | background-image: url("${wall}"); 23 | background-position: center; 24 | background-repeat: no-repeat; 25 | background-size: cover; 26 | background-color: black; 27 | } 28 | box#body { 29 | background-color: #${colors.base00}; 30 | border-radius: 10px; 31 | padding: 50px; 32 | border-style: solid; 33 | border-color: #${colors.base08}; 34 | border-width: 3px; 35 | } 36 | * { color: #${colors.base05}; border-style: none; font-family: "JetBrainsMono Nerd Font"; } 37 | #clock { color: #${colors.base00}; } 38 | entry { background: #${colors.base00}; border-style: none; } 39 | entry:hover, entry:focus { background: #${colors.base00}; box-shadow: none; } 40 | button { background: #${colors.base00}; border-style: none; } 41 | button:hover { background: #${colors.base08}; } 42 | button * { color: #${colors.base08}; } 43 | button:hover * { color: #${colors.base00}; } 44 | menu { background: #${colors.base01}; border-radius: 0px; } 45 | menu *:hover { background: #${colors.base02}; } 46 | button { box-shadow: none; text-shadow: none; } 47 | button.combo:hover { border-bottom-left-radius: 5px; border-top-left-radius: 5px; } 48 | ''; in 49 | "${pkgs.cage}/bin/cage -s -- ${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -s ${gtkgreetStyle}"; 50 | initial_session = { 51 | command = "Hyprland >/dev/null"; 52 | user = "astro"; 53 | }; 54 | }; 55 | }; 56 | 57 | environment.etc."greetd/environments".text = '' 58 | Hyprland >/dev/null 59 | sway >/dev/null 60 | river >/dev/null 61 | wayfire >/dev/null 62 | fish 63 | ''; 64 | } 65 | -------------------------------------------------------------------------------- /modules/iso.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: 2 | # my own installer 3 | { 4 | # kernel 5 | nix = { 6 | package = pkgs.nixUnstable; 7 | extraOptions = "experimental-features = nix-command flakes"; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /modules/kde.nix: -------------------------------------------------------------------------------- 1 | { 2 | services.xserver = { 3 | desktopManager.plasma5 = { 4 | enable = true; 5 | #useQtScaling = true; 6 | #runUsingSystemd = true; 7 | }; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /modules/main.kbd: -------------------------------------------------------------------------------- 1 | (defsrc 2 | grv 1 2 3 4 5 6 7 8 9 0 - = bspc 3 | tab q w e r t y u i o p [ ] \ 4 | caps a s d f g h j k l ; ' ret 5 | lsft z x c v b n m , . / rsft 6 | lctl lmet lalt spc ralt rmet cmp rctl 7 | ) 8 | 9 | (deflayer colemak 10 | grv 1 2 3 4 5 6 7 8 9 0 - = bspc 11 | tab q w f p b j l u y ; [ ] \ 12 | @esc a r s t g m n e i o ' ret 13 | lsft x c d v z k h , . / rsft 14 | @lay lmet lalt @spc lmet rmet cmp rctl 15 | ) 16 | 17 | (deflayer qwerty 18 | grv 1 2 3 4 5 6 7 8 9 0 - = bspc 19 | tab q w e r t y u i o p [ ] \ 20 | @cps a s d f g h j k l ; ' ret 21 | lsft z x c v b n m , . / rsft 22 | lctl lmet lalt spc lmet rmet cmp rctl 23 | ) 24 | 25 | (deflayer layouts 26 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ 27 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ 28 | caps _ _ _ @cmk _ _ @qwe _ _ _ _ _ 29 | _ _ _ _ _ _ _ _ _ _ _ _ 30 | _ _ _ _ _ _ _ _ 31 | ) 32 | 33 | (deflayer symbols 34 | _ f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del 35 | _ _ _ _ _ _ ins _ up _ pgup home prnt _ 36 | _ _ _ _ _ _ _ left down rght pgdn end _ 37 | _ _ _ _ _ _ _ mute vold volu _ _ 38 | pp _ prev _ next _ _ _ 39 | ) 40 | 41 | (defalias 42 | lay (layer-toggle layouts) 43 | cmk (layer-switch colemak) 44 | qwe (layer-switch qwerty) 45 | sym (layer-toggle symbols) 46 | esc (tap-next-release esc lctl) 47 | spc (tap-next-release spc @sym) 48 | cps (tap-next-release caps @lay) 49 | ) 50 | -------------------------------------------------------------------------------- /modules/minimal.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | config, 4 | lib, 5 | inputs, 6 | ... 7 | }: 8 | # configuration shared by all hosts 9 | { 10 | console.font = "Lat2-Terminus16"; 11 | 12 | # enable zsh autocompletion for system packages (systemd, etc) 13 | environment = { 14 | etc = { 15 | "nix/flake-channels/system".source = inputs.self; 16 | "nix/flake-channels/nixpkgs".source = inputs.nixpkgs; 17 | "nix/flake-channels/home-manager".source = inputs.hm; 18 | }; 19 | 20 | systemPackages = [pkgs.git pkgs.gcc pkgs.clang]; 21 | 22 | pathsToLink = ["/share/zsh"]; 23 | }; 24 | 25 | i18n = { 26 | defaultLocale = "en_US.UTF-8"; 27 | # saves space 28 | supportedLocales = ["en_US.UTF-8/UTF-8"]; 29 | }; 30 | 31 | # OpenGL 32 | hardware.opengl.enable = true; 33 | 34 | networking = { 35 | firewall.checkReversePath = "loose"; 36 | }; 37 | 38 | nix = { 39 | package = pkgs.nixUnstable; 40 | extraOptions = '' 41 | builders-use-substitutes = true 42 | experimental-features = nix-command flakes 43 | 44 | # for direnv GC roots 45 | keep-outputs = true 46 | keep-derivations = true 47 | ''; 48 | 49 | gc = { 50 | automatic = true; 51 | dates = "weekly"; 52 | options = "--delete-older-than 7d"; 53 | }; 54 | 55 | registry = lib.mapAttrs (n: v: {flake = v;}) inputs; 56 | 57 | nixPath = [ 58 | "nixpkgs=/etc/nix/flake-channels/nixpkgs" 59 | "home-manager=/etc/nix/flake-channels/home-manager" 60 | ]; 61 | 62 | settings = { 63 | auto-optimise-store = true; 64 | 65 | substituters = [ 66 | "https://nix-community.cachix.org" 67 | ]; 68 | trusted-public-keys = [ 69 | "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" 70 | ]; 71 | }; 72 | }; 73 | 74 | nixpkgs = { 75 | pkgs = inputs.self.pkgs.${config.nixpkgs.system}; 76 | config.allowUnfree = true; 77 | }; 78 | 79 | # enable programs 80 | programs.less.enable = true; 81 | programs.command-not-found.enable = false; 82 | 83 | # enable realtime capabilities to user processes 84 | security.rtkit.enable = true; 85 | 86 | security.sudo.wheelNeedsPassword = false; 87 | 88 | # services 89 | services = { 90 | openssh = { 91 | enable = true; 92 | useDns = true; 93 | }; 94 | 95 | resolved.enable = true; 96 | }; 97 | 98 | system.stateVersion = "21.11"; 99 | 100 | time.timeZone = "Asia/Kolkata"; 101 | users.users.astro = { 102 | isNormalUser = true; 103 | shell = pkgs.fish; 104 | extraGroups = ["adbusers" "networkmanager" "docker" "libvirtd" "transmission" "video" "wheel"]; 105 | description = "Astro"; 106 | }; 107 | 108 | zramSwap.enable = true; 109 | zramSwap.algorithm = "zstd"; 110 | 111 | # Speeed 112 | environment.binsh = "${pkgs.dash}/bin/dash"; 113 | } 114 | -------------------------------------------------------------------------------- /modules/school.nix: -------------------------------------------------------------------------------- 1 | { 2 | users.users.astro.extraGroups = ["vboxusers"]; 3 | 4 | virtualisation.virtualbox.host.enable = true; 5 | } 6 | -------------------------------------------------------------------------------- /modules/security.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | ... 5 | }: 6 | # security tweaks borrowed from @hlissner 7 | { 8 | ## System security tweaks 9 | # Prevent replacing the running kernel w/o reboot 10 | # Also prevents hibernation 11 | #security.protectKernelImage = true; 12 | 13 | # tmpfs = /tmp is mounted in ram. Doing so makes temp file management speedy 14 | # on ssd systems, and volatile! Because it's wiped on reboot. 15 | boot.tmpOnTmpfs = lib.mkDefault true; 16 | # If not using tmpfs, which is naturally purged on reboot, we must clean it 17 | # /tmp ourselves. /tmp should be volatile storage! 18 | boot.cleanTmpDir = lib.mkDefault (!config.boot.tmpOnTmpfs); 19 | 20 | # Fix a security hole in place for backwards compatibility. See desc in 21 | # nixpkgs/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix 22 | boot.loader.systemd-boot.editor = false; 23 | 24 | boot.kernel.sysctl = { 25 | # The Magic SysRq key is a key combo that allows users connected to the 26 | # system console of a Linux kernel to perform some low-level commands. 27 | # Disable it, since we don't need it, and is a potential security concern. 28 | "kernel.sysrq" = 0; 29 | 30 | ## TCP hardening 31 | # Prevent bogus ICMP errors from filling up logs. 32 | "net.ipv4.icmp_ignore_bogus_error_responses" = 1; 33 | # Reverse path filtering causes the kernel to do source validation of 34 | # packets received from all interfaces. This can mitigate IP spoofing. 35 | "net.ipv4.conf.default.rp_filter" = 1; 36 | "net.ipv4.conf.all.rp_filter" = 1; 37 | # Do not accept IP source route packets (we're not a router) 38 | "net.ipv4.conf.all.accept_source_route" = 0; 39 | "net.ipv6.conf.all.accept_source_route" = 0; 40 | # Don't send ICMP redirects (again, we're on a router) 41 | "net.ipv4.conf.all.send_redirects" = 0; 42 | "net.ipv4.conf.default.send_redirects" = 0; 43 | # Refuse ICMP redirects (MITM mitigations) 44 | "net.ipv4.conf.all.accept_redirects" = 0; 45 | "net.ipv4.conf.default.accept_redirects" = 0; 46 | "net.ipv4.conf.all.secure_redirects" = 0; 47 | "net.ipv4.conf.default.secure_redirects" = 0; 48 | "net.ipv6.conf.all.accept_redirects" = 0; 49 | "net.ipv6.conf.default.accept_redirects" = 0; 50 | # Protects against SYN flood attacks 51 | "net.ipv4.tcp_syncookies" = 1; 52 | # Incomplete protection again TIME-WAIT assassination 53 | "net.ipv4.tcp_rfc1337" = 1; 54 | 55 | ## TCP optimization 56 | # TCP Fast Open is a TCP extension that reduces network latency by packing 57 | # data in the sender’s initial TCP SYN. Setting 3 = enable TCP Fast Open for 58 | # both incoming and outgoing connections: 59 | "net.ipv4.tcp_fastopen" = 3; 60 | # Bufferbloat mitigations + slight improvement in throughput & latency 61 | "net.ipv4.tcp_congestion_control" = "bbr"; 62 | "net.core.default_qdisc" = "cake"; 63 | }; 64 | boot.kernelModules = ["tcp_bbr"]; 65 | 66 | # So we don't have to do this later... 67 | security.acme.acceptTerms = true; 68 | } 69 | -------------------------------------------------------------------------------- /pkgs/default.nix: -------------------------------------------------------------------------------- 1 | inputs: final: prev: { 2 | plymouth-theme = prev.callPackage ./plymouth-themes {}; 3 | 4 | gdb-frontend = prev.callPackage ./gdb-frontend {}; 5 | # instant repl with automatic flake loading 6 | repl = prev.callPackage ./repl {}; 7 | 8 | discord-openasar = prev.callPackage ./discord rec { 9 | inherit (prev.discord) pname; 10 | version = "0.0.21"; 11 | src = prev.fetchurl { 12 | url = "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz"; 13 | sha256 = "sha256-KDKUssPRrs/D10s5GhJ23hctatQmyqd27xS9nU7iNaM="; 14 | }; 15 | 16 | openasar = prev.callPackage "${inputs.nixpkgs}/pkgs/applications/networking/instant-messengers/discord/openasar.nix" {}; 17 | binaryName = "Discord"; 18 | desktopName = "Discord"; 19 | 20 | webRTC = true; 21 | enableVulkan = true; 22 | 23 | extraOptions = [ 24 | "--disable-gpu-memory-buffer-video-frames" 25 | "--enable-accelerated-mjpeg-decode" 26 | "--enable-accelerated-video" 27 | "--enable-gpu-rasterization" 28 | "--enable-native-gpu-memory-buffers" 29 | "--enable-zero-copy" 30 | "--ignore-gpu-blocklist" 31 | ]; 32 | }; 33 | 34 | # sway-borders = prev.callPackage ./sway-borders {}; 35 | } 36 | -------------------------------------------------------------------------------- /pkgs/discord/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pname, 3 | version, 4 | src, 5 | binaryName, 6 | desktopName, 7 | webRTC ? false, 8 | enableVulkan ? false, 9 | extraOptions ? [], 10 | autoPatchelfHook, 11 | makeDesktopItem, 12 | lib, 13 | stdenv, 14 | wrapGAppsHook, 15 | alsa-lib, 16 | at-spi2-atk, 17 | at-spi2-core, 18 | atk, 19 | cairo, 20 | cups, 21 | dbus, 22 | electron, 23 | expat, 24 | fontconfig, 25 | freetype, 26 | gdk-pixbuf, 27 | glib, 28 | gtk3, 29 | libcxx, 30 | libdrm, 31 | libnotify, 32 | libpulseaudio, 33 | libuuid, 34 | libX11, 35 | libXScrnSaver, 36 | libXcomposite, 37 | libXcursor, 38 | libXdamage, 39 | libXext, 40 | libXfixes, 41 | libXi, 42 | libXrandr, 43 | libXrender, 44 | libXtst, 45 | libxcb, 46 | libxshmfence, 47 | mesa, 48 | nspr, 49 | nss, 50 | openasar, 51 | pango, 52 | systemd, 53 | libappindicator-gtk3, 54 | libdbusmenu, 55 | vulkan-loader, 56 | vulkan-extension-layer, 57 | makeShellWrapper, 58 | }: let 59 | inherit binaryName; 60 | in 61 | stdenv.mkDerivation rec { 62 | inherit pname version src; 63 | 64 | nativeBuildInputs = [ 65 | alsa-lib 66 | autoPatchelfHook 67 | cups 68 | libdrm 69 | libuuid 70 | libXdamage 71 | libX11 72 | libXScrnSaver 73 | libXtst 74 | libxcb 75 | libxshmfence 76 | mesa 77 | nss 78 | wrapGAppsHook 79 | makeShellWrapper 80 | ]; 81 | 82 | dontWrapGApps = true; 83 | 84 | libPath = lib.makeLibraryPath [ 85 | libcxx 86 | systemd 87 | libpulseaudio 88 | libdrm 89 | mesa 90 | stdenv.cc.cc 91 | alsa-lib 92 | atk 93 | at-spi2-atk 94 | at-spi2-core 95 | cairo 96 | cups 97 | dbus 98 | expat 99 | fontconfig 100 | freetype 101 | gdk-pixbuf 102 | glib 103 | gtk3 104 | libnotify 105 | libX11 106 | libXcomposite 107 | libuuid 108 | libXcursor 109 | libXdamage 110 | libXext 111 | libXfixes 112 | libXi 113 | libXrandr 114 | libXrender 115 | libXtst 116 | nspr 117 | nss 118 | libxcb 119 | pango 120 | libXScrnSaver 121 | libappindicator-gtk3 122 | libdbusmenu 123 | vulkan-loader 124 | vulkan-extension-layer 125 | ]; 126 | 127 | flags = 128 | ( 129 | lib.optionals webRTC [ 130 | "--flag-switches-begin" 131 | "--enable-features=WebRTCPipeWireCapturer${lib.optionalString enableVulkan ",Vulkan"}" 132 | "--flag-switches-end" 133 | "--enable-webrtc-pipewire-capturer" 134 | ] 135 | ) 136 | ++ extraOptions; 137 | 138 | installPhase = '' 139 | runHook preInstall 140 | mkdir -p $out/{bin,opt/${binaryName},share/pixmaps,share/icons/hicolor/256x256/apps} 141 | mv * $out/opt/${binaryName} 142 | chmod +x $out/opt/${binaryName}/${binaryName} 143 | patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \ 144 | $out/opt/${binaryName}/${binaryName} 145 | wrapProgramShell $out/opt/${binaryName}/${binaryName} \ 146 | "''${gappsWrapperArgs[@]}" \ 147 | --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}" \ 148 | --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \ 149 | --prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/${binaryName} 150 | ln -s $out/opt/${binaryName}/${binaryName} $out/bin/ 151 | # Without || true the install would fail on case-insensitive filesystems 152 | ln -s $out/opt/${binaryName}/${binaryName} $out/bin/${ 153 | lib.strings.toLower binaryName 154 | } || true 155 | ln -s $out/opt/${binaryName}/discord.png $out/share/pixmaps/${pname}.png 156 | ln -s $out/opt/${binaryName}/discord.png $out/share/icons/hicolor/256x256/apps/${pname}.png 157 | ln -s "${desktopItem}/share/applications" $out/share/ 158 | runHook postInstall 159 | ''; 160 | 161 | postInstall = '' 162 | cp -f ${openasar} $out/opt/${binaryName}/resources/app.asar 163 | # Create starter script for discord 164 | echo "#!${stdenv.shell}" > $out/bin/${binaryName} 165 | echo "exec ${electron}/bin/electron ${lib.concatStringsSep " " flags} $out/opt/${binaryName}/resources/app.asar \$@" >> $out/bin/${binaryName} 166 | chmod 755 $out/bin/${binaryName} 167 | wrapProgram $out/bin/${binaryName} \ 168 | "''${gappsWrapperArgs[@]}" \ 169 | --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}" \ 170 | --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \ 171 | --prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/${pname} 172 | ''; 173 | 174 | desktopItem = makeDesktopItem { 175 | name = pname; 176 | exec = binaryName; 177 | icon = pname; 178 | inherit desktopName; 179 | genericName = meta.description; 180 | categories = ["Network" "InstantMessaging"]; 181 | mimeTypes = ["x-scheme-handler/discord"]; 182 | }; 183 | 184 | meta = with lib; { 185 | description = "All-in-one cross-platform voice and text chat for gamers, built with latest Electron"; 186 | homepage = "https://discordapp.com/"; 187 | downloadPage = "https://discordapp.com/download"; 188 | platforms = ["x86_64-linux"]; 189 | }; 190 | } 191 | -------------------------------------------------------------------------------- /pkgs/gdb-frontend/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | bash, 4 | stdenv, 5 | fetchFromGitHub, 6 | python3, 7 | gdb, 8 | tmux, 9 | writeShellScript, 10 | }: 11 | stdenv.mkDerivation rec { 12 | pname = "gdb-frontend"; 13 | version = "0.10.3-beta"; 14 | 15 | src = fetchFromGitHub { 16 | repo = pname; 17 | owner = "rohanrhu"; 18 | rev = "v${version}"; 19 | sha256 = "sha256-+l1SguRKnLDqT4rgXcod9xhiCOJZEKdZlOZfTNzP7fk="; 20 | }; 21 | 22 | buildInputs = [gdb python3 tmux]; 23 | propagatedUserEnvPkgs = [gdb python3 tmux]; 24 | 25 | dontConfigure = true; 26 | dontBuild = true; 27 | 28 | installPhase = '' 29 | mkdir -p $out/bin 30 | cp -r . $out 31 | echo "${python3}/bin/python $out/run.py \"\$@\"" > $out/bin/gdbfrontend 32 | chmod +x $out/bin/gdbfrontend 33 | ''; 34 | 35 | postPatch = '' 36 | substituteInPlace "run.py" \ 37 | --replace "/bin/bash" "${bash}/bin/bash" 38 | substituteInPlace "gdbfrontend-window" \ 39 | --replace "/bin/bash" "${bash}/bin/bash" 40 | substituteInPlace "build_gdb.sh" \ 41 | --replace "/bin/bash\n" "${bash}/bin/bash\n" 42 | substituteInPlace "url_modules/api/shell.py" \ 43 | --replace "/bin/bash" "${bash}/bin/bash" 44 | substituteInPlace "commands/gdbfrontend" \ 45 | --replace "/bin/bash" "${bash}/bin/bash" 46 | ''; 47 | 48 | meta = with lib; { 49 | description = "GDBFrontend is an easy, flexible and extensionable gui debugger"; 50 | homepage = "https://github.com/rohanrhu/gdb-frontend"; 51 | mainProgram = "gdbfrontend"; 52 | platforms = platforms.linux; 53 | maintainers = with maintainers; [fufexan]; 54 | }; 55 | } 56 | -------------------------------------------------------------------------------- /pkgs/patches/xwayland-hidpi.patch: -------------------------------------------------------------------------------- 1 | diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c 2 | index e3c1aaa50..1c1cef853 100644 3 | --- a/hw/xwayland/xwayland-cursor.c 4 | +++ b/hw/xwayland/xwayland-cursor.c 5 | @@ -164,6 +164,8 @@ xwl_cursor_attach_pixmap(struct xwl_seat *xwl_seat, 6 | } 7 | 8 | wl_surface_attach(xwl_cursor->surface, buffer, 0, 0); 9 | + wl_surface_set_buffer_scale(xwl_cursor->surface, 10 | + xwl_seat->xwl_screen->global_output_scale); 11 | xwl_surface_damage(xwl_seat->xwl_screen, xwl_cursor->surface, 0, 0, 12 | xwl_seat->x_cursor->bits->width, 13 | xwl_seat->x_cursor->bits->height); 14 | @@ -195,6 +197,7 @@ xwl_cursor_clear_frame_cb(struct xwl_cursor *xwl_cursor) 15 | void 16 | xwl_seat_set_cursor(struct xwl_seat *xwl_seat) 17 | { 18 | + struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; 19 | struct xwl_cursor *xwl_cursor = &xwl_seat->cursor; 20 | PixmapPtr pixmap; 21 | CursorPtr cursor; 22 | @@ -225,8 +228,8 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) 23 | wl_pointer_set_cursor(xwl_seat->wl_pointer, 24 | xwl_seat->pointer_enter_serial, 25 | xwl_cursor->surface, 26 | - xwl_seat->x_cursor->bits->xhot, 27 | - xwl_seat->x_cursor->bits->yhot); 28 | + xwl_scale_to(xwl_screen, xwl_seat->x_cursor->bits->xhot), 29 | + xwl_scale_to(xwl_screen, xwl_seat->x_cursor->bits->yhot)); 30 | 31 | xwl_cursor_attach_pixmap(xwl_seat, xwl_cursor, pixmap); 32 | } 33 | @@ -235,6 +238,7 @@ void 34 | xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool) 35 | { 36 | struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; 37 | + struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; 38 | struct xwl_cursor *xwl_cursor = &xwl_tablet_tool->cursor; 39 | PixmapPtr pixmap; 40 | CursorPtr cursor; 41 | @@ -263,9 +267,9 @@ xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool) 42 | zwp_tablet_tool_v2_set_cursor(xwl_tablet_tool->tool, 43 | xwl_tablet_tool->proximity_in_serial, 44 | xwl_cursor->surface, 45 | - xwl_seat->x_cursor->bits->xhot, 46 | - xwl_seat->x_cursor->bits->yhot); 47 | - 48 | + xwl_scale_to(xwl_screen, xwl_seat->x_cursor->bits->xhot), 49 | + xwl_scale_to(xwl_screen, xwl_seat->x_cursor->bits->yhot)); 50 | + wl_surface_set_buffer_scale(xwl_cursor->surface, xwl_screen->global_output_scale); 51 | xwl_cursor_attach_pixmap(xwl_seat, xwl_cursor, pixmap); 52 | } 53 | 54 | diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c 55 | index 672647f71..37ea93ce6 100644 56 | --- a/hw/xwayland/xwayland-input.c 57 | +++ b/hw/xwayland/xwayland-input.c 58 | @@ -458,8 +458,8 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer, 59 | DeviceIntPtr dev = get_pointer_device(xwl_seat); 60 | DeviceIntPtr master; 61 | int i; 62 | - int sx = wl_fixed_to_int(sx_w); 63 | - int sy = wl_fixed_to_int(sy_w); 64 | + int sx = wl_fixed_to_int(sx_w) * xwl_seat->xwl_screen->global_output_scale; 65 | + int sy = wl_fixed_to_int(sy_w) * xwl_seat->xwl_screen->global_output_scale; 66 | int dx, dy; 67 | ScreenPtr pScreen = xwl_seat->xwl_screen->screen; 68 | ValuatorMask mask; 69 | @@ -635,13 +635,14 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer, 70 | uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w) 71 | { 72 | struct xwl_seat *xwl_seat = data; 73 | + int32_t scale = xwl_seat->xwl_screen->global_output_scale; 74 | 75 | if (!xwl_seat->focus_window) 76 | return; 77 | 78 | xwl_seat->pending_pointer_event.has_absolute = TRUE; 79 | - xwl_seat->pending_pointer_event.x = sx_w; 80 | - xwl_seat->pending_pointer_event.y = sy_w; 81 | + xwl_seat->pending_pointer_event.x = sx_w * scale; 82 | + xwl_seat->pending_pointer_event.y = sy_w * scale; 83 | 84 | if (wl_proxy_get_version((struct wl_proxy *) xwl_seat->wl_pointer) < 5) 85 | dispatch_pointer_motion_event(xwl_seat); 86 | @@ -715,7 +716,8 @@ pointer_handle_axis(void *data, struct wl_pointer *pointer, 87 | xorg_list_del(&pending->l); 88 | free(pending); 89 | } else { 90 | - valuator_mask_set_double(&mask, index, wl_fixed_to_double(value) / divisor); 91 | + double scaled_value = wl_fixed_to_double(value); 92 | + valuator_mask_set_double(&mask, index, scaled_value / divisor); 93 | } 94 | 95 | QueuePointerEvents(get_pointer_device(xwl_seat), 96 | @@ -783,12 +785,13 @@ relative_pointer_handle_relative_motion(void *data, 97 | wl_fixed_t dy_unaccelf) 98 | { 99 | struct xwl_seat *xwl_seat = data; 100 | + int32_t scale = xwl_seat->xwl_screen->global_output_scale; 101 | 102 | xwl_seat->pending_pointer_event.has_relative = TRUE; 103 | - xwl_seat->pending_pointer_event.dx = wl_fixed_to_double(dxf); 104 | - xwl_seat->pending_pointer_event.dy = wl_fixed_to_double(dyf); 105 | - xwl_seat->pending_pointer_event.dx_unaccel = wl_fixed_to_double(dx_unaccelf); 106 | - xwl_seat->pending_pointer_event.dy_unaccel = wl_fixed_to_double(dy_unaccelf); 107 | + xwl_seat->pending_pointer_event.dx = wl_fixed_to_double(dxf) * scale; 108 | + xwl_seat->pending_pointer_event.dy = wl_fixed_to_double(dyf) * scale; 109 | + xwl_seat->pending_pointer_event.dx_unaccel = wl_fixed_to_double(dx_unaccelf) * scale; 110 | + xwl_seat->pending_pointer_event.dy_unaccel = wl_fixed_to_double(dy_unaccelf) * scale; 111 | 112 | if (!xwl_seat->focus_window) 113 | return; 114 | @@ -1226,8 +1229,8 @@ touch_handle_down(void *data, struct wl_touch *wl_touch, 115 | 116 | xwl_touch->window = wl_surface_get_user_data(surface); 117 | xwl_touch->id = id; 118 | - xwl_touch->x = wl_fixed_to_int(sx_w); 119 | - xwl_touch->y = wl_fixed_to_int(sy_w); 120 | + xwl_touch->x = wl_fixed_to_int(sx_w) * xwl_seat->xwl_screen->global_output_scale; 121 | + xwl_touch->y = wl_fixed_to_int(sy_w) * xwl_seat->xwl_screen->global_output_scale; 122 | xorg_list_add(&xwl_touch->link_touch, &xwl_seat->touches); 123 | 124 | xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchBegin); 125 | @@ -1263,8 +1266,8 @@ touch_handle_motion(void *data, struct wl_touch *wl_touch, 126 | if (!xwl_touch) 127 | return; 128 | 129 | - xwl_touch->x = wl_fixed_to_int(sx_w); 130 | - xwl_touch->y = wl_fixed_to_int(sy_w); 131 | + xwl_touch->x = wl_fixed_to_int(sx_w) * xwl_seat->xwl_screen->global_output_scale;; 132 | + xwl_touch->y = wl_fixed_to_int(sy_w) * xwl_seat->xwl_screen->global_output_scale;; 133 | xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchUpdate); 134 | } 135 | 136 | @@ -1957,8 +1960,8 @@ tablet_tool_motion(void *data, struct zwp_tablet_tool_v2 *tool, 137 | struct xwl_tablet_tool *xwl_tablet_tool = data; 138 | struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; 139 | int32_t dx, dy; 140 | - double sx = wl_fixed_to_double(x); 141 | - double sy = wl_fixed_to_double(y); 142 | + double sx = wl_fixed_to_double(x) * xwl_seat->xwl_screen->global_output_scale; 143 | + double sy = wl_fixed_to_double(y) * xwl_seat->xwl_screen->global_output_scale; 144 | 145 | if (!xwl_seat->tablet_focus_window) 146 | return; 147 | @@ -2987,6 +2990,7 @@ xwl_pointer_warp_emulator_set_fake_pos(struct xwl_pointer_warp_emulator *warp_em 148 | int x, 149 | int y) 150 | { 151 | + struct xwl_screen *xwl_screen; 152 | struct zwp_locked_pointer_v1 *locked_pointer = 153 | warp_emulator->locked_pointer; 154 | WindowPtr window; 155 | @@ -2998,6 +3002,7 @@ xwl_pointer_warp_emulator_set_fake_pos(struct xwl_pointer_warp_emulator *warp_em 156 | if (!warp_emulator->xwl_seat->focus_window) 157 | return; 158 | 159 | + xwl_screen = warp_emulator->xwl_seat->xwl_screen; 160 | window = warp_emulator->xwl_seat->focus_window->window; 161 | if (x >= window->drawable.x || 162 | y >= window->drawable.y || 163 | @@ -3006,8 +3011,8 @@ xwl_pointer_warp_emulator_set_fake_pos(struct xwl_pointer_warp_emulator *warp_em 164 | sx = x - window->drawable.x; 165 | sy = y - window->drawable.y; 166 | zwp_locked_pointer_v1_set_cursor_position_hint(locked_pointer, 167 | - wl_fixed_from_int(sx), 168 | - wl_fixed_from_int(sy)); 169 | + wl_fixed_from_int(xwl_scale_to(xwl_screen, sx)), 170 | + wl_fixed_from_int(xwl_scale_to(xwl_screen, sy))); 171 | wl_surface_commit(warp_emulator->xwl_seat->focus_window->surface); 172 | } 173 | } 174 | diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c 175 | index 3ad8adc8b..010ccfeeb 100644 176 | --- a/hw/xwayland/xwayland-output.c 177 | +++ b/hw/xwayland/xwayland-output.c 178 | @@ -184,6 +184,9 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height) 179 | { 180 | struct xwl_screen *xwl_screen = xwl_output->xwl_screen; 181 | 182 | + width *= xwl_screen->global_output_scale; 183 | + height *= xwl_screen->global_output_scale; 184 | + 185 | if (xwl_screen->root_clip_mode == ROOT_CLIP_FULL) 186 | SetRootClip(xwl_screen->screen, ROOT_CLIP_NONE); 187 | 188 | @@ -584,14 +587,15 @@ xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, 189 | new_emulated_height); 190 | } 191 | 192 | -static void 193 | -apply_output_change(struct xwl_output *xwl_output) 194 | +void 195 | +xwl_output_apply_changes(struct xwl_output *xwl_output) 196 | { 197 | struct xwl_screen *xwl_screen = xwl_output->xwl_screen; 198 | struct xwl_output *it; 199 | int mode_width, mode_height, count; 200 | int width = 0, height = 0, has_this_output = 0; 201 | RRModePtr *randr_modes; 202 | + int32_t scale = xwl_screen->global_output_scale; 203 | 204 | /* Clear out the "done" received flags */ 205 | xwl_output->wl_output_done = FALSE; 206 | @@ -610,10 +614,10 @@ apply_output_change(struct xwl_output *xwl_output) 207 | } 208 | 209 | /* Build a fresh modes array using the current refresh rate */ 210 | - randr_modes = output_get_rr_modes(xwl_output, mode_width, mode_height, &count); 211 | + randr_modes = output_get_rr_modes(xwl_output, mode_width * scale, mode_height * scale, &count); 212 | RROutputSetModes(xwl_output->randr_output, randr_modes, count, 1); 213 | RRCrtcNotify(xwl_output->randr_crtc, randr_modes[0], 214 | - xwl_output->x, xwl_output->y, 215 | + xwl_output->x * scale, xwl_output->y * scale, 216 | xwl_output->rotation, NULL, 1, &xwl_output->randr_output); 217 | /* RROutputSetModes takes ownership of the passed in modes, so we only 218 | * have to free the pointer array. 219 | @@ -654,7 +658,7 @@ output_handle_done(void *data, struct wl_output *wl_output) 220 | */ 221 | if (xwl_output->xdg_output_done || !xwl_output->xdg_output || 222 | zxdg_output_v1_get_version(xwl_output->xdg_output) >= 3) 223 | - apply_output_change(xwl_output); 224 | + xwl_output_apply_changes(xwl_output); 225 | } 226 | 227 | static void 228 | @@ -697,7 +701,7 @@ xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output) 229 | xwl_output->xdg_output_done = TRUE; 230 | if (xwl_output->wl_output_done && 231 | zxdg_output_v1_get_version(xdg_output) < 3) 232 | - apply_output_change(xwl_output); 233 | + xwl_output_apply_changes(xwl_output); 234 | } 235 | 236 | static void 237 | @@ -786,6 +790,8 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id) 238 | RROutputSetConnection(xwl_output->randr_output, RR_Connected); 239 | RRTellChanged(xwl_screen->screen); 240 | 241 | + xwl_output->scale = 1; 242 | + 243 | /* We want the output to be in the list as soon as created so we can 244 | * use it when binding to the xdg-output protocol... 245 | */ 246 | diff --git a/hw/xwayland/xwayland-output.h b/hw/xwayland/xwayland-output.h 247 | index 74a46994f..42ee71f55 100644 248 | --- a/hw/xwayland/xwayland-output.h 249 | +++ b/hw/xwayland/xwayland-output.h 250 | @@ -53,7 +53,7 @@ struct xwl_output { 251 | struct wl_output *output; 252 | struct zxdg_output_v1 *xdg_output; 253 | uint32_t server_output_id; 254 | - int32_t x, y, width, height, refresh; 255 | + int32_t x, y, width, height, refresh, scale; 256 | Rotation rotation; 257 | Bool wl_output_done; 258 | Bool xdg_output_done; 259 | @@ -92,6 +92,8 @@ void xwl_output_set_emulated_mode(struct xwl_output *xwl_output, 260 | void xwl_output_set_window_randr_emu_props(struct xwl_screen *xwl_screen, 261 | WindowPtr window); 262 | 263 | +void xwl_output_apply_changes(struct xwl_output *xwl_output); 264 | + 265 | void xwl_screen_init_xdg_output(struct xwl_screen *xwl_screen); 266 | 267 | int xwl_get_next_output_serial(void); 268 | diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c 269 | index ce74482ef..93260b230 100644 270 | --- a/hw/xwayland/xwayland-present.c 271 | +++ b/hw/xwayland/xwayland-present.c 272 | @@ -702,6 +702,8 @@ xwl_present_flip(WindowPtr present_window, 273 | 274 | /* We can flip directly to the main surface (full screen window without clips) */ 275 | wl_surface_attach(xwl_window->surface, buffer, 0, 0); 276 | + wl_surface_set_buffer_scale(xwl_window->surface, 277 | + xwl_window->xwl_screen->global_output_scale); 278 | 279 | if (xorg_list_is_empty(&xwl_present_window->frame_callback_list)) { 280 | xorg_list_add(&xwl_present_window->frame_callback_list, 281 | diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c 282 | index 5c8b388f0..6f117c332 100644 283 | --- a/hw/xwayland/xwayland-screen.c 284 | +++ b/hw/xwayland/xwayland-screen.c 285 | @@ -51,6 +51,7 @@ 286 | #include "xwayland-pixmap.h" 287 | #include "xwayland-present.h" 288 | #include "xwayland-shm.h" 289 | +#include "xwayland-window-buffers.h" 290 | 291 | #ifdef MITSHM 292 | #include "shmint.h" 293 | @@ -110,6 +111,12 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) 294 | return xwl_screen->rootless && xwl_screen_has_viewport_support(xwl_screen); 295 | } 296 | 297 | +int 298 | +xwl_scale_to(struct xwl_screen *xwl_screen, int value) 299 | +{ 300 | + return value / (double)xwl_screen->global_output_scale + 0.5; 301 | +} 302 | + 303 | /* Return the output @ 0x0, falling back to the first output in the list */ 304 | struct xwl_output * 305 | xwl_screen_get_first_output(struct xwl_screen *xwl_screen) 306 | @@ -127,6 +134,37 @@ xwl_screen_get_first_output(struct xwl_screen *xwl_screen) 307 | return xorg_list_first_entry(&xwl_screen->output_list, struct xwl_output, link); 308 | } 309 | 310 | +static void 311 | +xwl_screen_set_global_scale_from_property(struct xwl_screen *screen, 312 | + PropertyPtr prop) 313 | +{ 314 | + CARD32 *propdata; 315 | + 316 | + if (prop->type != XA_CARDINAL || prop->format != 32 || prop->size != 1) { 317 | + // TODO: handle warnings more cleanly. 318 | + LogMessageVerb(X_WARNING, 0, "Bad value for property %s.\n", 319 | + NameForAtom(prop->propertyName)); 320 | + return; 321 | + } 322 | + 323 | + propdata = prop->data; 324 | + xwl_screen_set_global_scale(screen, propdata[0]); 325 | +} 326 | + 327 | +static void 328 | +xwl_screen_update_property(struct xwl_screen *screen, 329 | + PropertyStateRec *propstate) 330 | +{ 331 | + switch (propstate->state) { 332 | + case PropertyNewValue: 333 | + xwl_screen_set_global_scale_from_property(screen, propstate->prop); 334 | + break; 335 | + case PropertyDelete: 336 | + xwl_screen_set_global_scale(screen, 1); 337 | + break; 338 | + } 339 | +} 340 | + 341 | static void 342 | xwl_property_callback(CallbackListPtr *pcbl, void *closure, 343 | void *calldata) 344 | @@ -134,19 +172,24 @@ xwl_property_callback(CallbackListPtr *pcbl, void *closure, 345 | ScreenPtr screen = closure; 346 | PropertyStateRec *rec = calldata; 347 | struct xwl_screen *xwl_screen; 348 | - struct xwl_window *xwl_window; 349 | 350 | if (rec->win->drawable.pScreen != screen) 351 | return; 352 | 353 | - xwl_window = xwl_window_get(rec->win); 354 | - if (!xwl_window) 355 | - return; 356 | - 357 | xwl_screen = xwl_screen_get(screen); 358 | 359 | - if (rec->prop->propertyName == xwl_screen->allow_commits_prop) 360 | + if (rec->prop->propertyName == xwl_screen->allow_commits_prop) { 361 | + struct xwl_window *xwl_window; 362 | + 363 | + xwl_window = xwl_window_get(rec->win); 364 | + if (!xwl_window) 365 | + return; 366 | + 367 | xwl_window_update_property(xwl_window, rec); 368 | + } 369 | + else if (rec->prop->propertyName == xwl_screen->global_output_scale_prop) { 370 | + xwl_screen_update_property(xwl_screen, rec); 371 | + } 372 | } 373 | 374 | static void 375 | @@ -563,8 +606,14 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen, 376 | { 377 | if (wl_surface_get_version(surface) >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION) 378 | wl_surface_damage_buffer(surface, x, y, width, height); 379 | - else 380 | + else { 381 | + x = xwl_scale_to(xwl_screen, x); 382 | + y = xwl_scale_to(xwl_screen, y); 383 | + width = xwl_scale_to(xwl_screen, width); 384 | + height = xwl_scale_to(xwl_screen, height); 385 | + 386 | wl_surface_damage(surface, x, y, width, height); 387 | + } 388 | } 389 | 390 | void 391 | @@ -580,10 +629,34 @@ xwl_screen_roundtrip(struct xwl_screen *xwl_screen) 392 | xwl_give_up("could not connect to wayland server\n"); 393 | } 394 | 395 | +void 396 | +xwl_screen_set_global_scale(struct xwl_screen *xwl_screen, int32_t scale) 397 | +{ 398 | + struct xwl_output *it; 399 | + struct xwl_window *xwl_window; 400 | + 401 | + xwl_screen->global_output_scale = scale; 402 | + 403 | + /* change randr resolutions and positions */ 404 | + xorg_list_for_each_entry(it, &xwl_screen->output_list, link) { 405 | + xwl_output_apply_changes(it); 406 | + } 407 | + 408 | + if (!xwl_screen->rootless && xwl_screen->screen->root) { 409 | + /* Clear all the buffers, so that they'll be remade with the new sizes 410 | + * (this doesn't occur automatically because as far as Xorg is 411 | + * concerned, the window's size is the same) */ 412 | + xorg_list_for_each_entry(xwl_window, &xwl_screen->window_list, link_window) { 413 | + xwl_window_buffers_recycle(xwl_window); 414 | + } 415 | + } 416 | +} 417 | + 418 | Bool 419 | xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) 420 | { 421 | static const char allow_commits[] = "_XWAYLAND_ALLOW_COMMITS"; 422 | + static const char global_output_scale[] = "_XWAYLAND_GLOBAL_OUTPUT_SCALE"; 423 | struct xwl_screen *xwl_screen; 424 | Pixel red_mask, blue_mask, green_mask; 425 | int ret, bpc, green_bpc, i; 426 | @@ -615,6 +688,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) 427 | #ifdef XWL_HAS_GLAMOR 428 | xwl_screen->glamor = 1; 429 | #endif 430 | + xwl_screen->global_output_scale = 1; 431 | 432 | for (i = 1; i < argc; i++) { 433 | if (strcmp(argv[i], "-rootless") == 0) { 434 | @@ -788,6 +862,12 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) 435 | if (xwl_screen->allow_commits_prop == BAD_RESOURCE) 436 | return FALSE; 437 | 438 | + xwl_screen->global_output_scale_prop = MakeAtom(global_output_scale, 439 | + strlen(global_output_scale), 440 | + TRUE); 441 | + if (xwl_screen->global_output_scale_prop == BAD_RESOURCE) 442 | + return FALSE; 443 | + 444 | AddCallback(&PropertyStateCallback, xwl_property_callback, pScreen); 445 | AddCallback(&RootWindowFinalizeCallback, xwl_root_window_finalized_callback, pScreen); 446 | 447 | diff --git a/hw/xwayland/xwayland-screen.h b/hw/xwayland/xwayland-screen.h 448 | index f04d431c7..bb7d51001 100644 449 | --- a/hw/xwayland/xwayland-screen.h 450 | +++ b/hw/xwayland/xwayland-screen.h 451 | @@ -73,6 +73,8 @@ struct xwl_screen { 452 | struct xorg_list damage_window_list; 453 | struct xorg_list window_list; 454 | 455 | + int32_t global_output_scale; 456 | + 457 | int wayland_fd; 458 | struct wl_display *display; 459 | struct wl_registry *registry; 460 | @@ -112,6 +114,7 @@ struct xwl_screen { 461 | struct glamor_context *glamor_ctx; 462 | 463 | Atom allow_commits_prop; 464 | + Atom global_output_scale_prop; 465 | 466 | /* The preferred GLVND vendor. If NULL, "mesa" is assumed. */ 467 | const char *glvnd_vendor; 468 | @@ -139,5 +142,7 @@ void xwl_screen_roundtrip (struct xwl_screen *xwl_screen); 469 | void xwl_surface_damage(struct xwl_screen *xwl_screen, 470 | struct wl_surface *surface, 471 | int32_t x, int32_t y, int32_t width, int32_t height); 472 | +int xwl_scale_to(struct xwl_screen *xwl_screen, int value); 473 | +void xwl_screen_set_global_scale(struct xwl_screen *xwl_screen, int32_t scale); 474 | 475 | #endif /* XWAYLAND_SCREEN_H */ 476 | diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c 477 | index 41061e344..79ef34f88 100644 478 | --- a/hw/xwayland/xwayland-window.c 479 | +++ b/hw/xwayland/xwayland-window.c 480 | @@ -470,7 +470,8 @@ ensure_surface_for_window(WindowPtr window) 481 | } 482 | 483 | wl_region_add(region, 0, 0, 484 | - window->drawable.width, window->drawable.height); 485 | + xwl_scale_to(xwl_screen, window->drawable.width), 486 | + xwl_scale_to(xwl_screen, window->drawable.height)); 487 | wl_surface_set_opaque_region(xwl_window->surface, region); 488 | wl_region_destroy(region); 489 | } 490 | @@ -841,6 +842,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window) 491 | #endif 492 | 493 | wl_surface_attach(xwl_window->surface, buffer, 0, 0); 494 | + wl_surface_set_buffer_scale(xwl_window->surface, xwl_screen->global_output_scale); 495 | 496 | /* Arbitrary limit to try to avoid flooding the Wayland 497 | * connection. If we flood it too much anyway, this could 498 | -------------------------------------------------------------------------------- /pkgs/patches/xwayland-vsync.patch: -------------------------------------------------------------------------------- 1 | --- a/hw/xwayland/xwayland-present.c 2 | +++ b/hw/xwayland/xwayland-present.c 3 | @@ -824,7 +824,8 @@ 4 | dixDestroyPixmap(vblank->pixmap, vblank->pixmap->drawable.id); 5 | vblank->pixmap = NULL; 6 | 7 | - if (xwl_present_queue_vblank(screen, window, vblank->crtc, 8 | + if (vblank->target_msc > crtc_msc && 9 | + xwl_present_queue_vblank(screen, window, vblank->crtc, 10 | vblank->event_id, crtc_msc + 1) 11 | == Success) 12 | return; 13 | -------------------------------------------------------------------------------- /pkgs/plymouth-themes/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | lib, 4 | fetchFromGitHub, 5 | }: 6 | stdenv.mkDerivation rec { 7 | pname = "adi1090x-plymouth"; 8 | version = "0.0.1"; 9 | 10 | pack = "pack_1"; 11 | theme = "cuts_alt"; 12 | 13 | src = fetchFromGitHub { 14 | owner = "adi1090x"; 15 | repo = "plymouth-themes"; 16 | rev = "bf2f570bee8e84c5c20caac353cbe1d811a4745f"; 17 | sha256 = "sha256-VNGvA8ujwjpC2rTVZKrXni2GjfiZk7AgAn4ZB4Baj2k="; 18 | }; 19 | 20 | phases = ["unpackPhase" "installPhase"]; 21 | 22 | installPhase = '' 23 | mkdir -p $out/share/plymouth/themes 24 | cp -r ${pack}/${theme} $out/share/plymouth/themes 25 | cat ${pack}/${theme}/${theme}.plymouth | sed "s@\/usr\/@$out\/@" > $out/share/plymouth/themes/${theme}/${theme}.plymouth 26 | ''; 27 | } 28 | -------------------------------------------------------------------------------- /pkgs/repl/default.nix: -------------------------------------------------------------------------------- 1 | # modified from https://github.com/gytis-ivaskevicius/flake-utils/plus 2 | { 3 | coreutils, 4 | gnused, 5 | writeShellScriptBin, 6 | }: let 7 | repl = ../../lib/repl.nix; 8 | example = command: desc: ''\n\u001b[33m ${command}\u001b[0m - ${desc}''; 9 | in 10 | writeShellScriptBin "repl" '' 11 | case "$1" in 12 | "-h"|"--help"|"help") 13 | printf "%b\n\e[4mUsage\e[0m: \ 14 | ${example "repl" "Loads system flake if available."} \ 15 | ${example "repl /path/to/flake.nix" "Loads specified flake."}\n" 16 | ;; 17 | *) 18 | if [ -z "$1" ]; then 19 | nix repl ${repl} 20 | else 21 | nix repl --arg flakePath $(${coreutils}/bin/readlink -f $1 | ${gnused}/bin/sed 's|/flake.nix||') ${repl} 22 | fi 23 | ;; 24 | esac 25 | '' 26 | -------------------------------------------------------------------------------- /pkgs/sway-borders/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | stdenv, 4 | ... 5 | }: 6 | stdenv.mkDerivation { 7 | name = "sway-borders"; 8 | version = "1.7"; 9 | 10 | src = pkgs.fetchFromGitHub { 11 | owner = "fluix-dev"; 12 | repo = "sway-borders"; 13 | rev = "3890d2a2fb255276993891e2da5f6cb33670efcd"; 14 | sha256 = "esMruivwq6XPPYJWaW825+d8rD8NOxbJQqVfAeBtXe0="; 15 | }; 16 | 17 | nativeBuildInputs = with pkgs; [ 18 | meson 19 | ninja 20 | pkg-config 21 | wayland 22 | scdoc 23 | ]; 24 | 25 | buildInputs = with pkgs; [ 26 | wayland 27 | libxkbcommon 28 | pcre 29 | json_c 30 | dbus 31 | libevdev 32 | pango 33 | cairo 34 | libinput 35 | libcap 36 | pam 37 | gdk-pixbuf 38 | librsvg 39 | wlroots 40 | wayland-protocols 41 | ]; 42 | 43 | mesonFlags = [ 44 | "-Ddefault-wallpaper=false" 45 | ]; 46 | 47 | meta = with pkgs.lib; { 48 | description = "An i3-compatible tiling Wayland compositor"; 49 | longDescription = '' 50 | Sway is a tiling Wayland compositor and a drop-in replacement for the i3 51 | window manager for X11. It works with your existing i3 configuration and 52 | supports most of i3's features, plus a few extras. 53 | Sway allows you to arrange your application windows logically, rather 54 | than spatially. Windows are arranged into a grid by default which 55 | maximizes the efficiency of your screen and can be quickly manipulated 56 | using only the keyboard. 57 | ''; 58 | homepage = "https://swaywm.org"; 59 | changelog = "https://github.com/swaywm/sway/releases/tag/${version}"; 60 | license = licenses.mit; 61 | platforms = platforms.linux; 62 | maintainers = with maintainers; [primeos synthetica ma27]; 63 | }; 64 | } 65 | -------------------------------------------------------------------------------- /pkgs/waterfox/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pname, 3 | version, 4 | src, 5 | binaryName, 6 | desktopName, 7 | isWayland ? true, 8 | enableVulkan ? true, 9 | extraOptions ? [], 10 | autoPatchelfHook, 11 | makeDesktopItem, 12 | lib, 13 | stdenv, 14 | wrapGAppsHook, 15 | alsa-lib, 16 | at-spi2-atk, 17 | at-spi2-core, 18 | atk, 19 | cairo, 20 | cups, 21 | dbus, 22 | electron_15, 23 | expat, 24 | ffmpeg_5, 25 | fontconfig, 26 | freetype, 27 | gdk-pixbuf, 28 | glib, 29 | gtk3, 30 | libcxx, 31 | libdrm, 32 | libnotify, 33 | libpulseaudio, 34 | libuuid, 35 | libX11, 36 | libXScrnSaver, 37 | libXcomposite, 38 | libXcursor, 39 | libXdamage, 40 | libXext, 41 | libXfixes, 42 | libXi, 43 | libXrandr, 44 | libXrender, 45 | libXtst, 46 | libxcb, 47 | libxshmfence, 48 | mesa, 49 | nspr, 50 | nss, 51 | pango, 52 | systemd, 53 | libappindicator-gtk3, 54 | libdbusmenu, 55 | nodePackages, 56 | vulkan-loader, 57 | vulkan-extension-layer, 58 | writeScript, 59 | common-updater-scripts, 60 | }: let 61 | inherit binaryName; 62 | in 63 | stdenv.mkDerivation rec { 64 | inherit pname version src; 65 | 66 | nativeBuildInputs = [ 67 | nodePackages.asar 68 | alsa-lib 69 | autoPatchelfHook 70 | cups 71 | libdrm 72 | libuuid 73 | libXdamage 74 | libX11 75 | libXScrnSaver 76 | libXtst 77 | libxcb 78 | libxshmfence 79 | mesa 80 | nss 81 | wrapGAppsHook 82 | ]; 83 | 84 | dontWrapGApps = true; 85 | 86 | libPath = lib.makeLibraryPath [ 87 | libcxx 88 | systemd 89 | libpulseaudio 90 | libdrm 91 | mesa 92 | stdenv.cc.cc 93 | alsa-lib 94 | atk 95 | at-spi2-atk 96 | at-spi2-core 97 | cairo 98 | cups 99 | dbus 100 | expat 101 | ffmpeg_5 102 | fontconfig 103 | freetype 104 | gdk-pixbuf 105 | glib 106 | gtk3 107 | libnotify 108 | libX11 109 | libXcomposite 110 | libuuid 111 | libXcursor 112 | libXdamage 113 | libXext 114 | libXfixes 115 | libXi 116 | libXrandr 117 | libXrender 118 | libXtst 119 | nspr 120 | nss 121 | libxcb 122 | pango 123 | systemd 124 | libXScrnSaver 125 | libappindicator-gtk3 126 | libdbusmenu 127 | vulkan-loader 128 | vulkan-extension-layer 129 | ]; 130 | 131 | flags = 132 | ( 133 | lib.optionals isWayland [ 134 | "--flag-switches-begin" 135 | "--enable-features=UseOzonePlatform,WebRTCPipeWireCapturer${lib.optionalString enableVulkan ",Vulkan"}" 136 | "--flag-switches-end" 137 | "--ozone-platform=wayland" 138 | "--enable-webrtc-pipewire-capturer" 139 | ] 140 | ) 141 | ++ extraOptions; 142 | 143 | installPhase = 144 | '' 145 | mkdir -p $out/{bin,usr/lib/${pname},share/pixmaps} 146 | ln -s discord.png $out/share/pixmaps/${pname}.png 147 | ln -s "${desktopItem}/share/applications" $out/share/ 148 | 149 | # HACKS FOR SYSTEM ELECTRON 150 | asar e resources/app.asar resources/app 151 | rm resources/app.asar 152 | sed -i "s|process.resourcesPath|'$out/usr/lib/${pname}'|" resources/app/app_bootstrap/buildInfo.js 153 | sed -i "s|exeDir,|'$out/share/pixmaps',|" resources/app/app_bootstrap/autoStart/linux.js 154 | asar p resources/app resources/app.asar --unpack-dir '**' 155 | rm -rf resources/app 156 | 157 | # Copy Relevant data 158 | cp -r resources/* $out/usr/lib/${pname}/ 159 | mkdir -p $out/opt/${binaryName} 160 | cp -r resources $out/opt/${binaryName}/ 161 | 162 | # Create starter script for discord 163 | echo "#!${stdenv.shell}" > $out/bin/${binaryName} 164 | echo "exec ${electron_15}/bin/electron ${lib.concatStringsSep " " flags} $out/usr/lib/${pname}/app.asar \$@" >> $out/bin/${binaryName} 165 | chmod 755 $out/bin/${binaryName} 166 | '' 167 | + '' 168 | wrapProgram $out/bin/${binaryName} \ 169 | "''${gappsWrapperArgs[@]}" \ 170 | --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \ 171 | --prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/${pname} 172 | ''; 173 | 174 | desktopItem = makeDesktopItem { 175 | name = pname; 176 | exec = binaryName; 177 | icon = pname; 178 | inherit desktopName; 179 | genericName = meta.description; 180 | categories = ["Network" "InstantMessaging"]; 181 | #mimeType = "x-scheme-handler/discord"; 182 | }; 183 | 184 | meta = with lib; { 185 | description = "All-in-one cross-platform voice and text chat for gamers, built with latest Electron"; 186 | homepage = "https://discordapp.com/"; 187 | downloadPage = "https://discordapp.com/download"; 188 | platforms = ["x86_64-linux"]; 189 | }; 190 | } 191 | -------------------------------------------------------------------------------- /pkgs/waterfox/waterfox-bin.nix: -------------------------------------------------------------------------------- 1 | { lib, stdenv, fetchurl, config, wrapGAppsHook 2 | , alsa-lib 3 | , atk 4 | , cairo 5 | , curl 6 | , cups 7 | , dbus-glib 8 | , dbus 9 | , fontconfig 10 | , freetype 11 | , gdk-pixbuf 12 | , glib 13 | , glibc 14 | , gtk2 15 | , gtk3 16 | , libkrb5 17 | , libX11 18 | , libXScrnSaver 19 | , libxcb 20 | , libXcomposite 21 | , libXcursor 22 | , libXdamage 23 | , libXext 24 | , libXfixes 25 | , libXi 26 | , libXinerama 27 | , libXrender 28 | , libXrandr 29 | , libXt 30 | , libXtst 31 | , libcanberra 32 | , libnotify 33 | , adwaita-icon-theme 34 | , libGLU, libGL 35 | , nspr 36 | , nss 37 | , pango 38 | , pipewire 39 | , pciutils 40 | , libheimdal 41 | , libpulseaudio 42 | , systemd 43 | , generated 44 | , writeScript 45 | , writeText 46 | , xidel 47 | , coreutils 48 | , gnused 49 | , gnugrep 50 | , gnupg 51 | , ffmpeg 52 | , runtimeShell 53 | , mesa 54 | , systemLocale ? config.i18n.defaultLocale or "en_US" 55 | }: 56 | 57 | let 58 | 59 | inherit (generated) version sources; 60 | 61 | waterfoxPlatforms = { 62 | x86_64-linux = "linux-x86_64"; 63 | }; 64 | 65 | arch = waterfoxPlatforms.${stdenv.hostPlatform.system}; 66 | 67 | isPrefixOf = prefix: string: 68 | builtins.substring 0 (builtins.stringLength prefix) string == prefix; 69 | 70 | sourceMatches = locale: source: 71 | (isPrefixOf source.locale locale) && source.arch == arch; 72 | 73 | policies = { 74 | DisableAppUpdate = true; 75 | } // config.waterfox.policies or {}; 76 | 77 | policiesJson = writeText "waterfox-policies.json" (builtins.toJSON { inherit policies; }); 78 | 79 | defaultSource = lib.findFirst (sourceMatches "en-US") {} sources; 80 | 81 | mozLocale = 82 | if systemLocale == "ca_ES@valencia" 83 | then "ca-valencia" 84 | else lib.replaceStrings ["_"] ["-"] systemLocale; 85 | 86 | source = lib.findFirst (sourceMatches mozLocale) defaultSource sources; 87 | 88 | pname = "waterfox-bin-unwrapped"; 89 | 90 | in 91 | 92 | stdenv.mkDerivation { 93 | inherit pname version; 94 | 95 | src = fetchurl { inherit (source) url sha256; }; 96 | 97 | libPath = lib.makeLibraryPath 98 | [ stdenv.cc.cc 99 | alsa-lib 100 | atk 101 | cairo 102 | curl 103 | cups 104 | dbus-glib 105 | dbus 106 | fontconfig 107 | freetype 108 | gdk-pixbuf 109 | glib 110 | glibc 111 | gtk2 112 | gtk3 113 | libkrb5 114 | mesa 115 | libX11 116 | libXScrnSaver 117 | libXcomposite 118 | libXcursor 119 | libxcb 120 | libXdamage 121 | libXext 122 | libXfixes 123 | libXi 124 | libXinerama 125 | libXrender 126 | libXrandr 127 | libXt 128 | libXtst 129 | libcanberra 130 | libnotify 131 | libGLU libGL 132 | nspr 133 | nss 134 | pango 135 | pipewire 136 | pciutils 137 | libheimdal 138 | libpulseaudio 139 | systemd 140 | ffmpeg 141 | ] + ":" + lib.makeSearchPathOutput "lib" "lib64" [ 142 | stdenv.cc.cc 143 | ]; 144 | 145 | inherit gtk3; 146 | 147 | buildInputs = [ wrapGAppsHook gtk3 adwaita-icon-theme ]; 148 | 149 | # "strip" after "patchelf" may break binaries. 150 | # See: https://github.com/NixOS/patchelf/issues/10 151 | dontStrip = true; 152 | dontPatchELF = true; 153 | 154 | patchPhase = '' 155 | # Don't download updates from Waterfox directly 156 | echo 'pref("app.update.auto", "false");' >> defaults/pref/channel-prefs.js 157 | ''; 158 | 159 | installPhase = 160 | '' 161 | mkdir -p "$prefix/usr/lib/waterfox-bin-${version}" 162 | cp -r * "$prefix/usr/lib/waterfox-bin-${version}" 163 | mkdir -p "$out/bin" 164 | ln -s "$prefix/usr/lib/waterfox-bin-${version}/waterfox" "$out/bin/" 165 | for executable in \ 166 | waterfox waterfox-bin plugin-container \ 167 | updater crashreporter webapprt-stub 168 | do 169 | if [ -e "$out/usr/lib/waterfox-bin-${version}/$executable" ]; then 170 | patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 171 | "$out/usr/lib/waterfox-bin-${version}/$executable" 172 | fi 173 | done 174 | find . -executable -type f -exec \ 175 | patchelf --set-rpath "$libPath" \ 176 | "$out/usr/lib/waterfox-bin-${version}/{}" \; 177 | # wrapWaterfox expects "$out/lib" instead of "$out/usr/lib" 178 | ln -s "$out/usr/lib" "$out/lib" 179 | gappsWrapperArgs+=(--argv0 "$out/bin/.waterfox-wrapped") 180 | # See: https://github.com/mozilla/policy-templates/blob/master/README.md 181 | mkdir -p "$out/lib/waterfox-bin-${version}/distribution"; 182 | ln -s ${policiesJson} "$out/lib/waterfox-bin-${version}/distribution/policies.json"; 183 | ''; 184 | 185 | passthru.execdir = "/bin"; 186 | passthru.ffmpegSupport = true; 187 | passthru.gssSupport = true; 188 | # update with: 189 | # $ nix-shell maintainers/scripts/update.nix --argstr package firefox-bin-unwrapped 190 | passthru.updateScript = import ./update.nix { 191 | inherit pname writeScript xidel coreutils gnused gnugrep gnupg curl runtimeShell; 192 | baseUrl = "https://github.com/WaterfoxCo/Waterfox/archive/refs/tags/"; 193 | }; 194 | meta = with lib; { 195 | description = "Waterfox, striking the perfect balance between privacy and usability. (binary package)"; 196 | homepage = "http://www.waterfox.net"; 197 | license = licenses.mpl20; 198 | platforms = builtins.attrNames waterfoxPlatforms; 199 | hydraPlatforms = []; 200 | maintainers = with maintainers; [ jcdickinson ]; 201 | }; 202 | } 203 | -------------------------------------------------------------------------------- /schemes/catppuccin-latte.nix: -------------------------------------------------------------------------------- 1 | { 2 | scheme = "Catppuccin Latte"; 3 | slug = "latte"; 4 | author = "Poco81"; 5 | colors = { 6 | base00 = "EFF1F5"; 7 | base01 = "CCD0DA"; 8 | base02 = "9CA0B0"; 9 | base03 = "6C6F85"; 10 | base04 = "C8C093"; 11 | base05 = "4C4F69"; 12 | base06 = "5C5F77"; 13 | base07 = "5C5F77"; 14 | base08 = "D20F39"; 15 | base09 = "FE640B"; 16 | base0A = "DF8E1D"; 17 | base0B = "40A02B"; 18 | base0C = "179299"; 19 | base0D = "1E66F5"; 20 | base0E = "DD7878"; 21 | base0F = "EA76CB"; 22 | accent = "DD7878"; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /schemes/gruvbox-dark-hard.nix: -------------------------------------------------------------------------------- 1 | { 2 | scheme = "Gruvbox dark, hard"; 3 | slug = "gruvbox-dark-hard"; 4 | author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)"; 5 | colors = { 6 | base00 = "1d2021"; 7 | base01 = "3c3836"; 8 | base02 = "504945"; 9 | base03 = "665c54"; 10 | base04 = "bdae93"; 11 | base05 = "d5c4a1"; 12 | base06 = "ebdbb2"; 13 | base07 = "fbf1c7"; 14 | base08 = "fb4934"; 15 | base09 = "fe8019"; 16 | base0A = "fabd2f"; 17 | base0B = "b8bb26"; 18 | base0C = "8ec07c"; 19 | base0D = "83a598"; 20 | base0E = "d3869b"; 21 | base0F = "d65d0e"; 22 | accent = "fabd2f"; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /schemes/gruvbox-dark-medium.nix: -------------------------------------------------------------------------------- 1 | { 2 | scheme = "Gruvbox dark, medium"; 3 | slug = "gruvbox-dark-medium"; 4 | author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)"; 5 | colors = { 6 | base00 = "282828"; 7 | base01 = "3c3836"; 8 | base02 = "504945"; 9 | base03 = "665c54"; 10 | base04 = "bdae93"; 11 | base05 = "d5c4a1"; 12 | base06 = "ebdbb2"; 13 | base07 = "fbf1c7"; 14 | base08 = "fb4934"; 15 | base09 = "fe8019"; 16 | base0A = "fabd2f"; 17 | base0B = "b8bb26"; 18 | base0C = "8ec07c"; 19 | base0D = "83a598"; 20 | base0E = "d3869b"; 21 | base0F = "d65d0e"; 22 | accent = "fabd2f"; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /schemes/gruvbox-light-medium.nix: -------------------------------------------------------------------------------- 1 | { 2 | scheme = "Gruvbox light, medium"; 3 | slug="gruvbox-light-medium"; 4 | author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)"; 5 | colors = { 6 | base00 = "fbf1c7"; # ---- 7 | base01 = "ebdbb2"; # --- 8 | base02 = "d5c4a1"; # -- 9 | base03 = "bdae93"; # - 10 | base04 = "665c54"; # + 11 | base05 = "504945"; # ++ 12 | base06 = "3c3836"; # +++ 13 | base07 = "282828"; # ++++ 14 | base08 = "9d0006"; # red 15 | base09 = "af3a03"; # orange 16 | base0A = "b57614"; # yellow 17 | base0B = "79740e"; # green 18 | base0C = "427b58"; # aqua/cyan 19 | base0D = "076678"; # blue 20 | base0E = "8f3f71"; # purple 21 | base0F = "d65d0e"; 22 | accent = "b57614"; 23 | }; 24 | } -------------------------------------------------------------------------------- /schemes/gruvbox-material-dark-hard.nix: -------------------------------------------------------------------------------- 1 | { 2 | scheme = "Gruvbox Material Dark, Hard"; 3 | author = "sainnhe"; 4 | slug = "gruvbox-material-dark-hard"; 5 | colors = { 6 | base00 = "202020"; 7 | base01 = "2a2827"; 8 | base02 = "504945"; 9 | base03 = "5a524c"; 10 | base04 = "bdae93"; 11 | base05 = "ddc7a1"; 12 | base06 = "ebdbb2"; 13 | base07 = "fbf1c7"; 14 | base08 = "ea6962"; 15 | base09 = "e78a4e"; 16 | base0A = "d8a657"; 17 | base0B = "a9b665"; 18 | base0C = "89b482"; 19 | base0D = "7daea3"; 20 | base0E = "d3869b"; 21 | base0F = "bd6f3e"; 22 | accent = "e78a4e"; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /schemes/kanagawa.nix: -------------------------------------------------------------------------------- 1 | { 2 | scheme = "Kanagawa"; 3 | slug = "kanagawa"; 4 | author = "Originally by rebelot(https://github.com/rebelot), ported by montdor (https://github.com/montdor)"; 5 | colors = { 6 | base00 = "1F1F28"; 7 | base01 = "2A2A37"; 8 | base02 = "223249"; 9 | base03 = "727169"; 10 | base04 = "C8C093"; 11 | base05 = "DCD7BA"; 12 | base06 = "938AA9"; 13 | base07 = "363646"; 14 | base08 = "C34043"; 15 | base09 = "FFA066"; 16 | base0A = "DCA561"; 17 | base0B = "98BB6C"; 18 | base0C = "7FB4CA"; 19 | base0D = "7E9CD8"; 20 | base0E = "957FB8"; 21 | base0F = "D27E99"; 22 | accent = "7E9CD8"; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /schemes/rose-pine.nix: -------------------------------------------------------------------------------- 1 | { 2 | slug = "rose-pine"; 3 | name = "Rosé Pine"; 4 | author = "Emilia Dunfelt "; 5 | colors = { 6 | base00 = "191724"; 7 | base01 = "26233a"; 8 | base02 = "21202e"; 9 | base03 = "6e6a86"; 10 | base04 = "908caa"; 11 | base05 = "e0def4"; 12 | base06 = "908caa"; 13 | base07 = "908caa"; 14 | base08 = "eb6f92"; 15 | base09 = "ebbcba"; 16 | base0A = "f6c177"; 17 | base0B = "9ccfd8"; 18 | base0C = "9ccfd8"; 19 | base0D = "31748f"; 20 | base0E = "c4a7e7"; 21 | base0F = "c4a7e7"; 22 | }; 23 | } -------------------------------------------------------------------------------- /schemes/tokyonight.nix: -------------------------------------------------------------------------------- 1 | { 2 | scheme = "tokyonight"; 3 | slug = "tokyonight"; 4 | author = "folke"; 5 | colors = { 6 | base00 = "1a1b26"; 7 | base01 = "1f2335"; 8 | base02 = "292e42"; 9 | base03 = "414868"; 10 | base04 = "565f89"; 11 | base05 = "a9b1d6"; 12 | base06 = "c0c0c0"; 13 | base07 = "c0caf5"; 14 | base08 = "f7768e"; 15 | base09 = "ff9e64"; 16 | base0A = "e0af68"; 17 | base0B = "9ece6a"; 18 | base0C = "7dcfff"; 19 | base0D = "7aa2f7"; 20 | base0E = "bb9af7"; 21 | base0F = "db4b4b"; 22 | accent = "7aa2f7"; 23 | }; 24 | } 25 | --------------------------------------------------------------------------------