├── .gitignore ├── README.md ├── enable-flakes ├── flake.lock ├── flake.nix ├── init.gpg └── modules ├── home ├── alacritty.nix ├── bash │ ├── bash_funcs │ ├── bashrc │ ├── default.nix │ └── rc.gpg ├── colors.nix ├── darwin-app-activation.nix ├── default.nix ├── discord.nix ├── emacs │ ├── default.nix │ └── init.el ├── floskell │ ├── default.nix │ └── floskell.json ├── fonts.nix ├── fourmolu │ ├── default.nix │ └── fourmolu.yaml ├── ghostty.nix ├── git.nix ├── go.nix ├── gpg.nix ├── helix │ ├── charm.nix │ └── default.nix ├── hyprland │ ├── default.nix │ └── hyprland.conf ├── kakoune │ ├── default.nix │ └── kakrc ├── kitty.nix ├── neovim │ ├── colorscheme.nix │ ├── default.nix │ └── init.lua ├── nushell.nix ├── picom.nix ├── pkgs.nix ├── prettier │ ├── default.nix │ └── prettierrc.yaml ├── readline.nix ├── rio.nix ├── rofi │ ├── default.nix │ └── theme.rasi ├── scripts │ ├── ask │ ├── cmdai │ ├── default.nix │ ├── generate-commit-message │ ├── install-docker │ ├── make-vid │ ├── map-keys │ ├── sessions │ ├── sessions.gpg │ ├── setup-mouse │ ├── setup-wacom │ ├── tm │ ├── tmls │ ├── webp-jpeg │ └── webp-png ├── ssh.nix ├── tmux │ ├── default.nix │ └── tmux.conf └── wezterm │ └── default.nix └── nixos ├── cachix.nix ├── cachix ├── cuda-maintainers.nix ├── helix.nix └── nix-community.nix ├── default.nix ├── hardware-config-athena.nix └── hardware-config-whitenoise.nix /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .ghc.environment.* 3 | xmonad-x86_64-linux 4 | xmonad.errors 5 | *.hi 6 | *.o 7 | config/kak/plugins/* 8 | /result 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Meowgorithm Dotfiles, Collectors’ Edition 2 | 3 | This repo contains NixOS and Home Manager configurations to support a few 4 | systems: 5 | 6 | - NixOS `x86_64` with Hyprland 7 | - macOS `x86_64` and `aarch64` 8 | - Headless, general-purpose Linux `x86_64` (including WSL) 9 | 10 | ## User Management 11 | 12 | ```bash 13 | # Enable flakes on non-NixOS systems: 14 | ./enable-flakes 15 | 16 | # Let it rip: 17 | nix run 18 | 19 | # Or, for headless VMs and WSL: 20 | nix run .#christian@headless 21 | ``` 22 | 23 | ## OS Management 24 | 25 | Update the system locally: 26 | 27 | ```bash 28 | nixos-rebuild switch --flake . 29 | ``` 30 | 31 | Or just do it over the network: 32 | 33 | ```bash 34 | nixos-rebuild switch --flake github:meowgorithm/dotfiles/master 35 | ``` 36 | -------------------------------------------------------------------------------- /enable-flakes: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | dir="$HOME/.config/nix" 4 | file="$dir/nix.conf" 5 | 6 | mkdir -p "$dir" 7 | cat << EOF > "$file" 8 | experimental-features = nix-command flakes 9 | EOF 10 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "anchor": { 4 | "flake": false, 5 | "locked": { 6 | "lastModified": 1671584763, 7 | "narHash": "sha256-YIGRBzEJrNKHPZMLW02AVWqFQ6k6NCzT+76sFZE5xBI=", 8 | "ref": "refs/heads/master", 9 | "rev": "930d232fcdaa570622e57e6d619f8cafc87a42a5", 10 | "revCount": 1, 11 | "type": "git", 12 | "url": "ssh://git.rocha.is/anchor" 13 | }, 14 | "original": { 15 | "type": "git", 16 | "url": "ssh://git.rocha.is/anchor" 17 | } 18 | }, 19 | "arno-pro": { 20 | "flake": false, 21 | "locked": { 22 | "lastModified": 1671590668, 23 | "narHash": "sha256-NqjnpVogfLPQA9CNS45HraL+Ekhy44GKDZ7RTM8t4A4=", 24 | "ref": "refs/heads/master", 25 | "rev": "76e7c3acd621b36fcf62490ff33071b90a7c138f", 26 | "revCount": 1, 27 | "type": "git", 28 | "url": "ssh://git.rocha.is/arno-pro" 29 | }, 30 | "original": { 31 | "type": "git", 32 | "url": "ssh://git.rocha.is/arno-pro" 33 | } 34 | }, 35 | "benjamins-gothic": { 36 | "flake": false, 37 | "locked": { 38 | "lastModified": 1671589173, 39 | "narHash": "sha256-YM23PVqhIPMcVWVCHA3qf1BmPHVojyvFhcGXwnT+woc=", 40 | "ref": "refs/heads/master", 41 | "rev": "6b5af96f1a58061d0621830aaa828b8b98a75865", 42 | "revCount": 1, 43 | "type": "git", 44 | "url": "ssh://git.rocha.is/benjamins-gothic" 45 | }, 46 | "original": { 47 | "type": "git", 48 | "url": "ssh://git.rocha.is/benjamins-gothic" 49 | } 50 | }, 51 | "carlos": { 52 | "inputs": { 53 | "nixpkgs": [ 54 | "nixpkgs" 55 | ] 56 | }, 57 | "locked": { 58 | "lastModified": 1746542153, 59 | "narHash": "sha256-I+Q1s6jyKjouzUPppaL2WwvrsN/CDPEx0m+jJr1a75Q=", 60 | "owner": "caarlos0", 61 | "repo": "nur", 62 | "rev": "1fc9d9618d1a2177cb01358eb4503a02a6cb3721", 63 | "type": "github" 64 | }, 65 | "original": { 66 | "owner": "caarlos0", 67 | "repo": "nur", 68 | "type": "github" 69 | } 70 | }, 71 | "charm": { 72 | "inputs": { 73 | "nixpkgs": [ 74 | "nixpkgs" 75 | ] 76 | }, 77 | "locked": { 78 | "lastModified": 1743550948, 79 | "narHash": "sha256-dO3BAJ91EVHBkHRF9iPat7wccx2zfxIeySO+iFtGUKE=", 80 | "owner": "charmbracelet", 81 | "repo": "nur", 82 | "rev": "fac99e886be5d3edc5fb55a2ce1b2d8a646a1e3f", 83 | "type": "github" 84 | }, 85 | "original": { 86 | "owner": "charmbracelet", 87 | "repo": "nur", 88 | "type": "github" 89 | } 90 | }, 91 | "dozer": { 92 | "flake": false, 93 | "locked": { 94 | "narHash": "sha256-xmh5HiITXyPmH3RMSx6xy0vvis8wFrtowvbblcGCfPw=", 95 | "type": "file", 96 | "url": "https://github.com/Mortennn/Dozer/releases/download/v4.0.0/Dozer.4.0.0.dmg" 97 | }, 98 | "original": { 99 | "type": "file", 100 | "url": "https://github.com/Mortennn/Dozer/releases/download/v4.0.0/Dozer.4.0.0.dmg" 101 | } 102 | }, 103 | "flake-compat": { 104 | "flake": false, 105 | "locked": { 106 | "lastModified": 1733328505, 107 | "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", 108 | "owner": "edolstra", 109 | "repo": "flake-compat", 110 | "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", 111 | "type": "github" 112 | }, 113 | "original": { 114 | "owner": "edolstra", 115 | "repo": "flake-compat", 116 | "type": "github" 117 | } 118 | }, 119 | "flake-parts": { 120 | "inputs": { 121 | "nixpkgs-lib": "nixpkgs-lib" 122 | }, 123 | "locked": { 124 | "lastModified": 1743550720, 125 | "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", 126 | "owner": "hercules-ci", 127 | "repo": "flake-parts", 128 | "rev": "c621e8422220273271f52058f618c94e405bb0f5", 129 | "type": "github" 130 | }, 131 | "original": { 132 | "owner": "hercules-ci", 133 | "repo": "flake-parts", 134 | "type": "github" 135 | } 136 | }, 137 | "flake-utils": { 138 | "inputs": { 139 | "systems": "systems" 140 | }, 141 | "locked": { 142 | "lastModified": 1731533236, 143 | "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 144 | "owner": "numtide", 145 | "repo": "flake-utils", 146 | "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 147 | "type": "github" 148 | }, 149 | "original": { 150 | "owner": "numtide", 151 | "repo": "flake-utils", 152 | "type": "github" 153 | } 154 | }, 155 | "fzyLua": { 156 | "flake": false, 157 | "locked": { 158 | "narHash": "sha256-HQDjDNNumHvbdskPPL1iUPyZzULf5iINZKhsDNnhPtk=", 159 | "type": "file", 160 | "url": "https://raw.githubusercontent.com/swarn/fzy-lua/a3f1dd75725b535e6b00af84048c7e066432f530/src/fzy_lua.lua" 161 | }, 162 | "original": { 163 | "type": "file", 164 | "url": "https://raw.githubusercontent.com/swarn/fzy-lua/a3f1dd75725b535e6b00af84048c7e066432f530/src/fzy_lua.lua" 165 | } 166 | }, 167 | "gabriello": { 168 | "flake": false, 169 | "locked": { 170 | "lastModified": 1671588801, 171 | "narHash": "sha256-x/yiD4vAtESUwdDuPt5HueysP/6mSX2gs9nWLlRlESs=", 172 | "ref": "refs/heads/master", 173 | "rev": "72e5c2bc8eeada449833ae86a69892d20ddfe3da", 174 | "revCount": 1, 175 | "type": "git", 176 | "url": "ssh://git.rocha.is/gabriello" 177 | }, 178 | "original": { 179 | "type": "git", 180 | "url": "ssh://git.rocha.is/gabriello" 181 | } 182 | }, 183 | "gelion": { 184 | "flake": false, 185 | "locked": { 186 | "lastModified": 1682989966, 187 | "narHash": "sha256-RC3emmP6XfPxbQkYiTEzRoPMnP5U5F5+lbAKs89GYuA=", 188 | "ref": "refs/heads/master", 189 | "rev": "1cf0f0d6004a4435629c5fb489f9690fd5691724", 190 | "revCount": 1, 191 | "type": "git", 192 | "url": "ssh://git.rocha.is/gelion" 193 | }, 194 | "original": { 195 | "type": "git", 196 | "url": "ssh://git.rocha.is/gelion" 197 | } 198 | }, 199 | "ghostty": { 200 | "inputs": { 201 | "flake-compat": "flake-compat", 202 | "flake-utils": "flake-utils", 203 | "nixpkgs-stable": "nixpkgs-stable", 204 | "nixpkgs-unstable": "nixpkgs-unstable", 205 | "zig": "zig", 206 | "zon2nix": "zon2nix" 207 | }, 208 | "locked": { 209 | "lastModified": 1747243928, 210 | "narHash": "sha256-0Z2ierPsjbg4iDOiwwBW28NapXZFSDyRL9E4XKTYop4=", 211 | "ref": "refs/heads/main", 212 | "rev": "a090e8eeeda7015f7cadbd4aa0ea4654a8026a71", 213 | "revCount": 10294, 214 | "type": "git", 215 | "url": "ssh://git@github.com/ghostty-org/ghostty" 216 | }, 217 | "original": { 218 | "type": "git", 219 | "url": "ssh://git@github.com/ghostty-org/ghostty" 220 | } 221 | }, 222 | "home-manager": { 223 | "inputs": { 224 | "nixpkgs": "nixpkgs" 225 | }, 226 | "locked": { 227 | "lastModified": 1747279714, 228 | "narHash": "sha256-UdxlE8yyrKiGq3bgGyJ78AdFwh+fuRAruKtyFY5Zq5I=", 229 | "owner": "nix-community", 230 | "repo": "home-manager", 231 | "rev": "954615c510c9faa3ee7fb6607ff72e55905e69f2", 232 | "type": "github" 233 | }, 234 | "original": { 235 | "owner": "nix-community", 236 | "repo": "home-manager", 237 | "type": "github" 238 | } 239 | }, 240 | "larsseit": { 241 | "flake": false, 242 | "locked": { 243 | "lastModified": 1671588600, 244 | "narHash": "sha256-IR6RYwu3JIEzUQrlDoyNt+B2mwxGGnVpMIFBKIlCSQs=", 245 | "ref": "refs/heads/master", 246 | "rev": "26f75356e8aa42c335eb3ea63c9ea08b33552993", 247 | "revCount": 1, 248 | "type": "git", 249 | "url": "ssh://git.rocha.is/larsseit" 250 | }, 251 | "original": { 252 | "type": "git", 253 | "url": "ssh://git.rocha.is/larsseit" 254 | } 255 | }, 256 | "liza": { 257 | "flake": false, 258 | "locked": { 259 | "lastModified": 1720313538, 260 | "narHash": "sha256-055N+JQSUBA0SCCVnDJOcDESc6LqiOWtP6O11Tm4+8s=", 261 | "ref": "refs/heads/main", 262 | "rev": "5edccd837e0c6596df039069badc5aefe27c4670", 263 | "revCount": 1, 264 | "type": "git", 265 | "url": "ssh://git.rocha.is/liza" 266 | }, 267 | "original": { 268 | "type": "git", 269 | "url": "ssh://git.rocha.is/liza" 270 | } 271 | }, 272 | "maru": { 273 | "flake": false, 274 | "locked": { 275 | "lastModified": 1715176702, 276 | "narHash": "sha256-UVBv6D4o1EtiuI5XLFtMhhZnz6/S1u3yL4pCz/osgrc=", 277 | "ref": "refs/heads/main", 278 | "rev": "fcd4a0b7a9ed9fe672f6fb232f6d045dced5d43e", 279 | "revCount": 1, 280 | "type": "git", 281 | "url": "ssh://git.rocha.is/maru" 282 | }, 283 | "original": { 284 | "type": "git", 285 | "url": "ssh://git.rocha.is/maru" 286 | } 287 | }, 288 | "mkAlias": { 289 | "inputs": { 290 | "nixpkgs": "nixpkgs_2" 291 | }, 292 | "locked": { 293 | "lastModified": 1678667396, 294 | "narHash": "sha256-00gStGvYNlFi9d9e2KJr9qXlcJotry7YfZyv2NCAThE=", 295 | "owner": "cdmistman", 296 | "repo": "mkAlias", 297 | "rev": "ab1afe594a3da8be30814b735cc5ad53d7c326f7", 298 | "type": "github" 299 | }, 300 | "original": { 301 | "owner": "cdmistman", 302 | "repo": "mkAlias", 303 | "type": "github" 304 | } 305 | }, 306 | "monitorcontrol": { 307 | "flake": false, 308 | "locked": { 309 | "narHash": "sha256-I5Opt4Ql+2TyomtgWcM5eX+oY1MVhdFxg/e14yTjxYQ=", 310 | "type": "file", 311 | "url": "https://github.com/MonitorControl/MonitorControl/releases/download/v4.3.3/MonitorControl.4.3.3.dmg" 312 | }, 313 | "original": { 314 | "type": "file", 315 | "url": "https://github.com/MonitorControl/MonitorControl/releases/download/v4.3.3/MonitorControl.4.3.3.dmg" 316 | } 317 | }, 318 | "monoflow": { 319 | "flake": false, 320 | "locked": { 321 | "lastModified": 1671590921, 322 | "narHash": "sha256-xzQ0OaJZXyzm+GBRSAaiU1Not3uuSiw6aL9aXScU6oI=", 323 | "ref": "refs/heads/master", 324 | "rev": "9d6135427c301d49141f4035b2dd4f1c01ef09e2", 325 | "revCount": 1, 326 | "type": "git", 327 | "url": "ssh://git.rocha.is/monoflow" 328 | }, 329 | "original": { 330 | "type": "git", 331 | "url": "ssh://git.rocha.is/monoflow" 332 | } 333 | }, 334 | "mononoki": { 335 | "flake": false, 336 | "locked": { 337 | "lastModified": 1711415714, 338 | "narHash": "sha256-i0UhcPKAedWsUZSbTNWqYN+uhobJSGWOHB9qkLXShkQ=", 339 | "ref": "refs/heads/main", 340 | "rev": "a17ffe9e42540f647af5c522426edd5ade97588e", 341 | "revCount": 1, 342 | "type": "git", 343 | "url": "ssh://git.rocha.is/mononoki" 344 | }, 345 | "original": { 346 | "type": "git", 347 | "url": "ssh://git.rocha.is/mononoki" 348 | } 349 | }, 350 | "mori": { 351 | "flake": false, 352 | "locked": { 353 | "lastModified": 1718719509, 354 | "narHash": "sha256-qE5Ema/UDCl7xBmwdYCyuyuwqpmf04C3i/r6j1u1Wq0=", 355 | "ref": "refs/heads/main", 356 | "rev": "1c02b324107d1e59852623a5915373a130b61f23", 357 | "revCount": 3, 358 | "type": "git", 359 | "url": "ssh://git.rocha.is/mori" 360 | }, 361 | "original": { 362 | "type": "git", 363 | "url": "ssh://git.rocha.is/mori" 364 | } 365 | }, 366 | "neufile-grotesk": { 367 | "flake": false, 368 | "locked": { 369 | "lastModified": 1682989846, 370 | "narHash": "sha256-hdfTz6NxbNsgFLqoEhVoUmyCmxrwUTV5WGxuigwUM5c=", 371 | "ref": "refs/heads/master", 372 | "rev": "fcee79e248c2227b9a87159060f73477c86c1a88", 373 | "revCount": 1, 374 | "type": "git", 375 | "url": "ssh://git.rocha.is/neufile-grotesk" 376 | }, 377 | "original": { 378 | "type": "git", 379 | "url": "ssh://git.rocha.is/neufile-grotesk" 380 | } 381 | }, 382 | "nixpkgs": { 383 | "locked": { 384 | "lastModified": 1746904237, 385 | "narHash": "sha256-3e+AVBczosP5dCLQmMoMEogM57gmZ2qrVSrmq9aResQ=", 386 | "owner": "NixOS", 387 | "repo": "nixpkgs", 388 | "rev": "d89fc19e405cb2d55ce7cc114356846a0ee5e956", 389 | "type": "github" 390 | }, 391 | "original": { 392 | "owner": "NixOS", 393 | "ref": "nixos-unstable", 394 | "repo": "nixpkgs", 395 | "type": "github" 396 | } 397 | }, 398 | "nixpkgs-lib": { 399 | "locked": { 400 | "lastModified": 1743296961, 401 | "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", 402 | "owner": "nix-community", 403 | "repo": "nixpkgs.lib", 404 | "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", 405 | "type": "github" 406 | }, 407 | "original": { 408 | "owner": "nix-community", 409 | "repo": "nixpkgs.lib", 410 | "type": "github" 411 | } 412 | }, 413 | "nixpkgs-stable": { 414 | "locked": { 415 | "lastModified": 1741992157, 416 | "narHash": "sha256-nlIfTsTrMSksEJc1f7YexXiPVuzD1gOfeN1ggwZyUoc=", 417 | "owner": "nixos", 418 | "repo": "nixpkgs", 419 | "rev": "da4b122f63095ca1199bd4d526f9e26426697689", 420 | "type": "github" 421 | }, 422 | "original": { 423 | "owner": "nixos", 424 | "ref": "release-24.11", 425 | "repo": "nixpkgs", 426 | "type": "github" 427 | } 428 | }, 429 | "nixpkgs-unstable": { 430 | "locked": { 431 | "lastModified": 1741865919, 432 | "narHash": "sha256-4thdbnP6dlbdq+qZWTsm4ffAwoS8Tiq1YResB+RP6WE=", 433 | "owner": "nixos", 434 | "repo": "nixpkgs", 435 | "rev": "573c650e8a14b2faa0041645ab18aed7e60f0c9a", 436 | "type": "github" 437 | }, 438 | "original": { 439 | "owner": "nixos", 440 | "ref": "nixpkgs-unstable", 441 | "repo": "nixpkgs", 442 | "type": "github" 443 | } 444 | }, 445 | "nixpkgs_2": { 446 | "locked": { 447 | "lastModified": 1677624842, 448 | "narHash": "sha256-4DF9DbDuK4/+KYx0L6XcPBeDHUFVCtzok2fWtwXtb5w=", 449 | "owner": "nixos", 450 | "repo": "nixpkgs", 451 | "rev": "d70f5cd5c3bef45f7f52698f39e7cc7a89daa7f0", 452 | "type": "github" 453 | }, 454 | "original": { 455 | "owner": "nixos", 456 | "ref": "nixos-22.11", 457 | "repo": "nixpkgs", 458 | "type": "github" 459 | } 460 | }, 461 | "nixpkgs_3": { 462 | "locked": { 463 | "lastModified": 1747091784, 464 | "narHash": "sha256-/2jlDI5+DfAbxdluamyRsORHueBYUiQh+aK/kshSvmE=", 465 | "owner": "NixOS", 466 | "repo": "nixpkgs", 467 | "rev": "2e1da60850ce8159db9654a969c2c683f41c18b5", 468 | "type": "github" 469 | }, 470 | "original": { 471 | "id": "nixpkgs", 472 | "type": "indirect" 473 | } 474 | }, 475 | "nixpkgs_4": { 476 | "locked": { 477 | "lastModified": 1744536153, 478 | "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", 479 | "owner": "NixOS", 480 | "repo": "nixpkgs", 481 | "rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11", 482 | "type": "github" 483 | }, 484 | "original": { 485 | "owner": "NixOS", 486 | "ref": "nixpkgs-unstable", 487 | "repo": "nixpkgs", 488 | "type": "github" 489 | } 490 | }, 491 | "pangaia": { 492 | "flake": false, 493 | "locked": { 494 | "lastModified": 1711415602, 495 | "narHash": "sha256-MIPq6glJ8zGI6FXHP2QMbc9Id/epso5wS+Qn2R8Vt98=", 496 | "ref": "refs/heads/main", 497 | "rev": "d85381db37d289447670bae0cefc0011b9b7301d", 498 | "revCount": 1, 499 | "type": "git", 500 | "url": "ssh://git.rocha.is/pangaia" 501 | }, 502 | "original": { 503 | "type": "git", 504 | "url": "ssh://git.rocha.is/pangaia" 505 | } 506 | }, 507 | "pique": { 508 | "flake": false, 509 | "locked": { 510 | "lastModified": 1671633129, 511 | "narHash": "sha256-OlgsrHbdEF74tIvW3oNxcsPgaE/fXCdH92/rQB0OFs0=", 512 | "ref": "refs/heads/master", 513 | "rev": "f3d94d262479804f55ab5d1ed4c904d367e52984", 514 | "revCount": 1, 515 | "type": "git", 516 | "url": "ssh://git.rocha.is/pique" 517 | }, 518 | "original": { 519 | "type": "git", 520 | "url": "ssh://git.rocha.is/pique" 521 | } 522 | }, 523 | "rifton": { 524 | "flake": false, 525 | "locked": { 526 | "lastModified": 1671588484, 527 | "narHash": "sha256-7UbsRobmO3ABShZz8Erg/JaJsoT3fKKIOd1HI/MlQ7w=", 528 | "ref": "refs/heads/master", 529 | "rev": "8a1f1dcd6b065037a9496659bd93f16f46c734e4", 530 | "revCount": 1, 531 | "type": "git", 532 | "url": "ssh://git.rocha.is/rifton" 533 | }, 534 | "original": { 535 | "type": "git", 536 | "url": "ssh://git.rocha.is/rifton" 537 | } 538 | }, 539 | "rio": { 540 | "inputs": { 541 | "flake-parts": "flake-parts", 542 | "nixpkgs": [ 543 | "nixpkgs" 544 | ], 545 | "rust-overlay": "rust-overlay", 546 | "systems": "systems_2" 547 | }, 548 | "locked": { 549 | "lastModified": 1747313456, 550 | "narHash": "sha256-HzDQVG3EUksM77TakWAWOX5afJ/j4CJJEujJuXCu8DA=", 551 | "owner": "raphamorim", 552 | "repo": "rio", 553 | "rev": "b3bad3e6eec3a1009bcc5582122f5ef828d81e90", 554 | "type": "github" 555 | }, 556 | "original": { 557 | "owner": "raphamorim", 558 | "repo": "rio", 559 | "type": "github" 560 | } 561 | }, 562 | "rois": { 563 | "flake": false, 564 | "locked": { 565 | "lastModified": 1671590393, 566 | "narHash": "sha256-JYMu1oMEB0ImaG8zHpcFJjF7K8xqFl3fk1HTz+5A0PU=", 567 | "ref": "refs/heads/master", 568 | "rev": "ec4dff9e1f172f152b4114a7268e450203bbd631", 569 | "revCount": 1, 570 | "type": "git", 571 | "url": "ssh://git.rocha.is/rois" 572 | }, 573 | "original": { 574 | "type": "git", 575 | "url": "ssh://git.rocha.is/rois" 576 | } 577 | }, 578 | "root": { 579 | "inputs": { 580 | "anchor": "anchor", 581 | "arno-pro": "arno-pro", 582 | "benjamins-gothic": "benjamins-gothic", 583 | "carlos": "carlos", 584 | "charm": "charm", 585 | "dozer": "dozer", 586 | "fzyLua": "fzyLua", 587 | "gabriello": "gabriello", 588 | "gelion": "gelion", 589 | "ghostty": "ghostty", 590 | "home-manager": "home-manager", 591 | "larsseit": "larsseit", 592 | "liza": "liza", 593 | "maru": "maru", 594 | "mkAlias": "mkAlias", 595 | "monitorcontrol": "monitorcontrol", 596 | "monoflow": "monoflow", 597 | "mononoki": "mononoki", 598 | "mori": "mori", 599 | "neufile-grotesk": "neufile-grotesk", 600 | "nixpkgs": "nixpkgs_3", 601 | "pangaia": "pangaia", 602 | "pique": "pique", 603 | "rifton": "rifton", 604 | "rio": "rio", 605 | "rois": "rois", 606 | "saans": "saans", 607 | "sf-mono": "sf-mono", 608 | "smear": "smear", 609 | "symbolset": "symbolset", 610 | "untitled-sans": "untitled-sans", 611 | "upton": "upton" 612 | } 613 | }, 614 | "rust-overlay": { 615 | "inputs": { 616 | "nixpkgs": "nixpkgs_4" 617 | }, 618 | "locked": { 619 | "lastModified": 1746844454, 620 | "narHash": "sha256-GcUWDQUDRYrD34ol90KGUpjbVcOfUNbv0s955jPecko=", 621 | "owner": "oxalica", 622 | "repo": "rust-overlay", 623 | "rev": "be092436d4c0c303b654e4007453b69c0e33009e", 624 | "type": "github" 625 | }, 626 | "original": { 627 | "owner": "oxalica", 628 | "repo": "rust-overlay", 629 | "type": "github" 630 | } 631 | }, 632 | "saans": { 633 | "flake": false, 634 | "locked": { 635 | "lastModified": 1718153613, 636 | "narHash": "sha256-9LqVzJzmH8xSyIEwwwux3bUYtz7QKjMBVIU+sK89sfk=", 637 | "ref": "refs/heads/main", 638 | "rev": "7ab838cf5ae84df8cdbe853c71a45b3bac98d580", 639 | "revCount": 1, 640 | "type": "git", 641 | "url": "ssh://git.rocha.is/saans" 642 | }, 643 | "original": { 644 | "type": "git", 645 | "url": "ssh://git.rocha.is/saans" 646 | } 647 | }, 648 | "sf-mono": { 649 | "flake": false, 650 | "locked": { 651 | "lastModified": 1671585411, 652 | "narHash": "sha256-NmrZ7I9d5MGQFIqjDENBZl2EEViQqgOcbs1e3FRMCik=", 653 | "ref": "refs/heads/master", 654 | "rev": "a339697b71c771aff4aa4e130b41628002781536", 655 | "revCount": 1, 656 | "type": "git", 657 | "url": "ssh://git.rocha.is/sf-mono" 658 | }, 659 | "original": { 660 | "type": "git", 661 | "url": "ssh://git.rocha.is/sf-mono" 662 | } 663 | }, 664 | "smear": { 665 | "flake": false, 666 | "locked": { 667 | "lastModified": 1746713614, 668 | "narHash": "sha256-bIVij6CEp+fQZMFcJLG1XkZpcIvEDuNm1WS7heSPlA0=", 669 | "owner": "sphamba", 670 | "repo": "smear-cursor.nvim", 671 | "rev": "162703638203060b1d3412e73429d232bbd2627e", 672 | "type": "github" 673 | }, 674 | "original": { 675 | "owner": "sphamba", 676 | "repo": "smear-cursor.nvim", 677 | "type": "github" 678 | } 679 | }, 680 | "symbolset": { 681 | "flake": false, 682 | "locked": { 683 | "lastModified": 1671589821, 684 | "narHash": "sha256-CO0uid1HV0laNpCFmYBGeFFpdOK74uF8uBjxfwn2B1Y=", 685 | "ref": "refs/heads/master", 686 | "rev": "8ea7db33949d3f6258b3d4379f57c821b74273ad", 687 | "revCount": 1, 688 | "type": "git", 689 | "url": "ssh://git.rocha.is/symbolset" 690 | }, 691 | "original": { 692 | "type": "git", 693 | "url": "ssh://git.rocha.is/symbolset" 694 | } 695 | }, 696 | "systems": { 697 | "locked": { 698 | "lastModified": 1681028828, 699 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 700 | "owner": "nix-systems", 701 | "repo": "default", 702 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 703 | "type": "github" 704 | }, 705 | "original": { 706 | "owner": "nix-systems", 707 | "repo": "default", 708 | "type": "github" 709 | } 710 | }, 711 | "systems_2": { 712 | "flake": false, 713 | "locked": { 714 | "lastModified": 1681028828, 715 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 716 | "owner": "nix-systems", 717 | "repo": "default", 718 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 719 | "type": "github" 720 | }, 721 | "original": { 722 | "owner": "nix-systems", 723 | "repo": "default", 724 | "type": "github" 725 | } 726 | }, 727 | "untitled-sans": { 728 | "flake": false, 729 | "locked": { 730 | "lastModified": 1671591302, 731 | "narHash": "sha256-T8gcpRoLbhSRzNGQX0Q1yi5OESEvsc+nYqsunNRsXUA=", 732 | "ref": "refs/heads/master", 733 | "rev": "581a33677a16c100c4077d34b3e9d5b91d2f6ef1", 734 | "revCount": 1, 735 | "type": "git", 736 | "url": "ssh://git.rocha.is/untitled-sans" 737 | }, 738 | "original": { 739 | "type": "git", 740 | "url": "ssh://git.rocha.is/untitled-sans" 741 | } 742 | }, 743 | "upton": { 744 | "flake": false, 745 | "locked": { 746 | "lastModified": 1671588093, 747 | "narHash": "sha256-JshYtNhDH+0w6D0aMLIanmsy7Rx/G0K37Uzvv3AJcPg=", 748 | "ref": "refs/heads/master", 749 | "rev": "f619cc4e209f2fc691f9429d923463602c00470a", 750 | "revCount": 1, 751 | "type": "git", 752 | "url": "ssh://git.rocha.is/upton" 753 | }, 754 | "original": { 755 | "type": "git", 756 | "url": "ssh://git.rocha.is/upton" 757 | } 758 | }, 759 | "zig": { 760 | "inputs": { 761 | "flake-compat": [ 762 | "ghostty" 763 | ], 764 | "flake-utils": [ 765 | "ghostty", 766 | "flake-utils" 767 | ], 768 | "nixpkgs": [ 769 | "ghostty", 770 | "nixpkgs-stable" 771 | ] 772 | }, 773 | "locked": { 774 | "lastModified": 1741825901, 775 | "narHash": "sha256-aeopo+aXg5I2IksOPFN79usw7AeimH1+tjfuMzJHFdk=", 776 | "owner": "mitchellh", 777 | "repo": "zig-overlay", 778 | "rev": "0b14285e283f5a747f372fb2931835dd937c4383", 779 | "type": "github" 780 | }, 781 | "original": { 782 | "owner": "mitchellh", 783 | "repo": "zig-overlay", 784 | "type": "github" 785 | } 786 | }, 787 | "zon2nix": { 788 | "inputs": { 789 | "flake-utils": [ 790 | "ghostty", 791 | "flake-utils" 792 | ], 793 | "nixpkgs": [ 794 | "ghostty", 795 | "nixpkgs-unstable" 796 | ] 797 | }, 798 | "locked": { 799 | "lastModified": 1742104771, 800 | "narHash": "sha256-LhidlyEA9MP8jGe1rEnyjGFCzLLgCdDpYeWggibayr0=", 801 | "owner": "jcollie", 802 | "repo": "zon2nix", 803 | "rev": "56c159be489cc6c0e73c3930bd908ddc6fe89613", 804 | "type": "github" 805 | }, 806 | "original": { 807 | "owner": "jcollie", 808 | "ref": "56c159be489cc6c0e73c3930bd908ddc6fe89613", 809 | "repo": "zon2nix", 810 | "type": "github" 811 | } 812 | } 813 | }, 814 | "root": "root", 815 | "version": 7 816 | } 817 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs.nixpkgs.url = "flake:nixpkgs"; 3 | inputs.home-manager.url = "github:nix-community/home-manager"; 4 | # inputs.home-manager.inputs.nixpkgs.follows = "nixpkgs"; 5 | inputs.charm.url = "github:charmbracelet/nur"; 6 | inputs.charm.inputs.nixpkgs.follows = "nixpkgs"; 7 | inputs.carlos.url = "github:caarlos0/nur"; 8 | inputs.carlos.inputs.nixpkgs.follows = "nixpkgs"; 9 | inputs.ghostty.url = "git+ssh://git@github.com/ghostty-org/ghostty"; 10 | inputs.rio.url = "github:raphamorim/rio"; 11 | inputs.rio.inputs.nixpkgs.follows = "nixpkgs"; 12 | 13 | # NeoVim Plugins 14 | inputs.smear.url = "github:sphamba/smear-cursor.nvim"; 15 | inputs.smear.flake = false; 16 | 17 | # Lua fzy implementation 18 | inputs.fzyLua.url = "https://raw.githubusercontent.com/swarn/fzy-lua/a3f1dd75725b535e6b00af84048c7e066432f530/src/fzy_lua.lua"; 19 | inputs.fzyLua.flake = false; 20 | 21 | # macOS stuff 22 | inputs.mkAlias.url = "github:cdmistman/mkAlias"; 23 | # inputs.mkAlias.inputs.nixpkgs.follows = "nixpkgs"; 24 | inputs.dozer.url = "https://github.com/Mortennn/Dozer/releases/download/v4.0.0/Dozer.4.0.0.dmg"; 25 | inputs.dozer.flake = false; 26 | inputs.monitorcontrol.url = "https://github.com/MonitorControl/MonitorControl/releases/download/v4.3.3/MonitorControl.4.3.3.dmg"; 27 | inputs.monitorcontrol.flake = false; 28 | 29 | # Fonts 30 | inputs.anchor.url = "git+ssh://git.rocha.is/anchor"; 31 | inputs.anchor.flake = false; 32 | inputs.arno-pro.url = "git+ssh://git.rocha.is/arno-pro"; 33 | inputs.arno-pro.flake = false; 34 | inputs.benjamins-gothic.url = "git+ssh://git.rocha.is/benjamins-gothic"; 35 | inputs.benjamins-gothic.flake = false; 36 | inputs.gabriello.url = "git+ssh://git.rocha.is/gabriello"; 37 | inputs.gabriello.flake = false; 38 | inputs.gelion.url = "git+ssh://git.rocha.is/gelion"; 39 | inputs.gelion.flake = false; 40 | inputs.larsseit.url = "git+ssh://git.rocha.is/larsseit"; 41 | inputs.larsseit.flake = false; 42 | inputs.liza.url = "git+ssh://git.rocha.is/liza"; 43 | inputs.liza.flake = false; 44 | inputs.maru.url = "git+ssh://git.rocha.is/maru"; 45 | inputs.maru.flake = false; 46 | inputs.monoflow.url = "git+ssh://git.rocha.is/monoflow"; 47 | inputs.mononoki.url = "git+ssh://git.rocha.is/mononoki"; 48 | inputs.mononoki.flake = false; 49 | inputs.mori.url = "git+ssh://git.rocha.is/mori"; 50 | inputs.mori.flake = false; 51 | inputs.monoflow.flake = false; 52 | inputs.neufile-grotesk.url = "git+ssh://git.rocha.is/neufile-grotesk"; 53 | inputs.neufile-grotesk.flake = false; 54 | inputs.pique.url = "git+ssh://git.rocha.is/pique"; 55 | inputs.pique.flake = false; 56 | inputs.pangaia.url = "git+ssh://git.rocha.is/pangaia"; 57 | inputs.pangaia.flake = false; 58 | inputs.rifton.url = "git+ssh://git.rocha.is/rifton"; 59 | inputs.rifton.flake = false; 60 | inputs.rois.url = "git+ssh://git.rocha.is/rois"; 61 | inputs.rois.flake = false; 62 | inputs.sf-mono.url = "git+ssh://git.rocha.is/sf-mono"; 63 | inputs.sf-mono.flake = false; 64 | inputs.saans.url = "git+ssh://git.rocha.is/saans"; 65 | inputs.saans.flake = false; 66 | inputs.symbolset.url = "git+ssh://git.rocha.is/symbolset"; 67 | inputs.symbolset.flake = false; 68 | inputs.untitled-sans.url = "git+ssh://git.rocha.is/untitled-sans"; 69 | inputs.untitled-sans.flake = false; 70 | inputs.upton.url = "git+ssh://git.rocha.is/upton"; 71 | inputs.upton.flake = false; 72 | 73 | outputs = inputs @ { 74 | self, 75 | nixpkgs, 76 | home-manager, 77 | ... 78 | }: let 79 | lib = nixpkgs.lib; 80 | 81 | x86_64-linux = "x86_64-linux"; 82 | x86_64-darwin = "x86_64-darwin"; 83 | aarch64-darwin = "aarch64-darwin"; 84 | 85 | mkSystem = { 86 | hostname, 87 | system ? x86_64-linux, 88 | default ? false, 89 | headless ? false, 90 | }: 91 | { 92 | nixosConfigurations."${hostname}" = lib.nixosSystem { 93 | inherit system; 94 | modules = [ 95 | { 96 | nixpkgs.overlays = [ 97 | (self: super: { 98 | # Enable CUDA/Optix in Blender 99 | blender = super.blender.override {cudaSupport = true;}; 100 | }) 101 | ]; 102 | } 103 | ({ 104 | pkgs, 105 | modulesPath, 106 | ... 107 | }: { 108 | system.configurationRevision = lib.mkIf (self ? rev) self.rev; 109 | }) 110 | (import ./modules/nixos hostname) 111 | ]; 112 | }; 113 | 114 | homeManagerConfigurations."christian@${hostname}" = 115 | import ./modules/home 116 | { 117 | pkgs = import nixpkgs { 118 | inherit system; 119 | config.allowUnfree = true; 120 | }; 121 | inherit system home-manager inputs headless; 122 | }; 123 | } 124 | // ( 125 | let 126 | target = 127 | if default 128 | then "default" 129 | else "christian@${hostname}"; 130 | in { 131 | packages."${system}"."${target}" = self.homeManagerConfigurations."christian@${hostname}".activationPackage; 132 | } 133 | ); 134 | in 135 | lib.foldr lib.recursiveUpdate {} (map mkSystem [ 136 | { 137 | # NixOS Desktop 138 | hostname = "whitenoise"; 139 | system = x86_64-linux; 140 | default = true; 141 | } 142 | { 143 | # NixOS Desktop 144 | hostname = "athena"; 145 | system = x86_64-linux; 146 | } 147 | { 148 | # iMac Pro 149 | hostname = "thunderclap"; 150 | system = x86_64-darwin; 151 | default = true; 152 | } 153 | { 154 | # MacBook Pro 155 | hostname = "meowmachine"; 156 | system = aarch64-darwin; 157 | default = true; 158 | } 159 | { 160 | # MacBook Air 161 | hostname = "la-tigra"; 162 | system = aarch64-darwin; 163 | } 164 | ]); 165 | } 166 | -------------------------------------------------------------------------------- /init.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meowgorithm/dotfiles/15d16a1902d59a9824982fb4e2eed50e13dd6842/init.gpg -------------------------------------------------------------------------------- /modules/home/alacritty.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...} @ inputs: let 2 | isDarwin = 3 | inputs.pkgs.stdenv.isDarwin; 4 | in { 5 | programs.alacritty = { 6 | enable = true; 7 | 8 | settings = { 9 | window = 10 | { 11 | padding = { 12 | x = 10; 13 | y = 16; 14 | }; 15 | } 16 | // ( 17 | if isDarwin 18 | then {decorations = "buttonless";} 19 | else {} 20 | ); 21 | 22 | font = let 23 | fontFamily = "JetBrains Mono"; 24 | in 25 | { 26 | normal = { 27 | family = fontFamily; 28 | style = "Light"; 29 | }; 30 | bold = { 31 | family = fontFamily; 32 | style = "Bold"; 33 | }; 34 | italic = { 35 | family = fontFamily; 36 | style = "Bold Italic"; 37 | }; 38 | bold_italic = { 39 | family = fontFamily; 40 | style = "Bold Italic"; 41 | }; 42 | } 43 | // ( 44 | if isDarwin 45 | then { 46 | size = 12.0; 47 | offset = { 48 | x = 0; 49 | y = 2; 50 | }; 51 | glyph_offset = { 52 | x = 0; 53 | y = 3; 54 | }; 55 | } 56 | else { 57 | size = 7.0; 58 | } 59 | ); 60 | 61 | colors = import ./colors.nix; 62 | }; 63 | }; 64 | } 65 | -------------------------------------------------------------------------------- /modules/home/bash/bash_funcs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | getCharmRepos() { 4 | getRepos() { 5 | gh repo list charmbracelet --visibility="$1" --json name 6 | } 7 | 8 | getAllRepos() { 9 | printf '%s %s' "$(getRepos "public")" "$(getRepos "private")" | jq -s 'add' 10 | } 11 | 12 | getAllRepos | 13 | jq .[].name | 14 | tr -d '"' | 15 | sort 16 | } 17 | 18 | pickCharmRepo() { 19 | getCharmRepos | gum filter --height=10 --header "$1" 20 | } 21 | 22 | charm_clone() { 23 | local repo 24 | repo="$(pickCharmRepo "Clone which Charm™ repo?")" 25 | if [[ -z "$repo" ]]; then 26 | printf "Okay, never mind.\n" 27 | return 1 28 | fi 29 | git clone "git@github.com:charmbracelet/$repo" "$HOME/src/$repo" 30 | } 31 | 32 | go_get_charm() { 33 | local repo 34 | repo="$(pickCharmRepo "Which Charm™ repo do you want to ‘go get?’")" 35 | if [[ -z "$repo" ]]; then 36 | printf "Okay, never mind.\n" 37 | return 1 38 | fi 39 | go get "github.com/charmbracelet/$repo" 40 | } 41 | 42 | which_os() { 43 | case "$OSTYPE" in 44 | darwin*) 45 | printf "darwin" 46 | ;; 47 | 48 | linux*) 49 | if [[ -f "/etc/issue" ]]; then 50 | issue=$(cat /etc/issue) 51 | if [[ $issue =~ "NixOS" ]]; then 52 | printf "nixos" 53 | elif [[ $issue =~ "Void" ]]; then 54 | printf "void" 55 | elif [[ $issue =~ "Arch" ]]; then 56 | printf "arch" 57 | elif [[ $issue =~ "Debian" ]]; then 58 | printf "debian" 59 | else 60 | printf "linux" 61 | fi 62 | fi 63 | ;; 64 | esac 65 | printf "" 66 | } 67 | 68 | command_exists() { 69 | if command -v "$1" &>/dev/null; then 70 | printf 1 71 | return 72 | fi 73 | printf 0 74 | } 75 | 76 | commands_exist() { 77 | for arg in "$@"; do 78 | if [[ ! command_exists != "$arg" ]]; then 79 | printf '%s' "$arg" 80 | fi 81 | done 82 | printf "" 83 | } 84 | 85 | #shellcheck disable=1090 86 | decryptAndSource() { 87 | command -v gpg >/dev/null 2>&1 && 88 | source <(gpg --decrypt <<<"$1" 2>/dev/null) 89 | } 90 | 91 | gitdiff() { 92 | if [[ $(which_os) == darwin ]]; then 93 | opendiff 94 | else 95 | vimdiff 96 | fi 97 | } 98 | 99 | remove_headerbar() { 100 | case "$OSTYPE" in 101 | linux*) xprop -format _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS 2 ;; 102 | *) return ;; 103 | esac 104 | } 105 | -------------------------------------------------------------------------------- /modules/home/bash/bashrc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Where our dotfiles repo lives 4 | export DOTFILES="$HOME/.dotfiles" 5 | 6 | os="$(which_os)" 7 | 8 | # OS/Distro specific stuff 9 | case "$os" in 10 | nixos) 11 | alias ls='ls --color=auto' 12 | PS1='[\u@\h \W]\$ ' 13 | 14 | # Fixes for various things on demand 15 | alias make-firefox-default="xdg-settings set default-web-browser firefox.desktop" 16 | alias fix-display='xrandr --output DP-0 --mode 2560x2880 --pos 0x0 --output DP-2 --mode 2560x2880 --pos 2560x0' 17 | alias set-wallpaper='[ -f "$HOME/.wallpaper" ] && feh --bg-scale "$HOME/.wallpaper"' 18 | alias start-picom='systemctl --user start picom.service' 19 | alias stop-picom='systemctl --user stop picom.service' 20 | alias restart-picom='systemctl --user restart picom.service' 21 | ;; 22 | 23 | debian) 24 | # shellcheck disable=1091 25 | if ! shopt -oq posix; then 26 | if [ -f /usr/share/bash-completion/bash_completion ]; then 27 | . /usr/share/bash-completion/bash_completion 28 | elif [ -f /etc/bash_completion ]; then 29 | . /etc/bash_completion 30 | fi 31 | fi 32 | ;; 33 | 34 | darwin) 35 | # Brew on Apple Silicon lives in /opt/homebrew and needs to initialize 36 | # in the shell with a script. 37 | bash_bin_arm="/opt/homebrew/bin/brew" 38 | if [[ $(uname -m) == "arm64" && -f $bash_bin_arm ]]; then 39 | eval "$("$bash_bin_arm" shellenv)" 40 | fi 41 | 42 | # Make sure XDG_CONFIG_HOME is a thing 43 | if [[ -z $XDG_CONFIG_HOME ]]; then 44 | export XDG_CONFIG_HOME="$HOME/.config" 45 | fi 46 | mkdir -p "$XDG_CONFIG_HOME" 47 | 48 | export CLICOLOR=1 49 | export LSCOLORS=dxfxcxdxbxegedabagacad 50 | alias ls='ls -h' 51 | 52 | # Keep TAR from tarring-up resource forks 53 | export COPYFILE_DISABLE=true 54 | 55 | # History Management 56 | shopt -s histappend 57 | export HISTCONTROL=ignoredups:erasedups 58 | export HISTSIZE=1000 59 | 60 | # Miscellaneous aliases 61 | alias flushdns='sudo dscacheutil -flushcache && dscacheutil -flushcache' 62 | alias fix_spotlight="find . -type d -path './.*' -prune -o -path './Pictures*' -prune -o -path './Library*' -prune -o -path '*node_modules/*' -prune -o -type d -name 'node_modules' -exec touch '{}/.metadata_never_index' \; -print" 63 | alias brew-remove="brew list | sort | gum filter --no-limit | xargs brew remove" 64 | 65 | # Print local network adapter IPs and copy them to the clipboard 66 | alias en0="ipconfig getifaddr en0 | pbcopy && ipconfig getifaddr en0" 67 | alias en1="ipconfig getifaddr en1 | pbcopy && ipconfig getifaddr en1" 68 | 69 | # Colored man pages 70 | export LESS_TERMCAP_mb=$'\E[01;31m' 71 | export LESS_TERMCAP_md=$'\E[01;31m' 72 | export LESS_TERMCAP_me=$'\E[0m' 73 | export LESS_TERMCAP_se=$'\E[0m' 74 | export LESS_TERMCAP_so=$'\E[01;44;33m' 75 | export LESS_TERMCAP_ue=$'\E[0m' 76 | export LESS_TERMCAP_us=$'\E[01;32m' 77 | ;; 78 | 79 | esac 80 | 81 | function nixPrompt() { 82 | case $IN_NIX_SHELL in 83 | pure) printf ' ' ;; 84 | impure) printf ' ' ;; 85 | *) printf '' ;; 86 | esac 87 | } 88 | 89 | red='\[\e[0;31m\]' 90 | yellow='\[\e[0;33m\]' 91 | cyan='\[\e[0;36m\]' 92 | violet='\[\e[38;5;63m\]' 93 | no_color='\[\e[0m\]' 94 | indigo='\[\e[38;2;90;86;224m\]' 95 | 96 | function prompt_func() { 97 | nix=$(nixPrompt) 98 | dimensions="$(tput cols)×$(tput lines)" 99 | git_branch=$(__git_ps1 " (%s)") 100 | 101 | if [[ -n $DEMO_PROMPT ]]; then 102 | PS1="$indigo>$no_color " 103 | else 104 | PS1="$indigo$dimensions $cyan\h:$red\w $cyan\u$yellow$git_branch$violet$nix $red\$ $no_color" 105 | fi 106 | } 107 | 108 | PROMPT_COMMAND=prompt_func 109 | 110 | gpg_TTY=$(tty) 111 | export GPG_TTY=$gpg_TTY 112 | export PATH="$PATH:$HOME/.bin" 113 | export PATH="$GOPATH/bin:$PATH" 114 | 115 | if [[ "$OSTYPE" == "linux" || "$OSTYPE" == "linux-gnu" ]]; then 116 | export PATH="$PATH:$HOME/.bin-linux" 117 | fi 118 | 119 | function updateinputs() { 120 | local inputs 121 | inputs="$(nix flake metadata --json | jq -r '.locks.nodes.root.inputs | keys | .[]' | gum filter --no-limit)" 122 | printf "Updating the following inputs:\n%s\n" "$input" 123 | IFS=$'\n' 124 | for input in $inputs; do 125 | nix flake update "$input" 126 | done 127 | } 128 | 129 | alias delete_pyc='find . -name '\*.pyc' -delete' 130 | alias delete_orig='find . -name '\*.orig' -delete' 131 | alias lock_pip='export PIP_REQUIRE_VIRTUALENV=true' 132 | alias unlock_pip='export PIP_REQUIRE_VIRTUALENV=false' 133 | alias ggbt='go get github.com/charmbracelet/bubbletea/v2@latest' 134 | alias ggb='go get github.com/charmbracelet/bubbles/v2@latest' 135 | alias gglg='go get github.com/charmbracelet/lipgloss/v2@latest' 136 | alias ggg='go get github.com/charmbracelet/glamour/v2/@latest' 137 | alias ggct='go get github.com/charmbracelet/x/exp/charmtone@main' 138 | alias lw='ssh localhost -p 23231' 139 | alias nb='nix build -L' 140 | alias nr='nix run -L' 141 | alias sshi='ssh -o IdentitiesOnly=yes' 142 | alias charm-install='gh repo list charmbracelet | cut -f1 | gum filter --no-limit | xargs -I {} go install -v "github.com/{}@latest"' 143 | alias code-review='git --no-pager diff | mods -f "code review this patch" | glow' 144 | alias filterkill='ps | awk "NR>1" | gum choose --header=" Kill Process?" | xargs kill' 145 | 146 | alias install-melt="go install -v github.com/charmbracelet/melt/cmd/melt@latest" 147 | alias install-gum="go install -v github.com/charmbracelet/gum@latest" 148 | alias tree='tree -C' 149 | 150 | # shellcheck disable=1091 151 | if test -n "$KITTY_INSTALLATION_DIR" -a -e "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"; then 152 | source "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash" 153 | fi 154 | 155 | # Go mod replace helper for Charm stuff 156 | gmr() { 157 | if [[ $# != 2 ]]; then 158 | printf 'We need two arguments\n' 159 | return 160 | fi 161 | go mod edit -replace "github.com/charmbracelet/$1=$2" 162 | } 163 | 164 | # GHCUP 165 | # shellcheck disable=1091 166 | [ -f "$HOME/.ghcup/env" ] && . "$HOME/.ghcup/env" 167 | export PATH="$PATH:$HOME/.ghcup/bin" 168 | 169 | # Cargo 170 | export PATH="$PATH:$HOME/.cargo/bin" 171 | export PATH="$HOME/.local/bin:$PATH" 172 | 173 | # Nix 174 | export PATH="$PATH:$HOME/.nix-profile/bin" 175 | 176 | # Helper vars 177 | export MEOW='git@github.com:meowgorithm' 178 | export MAGIC='git@github.com:magicnumbers' 179 | export BIT='https://meowgorithm@bitbucket.org/meowgorithm' 180 | export GITLAB='git@gitlab.com:meowgorithm' 181 | export CHARM='git@github.com:charmbracelet' 182 | export GOCHARM='github.com/charmbracelet' 183 | export GOMEOW='github.com/charmbracelet' 184 | 185 | # Direnv 186 | command -v direnv >/dev/null 2>&1 && eval "$(direnv hook bash)" 187 | 188 | # Prioritize /usr/bin on macOS 189 | if [[ "$os" == "darwin" ]]; then 190 | export PATH="/usr/bin:$PATH" 191 | fi 192 | -------------------------------------------------------------------------------- /modules/home/bash/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | } @ inputs: let 7 | note = name: "\n\n# --- ${name} ---\n\n"; 8 | 9 | readIntoVar = varName: path: 10 | "rc=\"$(cat <&1\n\n app_path=\"$HOME/Applications/Home Manager Apps\"\n tmp_path=\"$(mktemp -dt \"home-manager-applications.XXXXXXXXXX\")\" || exit 1\n\n ${pkgs.fd}/bin/fd \\\n -t l -d 1 . ${apps}/Applications \\\n -x $DRY_RUN_CMD ${mkalias} -L {} \"$tmp_path/{/}\"\n\n $DRY_RUN_CMD rm -rf \"$app_path\"\n $DRY_RUN_CMD mv \"$tmp_path\" \"$app_path\"\n"); 27 | } 28 | -------------------------------------------------------------------------------- /modules/home/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | home-manager, 3 | pkgs, 4 | system ? "x86_64-linux", 5 | inputs, 6 | headless, 7 | }: let 8 | lib = pkgs.lib; 9 | 10 | # 3rd party fonts 11 | fonts = [ 12 | "anchor" 13 | "arno-pro" 14 | "benjamins-gothic" 15 | "gabriello" 16 | "gelion" 17 | "larsseit" 18 | "liza" 19 | "maru" 20 | "monoflow" 21 | "mononoki" 22 | "mori" 23 | "neufile-grotesk" 24 | "pangaia" 25 | "pique" 26 | "rifton" 27 | "rois" 28 | "saans" 29 | "sf-mono" 30 | "symbolset" 31 | "untitled-sans" 32 | "upton" 33 | ]; 34 | 35 | # Packges from the Charm Nix User Respository 36 | charmPkgs = [ 37 | "freeze" 38 | "glow" 39 | "gum" 40 | "melt" 41 | "mods" 42 | "pop" 43 | "skate" 44 | "soft-serve" 45 | "vhs" 46 | "wishlist" 47 | ]; 48 | 49 | # Packages from Carlos' Nix User Repository 50 | carlosPkgs = [ 51 | "mdtree" 52 | "svu" 53 | ]; 54 | 55 | # Build a macOS application from a DMG. Will do nothing if the OS is not 56 | # macOS. 57 | mkDmg = name: appName: src: let 58 | mkIfDarwin = pkgs.lib.mkIf pkgs.stdenv.isDarwin; 59 | in 60 | mkIfDarwin (pkgs.stdenv.mkDerivation { 61 | inherit name src; 62 | buildInputs = with pkgs; [undmg]; 63 | sourceRoot = "${appName}.app"; 64 | phases = ["unpackPhase" "installPhase"]; 65 | unpackPhase = '' 66 | undmg "${src}"; 67 | ''; 68 | installPhase = '' 69 | mkdir -p "$out/Applications/${appName}.app" 70 | cp -pR * "$out/Applications/${appName}.app" 71 | ''; 72 | }); 73 | 74 | overlays = [ 75 | # Add packages from NURs 76 | ( 77 | self: super: let 78 | useNurPkg = nurName: pkgName: { 79 | ${pkgName} = inputs.${nurName}.packages.${self.system}.${pkgName}; 80 | }; 81 | in 82 | lib.foldr lib.recursiveUpdate {} ( 83 | (map (useNurPkg "charm") charmPkgs) 84 | ++ (map (useNurPkg "carlos") carlosPkgs) 85 | ) 86 | ) 87 | 88 | # Rio 89 | ( 90 | self: super: { 91 | rio = inputs.rio.packages.${system}.rio; 92 | } 93 | ) 94 | 95 | # macOS applications 96 | ( 97 | self: super: { 98 | dozer = mkDmg "dozer" "Dozer" inputs.dozer; 99 | monitorcontrol = mkDmg "monitorcontrol" "MonitorControl" inputs.monitorcontrol; 100 | } 101 | ) 102 | 103 | # Custom fonts 104 | (self: super: let 105 | mkFont = name: { 106 | "${name}" = pkgs.stdenv.mkDerivation { 107 | inherit name; 108 | src = inputs."${name}"; 109 | installPhase = '' 110 | mkdir -p $out/share/fonts/otf 111 | cp $src/* $out/share/fonts/otf 112 | ''; 113 | }; 114 | }; 115 | in 116 | with lib; foldr recursiveUpdate {} (map mkFont fonts)) 117 | ]; 118 | 119 | extraModules = lib.optionals (pkgs.stdenv.isLinux && ! headless) [ 120 | { 121 | home.packages = with pkgs; [ 122 | _1password-cli 123 | _1password-gui 124 | brave 125 | dunst 126 | eyedropper 127 | feh 128 | firefox 129 | inputs.ghostty.packages.${system}.default 130 | google-chrome 131 | gthumb 132 | shotgun 133 | slop 134 | tdesktop 135 | vlc 136 | xfce.thunar 137 | ]; 138 | } 139 | ./discord.nix 140 | ./hyprland 141 | ./picom.nix 142 | ./rofi 143 | ]; 144 | in 145 | home-manager.lib.homeManagerConfiguration { 146 | pkgs = pkgs // {inherit overlays;}; 147 | extraSpecialArgs = { 148 | inherit inputs system fonts charmPkgs carlosPkgs headless; 149 | }; 150 | modules = 151 | [ 152 | rec { 153 | home.stateVersion = "22.11"; 154 | home.username = "christian"; 155 | home.homeDirectory = 156 | ( 157 | if pkgs.stdenv.isDarwin 158 | then "/Users/" 159 | else "/home/" 160 | ) 161 | + home.username; 162 | } 163 | ./bash 164 | ./darwin-app-activation.nix 165 | ./emacs 166 | ./floskell 167 | ./fonts.nix 168 | ./fourmolu 169 | ./git.nix 170 | ./go.nix 171 | ./gpg.nix 172 | ./helix 173 | ./kakoune 174 | ./neovim 175 | ./nushell.nix 176 | ./pkgs.nix 177 | ./prettier 178 | ./readline.nix 179 | ./scripts 180 | ./ssh.nix 181 | ./tmux 182 | ./wezterm 183 | ] 184 | ++ (lib.optionals (! headless) [ 185 | ./alacritty.nix 186 | ./ghostty.nix 187 | ./kitty.nix 188 | ./rio.nix 189 | ]) 190 | ++ extraModules; 191 | } 192 | -------------------------------------------------------------------------------- /modules/home/discord.nix: -------------------------------------------------------------------------------- 1 | { config 2 | , pkgs 3 | , lib 4 | , ... 5 | }: { 6 | # By default Discord requires that the latest version be installed. Turn that 7 | # off. 8 | xdg.configFile."discord/settings.json".text = ''{"SKIP_HOST_UPDATE": true}''; 9 | } 10 | -------------------------------------------------------------------------------- /modules/home/emacs/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | programs.emacs = { 3 | enable = false; 4 | package = pkgs.emacs; 5 | extraPackages = emacsPkgs: 6 | with emacsPkgs; [ 7 | go-mode 8 | lsp-mode 9 | lsp-ui 10 | company 11 | yasnippet 12 | ]; 13 | extraConfig = builtins.readFile ./init.el; 14 | }; 15 | 16 | home.file.".emacs".text = '' 17 | (setq inhibit-startup-message t) 18 | ''; 19 | } 20 | -------------------------------------------------------------------------------- /modules/home/emacs/init.el: -------------------------------------------------------------------------------- 1 | (menu-bar-mode -1) 2 | (scroll-bar-mode -1) 3 | (tool-bar-mode -1) 4 | (global-hl-line-mode 1) 5 | (add-hook 'prog-mode-hook 'display-line-numbers-mode) 6 | 7 | (require 'org) 8 | 9 | ;; Company mode. 10 | (setq company-idle-delay 0) 11 | (setq company-minimum-prefix-length 1) 12 | 13 | ;; LSP mode. 14 | (require 'lsp-mode) 15 | (defun lsp-go-install-save-hooks () 16 | (add-hook 'before-save-hook #'lsp-format-buffer t t) 17 | (add-hook 'before-save-hook #'lsp-organize-imports t t)) 18 | 19 | ;; Go mode. 20 | (add-hook 'go-mode-hook #'lsp-deferred) 21 | (add-hook 'go-mode-hook #'lsp-go-install-save-hooks) 22 | (add-hook 'go-mode-hook #'lsp-deferred) 23 | (add-hook 'go-mode-hook #'yas-minor-mode) 24 | -------------------------------------------------------------------------------- /modules/home/floskell/default.nix: -------------------------------------------------------------------------------- 1 | {...}: { 2 | xdg.configFile.".floskell.json".source = ./floskell.json; 3 | } 4 | -------------------------------------------------------------------------------- /modules/home/floskell/floskell.json: -------------------------------------------------------------------------------- 1 | { 2 | "style": "chris-done", 3 | "extensions": [], 4 | "fixities": [], 5 | "formatting": { 6 | "op": { 7 | ",": { 8 | "force-linebreak": false, 9 | "spaces": "after", 10 | "linebreaks": "before" 11 | }, 12 | "default": { 13 | "force-linebreak": false, 14 | "spaces": "both", 15 | "linebreaks": "before" 16 | }, 17 | ". in expression": { 18 | "force-linebreak": false, 19 | "spaces": "both", 20 | "linebreaks": "before" 21 | }, 22 | ". in type": { 23 | "force-linebreak": false, 24 | "spaces": "after", 25 | "linebreaks": "after" 26 | }, 27 | "record": { 28 | "force-linebreak": false, 29 | "spaces": "after", 30 | "linebreaks": "after" 31 | } 32 | }, 33 | "group": { 34 | "(# in pattern": { 35 | "force-linebreak": false, 36 | "spaces": "both", 37 | "linebreaks": "after" 38 | }, 39 | "default": { 40 | "force-linebreak": false, 41 | "spaces": "both", 42 | "linebreaks": "after" 43 | }, 44 | "(# in expression": { 45 | "force-linebreak": false, 46 | "spaces": "both", 47 | "linebreaks": "after" 48 | }, 49 | ". in expression": { 50 | "force-linebreak": false, 51 | "spaces": "none", 52 | "linebreaks": "after" 53 | } 54 | }, 55 | "layout": { 56 | "infix-app": "flex", 57 | "if": "vertical", 58 | "import-spec-list": "flex", 59 | "con-decls": "vertical", 60 | "declaration": "vertical", 61 | "app": "flex", 62 | "let": "vertical", 63 | "record": "vertical", 64 | "type": "flex", 65 | "export-spec-list": "flex", 66 | "list-comp": "flex" 67 | }, 68 | "penalty": { 69 | "overfull": 10, 70 | "indent": 1, 71 | "overfull-once": 200, 72 | "max-line-length": 80, 73 | "linebreak": 100 74 | }, 75 | "indent": { 76 | "deriving": 4, 77 | "if": "indent-by 4", 78 | "let-binds": "indent-by 4", 79 | "import-spec-list": "indent-by 4", 80 | "onside": 4, 81 | "where": 2, 82 | "typesig": "indent-by 4", 83 | "do": "indent-by 4", 84 | "app": "indent-by 4", 85 | "case": "indent-by 4", 86 | "let-in": "indent-by 0", 87 | "where-binds": "indent-by 2", 88 | "let": "indent-by 4", 89 | "export-spec-list": "indent-by 4", 90 | "multi-if": "indent-by 4", 91 | "class": "indent-by 4" 92 | }, 93 | "align": { 94 | "let-binds": true, 95 | "where": true, 96 | "matches": false, 97 | "limits": [10, 25], 98 | "case": true, 99 | "import-module": false, 100 | "import-spec": false, 101 | "class": false, 102 | "record-fields": true 103 | }, 104 | "options": { 105 | "sort-pragmas": true, 106 | "flexible-oneline": false, 107 | "decl-no-blank-lines": [], 108 | "split-language-pragmas": false, 109 | "align-sum-type-decl": false, 110 | "sort-import-lists": true, 111 | "preserve-vertical-space": true, 112 | "sort-imports": [ 113 | { 114 | "prefixes": [""], 115 | "order": "sorted" 116 | }, 117 | { 118 | "prefixes": ["Test"], 119 | "order": "grouped" 120 | } 121 | ] 122 | } 123 | }, 124 | "language": "Haskell2010" 125 | } 126 | -------------------------------------------------------------------------------- /modules/home/fonts.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | fonts, 4 | headless, 5 | ... 6 | }: let 7 | maybeUse = pkgs.lib.optionals (! headless); 8 | 9 | allFonts = with pkgs; 10 | [ 11 | inter 12 | jetbrains-mono 13 | ibm-plex 14 | ] 15 | ++ (map (x: pkgs.${x}) fonts); 16 | in { 17 | home.packages = maybeUse allFonts; 18 | } 19 | -------------------------------------------------------------------------------- /modules/home/fourmolu/default.nix: -------------------------------------------------------------------------------- 1 | {...}: { 2 | xdg.configFile."fourmolu.yaml".source = ./fourmolu.yaml; 3 | } 4 | -------------------------------------------------------------------------------- /modules/home/fourmolu/fourmolu.yaml: -------------------------------------------------------------------------------- 1 | # Number of spaces per indentation step 2 | indentation: 4 3 | 4 | # Max line length for automatic line breaking 5 | column-limit: none 6 | 7 | # Styling of arrows in type signatures (choices: trailing, leading, or leading-args) 8 | function-arrows: leading 9 | 10 | # How to place commas in multi-line lists, records, etc. (choices: leading or trailing) 11 | comma-style: leading 12 | 13 | # Styling of import/export lists (choices: leading, trailing, or diff-friendly) 14 | import-export-style: diff-friendly 15 | 16 | # Whether to full-indent or half-indent 'where' bindings past the preceding body 17 | indent-wheres: true 18 | 19 | # Whether to leave a space before an opening record brace 20 | record-brace-space: false 21 | 22 | # Number of spaces between top-level declarations 23 | newlines-between-decls: 2 24 | 25 | # How to print Haddock comments (choices: single-line, multi-line, or multi-line-compact) 26 | haddock-style: multi-line-compact 27 | 28 | # How to print module docstring 29 | haddock-style-module: null 30 | 31 | # Styling of let blocks (choices: auto, inline, newline, or mixed) 32 | let-style: newline 33 | 34 | # How to align the 'in' keyword with respect to the 'let' keyword (choices: left-align, right-align, or no-space) 35 | in-style: left-align 36 | 37 | # Whether to put parentheses around a single constraint (choices: auto, always, or never) 38 | single-constraint-parens: always 39 | 40 | # Output Unicode syntax (choices: detect, always, or never) 41 | unicode: never 42 | 43 | # Give the programmer more choice on where to insert blank lines 44 | respectful: true 45 | 46 | # Fixity information for operators 47 | fixities: [] 48 | 49 | # Module reexports Fourmolu should know about 50 | reexports: [] 51 | -------------------------------------------------------------------------------- /modules/home/ghostty.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: let 2 | colors = import ./colors.nix; 3 | in { 4 | xdg.configFile."ghostty/config".text = 5 | '' 6 | term = xterm-256color 7 | 8 | macos-non-native-fullscreen = true 9 | macos-option-as-alt = left 10 | 11 | mouse-hide-while-typing = false 12 | copy-on-select = true 13 | confirm-close-surface = false 14 | link-url = true 15 | 16 | background = ${colors.background} 17 | foreground = ${colors.foreground} 18 | 19 | palette = 0=${colors.normal.black} 20 | palette = 1=${colors.normal.red} 21 | palette = 2=${colors.normal.green} 22 | palette = 3=${colors.normal.yellow} 23 | palette = 4=${colors.normal.blue} 24 | palette = 5=${colors.normal.magenta} 25 | palette = 6=${colors.normal.cyan} 26 | palette = 7=${colors.normal.white} 27 | palette = 8=${colors.bright.black} 28 | palette = 9=${colors.bright.red} 29 | palette = 10=${colors.bright.green} 30 | palette = 11=${colors.bright.yellow} 31 | palette = 12=${colors.bright.blue} 32 | palette = 13=${colors.bright.magenta} 33 | palette = 14=${colors.bright.cyan} 34 | palette = 15=${colors.bright.white} 35 | '' 36 | + ( 37 | if pkgs.stdenv.isDarwin 38 | then '' 39 | font-family = JetBrains Mono Light 40 | font-family-bold = JetBrains Mono Bold 41 | font-family-italic = JetBrains Mono Italic 42 | font-family-bold-italic = JetBrains Mono Bold Italic 43 | font-size = 13 44 | font-thicken = true 45 | adjust-cursor-thickness = 175% 46 | adjust-cell-width = -4% 47 | window-padding-x = 12 48 | window-padding-y = 10 49 | keybind = super+f=toggle_fullscreen 50 | window-colorspace = display-p3 51 | '' 52 | else '' 53 | window-decoration = false 54 | font-family = JetBrains Mono 55 | font-size = 7 56 | window-padding-x = 6 57 | window-padding-y = 5 58 | '' 59 | ); 60 | } 61 | -------------------------------------------------------------------------------- /modules/home/git.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | programs.git = { 3 | enable = true; 4 | package = pkgs.gitFull; 5 | userName = "Christian Rocha"; 6 | userEmail = "christian@rocha.is"; 7 | 8 | lfs.enable = true; 9 | 10 | ignores = [ 11 | ".DS_Store" 12 | ".ghc.environment.*" 13 | "xmonad-x86_64-linux" 14 | "xmonad.errors" 15 | "*.hi" 16 | "*.o" 17 | "nohup.out" 18 | "\#*" 19 | ]; 20 | 21 | signing = { 22 | signByDefault = true; 23 | key = "92B3C5E83E309FE64CB2F833589F6FDD5B820611"; 24 | }; 25 | 26 | aliases = { 27 | st = "status"; 28 | ci = "commit"; 29 | co = "checkout"; 30 | rs = "restore --staged"; 31 | count = "!git log --pretty=oneline | wc -l | tr -d ' ' | sed 's/$/ commits/'"; 32 | sync = "fetch --all --tags --prune"; 33 | housekeeping = "!git fsck && git fsck --unreachable && git gc --aggressive --prune && git prune && git prune-packed"; 34 | quickfix = "rebase --interactive HEAD^^"; 35 | wipeout = "!git branch | sed 's/^[*]* *//' | gum choose --no-limit --header 'Wipeout which branches?' | xargs git branch -D"; 36 | lg = "!git lg1"; 37 | lg1 = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"; 38 | lg2 = "log --graph --format=format:'%C(117)%h%C(reset) %s %C(dim white)%ar%C(reset) %C(181)%ae%C(reset) %C(141)%d%C(reset)' --all"; 39 | lgs = "log --graph --format=format:'%C(117)%h%C(reset) %C(226)%G?%C(reset) %s %C(dim white)%ar%C(reset) %C(181)%ae%C(reset) %C(141)%d%C(reset)' --all"; 40 | }; 41 | 42 | extraConfig = { 43 | color.ui = true; 44 | core = { 45 | editor = "hx"; 46 | }; 47 | url."git@github.com:".insteadOf = "https://github.com/"; 48 | }; 49 | }; 50 | } 51 | -------------------------------------------------------------------------------- /modules/home/go.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | programs.go = { 3 | enable = true; 4 | package = pkgs.go_1_24; 5 | goPath = ".go"; 6 | # goPrivate = [ 7 | # "github.com/charmbracelet" 8 | # "github.com/meowgorithm" 9 | # ]; 10 | }; 11 | 12 | home.packages = with pkgs; [ 13 | delve 14 | gofumpt 15 | golangci-lint 16 | golangci-lint-langserver 17 | gopls 18 | goreleaser 19 | gotools 20 | ]; 21 | } 22 | -------------------------------------------------------------------------------- /modules/home/gpg.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: { 7 | programs.gpg = { 8 | enable = true; 9 | }; 10 | 11 | services.gpg-agent = { 12 | defaultCacheTtl = 60 * 60 * 8; 13 | maxCacheTtl = 60 * 60 * 8; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /modules/home/helix/charm.nix: -------------------------------------------------------------------------------- 1 | let 2 | colors = import ../colors.nix; 3 | normal = colors.normal; 4 | bright = colors.bright; 5 | in { 6 | "ui.window" = normal.black; 7 | "ui.menu" = {bg = normal.black;}; 8 | "ui.menu.selected" = {bg = bright.black;}; 9 | "ui.menu.scroll" = { 10 | fg = normal.black; 11 | bg = normal.black; 12 | }; 13 | "ui.linenr" = { 14 | fg = "#3A3A3A"; 15 | }; 16 | "ui.linenr.selected" = { 17 | fg = "#6C6C6C"; 18 | }; 19 | "ui.popup" = { 20 | fg = normal.white; 21 | bg = normal.black; 22 | }; 23 | "ui.popup.info" = { 24 | fg = normal.white; 25 | }; 26 | "ui.selection" = { 27 | fg = normal.black; 28 | bg = normal.blue; 29 | }; 30 | "ui.selection.primary" = { 31 | fg = "#FFFDF5"; 32 | bg = "#5C42FF"; 33 | }; 34 | "ui.statusline" = { 35 | fg = normal.white; 36 | bg = "#202020"; 37 | }; 38 | "ui.statusline.inactive" = { 39 | fg = "#363636"; 40 | bg = "#1B1B1B"; 41 | }; 42 | "ui.statusline.normal" = { 43 | bg = "#333333"; 44 | modifiers = ["bold"]; 45 | }; 46 | "ui.statusline.insert" = { 47 | bg = "#00C3AC"; 48 | fg = "#FFFDF5"; 49 | modifiers = ["bold"]; 50 | }; 51 | "ui.statusline.select" = { 52 | bg = "#FF86D6"; 53 | fg = "#FFFDF5"; 54 | modifiers = ["bold"]; 55 | }; 56 | "ui.help" = { 57 | fg = normal.white; 58 | }; 59 | "ui.cursor" = {modifiers = ["reversed"];}; 60 | "ui.cursorline.primary" = {bg = "#080808";}; 61 | "ui.cursorline.secondary" = {bg = "#121212";}; 62 | "ui.virtual.inlay-hint" = { 63 | fg = "#585858"; 64 | }; 65 | "ui.virtual.ruler" = {bg = "#1D1D1D";}; 66 | "ui.virtual.whitespace" = {fg = "#3A3A3A";}; 67 | "ui.cursor.match" = { 68 | fg = normal.cyan; 69 | modifiers = ["underlined"]; 70 | }; 71 | "ui.gutter" = {}; 72 | 73 | "warning" = normal.yellow; 74 | "hint" = normal.white; 75 | "info" = normal.blue; 76 | 77 | "diff.delta" = normal.yellow; 78 | "diff.minus" = "#FD5B5B"; 79 | "diff.plus" = "#00D787"; 80 | 81 | "constructor" = normal.blue; 82 | "debug" = normal.white; 83 | "diagnostic" = {modifiers = ["underlined"];}; 84 | "error" = { 85 | fg = "#F05B5B"; 86 | }; 87 | "label" = "#C69669"; 88 | 89 | "attribute" = "#FD5B5B"; # class attributes, HTML tag attributes 90 | "type" = "#6E6ED8"; 91 | "constant" = "#FFFF87"; 92 | "constant.character.escape" = "#AFFFD7"; 93 | "constant.numeric" = "#FFFF87"; 94 | "constant.numeric.integer" = "#FFFF87"; 95 | "constant.numeric.float" = "#FFFF87"; 96 | "constant.builtin" = ""; # constants proviced by the language 97 | "constant.builtin.boolean" = ""; 98 | "string" = "#C69669"; 99 | "string.regexp" = "#C69669"; 100 | "string.special" = "#FF5FD2"; 101 | "string.special.path" = "#C69669"; 102 | "string.special.url" = "#C69669"; 103 | "string.special.symbol" = "#C69669"; # erlang atoms, ruby symbols, clojure keywords 104 | "comment" = "#05785F"; 105 | "comment.line" = "#676767"; 106 | "comment.block" = "#676767"; 107 | "comment.block.documentation" = "#676767"; 108 | "variable" = normal.white; 109 | "variable.builtin" = "#FF5FD2"; # self, this, super, etc 110 | "variable.parameter" = normal.white; # function parameters 111 | "variable.other.member" = normal.blue; # struct fields, unions 112 | 113 | "keyword" = "#00AAFF"; 114 | "keyword.control.conditional" = "#00AAFF"; 115 | "keyword.control.import" = "#00AAFF"; 116 | "keyword.control.return" = "#00AAFF"; 117 | "keyword.control.exception" = "#00AAFF"; 118 | "keyword.operator" = "#00AAFF"; # or, in 119 | "keyword.directive" = "#FF875F"; # preprocessor directives 120 | "keyword.storage" = "#FF875F"; 121 | "keyword.storage.type" = "#FF875F"; # class, function, var, let, etc 122 | "keyword.storage.modifier" = "#FF875F"; # static, mut, const, ref, etc 123 | "operator" = "#EF8080"; 124 | "function" = "#00D787"; 125 | "function.builtin" = "#FF8EC7"; 126 | "function.method" = "#FD5B5B"; 127 | "function.macro" = "#FD5B5B"; 128 | "function.special" = "#FD5B5B"; 129 | "tag" = ""; 130 | "namespace" = "#FF5F87"; 131 | } 132 | -------------------------------------------------------------------------------- /modules/home/helix/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | xdg.configFile."helix/ignore".text = '' 3 | *.gif 4 | *.mp4 5 | *.webm 6 | ''; 7 | 8 | home.packages = with pkgs; [ 9 | helix-gpt 10 | ]; 11 | 12 | programs.helix = { 13 | enable = true; 14 | 15 | settings = { 16 | theme = "charm"; 17 | keys.normal = { 18 | g.q = ":reflow"; 19 | g.w = ":set whitespace.render all"; 20 | g.W = ":set whitespace.render none"; 21 | g.F.o = ":set auto-format false"; 22 | g.F.O = ":set auto-format true"; 23 | g.R = ":reload-all"; 24 | g.C = ":buffer-close-others"; 25 | X = "extend_line_above"; 26 | "{" = "goto_prev_paragraph"; 27 | "}" = "goto_next_paragraph"; 28 | D = ["select_mode" "goto_line_end" "delete_selection" "normal_mode"]; 29 | space.w = ":write"; 30 | space.q = ":quit"; 31 | space.H = ":toggle lsp.display-inlay-hints"; 32 | space.D = ":toggle end-of-line-diagnostics disable hint"; 33 | }; 34 | editor = { 35 | cursorline = true; 36 | true-color = true; 37 | lsp.display-messages = true; 38 | lsp.display-inlay-hints = false; 39 | rulers = [80]; 40 | auto-format = true; 41 | color-modes = true; 42 | statusline = { 43 | mode.normal = "NORMAL"; 44 | mode.insert = "INSERT"; 45 | mode.select = "SELECT"; 46 | left = ["mode" "spinner" "file-name"]; 47 | center = []; 48 | right = ["diagnostics" "selections" "position" "file-encoding" "file-line-ending" "file-type" "version-control"]; 49 | }; 50 | end-of-line-diagnostics = "hint"; 51 | inline-diagnostics = { 52 | cursor-line = "error"; 53 | other-lines = "error"; 54 | }; 55 | }; 56 | }; 57 | 58 | languages.language-server = { 59 | copilot = { 60 | command = "helix-gpt"; 61 | }; 62 | }; 63 | 64 | languages.language = [ 65 | { 66 | name = "nix"; 67 | auto-format = true; 68 | formatter = {command = "alejandra";}; 69 | language-servers = ["nil" "copilot"]; 70 | } 71 | { 72 | name = "haskell"; 73 | auto-format = true; 74 | formatter = {command = "fourmolu";}; 75 | language-servers = ["haskell-language-server-wrapper" "copilot"]; 76 | } 77 | { 78 | name = "cabal"; 79 | scope = ""; 80 | roots = []; 81 | file-types = ["cabal"]; 82 | formatter = {command = "cabal-fmt";}; 83 | auto-format = true; 84 | } 85 | { 86 | name = "go"; 87 | formatter = {command = "goimports";}; 88 | language-servers = ["gopls" "copilot"]; 89 | } 90 | { 91 | name = "lua"; 92 | auto-format = true; 93 | } 94 | { 95 | name = "html"; 96 | indent = { 97 | tab-width = 2; 98 | unit = " "; 99 | }; 100 | auto-format = false; 101 | formatter = { 102 | command = "prettier"; 103 | args = ["--parser" "html" "--tab-width" "2"]; 104 | }; 105 | } 106 | { 107 | name = "css"; 108 | indent = { 109 | tab-width = 4; 110 | unit = " "; 111 | }; 112 | formatter = { 113 | command = "prettier"; 114 | args = ["--parser" "css" "--tab-width" "2"]; 115 | }; 116 | language-servers = ["css-languageserver" "copilot"]; 117 | } 118 | { 119 | name = "typescript"; 120 | indent = { 121 | tab-width = 4; 122 | unit = " "; 123 | }; 124 | auto-format = true; 125 | formatter = { 126 | command = "prettier"; 127 | args = ["--parser" "typescript" "--tab-width" "4"]; 128 | }; 129 | language-servers = ["typescript-language-server" "copilot"]; 130 | } 131 | { 132 | name = "svg"; 133 | scope = ""; 134 | roots = []; 135 | file-types = ["svg"]; 136 | formatter = { 137 | command = "svgo"; 138 | args = ["--pretty" "-"]; 139 | }; 140 | } 141 | ]; 142 | 143 | themes = { 144 | charm = import ./charm.nix; 145 | }; 146 | }; 147 | } 148 | -------------------------------------------------------------------------------- /modules/home/hyprland/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | xdg.configFile."hypr/hyprland.conf".source = ./hyprland.conf; 3 | 4 | home.packages = with pkgs; [ 5 | waybar 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /modules/home/hyprland/hyprland.conf: -------------------------------------------------------------------------------- 1 | 2 | # ####################################################################################### 3 | # AUTOGENERATED HYPR CONFIG. 4 | # PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT, 5 | # OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS. 6 | # ####################################################################################### 7 | 8 | autogenerated = 0 # remove this line to remove the warning 9 | 10 | # This is an example Hyprland config file. 11 | # Refer to the wiki for more information. 12 | # https://wiki.hyprland.org/Configuring/ 13 | 14 | # Please note not all available settings / options are set here. 15 | # For a full list, see the wiki 16 | 17 | # You can split this configuration into multiple files 18 | # Create your files separately and then link them to this file like this: 19 | # source = ~/.config/hypr/myColors.conf 20 | 21 | 22 | ################ 23 | ### MONITORS ### 24 | ################ 25 | 26 | # See https://wiki.hyprland.org/Configuring/Monitors/ 27 | monitor=,preferred,auto,2 28 | 29 | xwayland { 30 | force_zero_scaling = true 31 | } 32 | 33 | 34 | ################### 35 | ### MY PROGRAMS ### 36 | ################### 37 | 38 | # See https://wiki.hyprland.org/Configuring/Keywords/ 39 | 40 | # Set programs that you use 41 | $terminal = ghostty 42 | $fileManager = dolphin 43 | $menu = wofi --show drun 44 | 45 | 46 | ################# 47 | ### AUTOSTART ### 48 | ################# 49 | 50 | # Autostart necessary processes (like notifications daemons, status bars, etc.) 51 | # Or execute your favorite apps at launch like this: 52 | 53 | # exec-once = $terminal 54 | # exec-once = nm-applet & 55 | # exec-once = waybar & hyprpaper & firefox 56 | 57 | 58 | ############################# 59 | ### ENVIRONMENT VARIABLES ### 60 | ############################# 61 | 62 | # See https://wiki.hyprland.org/Configuring/Environment-variables/ 63 | 64 | env = XCURSOR_SIZE,32 65 | env = HYPRCURSOR_SIZE,24 66 | env = GDK_SCALE,2 67 | 68 | 69 | ##################### 70 | ### LOOK AND FEEL ### 71 | ##################### 72 | 73 | # Refer to https://wiki.hyprland.org/Configuring/Variables/ 74 | 75 | # https://wiki.hyprland.org/Configuring/Variables/#general 76 | general { 77 | gaps_in = 5 78 | gaps_out = 20 79 | 80 | border_size = 2 81 | 82 | # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors 83 | col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg 84 | col.inactive_border = rgba(595959aa) 85 | 86 | # Set to true enable resizing windows by clicking and dragging on borders and gaps 87 | resize_on_border = false 88 | 89 | # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on 90 | allow_tearing = false 91 | 92 | layout = dwindle 93 | } 94 | 95 | # https://wiki.hyprland.org/Configuring/Variables/#decoration 96 | decoration { 97 | rounding = 10 98 | 99 | # Change transparency of focused and unfocused windows 100 | active_opacity = 1.0 101 | inactive_opacity = 1.0 102 | 103 | shadow { 104 | enabled = true 105 | range = 4 106 | render_power = 3 107 | color = rgba(1a1a1aee) 108 | } 109 | 110 | # https://wiki.hyprland.org/Configuring/Variables/#blur 111 | blur { 112 | enabled = true 113 | size = 3 114 | passes = 1 115 | 116 | vibrancy = 0.1696 117 | } 118 | } 119 | 120 | # https://wiki.hyprland.org/Configuring/Variables/#animations 121 | animations { 122 | enabled = yes, please :) 123 | 124 | # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more 125 | 126 | bezier = easeOutQuint,0.23,1,0.32,1 127 | bezier = easeInOutCubic,0.65,0.05,0.36,1 128 | bezier = linear,0,0,1,1 129 | bezier = almostLinear,0.5,0.5,0.75,1.0 130 | bezier = quick,0.15,0,0.1,1 131 | 132 | animation = global, 1, 10, default 133 | animation = border, 1, 5.39, easeOutQuint 134 | animation = windows, 1, 4.79, easeOutQuint 135 | animation = windowsIn, 1, 4.1, easeOutQuint, popin 87% 136 | animation = windowsOut, 1, 1.49, linear, popin 87% 137 | animation = fadeIn, 1, 1.73, almostLinear 138 | animation = fadeOut, 1, 1.46, almostLinear 139 | animation = fade, 1, 3.03, quick 140 | animation = layers, 1, 3.81, easeOutQuint 141 | animation = layersIn, 1, 4, easeOutQuint, fade 142 | animation = layersOut, 1, 1.5, linear, fade 143 | animation = fadeLayersIn, 1, 1.79, almostLinear 144 | animation = fadeLayersOut, 1, 1.39, almostLinear 145 | animation = workspaces, 1, 1.94, almostLinear, fade 146 | animation = workspacesIn, 1, 1.21, almostLinear, fade 147 | animation = workspacesOut, 1, 1.94, almostLinear, fade 148 | } 149 | 150 | # Ref https://wiki.hyprland.org/Configuring/Workspace-Rules/ 151 | # "Smart gaps" / "No gaps when only" 152 | # uncomment all if you wish to use that. 153 | # workspace = w[tv1], gapsout:0, gapsin:0 154 | # workspace = f[1], gapsout:0, gapsin:0 155 | # windowrulev2 = bordersize 0, floating:0, onworkspace:w[tv1] 156 | # windowrulev2 = rounding 0, floating:0, onworkspace:w[tv1] 157 | # windowrulev2 = bordersize 0, floating:0, onworkspace:f[1] 158 | # windowrulev2 = rounding 0, floating:0, onworkspace:f[1] 159 | 160 | # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more 161 | dwindle { 162 | pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below 163 | preserve_split = true # You probably want this 164 | } 165 | 166 | # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more 167 | master { 168 | new_status = master 169 | } 170 | 171 | # https://wiki.hyprland.org/Configuring/Variables/#misc 172 | misc { 173 | force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers 174 | disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :( 175 | } 176 | 177 | 178 | ############# 179 | ### INPUT ### 180 | ############# 181 | 182 | # https://wiki.hyprland.org/Configuring/Variables/#input 183 | input { 184 | kb_layout = us 185 | kb_variant = 186 | kb_model = 187 | kb_options = caps:escape 188 | kb_rules = 189 | 190 | follow_mouse = 1 191 | 192 | sensitivity = 0 # -1.0 - 1.0, 0 means no modification. 193 | 194 | touchpad { 195 | natural_scroll = false 196 | } 197 | } 198 | 199 | # https://wiki.hyprland.org/Configuring/Variables/#gestures 200 | gestures { 201 | workspace_swipe = false 202 | } 203 | 204 | # Example per-device config 205 | # See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more 206 | device { 207 | name = epic-mouse-v1 208 | sensitivity = -0.5 209 | } 210 | 211 | 212 | ################### 213 | ### KEYBINDINGS ### 214 | ################### 215 | 216 | # See https://wiki.hyprland.org/Configuring/Keywords/ 217 | $mainMod = SUPER # Sets "Windows" key as main modifier 218 | 219 | # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more 220 | bind = $mainMod, Return, exec, $terminal 221 | bind = $mainMod, C, killactive, 222 | bind = $mainMod, M, exit, 223 | bind = $mainMod, E, exec, $fileManager 224 | bind = $mainMod, V, togglefloating, 225 | bind = $mainMod, R, exec, $menu 226 | bind = $mainMod, P, pseudo, # dwindle 227 | bind = $mainMod SHIFT, J, togglesplit, # dwindle 228 | 229 | # Move focus with mainMod + arrow keys 230 | bind = $mainMod, h, movefocus, l 231 | bind = $mainMod, l, movefocus, r 232 | bind = $mainMod, j, movefocus, u 233 | bind = $mainMod, k, movefocus, d 234 | 235 | # Switch workspaces with mainMod + [0-9] 236 | bind = $mainMod, 1, workspace, 1 237 | bind = $mainMod, 2, workspace, 2 238 | bind = $mainMod, 3, workspace, 3 239 | bind = $mainMod, 4, workspace, 4 240 | bind = $mainMod, 5, workspace, 5 241 | bind = $mainMod, 6, workspace, 6 242 | bind = $mainMod, 7, workspace, 7 243 | bind = $mainMod, 8, workspace, 8 244 | bind = $mainMod, 9, workspace, 9 245 | bind = $mainMod, 0, workspace, 10 246 | 247 | # Move active window to a workspace with mainMod + SHIFT + [0-9] 248 | bind = $mainMod SHIFT, 1, movetoworkspace, 1 249 | bind = $mainMod SHIFT, 2, movetoworkspace, 2 250 | bind = $mainMod SHIFT, 3, movetoworkspace, 3 251 | bind = $mainMod SHIFT, 4, movetoworkspace, 4 252 | bind = $mainMod SHIFT, 5, movetoworkspace, 5 253 | bind = $mainMod SHIFT, 6, movetoworkspace, 6 254 | bind = $mainMod SHIFT, 7, movetoworkspace, 7 255 | bind = $mainMod SHIFT, 8, movetoworkspace, 8 256 | bind = $mainMod SHIFT, 9, movetoworkspace, 9 257 | bind = $mainMod SHIFT, 0, movetoworkspace, 10 258 | 259 | # Example special workspace (scratchpad) 260 | bind = $mainMod, S, togglespecialworkspace, magic 261 | bind = $mainMod SHIFT, S, movetoworkspace, special:magic 262 | 263 | # Scroll through existing workspaces with mainMod + scroll 264 | bind = $mainMod, mouse_down, workspace, e+1 265 | bind = $mainMod, mouse_up, workspace, e-1 266 | 267 | # Move/resize windows with mainMod + LMB/RMB and dragging 268 | bindm = $mainMod, mouse:272, movewindow 269 | bindm = $mainMod, mouse:273, resizewindow 270 | 271 | # Laptop multimedia keys for volume and LCD brightness 272 | bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ 273 | bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- 274 | bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle 275 | bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle 276 | bindel = ,XF86MonBrightnessUp, exec, brightnessctl s 10%+ 277 | bindel = ,XF86MonBrightnessDown, exec, brightnessctl s 10%- 278 | 279 | # Requires playerctl 280 | bindl = , XF86AudioNext, exec, playerctl next 281 | bindl = , XF86AudioPause, exec, playerctl play-pause 282 | bindl = , XF86AudioPlay, exec, playerctl play-pause 283 | bindl = , XF86AudioPrev, exec, playerctl previous 284 | 285 | ############################## 286 | ### WINDOWS AND WORKSPACES ### 287 | ############################## 288 | 289 | # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more 290 | # See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules 291 | 292 | # Example windowrule v1 293 | # windowrule = float, ^(kitty)$ 294 | 295 | # Example windowrule v2 296 | # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ 297 | 298 | # Ignore maximize requests from apps. You'll probably like this. 299 | windowrulev2 = suppressevent maximize, class:.* 300 | 301 | # Fix some dragging issues with XWayland 302 | windowrulev2 = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0 303 | -------------------------------------------------------------------------------- /modules/home/kakoune/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | programs.kakoune = { 3 | enable = true; 4 | extraConfig = builtins.readFile ./kakrc; 5 | }; 6 | 7 | home.packages = with pkgs; [ 8 | kak-lsp 9 | ]; 10 | } 11 | -------------------------------------------------------------------------------- /modules/home/kakoune/kakrc: -------------------------------------------------------------------------------- 1 | # Bootstrap plug.kak 2 | declare-option -docstring "plug.kak's directory" str plugkakdir "%val{config}/plugins/plug.kak" 3 | declare-option -docstring "plug.kak's main script" str plugkak "%opt{plugkakdir}/rc/plug.kak" 4 | try %{ 5 | source "%opt{plugkak}" 6 | } catch %sh{ 7 | if [ ! -d "$kak_opt_plugkakdir" ]; then 8 | git clone https://github.com/robertmeta/plug.kak.git "$kak_opt_plugkakdir" 9 | echo "source '%opt{plugkak}" 10 | fi 11 | } 12 | 13 | plug "andreyorst/plug.kak" noload 14 | 15 | # Highlight current line 16 | plug "insipx/kak-crosshairs" config %{ cursorline } 17 | 18 | # Fuzzy find with find 19 | def find -params 1 -shell-script-candidates %{ find . -type f -not -path '*/\.git/*' } %{ edit %arg{1} } 20 | 21 | # Fuzzy find with fzf 22 | plug "andreyorst/fzf.kak" config %{ 23 | map global user p ': fzf-modef' -docstring 'fzf find file' 24 | } defer "fzf-file" %{ 25 | set-option global fzf_file_command 'rg --hidden --files --glob !*.git' 26 | evaluate-commands %sh{ 27 | [ -n "$(command -v bat)" ] && echo "set-option global fzf_highlight_command bat" 28 | } 29 | } 30 | 31 | # Fuzzy find with Lua 32 | plug "gustavo-hms/luar" %{ 33 | plug "gustavo-hms/peneira" %{ 34 | require-module peneira 35 | 36 | set-option global peneira_files_command "rg --files" 37 | 38 | define-command peneira-buffers %{ 39 | peneira 'buffers: ' %{ printf '%s\n' $kak_quoted_buflist } %{ 40 | buffer %arg{1} 41 | } 42 | } 43 | 44 | map global normal ':peneira-files' -docstring 'fuzzy find files' 45 | map global user b ':peneira-buffers' -docstring 'fuzzy find buffers' 46 | } 47 | } 48 | 49 | # Tree 50 | plug "andreyorst/kaktree" config %{ 51 | hook global WinSetOption filetype=kaktree %{ 52 | remove-highlighter buffer/numbers 53 | remove-highlighter buffer/matching 54 | remove-highlighter buffer/wrap 55 | remove-highlighter buffer/show-whitespaces 56 | } 57 | kaktree-enable 58 | map global user 'n' ':kaktree-toggle' 59 | } 60 | 61 | # LSP 62 | eval %sh{kak-lsp --kakoune -s $kak_session} 63 | hook global WinSetOption filetype=(haskell|go|elm|sh) %{ 64 | lsp-enable-window 65 | lsp-auto-hover-enable 66 | } 67 | 68 | # Format Go on save 69 | hook global BufWritePre .*[.]go %{ 70 | try %{ lsp-code-action-sync '^Organize Imports$' } 71 | lsp-formatting-sync 72 | } 73 | 74 | # Default setings for buffers 75 | define-command -hidden buffer-default-setup %{ 76 | add-highlighter buffer/numbers number-lines -hlcursor -separator " │ " -min-digits 3 77 | modeline-parse 78 | } 79 | 80 | hook global BufOpenFile .* %{ buffer-default-setup } 81 | hook global BufCreate .* %{ buffer-default-setup } 82 | 83 | set-option global tabstop 4 84 | set-option global indentwidth 4 85 | set-option global scrolloff 5,5 86 | 87 | # Paragraph jumping 88 | map global normal '' '[p' 89 | map global normal '=' 'p' 90 | map global normal '' '}p' 91 | map global normal '_' '{p' 92 | 93 | # UI colors 94 | face global LineNumbers rgb:595959,default 95 | face global LineNumberCursor rgb:999999,default 96 | face global CursorLine default,rgb:ff0000 97 | face global crosshairs_line default,rgb:262626 98 | 99 | declare-option bool showing_whitespaces 100 | 101 | define-command -docstring "show whitespaces" show-whitespaces %{ 102 | add-highlighter global/whitespaces show-whitespaces -tab ▸ 103 | } 104 | 105 | define-command -docstring "hide whitespaces" hide-whitespaces %{ 106 | remove-highlighter global/whitespaces 107 | } 108 | 109 | define-command -docstring "toggle whitespaces" toggle-whitespaces %{ 110 | evaluate-commands %sh{ 111 | if [ "$kak_opt_showing_whitespaces" = "true" ]; then 112 | printf "%s\n" "hide-whitespaces" 113 | printf "%s\n" "set global showing_whitespaces false" 114 | else 115 | printf "%s\n" "show-whitespaces" 116 | printf "%s\n" "set global showing_whitespaces true" 117 | fi 118 | } 119 | } 120 | 121 | map global user -docstring "toggle whitespaces" 'w' ':toggle-whitespaces' 122 | 123 | # Horizontal split with tmux 124 | define-command horizontal-split \ 125 | -docstring "horizontal-split : open vertical-split" \ 126 | -params 0.. \ 127 | -file-completion \ 128 | %{ tmux-terminal-horizontal kak -c %val{session} %arg{@} } 129 | alias global hs horizontal-split 130 | 131 | # Vertical split with tmux 132 | define-command vertical-split \ 133 | -docstring "vertical-split : open vertical-split" \ 134 | -params 0.. \ 135 | -file-completion \ 136 | %{ tmux-terminal-vertical kak -c %val{session} %arg{@} } 137 | alias global vs vertical-split 138 | 139 | hook global BufCreate .*/bash(rc|_profile|_funcs) %{ set buffer filetype sh } 140 | 141 | hook global BufSetOption filetype=scss %{ 142 | set-option buffer formatcmd "prettier --stdin-filepath=%val{buffile} --tab-width 4" 143 | } 144 | -------------------------------------------------------------------------------- /modules/home/kitty.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: let 2 | isDarwin = 3 | pkgs.stdenv.isDarwin; 4 | 5 | colors = 6 | import ./colors.nix; 7 | in { 8 | programs.kitty = 9 | ( 10 | if isDarwin 11 | then { 12 | darwinLaunchOptions = []; 13 | } 14 | else {} 15 | ) 16 | // { 17 | enable = true; 18 | 19 | environment = { 20 | PATH = "/usr/local/bin:\${PATH}"; 21 | }; 22 | 23 | settings = 24 | { 25 | enable_audio_bell = false; 26 | copy_on_select = true; 27 | remember_window_size = false; 28 | initial_window_width = 680; 29 | initial_window_height = 720; 30 | 31 | cursor_trail = 32 | if pkgs.stdenv.isLinux 33 | then 1 34 | else 0; 35 | 36 | enabled_layouts = "tall:bias=70, tall:bias=30, horizontal, stack"; 37 | 38 | window_border_width = "1.0"; 39 | window_margin_width = "0.0"; 40 | single_window_margin_width = "0.0"; 41 | window_padding_width = "10.0 12.0"; 42 | 43 | active_border_color = "#686868"; 44 | inactive_border_color = "#4A4A4A"; 45 | 46 | tab_bar_margin_width = "1.0"; 47 | tab_bar_style = "separator"; 48 | tab_separator = "\" │ \""; 49 | 50 | active_tab_foreground = "#e6e6e6"; 51 | active_tab_background = "#3a3a3a"; 52 | active_tab_font_style = "normal"; 53 | inactive_tab_foreground = "#bfbfbf"; 54 | inactive_tab_background = "#171717"; 55 | inactive_tab_font_style = "normal"; 56 | 57 | allow_remote_control = true; 58 | 59 | macos_option_as_alt = "left"; 60 | macos_quit_when_last_window_closed = "yes"; 61 | macos_traditional_fullscreen = "yes"; 62 | macos_titlebar_color = "background"; 63 | macos_show_window_title_in = "none"; 64 | 65 | selection_foreground = "#222222"; 66 | selection_background = "#ccff00"; 67 | 68 | background = colors.background; 69 | foreground = colors.foreground; 70 | 71 | color0 = colors.normal.black; 72 | color8 = colors.bright.black; 73 | color1 = colors.normal.red; 74 | color9 = colors.bright.red; 75 | color2 = colors.normal.green; 76 | color10 = colors.bright.green; 77 | color3 = colors.normal.yellow; 78 | color11 = colors.bright.yellow; 79 | color4 = colors.normal.blue; 80 | color12 = colors.bright.blue; 81 | color5 = colors.normal.magenta; 82 | color13 = colors.bright.magenta; 83 | color6 = colors.normal.cyan; 84 | color14 = colors.bright.cyan; 85 | color7 = colors.normal.white; 86 | color15 = colors.bright.white; 87 | 88 | adjust_line_height = "105%"; 89 | } 90 | // ( 91 | if isDarwin 92 | then { 93 | font_family = "JetBrains Mono Light"; 94 | italic_family = "JetBrains Mono Light Italic"; 95 | bold_font = "JetBrains Mono Bold"; 96 | bold_italic_font = "JetBrains Mono Medium Bold"; 97 | 98 | font_size = "12.5"; 99 | mouse_hide_wait = "3.0"; 100 | kitty_mod = "cmd"; 101 | } 102 | else { 103 | font_family = "JetBrains Mono"; 104 | italic_family = "JetBrains Mono Italic"; 105 | bold_font = "JetBrains Mono Bold"; 106 | bold_italic_font = "JetBrains Mono Bold Italic"; 107 | 108 | font_size = "7.0"; 109 | background_opacity = "0.97"; 110 | dynamic_background_opacity = "yes"; 111 | } 112 | ); 113 | 114 | keybindings = 115 | if isDarwin 116 | then { 117 | "kitty_mod+n" = "new_os_window_with_cwd"; 118 | "kitty_mod+t" = "new_tab_with_cwd"; 119 | "kitty_mod+shift+." = "move_tab_forward"; 120 | "kitty_mod+shift+," = "move_tab_backward"; 121 | 122 | # Create windows 123 | "cmd+enter" = "launch --cwd=current --location=vsplit"; 124 | "shift+cmd+enter" = "launch --cwd=current --location=hsplit"; 125 | 126 | # Select window (BSP-layout only) 127 | "cmd+shift+h" = "neighboring_window left"; 128 | "cmd+shift+l" = "neighboring_window right"; 129 | "cmd+shift+k" = "neighboring_window up"; 130 | "cmd+shift+j" = "neighboring_window down"; 131 | 132 | # Move windows 133 | "cmd+b" = "layout_action rotate"; 134 | "cmd+ctrl+k" = "move_window up"; 135 | "cmd+ctrl+h" = "move_window left"; 136 | "cmd+ctrl+l" = "move_window right"; 137 | "cmd+ctrl+j" = "move_window down"; 138 | 139 | # Resize windows 140 | "cmd+shift+ctrl+h" = "resize_window narrower 4"; 141 | "cmd+shift+ctrl+l" = "resize_window wider 4"; 142 | "cmd+shift+ctrl+k" = "resize_window taller 4"; 143 | "cmd+shift+ctrl+j" = "resize_window shorter 4"; 144 | } 145 | else {}; 146 | }; 147 | } 148 | -------------------------------------------------------------------------------- /modules/home/neovim/colorscheme.nix: -------------------------------------------------------------------------------- 1 | lib: isNvim: let 2 | inherit (lib) concatStrings mapAttrsToList; 3 | inherit (builtins) concatStringsSep; 4 | 5 | mkReset = name: {...}: "hi ${name} guifg=NONE guibg=NONE gui=NONE cterm=NONE"; 6 | 7 | mkRule = name: { 8 | fg ? "NONE", 9 | bg ? "NONE", 10 | gui ? ["NONE"], 11 | }: let 12 | guiStr = concatStringsSep "," gui; 13 | in "hi ${name} guifg=${fg} guibg=${bg} gui=${guiStr} cterm=${guiStr}"; 14 | 15 | white = "#ffffff"; 16 | grey = "#676767"; 17 | brown = "#835f5e"; 18 | crimson = "#ec6965"; 19 | orange = "#ef8d34"; 20 | tan = "#c69669"; 21 | khaki = "#c2c99c"; 22 | grass = "#1dc967"; 23 | forest = "#00af87"; 24 | aqua = "#00ccbb"; 25 | blue = "#0baef4"; 26 | ultraviolet = "#8352FF"; 27 | fuchsia = "#dc59de"; 28 | hotPink = "#f64c8d"; 29 | 30 | builtin.fg = orange; 31 | comment.fg = grey; 32 | constant.fg = aqua; 33 | declaration.fg = grass; 34 | function.fg = blue; 35 | functionName.fg = white; 36 | include.fg = hotPink; 37 | keyword.fg = fuchsia; 38 | operator.fg = crimson; 39 | punctuation.fg = khaki; 40 | specialChar.fg = ultraviolet; 41 | string.fg = tan; 42 | type.fg = brown; 43 | 44 | ui = { 45 | ColorColumn.bg = "#202020"; 46 | CursorLine.bg = "#090909"; 47 | LineNr.fg = "#4d4d4d"; 48 | Normal.fg = "#C5C8C6"; 49 | Search = { 50 | fg = "#202020"; 51 | bg = "#dcf764"; 52 | }; 53 | Visual.bg = "#4128bd"; 54 | CursorLineNr.fg = "#8c8c8c"; 55 | Folded = { 56 | fg = "#767676"; 57 | bg = "#2a2a2a"; 58 | }; 59 | PMenu = { 60 | fg = "#a8a8a8"; 61 | bg = "#090909"; 62 | }; 63 | NonText.fg = "#414141"; 64 | PMenuSel = { 65 | fg = "#c2a3e0"; 66 | bg = "#5f00ff"; 67 | }; 68 | PMenuSBar.bg = "#005f5f"; 69 | PMenuThumb.bg = "#00af87"; 70 | SignColumn = {}; 71 | WinSeparator.fg = "#333333"; 72 | 73 | # Tabs 74 | "TabLine" = { 75 | fg = "#999999"; 76 | bg = "#2A2A2A"; 77 | }; 78 | "TabLineFill" = { 79 | fg = "NONE"; 80 | bg = "#1A1A1A"; 81 | }; 82 | "TabLineSel" = { 83 | fg = "#ffffff"; 84 | bg = "#108dcb"; 85 | }; 86 | "Title".fg = "#dcf764"; 87 | }; 88 | 89 | defaults = { 90 | Comment = comment; 91 | Constant = constant; 92 | String = string; 93 | Character = specialChar; 94 | Number = constant; 95 | Boolean = constant; 96 | Float = constant; 97 | Identifier = {}; 98 | Function = function; 99 | Statement = declaration; 100 | Conditional = keyword; # if, then, else, switch, etc. 101 | Repeat = keyword; # for, do, while, etc. 102 | Label = keyword; # case, default, etc. 103 | Operator = operator; 104 | Keyword = keyword; # any other keyword 105 | Exception = keyword; # try, catch, throw 106 | PreProc = builtin; 107 | Include = builtin; 108 | Define = builtin; 109 | Macro = builtin; 110 | PreConduit = builtin; # preprocessor keywords: #if, #else, etc; 111 | Type = type; 112 | StorageClass = type; 113 | Structure = keyword; 114 | Typedef = type; 115 | Special = specialChar; 116 | SpecialChar = specialChar; 117 | Tag = function; 118 | Delimiter = punctuation; 119 | SpecialComment = specialChar; 120 | Debug = builtin; 121 | 122 | #Underlined = {}; 123 | #Ignore = {}; 124 | #Error = {}; 125 | #Todo = {}; 126 | }; 127 | 128 | nix = { 129 | "@boolean.nix" = constant; 130 | "@comment.nix" = comment; 131 | "@conditional.nix" = keyword; # if/then/else 132 | "@constant.nix" = constant; 133 | "@constant.builtin.nix" = builtin; 134 | "@exception.nix" = {}; # exceptions 135 | "@field.nix" = function; 136 | "@float.nix" = constant; 137 | "@function.call.nix" = function; 138 | "@include.nix" = include; # import 139 | "@keyword.nix" = keyword; # basic keywords 140 | "@keyword.operator.nix" = operator; # fieldaccess default (a.b or c) 141 | "@number.nix" = constant; 142 | "@operator.nix" = operator; 143 | "@parameter.nix" = type; # function arguments 144 | "@punctuation.bracket.nix" = punctuation; 145 | "@punctuation.delimiter.nix" = punctuation; 146 | "@punctuation.nix" = punctuation; 147 | "@punctuation.special.nix" = operator; # string interpolation + the ... in { ... } 148 | "@string.escape.nix" = specialChar; # escape sequences 149 | "@string.nix".fg = forest; 150 | "@string.special.nix" = {}; # paths and URLs 151 | "@variable.nix".fg = brown; # basic identifiers 152 | }; 153 | 154 | go = { 155 | "@constant.go" = constant; 156 | "@boolean.go" = constant; 157 | "@number.go" = constant; 158 | "@label.go" = {}; 159 | "@keyword.go" = keyword; 160 | "@conditional.go" = keyword; 161 | "@keyword.return.go" = keyword; 162 | "@keyword.coroutine.go" = keyword; 163 | "@keyword.function.go" = declaration; 164 | "@type.go" = type; 165 | "@type.builtin.go" = builtin; 166 | "@parameter.go" = constant; 167 | "@field.go" = specialChar; 168 | "@method.go" = functionName; 169 | "@include.go" = include; 170 | "@function.builtin.go" = builtin; 171 | "@function.call.go" = function; 172 | "@method.call.go" = function; 173 | "@punctuation.bracket.go" = punctuation; 174 | "@punctuation.delimiter.go" = punctuation; 175 | "@operator.go" = operator; 176 | "@string.go" = string; 177 | "@string.escape.go" = specialChar; 178 | "@comment.go" = comment; 179 | }; 180 | 181 | css = { 182 | "@media.scss".fg = "#dc59de"; 183 | "@include.scss".fg = "#dc59de"; 184 | "@type.scss".fg = "#dc59de"; 185 | "@keyword.scss".fg = "#dc59de"; 186 | "@operator.scss".fg = "#ec6965"; 187 | "@comment.scss".fg = "#676767"; 188 | "@type.qualifier.scss".fg = "#dc59de"; 189 | "@string.scss".fg = "#12deab"; 190 | "@number.scss".fg = "#12deab"; 191 | "@property.scss".fg = "#0ce4d5"; 192 | "@namespace.scss".fg = "#ff0000"; 193 | "@type.definition.scss".fg = "#dc59de"; 194 | "@punctuation.delimiter.scss".fg = "#c2c99c"; 195 | "@punctuation.bracket.scss".fg = "#c2c99c"; 196 | "@function.scss".fg = "#e354ce"; 197 | "@variable.scss".fg = "#7a52ff"; 198 | }; 199 | 200 | mkRules = rules: 201 | "\" Reset.\n" 202 | + (concatStringsSep "\n" (mapAttrsToList mkReset rules)) 203 | + "\n\n\" Rules.\n" 204 | + (concatStringsSep "\n" (mapAttrsToList mkRule rules)) 205 | + "\n\n"; 206 | in 207 | concatStrings (map mkRules [ui defaults nix go css]) 208 | -------------------------------------------------------------------------------- /modules/home/neovim/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | inputs, 4 | ... 5 | }: let 6 | colorscheme = (import ./colorscheme.nix) pkgs.lib; 7 | 8 | buildVimPlugin = name: 9 | pkgs.vimUtils.buildVimPlugin { 10 | name = name; 11 | src = inputs."${name}"; 12 | }; 13 | in { 14 | programs.neovim = { 15 | enable = true; 16 | viAlias = true; 17 | vimAlias = true; 18 | vimdiffAlias = true; 19 | withNodeJs = true; 20 | withPython3 = true; 21 | plugins = with pkgs.vimPlugins; [ 22 | # LSP-ish 23 | blink-cmp 24 | nvim-lspconfig 25 | conform-nvim 26 | 27 | BufOnly-vim 28 | copilot-vim 29 | nvim-colorizer-lua 30 | nvim-tree-lua 31 | telescope-nvim 32 | trouble-nvim 33 | vim-airline 34 | vim-fugitive 35 | vim-gitgutter 36 | vim-gnupg 37 | vim-surround 38 | vim-unimpaired 39 | vim-vsnip 40 | 41 | (nvim-treesitter.withPlugins ( 42 | plugins: 43 | with plugins; [ 44 | nix 45 | bash 46 | css 47 | elm 48 | go 49 | gomod 50 | gowork 51 | haskell 52 | html 53 | javascript 54 | json 55 | lua 56 | scss 57 | templ 58 | typescript 59 | ] 60 | )) 61 | 62 | # Avante and its dependencies 63 | avante-nvim 64 | dressing-nvim 65 | img-clip-nvim 66 | nui-nvim 67 | plenary-nvim 68 | 69 | # Plugins not in nixpkgs 70 | # (buildVimPlugin "smear") 71 | ]; 72 | extraLuaConfig = '' 73 | ${builtins.readFile ./init.lua} 74 | vim.cmd 'colorscheme pantera-negra' 75 | ''; 76 | }; 77 | 78 | xdg.configFile."nvim/colors/pantera-negra.vim".text = colorscheme true; 79 | } 80 | -------------------------------------------------------------------------------- /modules/home/neovim/init.lua: -------------------------------------------------------------------------------- 1 | local g = vim.g 2 | local opt = vim.opt 3 | local autocmd = vim.api.nvim_create_autocmd 4 | local augroup = vim.api.nvim_create_augroup 5 | local hi = vim.api.nvim_set_hl 6 | 7 | local nmap = function(lhs, rhs, opts) 8 | vim.keymap.set("n", lhs, rhs, opts) 9 | end 10 | local vmap = function(lhs, rhs, opts) 11 | vim.keymap.set("v", lhs, rhs, opts) 12 | end 13 | local imap = function(lhs, rhs, opts) 14 | vim.keymap.set("i", lhs, rhs, opts) 15 | end 16 | 17 | g.mapleader = " " 18 | 19 | local options = { 20 | compatible = false, 21 | backup = false, 22 | writebackup = false, 23 | swapfile = false, 24 | shell = "bash", 25 | number = true, 26 | wrap = false, 27 | expandtab = true, 28 | shiftwidth = 4, 29 | tabstop = 4, 30 | softtabstop = 4, 31 | termguicolors = true, 32 | showmatch = true, 33 | autoread = true, 34 | colorcolumn = "80", 35 | mouse = "a", 36 | spell = false, 37 | spelllang = { "en_us" }, 38 | cursorline = true, 39 | ruler = true, 40 | signcolumn = "yes", 41 | listchars = "tab:▸ ,trail:·,eol:¶", 42 | splitbelow = true, 43 | splitright = true, 44 | scrolloff = 8, 45 | sidescrolloff = 5, 46 | foldmethod = "marker", 47 | equalalways = true, 48 | conceallevel = 0, 49 | -- Search 50 | hlsearch = false, 51 | ignorecase = true, 52 | incsearch = true, 53 | wrapscan = true, 54 | -- Persistent undo 55 | undofile = true, 56 | undodir = vim.fn.stdpath("data") .. "/undo", 57 | -- Text foramtting options. See :help fo-table. 58 | formatoptions = "tcroq1]jp", 59 | } 60 | 61 | for k, v in pairs(options) do 62 | opt[k] = v 63 | end 64 | 65 | nmap("gs", "^") 66 | nmap("gl", "$") 67 | nmap("gn", "bnext") 68 | nmap("gp", "bprev") 69 | nmap("BO", "BufOnly") 70 | nmap("f", "Telescope find_files") 71 | nmap("g", "Telescope live_grep") 72 | nmap("sd", "Telescope lsp_document_symbols") 73 | nmap("sw", "Telescope lsp_dynamic_workspace_symbols") 74 | nmap("r", "Telescope registers") 75 | nmap(";", "Telescope buffers") 76 | nmap("w", "write") 77 | nmap("n", "noa write") 78 | nmap("", "gcc") 79 | nmap("y", '"+y') 80 | 81 | -- Visual Mode Blockwise Indent. This keeps the current visual block selection 82 | -- active after changing indent with '<' or '>'. Usually the visual block 83 | -- selection is lost after you shift it, which is incredibly annoying. 84 | -- 85 | -- http://vim.wikia.com/wiki/Short_mappings_for_common_tasks 86 | vmap(">", ">gv") 87 | vmap("<", " indents in normal mode as well? 90 | nmap(">", ">>") 91 | nmap("<", "<<") 92 | 93 | -- Toggles 94 | nmap("i", "set invlist") 95 | nmap("S", "set hlsearch! hlsearch?") 96 | nmap("W", "set wrap! wrap?") 97 | 98 | autocmd({ "FileType" }, { pattern = "lua", command = "set noexpandtab" }) 99 | 100 | -- Trim trailing whitespace on save 101 | autocmd({ "BufWritePre" }, { pattern = { "*" }, command = [[%s/\s\+$//e]] }) 102 | 103 | -- Highlight current line in current window only 104 | autocmd({ "WinEnter", "BufEnter" }, { pattern = "*", command = "setlocal cursorline" }) 105 | autocmd({ "WinLeave" }, { pattern = "*", command = "setlocal nocursorline" }) 106 | 107 | -- Keep splits equal size 108 | autocmd("VimResized", { pattern = "*", command = "wincmd =" }) 109 | 110 | -- Markdown spell checking 111 | augroup("markdownSpell", { clear = true }) 112 | autocmd({ "FileType" }, { 113 | pattern = "markdown", 114 | command = "setlocal spell", 115 | group = "markdownSpell", 116 | }) 117 | autocmd({ "BufRead", "BufNewFile" }, { 118 | pattern = "*.md", 119 | command = "setlocal spell", 120 | group = "markdownSpell", 121 | }) 122 | 123 | -- Colorizer 124 | require("colorizer").setup({ names = false }) 125 | 126 | -- Tree 127 | nmap("t", "NvimTreeToggle") 128 | require("nvim-tree").setup({ 129 | disable_netrw = true, 130 | renderer = { 131 | icons = { 132 | symlink_arrow = " >> ", 133 | show = { 134 | git = true, 135 | folder = true, 136 | file = false, 137 | folder_arrow = false, 138 | }, 139 | glyphs = { 140 | folder = { 141 | arrow_open = "", 142 | arrow_closed = "", 143 | default = "▶", 144 | open = "▼", 145 | empty = "▼", 146 | empty_open = "▼", 147 | symlink = "*", 148 | symlink_open = "!", 149 | }, 150 | git = { 151 | unstaged = "!", 152 | staged = "✓", 153 | unmerged = "U", 154 | renamed = "➜", 155 | untracked = "*", 156 | deleted = "✗", 157 | ignored = "◌", 158 | }, 159 | }, 160 | }, 161 | indent_markers = { 162 | enable = true, 163 | icons = { 164 | corner = "╰ ", 165 | edge = "│ ", 166 | none = " ", 167 | }, 168 | }, 169 | }, 170 | }) 171 | 172 | -- Telescope 173 | require("telescope").setup({ 174 | defaults = { 175 | mappings = { 176 | i = { [""] = require("telescope.actions").delete_buffer }, 177 | }, 178 | }, 179 | }) 180 | 181 | -- Trouble 182 | require("trouble").setup() 183 | nmap("E", "Trouble diagnostics toggle") 184 | nmap("xx", "Trouble diagnostics toggle filter.buf=0") 185 | 186 | -- GitGutter 187 | g.gitgutter_sign_modified = "•" 188 | hi(0, "GitGutterAdd", { fg = "#009900" }) 189 | hi(0, "GitGutterChange", { fg = "#bbbb00" }) 190 | hi(0, "GitGutterDelete", { fg = "#ff2222" }) 191 | 192 | -- Avante 193 | require("avante_lib").load() 194 | require("avante").setup({ 195 | behaviour = { auto_suggestions = false }, 196 | hints = { enabled = true }, 197 | windows = { 198 | width = 30, 199 | sidebar_header = { 200 | align = "left", 201 | rounded = true, 202 | }, 203 | }, 204 | provider = "claude37", 205 | vendors = { 206 | claude37 = { 207 | __inherited_from = "claude", 208 | model = "claude-3-7-sonnet-20250219", 209 | }, 210 | }, 211 | }) 212 | 213 | -- TreeSitter 214 | require("nvim-treesitter.configs").setup({ 215 | highlight = { enable = true, additional_vim_regex_highlighting = false }, 216 | indent = { enable = true }, 217 | }) 218 | 219 | -- Vsnip 220 | imap("", "vsnip#available(1) ? '(vsnip-expand-or-jump)' : ''", { expr = true }) 221 | 222 | -- Blink 223 | require("blink.cmp").setup({ 224 | completion = { 225 | list = { 226 | selection = { 227 | preselect = true, 228 | auto_insert = true, 229 | }, 230 | }, 231 | menu = { 232 | -- Don't show completion menu automatically when searching 233 | auto_show = function(ctx) 234 | return ctx.mode ~= "cmdline" or not vim.tbl_contains({ "/", "?" }, vim.fn.getcmdtype()) 235 | end, 236 | draw = { 237 | columns = { 238 | { "label", "label_description", gap = 1 }, 239 | { "kind", "source_name" }, 240 | }, 241 | }, 242 | }, 243 | documentation = { 244 | auto_show = true, 245 | auto_show_delay_ms = 250, 246 | treesitter_highlighting = true, 247 | }, 248 | }, 249 | cmdline = { 250 | enabled = true, 251 | completion = { menu = { auto_show = true } }, 252 | }, 253 | fuzzy = { implementation = "lua" }, 254 | sources = { 255 | providers = { 256 | lsp = { min_keyword_length = 1, score_offset = 0 }, 257 | path = { min_keyword_length = 0 }, 258 | buffer = { min_keyword_length = 1, max_items = 5 }, 259 | }, 260 | }, 261 | }) 262 | 263 | -- Conform 264 | do 265 | require("conform").setup({ 266 | formatters_by_ft = { 267 | cabal = { "cabal_fmt" }, 268 | css = { "prettier" }, 269 | haskell = { "fourmolu" }, 270 | html = { "prettier" }, 271 | javascript = { "prettier" }, 272 | json = { "jq" }, 273 | lua = { "stylua" }, 274 | markdown = { "prettier" }, 275 | nix = { "alejandra" }, 276 | sh = { "shfmt" }, 277 | templ = { "templ" }, 278 | yaml = { "prettier" }, 279 | -- ["_"] = { "trim_whitespace", "trim_newlines" }, 280 | }, 281 | format_on_save = { 282 | timeout_ms = 500, 283 | lsp_format = "fallback", 284 | }, 285 | }) 286 | 287 | vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" 288 | end 289 | 290 | -- LSP 291 | do 292 | local lspCfg = require("lspconfig") 293 | local lspMethods = vim.lsp.protocol.Methods 294 | 295 | require("lspconfig.ui.windows").default_options.border = "rounded" 296 | 297 | local capabilities = require("blink.cmp").get_lsp_capabilities({ 298 | workspace = { 299 | didChangeWatchedFiles = { 300 | dynamicRegistration = true, -- needs fswatch on linux 301 | relativePatternSupport = true, 302 | }, 303 | }, 304 | }, true) 305 | 306 | local organize_imports = function(client, bufnr, timeoutms) 307 | local params = vim.lsp.util.make_range_params() 308 | params.context = { only = { "source.organizeImports" } } 309 | local result = client.request_sync(lspMethods.textDocument_codeAction, params, timeoutms, bufnr) or {} 310 | for _, r in pairs(result.result or {}) do 311 | if r.edit then 312 | local enc = client.offset_encoding or "utf-16" 313 | vim.lsp.util.apply_workspace_edit(r.edit, enc) 314 | elseif r.command and r.command.command then 315 | vim.lsp.buf.execute_command(r.command) 316 | end 317 | end 318 | end 319 | 320 | local lspAttachGroup = vim.api.nvim_create_augroup("LspAttachGroup", { clear = true }) 321 | 322 | vim.api.nvim_create_autocmd("LspAttach", { 323 | callback = function(args) 324 | local bufnr = args.buf 325 | local client = vim.lsp.get_client_by_id(args.data.client_id) 326 | if client == nil then 327 | return 328 | end 329 | 330 | local map = function(key, cmd) 331 | vim.api.nvim_buf_set_keymap(bufnr, "n", key, "lua " .. cmd .. "", { 332 | noremap = true, 333 | silent = true, 334 | }) 335 | end 336 | 337 | map("gd", "vim.lsp.buf.definition()") 338 | map("lr", "vim.lsp.buf.rename()") 339 | map("a", "vim.lsp.buf.code_action()") 340 | map("ll", "vim.diagnostic.open_float()") 341 | 342 | if client.supports_method(lspMethods.textDocument_codelens) then 343 | map("lh", "vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())") 344 | end 345 | 346 | if client.supports_method(lspMethods.textDocument_codeAction) then 347 | if client.name ~= "lua_ls" then -- organize_imports is comically broken in lua 348 | vim.api.nvim_create_autocmd({ "BufWritePre" }, { 349 | buffer = bufnr, 350 | callback = function() 351 | organize_imports(client, bufnr, 1000) 352 | end, 353 | group = lspAttachGroup, 354 | }) 355 | end 356 | end 357 | end, 358 | }) 359 | 360 | for _, server in ipairs({ 361 | "bashls", 362 | "golangci_lint_ls", 363 | "hls", 364 | "html", 365 | "jsonls", 366 | "nil_ls", 367 | "templ", 368 | "ts_ls", 369 | "yamlls", 370 | }) do 371 | lspCfg[server].setup({ capabilities = capabilities }) 372 | end 373 | 374 | lspCfg.gopls.setup({ 375 | capabilities = capabilities, 376 | settings = { 377 | gopls = { 378 | gofumpt = true, 379 | codelenses = { 380 | gc_details = true, 381 | generate = true, 382 | regenerate_cgo = true, 383 | run_govulncheck = true, 384 | test = true, 385 | tidy = true, 386 | upgrade_dependency = true, 387 | vendor = true, 388 | }, 389 | hints = { 390 | assignVariableTypes = true, 391 | compositeLiteralFields = true, 392 | compositeLiteralTypes = true, 393 | constantValues = true, 394 | functionTypeParameters = true, 395 | parameterNames = true, 396 | rangeVariableTypes = true, 397 | }, 398 | analyses = { 399 | nilness = true, 400 | shadow = true, 401 | shift = true, 402 | unusedparams = true, 403 | unusedwrite = true, 404 | useany = true, 405 | unusedvariable = true, 406 | }, 407 | usePlaceholders = true, 408 | completeUnimported = true, 409 | staticcheck = true, 410 | directoryFilters = { "-.git", "-node_modules" }, 411 | }, 412 | }, 413 | }) 414 | 415 | lspCfg.lua_ls.setup({ 416 | capabilities = capabilities, 417 | settings = { 418 | Lua = { 419 | diagnostics = { globals = { "vim" } }, 420 | }, 421 | completion = { callSnippet = "Replace" }, 422 | hint = { enable = true }, 423 | }, 424 | }) 425 | end 426 | -------------------------------------------------------------------------------- /modules/home/nushell.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; 3 | with pkgs.nushellPlugins; [ 4 | nufmt 5 | gstat 6 | highlight 7 | ]; 8 | 9 | programs.nushell = { 10 | enable = true; 11 | settings = { 12 | show_banner = false; 13 | }; 14 | extraConfig = '' 15 | ''; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /modules/home/picom.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: { 7 | services.picom = { 8 | enable = true; 9 | shadow = true; 10 | shadowOffsets = [(-60) (-45)]; 11 | shadowOpacity = 0.8; 12 | fade = true; 13 | fadeSteps = [0.24 0.24]; 14 | fadeDelta = 16; 15 | settings = { 16 | shadow-radius = 60; 17 | no-dock-shadow = true; 18 | no-dnd-shadow = true; 19 | }; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /modules/home/pkgs.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | charmPkgs, 5 | carlosPkgs, 6 | headless, 7 | ... 8 | }: let 9 | isLinux = pkgs.stdenv.isLinux; 10 | isDarwin = pkgs.stdenv.isDarwin; 11 | # isX86_64 = pkgs.stdenv.isx86_64; 12 | in { 13 | home.packages = with pkgs; 14 | [ 15 | age 16 | awscli2 17 | bc 18 | brotli 19 | cargo 20 | clang 21 | coreutils 22 | ctags 23 | curl 24 | direnv 25 | doctl 26 | duf 27 | elvish 28 | faketty 29 | ffmpeg 30 | fish 31 | fzf 32 | getopt 33 | gh 34 | gnumake 35 | gnupg 36 | gnused 37 | gnutar 38 | go-task 39 | haskellPackages.cabal-fmt 40 | htop 41 | imagemagick 42 | jq 43 | librsvg # for the rsvg-convert binary 44 | libwebp 45 | luajit 46 | moreutils 47 | mosh 48 | ngrok 49 | optipng 50 | postgresql 51 | python3 52 | redis 53 | ripgrep 54 | rpm 55 | shellcheck 56 | shfmt 57 | simple-http-server 58 | tree 59 | tree-sitter 60 | ttyd 61 | viu 62 | wget 63 | yq 64 | z-lua 65 | zlib 66 | zopfli 67 | ] 68 | # Haskell 69 | ++ (with pkgs.haskellPackages; [ 70 | cabal-fmt 71 | ]) 72 | # Elm 73 | ++ (with pkgs.elmPackages; [ 74 | elm 75 | elm-language-server 76 | ]) 77 | # Rust 78 | ++ (with pkgs; [ 79 | rust-analyzer 80 | rustc 81 | ]) 82 | # Various LSP 83 | ++ (with pkgs; [ 84 | alejandra 85 | bash-language-server 86 | lua-language-server 87 | nil 88 | #semgrep # broken in nixpkgs unstable 89 | stylua 90 | typescript 91 | typescript-language-server 92 | vim-language-server 93 | vscode-langservers-extracted 94 | yaml-language-server 95 | ]) 96 | # LSPs that use Node 97 | ++ (with pkgs.nodePackages_latest; [ 98 | prettier 99 | svgo 100 | ]) 101 | # Desktops only 102 | ++ ( 103 | lib.optionals (! headless) (with pkgs; [ 104 | vscode 105 | ]) 106 | ) 107 | # Linux Desktop 108 | ++ (lib.optionals (isLinux && ! headless) (with pkgs; [ 109 | element 110 | ])) 111 | # macOS 112 | ++ (lib.optionals isDarwin (with pkgs; [ 113 | cachix 114 | dozer 115 | monitorcontrol 116 | ])) 117 | # Charm NUR 118 | ++ (map (x: pkgs.${x}) charmPkgs) 119 | # Carlos' NUR 120 | ++ (map (x: pkgs.${x}) carlosPkgs); 121 | 122 | programs = { 123 | z-lua.enable = true; 124 | }; 125 | } 126 | -------------------------------------------------------------------------------- /modules/home/prettier/default.nix: -------------------------------------------------------------------------------- 1 | {...}: { 2 | home.file.".prettierrc.yaml".source = ./prettierrc.yaml; 3 | } 4 | -------------------------------------------------------------------------------- /modules/home/prettier/prettierrc.yaml: -------------------------------------------------------------------------------- 1 | overrides: 2 | - files: 3 | - "*.js" 4 | - "*.ts" 5 | options: 6 | tabWidth: 4 7 | -------------------------------------------------------------------------------- /modules/home/readline.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | programs.readline = { 8 | enable = true; 9 | includeSystemConfig = false; 10 | variables.expand-tilde = true; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /modules/home/rio.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.packages = with pkgs; ( 3 | if pkgs.stdenv.isDarwin 4 | then [] 5 | else [rio] 6 | ); 7 | 8 | xdg.configFile."rio/config.toml".text = let 9 | colors = 10 | import ./colors.nix; 11 | 12 | home = 13 | if pkgs.stdenv.isDarwin 14 | then "/Users/christian" 15 | else "/home/christian"; 16 | 17 | fontSize = 18 | if pkgs.stdenv.isDarwin 19 | then "13" 20 | else "7"; 21 | in '' 22 | hide-cursor-when-typing = true 23 | padding-x = 16 24 | padding-y = [0, 8] 25 | option-as-alt = 'left' 26 | confirm-before-quit = false 27 | 28 | [editor] 29 | program = "${home}/.nix-profile/bin/nvim" 30 | args = [] 31 | 32 | [window] 33 | width = 600 34 | height = 640 35 | mode = "Windowed" 36 | opacity = 1.0 37 | blur = false 38 | decorations = "Buttonless" 39 | 40 | [cursor] 41 | blinking = true 42 | blinking-interval = 530 43 | 44 | 45 | line-height = 1.2 46 | 47 | [fonts] 48 | size = ${fontSize} 49 | 50 | [fonts.regular] 51 | family = "JetBrains Mono" 52 | style = "Normal" 53 | weight = 400 54 | 55 | [fonts.bold] 56 | family = "JetBrains Mono" 57 | style = "Normal" 58 | weight = 800 59 | 60 | [fonts.italic] 61 | family = "JetBrains Mono" 62 | style = "Italic" 63 | weight = 400 64 | 65 | [fonts.bold-italic] 66 | family = "JetBrains Mono" 67 | style = "Italic" 68 | weight = 800 69 | 70 | [navigation] 71 | mode = "Plain" 72 | 73 | [colors] 74 | cursor = '#00af87' 75 | background = '${colors.background}' 76 | foreground = '${colors.foreground}' 77 | # cursor = '#F38BA3' 78 | # tabs = '#443d40' 79 | # tabs-active = '#F38BA3' 80 | # green = '#0BA95B' 81 | # red = '#ED203D' 82 | # blue = '#12B5E5' 83 | # yellow = '#FCBA28' 84 | ''; 85 | } 86 | -------------------------------------------------------------------------------- /modules/home/rofi/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: { 7 | programs.rofi = { 8 | enable = true; 9 | extraConfig = { 10 | padding = 40; 11 | width = 1200; 12 | lines = 20; 13 | dpi = 192; 14 | font = "Inter 12"; 15 | }; 16 | theme = ./theme.rasi; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /modules/home/rofi/theme.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: rgba(241, 241, 237, 95%); 3 | foreground: rgba(62, 62, 57, 100%); 4 | 5 | selected-normal-foreground: rgba ( 249, 249, 249, 100 % ); 6 | normal-foreground: @foreground; 7 | normal-background: transparent; 8 | alternate-normal-background: transparent; 9 | red: rgba(220, 50, 47, 100 % ); 10 | selected-urgent-foreground: rgba(249, 249, 249, 100 % ); 11 | blue: rgba(38, 139, 210, 100 % ); 12 | urgent-foreground: rgba(204, 102, 102, 100 % ); 13 | alternate-urgent-background: rgba(75, 81, 96, 90 % ); 14 | active-foreground: rgba(101, 172, 255, 100 % ); 15 | lightbg: rgba(238, 232, 213, 100 % ); 16 | selected-active-foreground: rgba(249, 249, 249, 100 % ); 17 | alternate-active-background: rgba(75, 81, 96, 89 % ); 18 | alternate-normal-foreground: @foreground; 19 | normal-background: transparent; 20 | lightfg: rgba(88, 104, 117, 100 % ); 21 | selected-normal-background: rgba(64, 132, 214, 100 % ); 22 | border-color: rgba(124, 131, 137, 100 % ); 23 | spacing: 2; 24 | separatorcolor: rgba(29, 31, 33, 100 % ); 25 | urgent-background: rgba(29, 31, 33, 17 % ); 26 | selected-urgent-background: rgba(165, 66, 66, 100 % ); 27 | alternate-urgent-foreground: @urgent-foreground; 28 | background-color: rgba(0, 0, 0, 0 % ); 29 | alternate-active-foreground: @active-foreground; 30 | active-background: rgba(29, 31, 33, 17 % ); 31 | selected-active-background: rgba(68, 145, 237, 100 % ); 32 | } 33 | #window { 34 | background-color: @background; 35 | border: 0; 36 | padding: 40px; 37 | border-radius: 20px; 38 | } 39 | #mainbox { 40 | border: 0; 41 | padding: 0; 42 | } 43 | #message { 44 | border: 2px 0px 0px; 45 | border-color: @separatorcolor; 46 | padding: 1px; 47 | } 48 | #textbox { 49 | text-color: @foreground; 50 | } 51 | #listview { 52 | fixed-height: 0; 53 | border: 0px 0px 0px; 54 | border-color: @separatorcolor; 55 | spacing: 0; 56 | scrollbar: false; 57 | padding: 16px 0px 0px ; 58 | } 59 | #element { 60 | border: 0; 61 | padding: 4px 8px; 62 | } 63 | #element.normal.normal { 64 | background-color: @normal-background; 65 | text-color: @normal-foreground; 66 | } 67 | #element.normal.urgent { 68 | background-color: @urgent-background; 69 | text-color: @urgent-foreground; 70 | } 71 | #element.normal.active { 72 | background-color: @active-background; 73 | text-color: @active-foreground; 74 | } 75 | #element.selected.normal { 76 | background-color: @selected-normal-background; 77 | text-color: @selected-normal-foreground; 78 | } 79 | #element.selected.urgent { 80 | background-color: @selected-urgent-background; 81 | text-color: @selected-urgent-foreground; 82 | } 83 | #element.selected.active { 84 | background-color: @selected-active-background; 85 | text-color: @selected-active-foreground; 86 | } 87 | #element.alternate.normal { 88 | background-color: @alternate-normal-background; 89 | text-color: @alternate-normal-foreground; 90 | } 91 | #element.alternate.urgent { 92 | background-color: @alternate-urgent-background; 93 | text-color: @alternate-urgent-foreground; 94 | } 95 | #element.alternate.active { 96 | background-color: @alternate-active-background; 97 | text-color: @alternate-active-foreground; 98 | } 99 | #scrollbar { 100 | width: 4px; 101 | border: 0; 102 | handle-color: @normal-foreground; 103 | handle-width: 8px; 104 | padding: 0; 105 | } 106 | #mode-switcher { 107 | border: 2px 0px 0px ; 108 | border-color: @separatorcolor; 109 | } 110 | #button { 111 | spacing: 0; 112 | text-color: @normal-foreground; 113 | } 114 | #button.selected { 115 | background-color: @selected-normal-background; 116 | text-color: @selected-normal-foreground; 117 | } 118 | #inputbar { 119 | spacing: 0; 120 | text-color: @normal-foreground; 121 | padding: 2px 8px; 122 | } 123 | #case-indicator { 124 | spacing: 0; 125 | text-color: @normal-foreground; 126 | } 127 | #entry { 128 | spacing: 0; 129 | text-color: @normal-foreground; 130 | } 131 | #prompt { 132 | spacing: 0; 133 | text-color: @normal-foreground; 134 | } 135 | #inputbar { 136 | children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; 137 | } 138 | #textbox-prompt-colon { 139 | expand: false; 140 | str: ":"; 141 | margin: 0px 0.3em 0em 0em ; 142 | text-color: @normal-foreground; 143 | } 144 | -------------------------------------------------------------------------------- /modules/home/scripts/ask: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # By @qapquiz (on GitHub) 4 | # https://gist.github.com/qapquiz/c7c80a4f267c1d04247c398d466285a6 5 | 6 | function ask_gpt() { 7 | PROMPT=$(gum input --width 80 --placeholder "prompt") 8 | 9 | if [[ -z "$PROMPT" ]]; then 10 | exit 0 11 | fi 12 | 13 | gum style --foreground 212 "> $PROMPT" 14 | 15 | RESULT=$( 16 | gum spin -s line --title "Asking ChatGPT..." --show-output -- curl -sS https://api.openai.com/v1/chat/completions \ 17 | -H "Content-Type: application/json" \ 18 | -H "Authorization: Bearer $OPENAI_API_KEY" \ 19 | -d '{ 20 | "model": "gpt-3.5-turbo", 21 | "messages": [{"role": "user", "content": "'"$PROMPT"'"}] 22 | }' | jq ".choices[0].message.content" 23 | ) 24 | 25 | printf "%s" "$RESULT" | glow 26 | } 27 | 28 | while true; do 29 | ask_gpt 30 | done 31 | -------------------------------------------------------------------------------- /modules/home/scripts/cmdai: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mods -m gpt-3.5-turbo "command to $*. only the command, no explanations, no formatting, no surrounding backticks, replace specific directories with placeholders formatted as {{ placeholder }}" | 4 | vipe | 5 | bash 6 | -------------------------------------------------------------------------------- /modules/home/scripts/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | home.file = 3 | { 4 | ".bin/ask".source = ./ask; 5 | ".bin/cmdai".source = ./cmdai; 6 | ".bin/generate-commit-message".source = ./generate-commit-message; 7 | ".bin/install-docker".source = ./install-docker; 8 | ".bin/make-vid".source = ./make-vid; 9 | ".bin/sessions".source = ./sessions; 10 | ".bin/sessions.gpg".source = ./sessions.gpg; 11 | ".bin/tm".source = ./tm; 12 | ".bin/tmls".source = ./tmls; 13 | ".bin/webp-jpeg".source = ./webp-jpeg; 14 | ".bin/webp-png".source = ./webp-png; 15 | } 16 | // ( 17 | if pkgs.stdenv.isLinux 18 | then { 19 | ".bin/map-keys".source = ./map-keys; 20 | ".bin/setup-mouse".source = ./setup-mouse; 21 | ".bin/setup-wacom".source = ./setup-wacom; 22 | } 23 | else {} 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /modules/home/scripts/generate-commit-message: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | diff="$(git diff)" 4 | 5 | if [[ $diff == "" ]]; then 6 | printf 'No diff.\n' 7 | exit 1 8 | fi 9 | 10 | msg="$( 11 | printf '%s' "$diff" | \ 12 | mods "write a commit message for this diff" | \ 13 | sed -z '$ s/\n$//' | \ 14 | gum write \ 15 | --header " Look ok? Ctrl+D to commit, or Ctrl+C to cancel" \ 16 | --prompt.foreground "240" 17 | )" 18 | 19 | if [[ $msg == "" ]]; then 20 | exit 1 21 | fi 22 | 23 | git commit -am "$msg" 24 | -------------------------------------------------------------------------------- /modules/home/scripts/install-docker: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | issue="$(cat /etc/issue)" 4 | 5 | if ! [[ $issue =~ "Debian" ]]; then 6 | printf 'This script is for Debian only.\n' 7 | exit 1; 8 | fi 9 | 10 | # Remove old packages 11 | sudo apt-get remove docker docker-engine docker.io containerd runc 12 | 13 | # Allow apt to use a repository over HTTP S 14 | sudo apt-get update 15 | sudo apt-get install \ 16 | ca-certificates \ 17 | curl \ 18 | gnupg \ 19 | lsb-release 20 | 21 | # Get Docker's GPG key 22 | sudo mkdir -p /etc/apt/keyrings 23 | curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg 24 | 25 | # Add the Docker repository 26 | echo \ 27 | "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ 28 | $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 29 | 30 | # Install Docker engine 31 | sudo apt-get update 32 | sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin 33 | 34 | # Verify 35 | sudo docker run hello-world 36 | 37 | # Add user to docker group 38 | sudo usermod -aG docker "$USER" 39 | -------------------------------------------------------------------------------- /modules/home/scripts/make-vid: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source "$HOME/.local/share/meowgorithm/bash_funcs" 4 | 5 | if [[ $(command_exists ffmpeg) == 0 ]]; then 6 | printf "Can't find ffmpeg. Please install it (or check your path).\n" 7 | exit 1 8 | fi 9 | 10 | pngSeq='pngs/frame-%5d.png' 11 | 12 | function usage { 13 | cmd=$(basename "$0") 14 | local cmd 15 | printf "Create a video from a PNG sequence.\n\n" 16 | printf "Usage:\n" 17 | printf " %s [gif|mp4|webm] framerate width basename [max-gif-colors]\n\n" "$cmd" 18 | printf "The input is expected to be a PNG sequence relative to the current\ndirectory with the format 'pngs/frame-%%5d.png'\n" 19 | } 20 | 21 | function makeGIF { 22 | local framerate=$1 23 | local width=$2 24 | local basename=$3 25 | local maxColors=$5 26 | 27 | # GIFs of 60fps videos have to be 50fps 28 | if [[ $framerate == "60" ]]; then 29 | framerate=50 30 | fi 31 | 32 | if [[ $maxColors == "" ]]; then 33 | maxColors=256 34 | fi 35 | 36 | ffmpeg \ 37 | -framerate "$framerate" \ 38 | -i $pngSeq \ 39 | -vf "fps=$framerate,scale=$width:-1:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=${maxColors}[p];[s1][p]paletteuse" \ 40 | "$basename".gif 41 | } 42 | 43 | function makeMP4 { 44 | local framerate=$1 45 | local width=$2 46 | local basename=$3 47 | 48 | ffmpeg \ 49 | -framerate "$framerate" \ 50 | -i $pngSeq \ 51 | -vcodec libx264 \ 52 | -pix_fmt yuv420p \ 53 | -an \ 54 | -crf 20 \ 55 | -filter:v scale="$width":-1 \ 56 | "${basename}.mp4" 57 | } 58 | 59 | function makeWebM { 60 | local framerate=$1 61 | local width=$2 62 | local basename=$3 63 | 64 | ffmpeg -framerate "$framerate" \ 65 | -i $pngSeq \ 66 | -pix_fmt yuv420p \ 67 | -an \ 68 | -crf 30 \ 69 | -b:v 0 \ 70 | -filter:v scale="$width":-1 \ 71 | "${basename}.webm" 72 | } 73 | 74 | if [[ $# -lt 4 || $1 == "-h" ]]; then 75 | usage 76 | exit 1 77 | fi 78 | 79 | case $1 in 80 | gif) 81 | if [[ $# -lt 5 ]]; then exit 1; fi 82 | makeGIF "$2" "$3" "$4" "$5" 83 | ;; 84 | mp4) makeMP4 "$2" "$3" "$4" ;; 85 | webm) makeWebM "$2" "$3" "$4" ;; 86 | *) usage ;; 87 | esac 88 | -------------------------------------------------------------------------------- /modules/home/scripts/map-keys: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | setxkbmap -option 4 | xmodmap ~/.Xmodmap 5 | -------------------------------------------------------------------------------- /modules/home/scripts/sessions: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | bash <( gpg -d "$HOME/.bin/sessions.gpg" ) 4 | -------------------------------------------------------------------------------- /modules/home/scripts/sessions.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meowgorithm/dotfiles/15d16a1902d59a9824982fb4e2eed50e13dd6842/modules/home/scripts/sessions.gpg -------------------------------------------------------------------------------- /modules/home/scripts/setup-mouse: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mouse='Microsoft Microsoft Pro Intellimouse Mouse' 4 | 5 | xinput --set-prop "$mouse" 'libinput Accel Speed' 0 6 | xinput --set-prop "$mouse" 'libinput Natural Scrolling Enabled' 1 7 | -------------------------------------------------------------------------------- /modules/home/scripts/setup-wacom: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | xsetwacom --set "Wacom Intuos Pro M Pen stylus" Button 1 "1" 4 | xsetwacom --set "Wacom Intuos Pro M Pen stylus" Button 2 "pan" 5 | xsetwacom --set "Wacom Intuos Pro M Pen stylus" PanScrollThreshold 200 6 | -------------------------------------------------------------------------------- /modules/home/scripts/tm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [[ $1 == "" ]]; then 4 | echo "Usage: $(basename "$0") session-name" 5 | exit 1 6 | fi 7 | 8 | tmux has-session -t "$1" 2>/dev/null 9 | 10 | # Create session if it doesn't exist 11 | if [ $? != 0 ]; then 12 | tmux new-session -d -s "$1" 13 | fi 14 | 15 | tmux attach-session -t "$1" 16 | -------------------------------------------------------------------------------- /modules/home/scripts/tmls: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ensure() { 4 | if ! command -v "$1" &>/dev/null; then 5 | printf "%s not found. Please install it (or check your PATH) and try again.\n" "$1" 6 | exit 1 7 | fi 8 | } 9 | 10 | filter() { 11 | local height="" 12 | if [ "$2" != "" ]; then 13 | height="--height $2" 14 | fi 15 | # shellcheck disable=2086 16 | tmux list-sessions -F "#S" | fzf --header "$1" $height 17 | } 18 | 19 | ensure tmux 20 | ensure fzf 21 | 22 | if ! tmux ls &>/dev/null; then 23 | printf "no sessions\n" 24 | exit 1 25 | fi 26 | 27 | if [ "$TMUX" != "" ]; then 28 | tmux switch-client -t "$(filter "switch session")" 29 | else 30 | tmux attach-session -t "$(filter "attach session" 12)" 31 | fi 32 | -------------------------------------------------------------------------------- /modules/home/scripts/webp-jpeg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if ! command -v cwebp &>/dev/null; then 4 | printf "'cwebp' not found. Please install WebP and try again.\n\n" 5 | exit 1 6 | fi 7 | 8 | function usage { 9 | printf "Convert an image to a JPEG-style WebP image.\n\n" 10 | printf "Usage:\n %s quality source\n" "$0" 11 | } 12 | 13 | if [[ $# -lt 2 || $1 == "-h" ]]; then 14 | usage 15 | exit 1 16 | fi 17 | 18 | cwebp -q "$1" -m 6 "$2" -o "${2%.*}".webp 19 | -------------------------------------------------------------------------------- /modules/home/scripts/webp-png: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if ! command -v cwebp &>/dev/null; then 4 | printf "'cwebp' not found. Please install WebP and try again.\n\n" 5 | exit 1 6 | fi 7 | 8 | function usage { 9 | printf "Convert an image to a PNG-style WebP image.\n\n" 10 | printf "Usage:\n %s source\n" "$0" 11 | } 12 | 13 | if [[ $# -lt 1 || $1 == "-h" ]]; then 14 | usage 15 | exit 1 16 | fi 17 | 18 | cwebp -z 9 -o "${1%.*}".webp "$1" 19 | -------------------------------------------------------------------------------- /modules/home/ssh.nix: -------------------------------------------------------------------------------- 1 | {...}: { 2 | programs.ssh = { 3 | enable = true; 4 | includes = ["~/.ssh/config.local"]; 5 | 6 | matchBlocks = { 7 | "*" = { 8 | identityFile = "~/.ssh/id_ed25519"; 9 | }; 10 | 11 | "localhost" = { 12 | extraOptions = { 13 | UserKnownHostsFile = "/dev/null"; 14 | StrictHostKeyChecking = "no"; 15 | }; 16 | }; 17 | }; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /modules/home/tmux/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: { 7 | home.packages = with pkgs; [ 8 | tmux 9 | ]; 10 | 11 | # Home Manager's tmux flake inserts some settings we don't want, so just use 12 | # a simple config file in this case. 13 | home.file.".tmux.conf".source = ./tmux.conf; 14 | } 15 | -------------------------------------------------------------------------------- /modules/home/tmux/tmux.conf: -------------------------------------------------------------------------------- 1 | set -g mouse on 2 | set -sg escape-time 0 3 | 4 | # Reload configuration 5 | bind-key r source-file ~/.tmux.conf \; display-message "Configuration reloaded" 6 | 7 | # Enable clipboard. Values here are: 8 | # on: tmux and applications within tmux can set the clipboard 9 | # external: only tmux can set the clipboard 10 | # off: disable clipboard support 11 | set -s set-clipboard on 12 | 13 | # Truecolor and italics. 14 | # 15 | # See also some Kitty notes on the subject: 16 | # https://github.com/kovidgoyal/kitty/issues/312 17 | set -g default-terminal "xterm-256color" 18 | set -ga terminal-overrides ",xterm-*:Tc" 19 | 20 | # Advanced terminal features 21 | set -g focus-events on 22 | # set-option -g extended-keys always # breaks bracketed paste in vim :( 23 | 24 | # Super useful when using "grouped sessions" and multi-monitor setup 25 | setw -g aggressive-resize on 26 | 27 | # Status bar 28 | set-option -g status-position bottom 29 | set-option -g status-left '#[bg=colour63,fg=colour229,bold] #S ' 30 | set-option -g status-left-length 40 31 | set-option -g status-right ' #[fg=colour240]#T #[fg=colour238]%d %b %Y %l:%M%p ' 32 | set-option -g status-right-length 80 33 | set-option -g status-bg colour235 34 | set-option -g status-fg colour241 35 | 36 | # Default window title colors 37 | set-window-option -g window-status-format ' #I #W #F ' 38 | 39 | set-window-option -g window-status-current-format '#[bg=colour211,fg=colour231] #I #W #F ' 40 | set-option -g pane-border-style 'fg=colour238' 41 | set-option -g pane-active-border-style 'fg=colour63' 42 | 43 | # Pane number display 44 | set-option -g display-panes-active-colour colour33 45 | set-option -g display-panes-colour colour166 46 | 47 | # Navigation 48 | bind -n c-m-h select-pane -L 49 | bind -n c-m-j select-pane -D 50 | bind -n c-m-k select-pane -U 51 | bind -n c-m-l select-pane -R 52 | bind -n c-m-n next-window 53 | bind -n c-m-p previous-window 54 | bind \` display-popup -h 20 -w 32 -E "$HOME/.bin/tmls" 55 | 56 | # Window management 57 | bind H split-window -h -l 100 -c "#{pane_current_path}" 58 | bind J split-window -p 50 -c "#{pane_current_path}" 59 | bind c new-window -c "#{pane_current_path}" 60 | -------------------------------------------------------------------------------- /modules/home/wezterm/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: let 2 | colors = import ../colors.nix; 3 | in { 4 | programs.wezterm = { 5 | enable = !pkgs.stdenv.isDarwin; 6 | enableBashIntegration = true; 7 | colorSchemes = { 8 | "Pantera Negra" = { 9 | foreground = colors.foreground; 10 | background = colors.background; 11 | ansi = [ 12 | colors.normal.black 13 | colors.normal.red 14 | colors.normal.green 15 | colors.normal.yellow 16 | colors.normal.blue 17 | colors.normal.magenta 18 | colors.normal.cyan 19 | colors.normal.white 20 | ]; 21 | brights = [ 22 | colors.bright.black 23 | colors.bright.red 24 | colors.bright.green 25 | colors.bright.yellow 26 | colors.bright.blue 27 | colors.bright.magenta 28 | colors.bright.cyan 29 | colors.bright.white 30 | ]; 31 | }; 32 | }; 33 | extraConfig = 34 | ({ 35 | fontSize, 36 | cellWidth, 37 | }: '' 38 | return (function() 39 | local wezterm = require("wezterm") 40 | local config = {} 41 | 42 | if wezterm.config_builder then 43 | config = wezterm.config_builder() 44 | end 45 | 46 | config.font = wezterm.font({ 47 | family = "JetBrains Mono", 48 | weight = "Medium", 49 | }) 50 | config.font_size = ${fontSize} 51 | config.line_height = 1.0 52 | config.cell_width = ${cellWidth} 53 | config.hide_tab_bar_if_only_one_tab = true 54 | config.window_decorations = "RESIZE" 55 | config.color_scheme = "Pantera Negra" 56 | config.window_padding = { 57 | left = "16pt", 58 | right = "16pt", 59 | top = "12pt", 60 | bottom = "12pt", 61 | } 62 | 63 | return config 64 | end)() 65 | '') 66 | ( 67 | if pkgs.stdenv.isLinux 68 | then { 69 | fontSize = "9.5"; 70 | cellWidth = "1.0"; 71 | } 72 | else { 73 | fontSize = "13.0"; 74 | cellWidth = "0.9"; 75 | } 76 | ); 77 | }; 78 | } 79 | -------------------------------------------------------------------------------- /modules/nixos/cachix.nix: -------------------------------------------------------------------------------- 1 | # WARN: this file will get overwritten by $ cachix use 2 | { 3 | pkgs, 4 | lib, 5 | ... 6 | }: let 7 | folder = ./cachix; 8 | toImport = name: value: folder + ("/" + name); 9 | filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key; 10 | imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); 11 | in { 12 | inherit imports; 13 | nix.settings.substituters = ["https://cache.nixos.org/"]; 14 | } 15 | -------------------------------------------------------------------------------- /modules/nixos/cachix/cuda-maintainers.nix: -------------------------------------------------------------------------------- 1 | { 2 | nix.settings = { 3 | substituters = [ 4 | "https://cuda-maintainers.cachix.org" 5 | ]; 6 | trusted-public-keys = [ 7 | "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" 8 | ]; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /modules/nixos/cachix/helix.nix: -------------------------------------------------------------------------------- 1 | { 2 | nix.settings = { 3 | substituters = [ 4 | "https://helix.cachix.org" 5 | ]; 6 | trusted-public-keys = [ 7 | "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" 8 | ]; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /modules/nixos/cachix/nix-community.nix: -------------------------------------------------------------------------------- 1 | { 2 | nix.settings = { 3 | substituters = [ 4 | "https://nix-community.cachix.org" 5 | ]; 6 | trusted-public-keys = [ 7 | "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" 8 | ]; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /modules/nixos/default.nix: -------------------------------------------------------------------------------- 1 | hostname: { 2 | pkgs, 3 | modulesPath, 4 | ... 5 | }: { 6 | imports = [ 7 | ./hardware-config-${hostname}.nix 8 | ./cachix.nix 9 | ]; 10 | 11 | nix.settings = { 12 | experimental-features = ["nix-command" "flakes"]; 13 | trusted-users = ["root" "christian"]; 14 | }; 15 | 16 | nixpkgs.config = { 17 | allowUnfree = true; 18 | # cudaSupport = true; 19 | }; 20 | 21 | boot = { 22 | isContainer = false; 23 | loader.systemd-boot.enable = true; 24 | loader.efi.canTouchEfiVariables = true; 25 | loader.timeout = 30; 26 | }; 27 | 28 | hardware.graphics.enable = true; 29 | 30 | networking = { 31 | hostName = hostname; 32 | firewall.enable = false; 33 | networkmanager.enable = true; 34 | }; 35 | 36 | hardware.bluetooth.enable = true; 37 | services.blueman.enable = true; 38 | 39 | hardware.keyboard.zsa.enable = true; 40 | hardware.opentabletdriver.enable = true; 41 | 42 | services.hardware.bolt.enable = true; 43 | 44 | time = { 45 | timeZone = "America/New_York"; 46 | hardwareClockInLocalTime = true; 47 | }; 48 | 49 | i18n.defaultLocale = "en_US.UTF-8"; 50 | console = { 51 | font = "Lat2-Terminus16"; 52 | useXkbConfig = true; 53 | }; 54 | 55 | environment.variables = { 56 | GDK_SCALE = "2"; 57 | GDK_DPI_SCALE = "0.5"; 58 | QT_AUTO_SCREEN_SCALE_FACTOR = "1"; 59 | QT_FONT_DPI = "192"; 60 | _JAVA_OPTIONS = "-Dsun.java2d.uiScale=2"; 61 | }; 62 | 63 | programs.hyprland.enable = true; 64 | programs.hyprlock.enable = true; 65 | services.hypridle.enable = true; 66 | 67 | virtualisation.docker.enable = true; 68 | 69 | environment.systemPackages = with pkgs; [ 70 | # blender 71 | cachix 72 | # cudatoolkit 73 | faac 74 | faad2 75 | git 76 | gnupg 77 | lguf-brightness 78 | lsof 79 | pinentry 80 | sqlite-interactive 81 | tmux 82 | vim 83 | wget 84 | ]; 85 | 86 | fonts.packages = with pkgs; [ 87 | jetbrains-mono 88 | noto-fonts 89 | noto-fonts-cjk-sans 90 | noto-fonts-cjk-serif 91 | noto-fonts-emoji 92 | noto-fonts-extra 93 | source-han-sans 94 | ubuntu_font_family 95 | ]; 96 | 97 | security.sudo.wheelNeedsPassword = false; 98 | users.users.christian = { 99 | isNormalUser = true; 100 | extraGroups = ["wheel" "docker"]; 101 | packages = with pkgs; [ 102 | discord 103 | slack 104 | spotify 105 | ]; 106 | }; 107 | 108 | services.pcscd.enable = true; 109 | programs.gnupg.agent = { 110 | enable = true; 111 | enableSSHSupport = false; 112 | }; 113 | 114 | programs.ssh.startAgent = true; 115 | 116 | services.openssh = { 117 | enable = true; 118 | settings.PermitRootLogin = "no"; 119 | settings.PasswordAuthentication = false; 120 | }; 121 | 122 | services.avahi = { 123 | enable = true; 124 | publish = { 125 | enable = true; 126 | addresses = true; 127 | workstation = true; 128 | }; 129 | }; 130 | 131 | programs.steam = { 132 | enable = true; 133 | remotePlay.openFirewall = true; 134 | dedicatedServer.openFirewall = true; 135 | }; 136 | 137 | system.stateVersion = "22.05"; 138 | } 139 | -------------------------------------------------------------------------------- /modules/nixos/hardware-config-athena.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 | { config, lib, pkgs, modulesPath, ... }: 5 | 6 | { 7 | imports = 8 | [ (modulesPath + "/installer/scan/not-detected.nix") 9 | ]; 10 | 11 | boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; 12 | boot.initrd.kernelModules = [ ]; 13 | boot.kernelModules = [ "kvm-amd" ]; 14 | boot.extraModulePackages = [ ]; 15 | 16 | fileSystems."/" = 17 | { device = "/dev/disk/by-uuid/45b5dfb8-7255-4c1d-868e-75b10518449e"; 18 | fsType = "btrfs"; 19 | }; 20 | 21 | fileSystems."/boot" = 22 | { device = "/dev/disk/by-uuid/4D0E-A6BE"; 23 | fsType = "vfat"; 24 | }; 25 | 26 | swapDevices = [ ]; 27 | 28 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 29 | # (the default) this is the recommended approach. When using systemd-networkd it's 30 | # still possible to use this option, but it's recommended to use it in conjunction 31 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`. 32 | networking.useDHCP = lib.mkDefault true; 33 | # networking.interfaces.enp78s0.useDHCP = lib.mkDefault true; 34 | # networking.interfaces.enp79s0.useDHCP = lib.mkDefault true; 35 | 36 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 37 | hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 38 | } 39 | -------------------------------------------------------------------------------- /modules/nixos/hardware-config-whitenoise.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 = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; 16 | boot.initrd.kernelModules = []; 17 | boot.kernelModules = ["kvm-amd"]; 18 | boot.extraModulePackages = []; 19 | 20 | fileSystems."/" = { 21 | device = "/dev/disk/by-label/NIXROOT"; 22 | fsType = "btrfs"; 23 | }; 24 | 25 | fileSystems."/boot" = { 26 | device = "/dev/disk/by-label/NIXBOOT"; 27 | fsType = "vfat"; 28 | }; 29 | 30 | swapDevices = []; 31 | 32 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 33 | # (the default) this is the recommended approach. When using systemd-networkd it's 34 | # still possible to use this option, but it's recommended to use it in conjunction 35 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`. 36 | networking.useDHCP = lib.mkDefault true; 37 | # networking.interfaces.enp78s0.useDHCP = lib.mkDefault true; 38 | # networking.interfaces.enp79s0.useDHCP = lib.mkDefault true; 39 | # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; 40 | 41 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 42 | hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 43 | } 44 | --------------------------------------------------------------------------------