nix config

Merge integration branch with darwin support

Amp-Thread-ID: https://ampcode.com/threads/T-0748e36c-aff2-4360-bbfe-f185d2e11209
Co-authored-by: Amp <amp@ampcode.com>

+1802 -50
+243 -49
flake.lock
··· 10 10 "systems": "systems" 11 11 }, 12 12 "locked": { 13 - "lastModified": 1723293904, 14 - "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=", 13 + "lastModified": 1754433428, 14 + "narHash": "sha256-NA/FT2hVhKDftbHSwVnoRTFhes62+7dxZbxj5Gxvghs=", 15 15 "owner": "ryantm", 16 16 "repo": "agenix", 17 - "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41", 17 + "rev": "9edb1787864c4f59ae5074ad498b6272b3ec308d", 18 18 "type": "github" 19 19 }, 20 20 "original": { ··· 75 75 "url": "ssh://gitea@git.sealight.xyz/aynish/basant" 76 76 } 77 77 }, 78 + "brew-src": { 79 + "flake": false, 80 + "locked": { 81 + "lastModified": 1758543057, 82 + "narHash": "sha256-lw3V2jOGYphUFHYQ5oARcb6urlbNpUCLJy1qhsGdUmc=", 83 + "owner": "Homebrew", 84 + "repo": "brew", 85 + "rev": "5b236456eb93133c2bd0d60ef35ed63f1c0712f6", 86 + "type": "github" 87 + }, 88 + "original": { 89 + "owner": "Homebrew", 90 + "ref": "4.6.12", 91 + "repo": "brew", 92 + "type": "github" 93 + } 94 + }, 78 95 "darwin": { 79 96 "inputs": { 80 97 "nixpkgs": [ ··· 83 100 ] 84 101 }, 85 102 "locked": { 86 - "lastModified": 1700795494, 87 - "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", 103 + "lastModified": 1744478979, 104 + "narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=", 88 105 "owner": "lnl7", 89 106 "repo": "nix-darwin", 90 - "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", 107 + "rev": "43975d782b418ebf4969e9ccba82466728c2851b", 91 108 "type": "github" 92 109 }, 93 110 "original": { ··· 97 114 "type": "github" 98 115 } 99 116 }, 117 + "darwin_2": { 118 + "inputs": { 119 + "nixpkgs": [ 120 + "nixpkgs" 121 + ] 122 + }, 123 + "locked": { 124 + "lastModified": 1757432263, 125 + "narHash": "sha256-qHn+/0+IOz5cG68BZUwL9BV3EO/e9eNKCjH3+N7wMdI=", 126 + "owner": "LnL7", 127 + "repo": "nix-darwin", 128 + "rev": "1fef4404de4d1596aa5ab2bd68078370e1b9dcdb", 129 + "type": "github" 130 + }, 131 + "original": { 132 + "owner": "LnL7", 133 + "ref": "nix-darwin-25.05", 134 + "repo": "nix-darwin", 135 + "type": "github" 136 + } 137 + }, 100 138 "deploy-rs": { 101 139 "inputs": { 102 140 "flake-compat": "flake-compat_2", ··· 106 144 "utils": "utils" 107 145 }, 108 146 "locked": { 109 - "lastModified": 1718194053, 110 - "narHash": "sha256-FaGrf7qwZ99ehPJCAwgvNY5sLCqQ3GDiE/6uLhxxwSY=", 147 + "lastModified": 1756719547, 148 + "narHash": "sha256-N9gBKUmjwRKPxAafXEk1EGadfk2qDZPBQp4vXWPHINQ=", 111 149 "owner": "serokell", 112 150 "repo": "deploy-rs", 113 - "rev": "3867348fa92bc892eba5d9ddb2d7a97b9e127a8a", 151 + "rev": "125ae9e3ecf62fb2c0fd4f2d894eb971f1ecaed2", 114 152 "type": "github" 115 153 }, 116 154 "original": { ··· 178 216 ] 179 217 }, 180 218 "locked": { 181 - "lastModified": 1724031427, 182 - "narHash": "sha256-o1HdAf+7IGv9M13R3c+zc/sJ0QgeEnhsvHBcodI4UpM=", 219 + "lastModified": 1758287904, 220 + "narHash": "sha256-IGmaEf3Do8o5Cwp1kXBN1wQmZwQN3NLfq5t4nHtVtcU=", 183 221 "owner": "nix-community", 184 222 "repo": "disko", 185 - "rev": "4e719b38fa7c85f4f65d0308ca7084c91e7bdd6d", 223 + "rev": "67ff9807dd148e704baadbd4fd783b54282ca627", 186 224 "type": "github" 187 225 }, 188 226 "original": { ··· 232 270 "flake-compat_2": { 233 271 "flake": false, 234 272 "locked": { 235 - "lastModified": 1696426674, 236 - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", 273 + "lastModified": 1733328505, 274 + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", 237 275 "owner": "edolstra", 238 276 "repo": "flake-compat", 239 - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", 277 + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", 240 278 "type": "github" 241 279 }, 242 280 "original": { ··· 277 315 "type": "indirect" 278 316 } 279 317 }, 318 + "flake-parts_2": { 319 + "inputs": { 320 + "nixpkgs-lib": [ 321 + "nur", 322 + "nixpkgs" 323 + ] 324 + }, 325 + "locked": { 326 + "lastModified": 1733312601, 327 + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", 328 + "owner": "hercules-ci", 329 + "repo": "flake-parts", 330 + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", 331 + "type": "github" 332 + }, 333 + "original": { 334 + "owner": "hercules-ci", 335 + "repo": "flake-parts", 336 + "type": "github" 337 + } 338 + }, 280 339 "flake-root": { 281 340 "locked": { 282 341 "lastModified": 1692742795, ··· 405 464 }, 406 465 "hardware": { 407 466 "locked": { 408 - "lastModified": 1723310128, 409 - "narHash": "sha256-IiH8jG6PpR4h9TxSGMYh+2/gQiJW9MwehFvheSb5rPc=", 467 + "lastModified": 1758663926, 468 + "narHash": "sha256-6CFdj7Xs616t1W4jLDH7IohAAvl5Dyib3qEv/Uqw1rk=", 410 469 "owner": "nixos", 411 470 "repo": "nixos-hardware", 412 - "rev": "c54cf53e022b0b3c1d3b8207aa0f9b194c24f0cf", 471 + "rev": "170ff93c860b2a9868ed1e1102d4e52cb3d934e1", 413 472 "type": "github" 414 473 }, 415 474 "original": { ··· 426 485 ] 427 486 }, 428 487 "locked": { 429 - "lastModified": 1703113217, 430 - "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", 488 + "lastModified": 1745494811, 489 + "narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=", 431 490 "owner": "nix-community", 432 491 "repo": "home-manager", 433 - "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", 492 + "rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be", 434 493 "type": "github" 435 494 }, 436 495 "original": { ··· 446 505 ] 447 506 }, 448 507 "locked": { 449 - "lastModified": 1751810233, 450 - "narHash": "sha256-kllkNbIqQi3VplgTMeGzuh1t8Gk8TauvkTRt93Km+tQ=", 508 + "lastModified": 1758463745, 509 + "narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=", 451 510 "owner": "nix-community", 452 511 "repo": "home-manager", 453 - "rev": "9b0873b46c9f9e4b7aa01eb634952c206af53068", 512 + "rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3", 454 513 "type": "github" 455 514 }, 456 515 "original": { ··· 460 519 "type": "github" 461 520 } 462 521 }, 522 + "homebrew-bundle": { 523 + "flake": false, 524 + "locked": { 525 + "lastModified": 1745335228, 526 + "narHash": "sha256-TIKR2UgtyUmHLNZp255/vLs+1I10hXe+sciMEbAGFwE=", 527 + "owner": "homebrew", 528 + "repo": "homebrew-bundle", 529 + "rev": "a3265c84b232e13048ecbf6fc18a2eedfadbeb08", 530 + "type": "github" 531 + }, 532 + "original": { 533 + "owner": "homebrew", 534 + "repo": "homebrew-bundle", 535 + "type": "github" 536 + } 537 + }, 538 + "homebrew-cask": { 539 + "flake": false, 540 + "locked": { 541 + "lastModified": 1759110411, 542 + "narHash": "sha256-wsvLofMB/1bkjY6OQjjWU80+AbQiPzZSLZ3cjsYpOAs=", 543 + "owner": "homebrew", 544 + "repo": "homebrew-cask", 545 + "rev": "80f95de379d69edb696dd29106b2d8b077c98896", 546 + "type": "github" 547 + }, 548 + "original": { 549 + "owner": "homebrew", 550 + "repo": "homebrew-cask", 551 + "type": "github" 552 + } 553 + }, 554 + "homebrew-core": { 555 + "flake": false, 556 + "locked": { 557 + "lastModified": 1759116320, 558 + "narHash": "sha256-FGqC/WlIJnMkhV7l6XK6r5AqUYkwTHvHBCUjFe3DUUY=", 559 + "owner": "homebrew", 560 + "repo": "homebrew-core", 561 + "rev": "0ccf924357d3eca3268d6dafb224ad9dc4f2398a", 562 + "type": "github" 563 + }, 564 + "original": { 565 + "owner": "homebrew", 566 + "repo": "homebrew-core", 567 + "type": "github" 568 + } 569 + }, 570 + "jovian": { 571 + "inputs": { 572 + "nix-github-actions": "nix-github-actions", 573 + "nixpkgs": [ 574 + "unstable" 575 + ] 576 + }, 577 + "locked": { 578 + "lastModified": 1757230583, 579 + "narHash": "sha256-4uqu7sFPOaVTCogsxaGMgbzZ2vK40GVGMfUmrvK3/LY=", 580 + "owner": "Jovian-Experiments", 581 + "repo": "Jovian-NixOS", 582 + "rev": "fc3960e6c32c9d4f95fff2ef84444284d24d3bea", 583 + "type": "github" 584 + }, 585 + "original": { 586 + "owner": "Jovian-Experiments", 587 + "repo": "Jovian-NixOS", 588 + "type": "github" 589 + } 590 + }, 463 591 "lowdown-src": { 464 592 "flake": false, 465 593 "locked": { ··· 516 644 "type": "github" 517 645 } 518 646 }, 647 + "nix-github-actions": { 648 + "inputs": { 649 + "nixpkgs": [ 650 + "jovian", 651 + "nixpkgs" 652 + ] 653 + }, 654 + "locked": { 655 + "lastModified": 1729697500, 656 + "narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=", 657 + "owner": "zhaofengli", 658 + "repo": "nix-github-actions", 659 + "rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf", 660 + "type": "github" 661 + }, 662 + "original": { 663 + "owner": "zhaofengli", 664 + "ref": "matrix-name", 665 + "repo": "nix-github-actions", 666 + "type": "github" 667 + } 668 + }, 669 + "nix-homebrew": { 670 + "inputs": { 671 + "brew-src": "brew-src" 672 + }, 673 + "locked": { 674 + "lastModified": 1758598228, 675 + "narHash": "sha256-qr60maXGbZ4FX5tejPRI3nr0bnRTnZ3AbbbfO6/6jq4=", 676 + "owner": "zhaofengli-wip", 677 + "repo": "nix-homebrew", 678 + "rev": "f36e5db56e117f7df701ab152d0d2036ea85218c", 679 + "type": "github" 680 + }, 681 + "original": { 682 + "owner": "zhaofengli-wip", 683 + "repo": "nix-homebrew", 684 + "type": "github" 685 + } 686 + }, 519 687 "nix-matrix-appservices": { 520 688 "inputs": { 521 689 "devshell": "devshell", ··· 576 744 }, 577 745 "nixos-hardware": { 578 746 "locked": { 579 - "lastModified": 1723310128, 580 - "narHash": "sha256-IiH8jG6PpR4h9TxSGMYh+2/gQiJW9MwehFvheSb5rPc=", 747 + "lastModified": 1758663926, 748 + "narHash": "sha256-6CFdj7Xs616t1W4jLDH7IohAAvl5Dyib3qEv/Uqw1rk=", 581 749 "owner": "NixOS", 582 750 "repo": "nixos-hardware", 583 - "rev": "c54cf53e022b0b3c1d3b8207aa0f9b194c24f0cf", 751 + "rev": "170ff93c860b2a9868ed1e1102d4e52cb3d934e1", 584 752 "type": "github" 585 753 }, 586 754 "original": { ··· 690 858 }, 691 859 "nixpkgs_4": { 692 860 "locked": { 693 - "lastModified": 1755274400, 694 - "narHash": "sha256-rTInmnp/xYrfcMZyFMH3kc8oko5zYfxsowaLv1LVobY=", 861 + "lastModified": 1758791193, 862 + "narHash": "sha256-F8WmEwFoHsnix7rt290R0rFXNJiMbClMZyIC/e+HYf0=", 695 863 "owner": "nixos", 696 864 "repo": "nixpkgs", 697 - "rev": "ad7196ae55c295f53a7d1ec39e4a06d922f3b899", 865 + "rev": "25e53aa156d47bad5082ff7618f5feb1f5e02d01", 698 866 "type": "github" 699 867 }, 700 868 "original": { ··· 704 872 "type": "github" 705 873 } 706 874 }, 875 + "nixpkgs_5": { 876 + "locked": { 877 + "lastModified": 1758690382, 878 + "narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=", 879 + "owner": "nixos", 880 + "repo": "nixpkgs", 881 + "rev": "e643668fd71b949c53f8626614b21ff71a07379d", 882 + "type": "github" 883 + }, 884 + "original": { 885 + "owner": "nixos", 886 + "ref": "nixos-unstable", 887 + "repo": "nixpkgs", 888 + "type": "github" 889 + } 890 + }, 707 891 "nur": { 892 + "inputs": { 893 + "flake-parts": "flake-parts_2", 894 + "nixpkgs": "nixpkgs_5" 895 + }, 708 896 "locked": { 709 - "lastModified": 1724040334, 710 - "narHash": "sha256-Ia4gRRmhFn4oJ4SJKJPDNPomsRRFWU+bqCK7yuiLW4E=", 897 + "lastModified": 1759117007, 898 + "narHash": "sha256-DSnkPMhK2Eg0XLiyjEPVtIpdcmWmYsBMhVGCN1144SA=", 711 899 "owner": "nix-community", 712 900 "repo": "NUR", 713 - "rev": "24471a48600e18669d13d24c9640b9859357d2cf", 901 + "rev": "fccc09dffa659dc1410eceb33285831ba12bc7f6", 714 902 "type": "github" 715 903 }, 716 904 "original": { ··· 726 914 ] 727 915 }, 728 916 "locked": { 729 - "lastModified": 1756350023, 730 - "narHash": "sha256-4S6EUvEFvOnwjSo/LqAVVuX2/JjAJ8gQFmQQ0DS4oXU=", 917 + "lastModified": 1759014010, 918 + "narHash": "sha256-NMpUufnxiGDTs/4Nxj8t+n4wc4aSs02a4T5OORo0gBQ=", 731 919 "ref": "main", 732 - "rev": "a807111f9b20c501183516baf8082c4359aaaaa1", 733 - "revCount": 1594, 920 + "rev": "08c1dddf38c39d6f7c73a24f4d396f4c925185bf", 921 + "revCount": 1602, 734 922 "type": "git", 735 923 "url": "ssh://gitea@git.sealight.xyz/aynish/kitaab" 736 924 }, ··· 775 963 "agenix": "agenix", 776 964 "autohide-tdrop": "autohide-tdrop", 777 965 "basant": "basant", 966 + "darwin": "darwin_2", 778 967 "deploy-rs": "deploy-rs", 779 968 "disko": "disko", 780 969 "grasp": "grasp", 781 970 "hardware": "hardware", 782 971 "home-manager": "home-manager_2", 972 + "homebrew-bundle": "homebrew-bundle", 973 + "homebrew-cask": "homebrew-cask", 974 + "homebrew-core": "homebrew-core", 975 + "jovian": "jovian", 976 + "nix-homebrew": "nix-homebrew", 783 977 "nix-matrix-appservices": "nix-matrix-appservices", 784 978 "nixos-hardware": "nixos-hardware", 785 979 "nixpkgs": "nixpkgs_4", ··· 815 1009 ] 816 1010 }, 817 1011 "locked": { 818 - "lastModified": 1724034091, 819 - "narHash": "sha256-b1g7w0sw+MDAhUAeCoX1vlTghsqcDZkxr+k9OZmxPa8=", 1012 + "lastModified": 1759113356, 1013 + "narHash": "sha256-xm4kEUcV2jk6u15aHazFP4YsMwhq+PczA+Ul/4FDKWI=", 820 1014 "owner": "oxalica", 821 1015 "repo": "rust-overlay", 822 - "rev": "c7d36e0947826e0751a5214ffe82533fbc909bc0", 1016 + "rev": "be3b8843a2be2411500f6c052876119485e957a2", 823 1017 "type": "github" 824 1018 }, 825 1019 "original": { ··· 933 1127 "vowel-src": "vowel-src" 934 1128 }, 935 1129 "locked": { 936 - "lastModified": 1723223284, 937 - "narHash": "sha256-NAT+g5nsaJZkpR0sCZjerd1xx233ZUdRH3ZWwZhzq/c=", 1130 + "lastModified": 1730626669, 1131 + "narHash": "sha256-nFyZrvTPn9OM9UZmuAwy3e1Ba0ZuYc2FaDCOOhGtqg4=", 938 1132 "owner": "mitchmindtree", 939 1133 "repo": "tidalcycles.nix", 940 - "rev": "82f3e8e8d02eb9f0c9dfe9ab3773b825c6bc1982", 1134 + "rev": "0db0918e7a3d3c30ed7a6e81dc9d4e3832870ac4", 941 1135 "type": "github" 942 1136 }, 943 1137 "original": { ··· 966 1160 }, 967 1161 "unstable": { 968 1162 "locked": { 969 - "lastModified": 1752687322, 970 - "narHash": "sha256-RKwfXA4OZROjBTQAl9WOZQFm7L8Bo93FQwSJpAiSRvo=", 1163 + "lastModified": 1758690382, 1164 + "narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=", 971 1165 "owner": "nixos", 972 1166 "repo": "nixpkgs", 973 - "rev": "6e987485eb2c77e5dcc5af4e3c70843711ef9251", 1167 + "rev": "e643668fd71b949c53f8626614b21ff71a07379d", 974 1168 "type": "github" 975 1169 }, 976 1170 "original": { ··· 985 1179 "systems": "systems_4" 986 1180 }, 987 1181 "locked": { 988 - "lastModified": 1701680307, 989 - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", 1182 + "lastModified": 1731533236, 1183 + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 990 1184 "owner": "numtide", 991 1185 "repo": "flake-utils", 992 - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", 1186 + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 993 1187 "type": "github" 994 1188 }, 995 1189 "original": {
+130 -1
flake.nix
··· 38 38 # Matrix 39 39 nix-matrix-appservices.url = "gitlab:coffeetables/nix-matrix-appservices"; 40 40 41 + # Darwin 42 + darwin = { 43 + url = "github:LnL7/nix-darwin/nix-darwin-25.05"; 44 + inputs.nixpkgs.follows = "nixpkgs"; 45 + }; 46 + nix-homebrew = { 47 + url = "github:zhaofengli-wip/nix-homebrew"; 48 + }; 49 + homebrew-bundle = { 50 + url = "github:homebrew/homebrew-bundle"; 51 + flake = false; 52 + }; 53 + homebrew-core = { 54 + url = "github:homebrew/homebrew-core"; 55 + flake = false; 56 + }; 57 + homebrew-cask = { 58 + url = "github:homebrew/homebrew-cask"; 59 + flake = false; 60 + }; 61 + 62 + # Steam Deck / Gaming 63 + jovian = { 64 + url = "github:Jovian-Experiments/Jovian-NixOS"; 65 + inputs.nixpkgs.follows = "unstable"; 66 + }; 67 + 41 68 # Others 42 69 nur.url = "github:nix-community/NUR"; 43 70 rust-overlay = { ··· 61 88 62 89 outputs = { self, nixpkgs, unstable, nixos-hardware, home-manager, deploy-rs 63 90 , agenix, disko, basant, grasp, nix-matrix-appservices, nur, tidalcycles 64 - , rust-overlay, vimwikicli, autohide-tdrop, ... }@inputs: 91 + , rust-overlay, vimwikicli, autohide-tdrop, darwin, nix-homebrew, homebrew-bundle 92 + , homebrew-core, homebrew-cask, jovian, ... }@inputs: 65 93 let 66 94 forAllSystems = nixpkgs.lib.genAttrs [ 67 95 "aarch64-linux" ··· 124 152 tidalcycles.overlays.default # needed for nvim which comes pre-installed lol 125 153 ]; 126 154 }); 155 + 156 + # Package set for Darwin systems 157 + darwinPkgsFor = forAllSystems (system: 158 + import nixpkgs { 159 + inherit system; 160 + config = { 161 + permittedInsecurePackages = [ 162 + "olm-3.2.16" 163 + ]; 164 + allowUnfreePredicate = pkg: 165 + builtins.elem (nixpkgs.lib.getName pkg) [ 166 + "ripcord" 167 + "vcv-rack" 168 + "SunVox" 169 + "renoise" 170 + ]; 171 + }; 172 + overlays = [ 173 + rust-overlay.overlays.default 174 + tidalcycles.overlays.default 175 + agenix.overlays.default 176 + nur.overlay 177 + unstableOverlay 178 + vimwikiOverlay 179 + self.overlays.additions 180 + self.overlays.modifications 181 + ]; 182 + }); 183 + 184 + # Package set for Steam Deck (gaming-focused) 185 + deckPkgsFor = forAllSystems (system: 186 + import unstable { 187 + inherit system; 188 + config = { 189 + permittedInsecurePackages = [ 190 + "olm-3.2.16" 191 + ]; 192 + allowUnfreePredicate = pkg: 193 + builtins.elem (nixpkgs.lib.getName pkg) [ 194 + "ripcord" 195 + "vcv-rack" 196 + "SunVox" 197 + "renoise" 198 + "steam" 199 + "steam-original" 200 + "steam-runtime" 201 + ]; 202 + }; 203 + overlays = [ 204 + rust-overlay.overlays.default 205 + tidalcycles.overlays.default 206 + agenix.overlays.default 207 + nur.overlay 208 + unstableOverlay 209 + vimwikiOverlay 210 + self.overlays.additions 211 + self.overlays.modifications 212 + ]; 213 + }); 127 214 in { 128 215 # Your custom packages 129 216 # Acessible through 'nix build', 'nix shell', etc ··· 227 314 home-manager.useGlobalPkgs = true; 228 315 home-manager.useUserPackages = true; 229 316 home-manager.users.anish = import ./home/dev; 317 + } 318 + ]; 319 + }; 320 + 321 + deck = unstable.lib.nixosSystem rec { 322 + specialArgs = { inherit inputs self; }; 323 + system = "x86_64-linux"; 324 + pkgs = deckPkgsFor.${system}; 325 + modules = [ 326 + ./hosts/deck 327 + jovian.nixosModules.default 328 + self.nixosModules.wireguard 329 + agenix.nixosModules.age 330 + self.nixosModules.backup 331 + home-manager.nixosModules.home-manager 332 + { 333 + nix.registry.nixpkgs.flake = unstable; 334 + home-manager.useGlobalPkgs = true; 335 + home-manager.useUserPackages = true; 336 + home-manager.users.anish = import ./home/gui; 337 + } 338 + ]; 339 + }; 340 + }; 341 + 342 + # Darwin configuration entrypoint 343 + darwinConfigurations = { 344 + "Anishs-MacBook-Pro" = darwin.lib.darwinSystem rec { 345 + system = "aarch64-darwin"; 346 + pkgs = darwinPkgsFor.${system}; 347 + specialArgs = { inherit inputs self; }; 348 + modules = [ 349 + ./hosts/darwin 350 + home-manager.darwinModules.home-manager 351 + agenix.darwinModules.default 352 + { 353 + users.users.anishlakhwara.home = "/Users/anishlakhwara"; 354 + home-manager = { 355 + users.anishlakhwara = import ./home/darwin; 356 + useGlobalPkgs = true; 357 + useUserPackages = true; 358 + }; 230 359 } 231 360 ]; 232 361 };
+28
home/darwin/default.nix
··· 1 + { self, pkgs, ... }: 2 + { 3 + imports = [ 4 + ../profiles/nvim 5 + ../profiles/cli 6 + ../profiles/direnv 7 + ../profiles/git 8 + ../profiles/task 9 + ../profiles/kitty 10 + # ../profiles/firefox 11 + ]; 12 + 13 + home.username = "anishlakhwara"; 14 + home.homeDirectory = "/Users/anishlakhwara"; 15 + home.stateVersion = "22.05"; 16 + 17 + programs.zsh.initExtra = '' 18 + PATH=/Users/anishlakhwara/.sourcegraph/bin:/Users/anishlakhwara/.sourcegraph/sg.zsh_autocomplete:/Users/anishlakhwara/google-cloud-sdk/bin:/Users/anishlakhwara/google-cloud-sdk/completion.zsh.inc:/Users/anishlakhwara/google-cloud-sdk/path.zsh.inc:/Users/anishlakhwara/.sg:/opt/homebrew/bin:$PATH 19 + ''; 20 + 21 + # Managing sketchybar plugins from home-manager 22 + home.file = { 23 + ".config/sketchybar" = { 24 + source = ./sketchybar; 25 + recursive = true; 26 + }; 27 + }; 28 + }
+20
home/darwin/sketchybar/battery.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + COLOR="$CYAN" 4 + 5 + sketchybar --add item battery right \ 6 + --set battery \ 7 + update_freq=60 \ 8 + icon.color="$COLOR" \ 9 + icon.padding_left=10 \ 10 + label.padding_right=10 \ 11 + label.color="$COLOR" \ 12 + background.height=26 \ 13 + background.corner_radius="$CORNER_RADIUS" \ 14 + background.padding_right=5 \ 15 + background.border_width="$BORDER_WIDTH" \ 16 + background.border_color="$COLOR" \ 17 + background.color="$BAR_COLOR" \ 18 + background.drawing=on \ 19 + script="$PLUGIN_DIR/power.sh" \ 20 + --subscribe battery power_source_change
+20
home/darwin/sketchybar/items/battery.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + COLOR="$CYAN" 4 + 5 + sketchybar --add item battery right \ 6 + --set battery \ 7 + update_freq=60 \ 8 + icon.color="$COLOR" \ 9 + icon.padding_left=10 \ 10 + label.padding_right=10 \ 11 + label.color="$COLOR" \ 12 + background.height=26 \ 13 + background.corner_radius="$CORNER_RADIUS" \ 14 + background.padding_right=5 \ 15 + background.border_width="$BORDER_WIDTH" \ 16 + background.border_color="$COLOR" \ 17 + background.color="$BAR_COLOR" \ 18 + background.drawing=on \ 19 + script="$PLUGIN_DIR/power.sh" \ 20 + --subscribe battery power_source_change
+18
home/darwin/sketchybar/items/calendar.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + COLOR="$BLUE" 4 + 5 + sketchybar --add item calendar right \ 6 + --set calendar update_freq=15 \ 7 + icon.color="$COLOR" \ 8 + icon.padding_left=10 \ 9 + label.color="$COLOR" \ 10 + label.padding_right=10 \ 11 + background.height=26 \ 12 + background.corner_radius="$CORNER_RADIUS" \ 13 + background.padding_right=5 \ 14 + background.border_width="$BORDER_WIDTH" \ 15 + background.border_color="$COLOR" \ 16 + background.color="$BAR_COLOR" \ 17 + background.drawing=on \ 18 + script="$PLUGIN_DIR/calendar.sh"
+21
home/darwin/sketchybar/items/clock.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + COLOR="$MAGENTA" 4 + 5 + sketchybar --add item clock right \ 6 + --set clock update_freq=60 \ 7 + icon.padding_left=10 \ 8 + icon.color="$COLOR" \ 9 + icon=" " \ 10 + label.color="$COLOR" \ 11 + label.padding_right=5 \ 12 + label.width=43 \ 13 + align=center \ 14 + background.height=26 \ 15 + background.corner_radius="$CORNER_RADIUS" \ 16 + background.padding_right=2 \ 17 + background.border_width="$BORDER_WIDTH" \ 18 + background.border_color="$COLOR" \ 19 + background.color="$BAR_COLOR" \ 20 + background.drawing=on \ 21 + script="$PLUGIN_DIR/clock.sh"
+19
home/darwin/sketchybar/items/cpu.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + COLOR="$YELLOW" 4 + 5 + sketchybar --add item cpu right \ 6 + --set cpu \ 7 + update_freq=3 \ 8 + icon.color="$COLOR" \ 9 + icon.padding_left=10 \ 10 + label.color="$COLOR" \ 11 + label.padding_right=10 \ 12 + background.height=26 \ 13 + background.corner_radius="$CORNER_RADIUS" \ 14 + background.padding_right=5 \ 15 + background.border_width="$BORDER_WIDTH" \ 16 + background.border_color="$COLOR" \ 17 + background.color="$BAR_COLOR" \ 18 + background.drawing=on \ 19 + script="$PLUGIN_DIR/cpu.sh"
+20
home/darwin/sketchybar/items/front_app.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + COLOR="$WHITE" 4 + 5 + sketchybar \ 6 + --add item front_app left \ 7 + --set front_app script="$PLUGIN_DIR/front_app.sh" \ 8 + icon.drawing=off \ 9 + background.height=26 \ 10 + background.padding_left=0 \ 11 + background.padding_right=10 \ 12 + background.border_width="$BORDER_WIDTH" \ 13 + background.border_color="$COLOR" \ 14 + background.corner_radius="$CORNER_RADIUS" \ 15 + background.color="$BAR_COLOR" \ 16 + label.color="$COLOR" \ 17 + label.padding_left=10 \ 18 + label.padding_right=10 \ 19 + associated_display=active \ 20 + --subscribe front_app front_app_switched
+44
home/darwin/sketchybar/items/spaces.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + SPACE_ICONS=("1" "2" "3" "4" "5" "6" "7" "8" "9" "10") 4 + 5 + sketchybar --add item spacer.1 left \ 6 + --set spacer.1 background.drawing=off \ 7 + label.drawing=off \ 8 + icon.drawing=off \ 9 + width=10 10 + 11 + for i in {0..9}; do 12 + sid=$((i + 1)) 13 + sketchybar --add space space.$sid left \ 14 + --set space.$sid associated_space=$sid \ 15 + label.drawing=off \ 16 + icon.padding_left=10 \ 17 + icon.padding_right=10 \ 18 + background.padding_left=-5 \ 19 + background.padding_right=-5 \ 20 + script="$PLUGIN_DIR/space.sh" 21 + done 22 + 23 + sketchybar --add item spacer.2 left \ 24 + --set spacer.2 background.drawing=off \ 25 + label.drawing=off \ 26 + icon.drawing=off \ 27 + width=5 28 + 29 + sketchybar --add bracket spaces '/space.*/' \ 30 + --set spaces background.border_width="$BORDER_WIDTH" \ 31 + background.border_color="$RED" \ 32 + background.corner_radius="$CORNER_RADIUS" \ 33 + background.color="$BAR_COLOR" \ 34 + background.height=26 \ 35 + background.drawing=on 36 + 37 + sketchybar --add item separator left \ 38 + --set separator icon= \ 39 + icon.font="$FONT:Regular:16.0" \ 40 + background.padding_left=26 \ 41 + background.padding_right=15 \ 42 + label.drawing=off \ 43 + associated_display=active \ 44 + icon.color="$YELLOW"
+23
home/darwin/sketchybar/items/spotify.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + COLOR="$ORANGE" 4 + 5 + sketchybar --add item spotify q \ 6 + --set spotify \ 7 + scroll_texts=on \ 8 + icon=󰎆 \ 9 + icon.color="$COLOR" \ 10 + icon.padding_left=10 \ 11 + background.color="$BAR_COLOR" \ 12 + background.height=26 \ 13 + background.corner_radius="$CORNER_RADIUS" \ 14 + background.border_width="$BORDER_WIDTH" \ 15 + background.border_color="$COLOR" \ 16 + background.padding_right=-5 \ 17 + background.drawing=on \ 18 + label.padding_right=10 \ 19 + label.max_chars=20 \ 20 + associated_display=active \ 21 + updates=on \ 22 + script="$PLUGIN_DIR/spotify.sh" \ 23 + --subscribe spotify media_change
+20
home/darwin/sketchybar/items/volume.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + COLOR="$GREEN" 4 + 5 + sketchybar \ 6 + --add item sound right \ 7 + --set sound \ 8 + icon.color="$COLOR" \ 9 + icon.padding_left=10 \ 10 + label.color="$COLOR" \ 11 + label.padding_right=10 \ 12 + background.height=26 \ 13 + background.corner_radius="$CORNER_RADIUS" \ 14 + background.padding_right=5 \ 15 + background.border_width="$BORDER_WIDTH" \ 16 + background.border_color="$COLOR" \ 17 + background.color="$BAR_COLOR" \ 18 + background.drawing=on \ 19 + script="$PLUGIN_DIR/sound.sh" \ 20 + --subscribe sound volume_change
+4
home/darwin/sketchybar/items/vpn.sh
··· 1 + sketchybar -m --add item vpn right \ 2 + --set vpn icon= \ 3 + update_freq=5 \ 4 + script="~/.config/sketchybar/plugins/vpn.sh"
+3
home/darwin/sketchybar/plugins/calendar.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + sketchybar --set "$NAME" icon="󰸗 " label="$(date '+%a %d. %b')"
+4
home/darwin/sketchybar/plugins/clock.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + LABEL=$(date '+%H:%M') 4 + sketchybar --set "$NAME" icon=" " label="$LABEL"
+3
home/darwin/sketchybar/plugins/cpu.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + sketchybar --set "$NAME" icon="" label="$(ps -A -o %cpu | awk '{s+=$1} END {s /= 8} END {printf "%.1f%%\n", s}')"
+7
home/darwin/sketchybar/plugins/front_app.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + case "$SENDER" in 4 + "front_app_switched") 5 + sketchybar --set "$NAME" label="$INFO" 6 + ;; 7 + esac
+30
home/darwin/sketchybar/plugins/power.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + PERCENTAGE=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1) 4 + CHARGING=$(pmset -g batt | grep 'AC Power') 5 + 6 + if [ "$PERCENTAGE" = "" ]; then 7 + exit 0 8 + fi 9 + 10 + case ${PERCENTAGE} in 11 + 9[0-9] | 100) 12 + ICON=" " 13 + ;; 14 + [6-8][0-9]) 15 + ICON=" " 16 + ;; 17 + [3-5][0-9]) 18 + ICON=" " 19 + ;; 20 + [1-2][0-9]) 21 + ICON=" " 22 + ;; 23 + *) ICON=" " ;; 24 + esac 25 + 26 + if [ "$CHARGING" != "" ]; then 27 + ICON="" 28 + fi 29 + 30 + sketchybar --set "$NAME" icon="$ICON" label="${PERCENTAGE}% "
+20
home/darwin/sketchybar/plugins/sound.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + VOLUME=$(osascript -e "output volume of (get volume settings)") 4 + MUTED=$(osascript -e "output muted of (get volume settings)") 5 + 6 + if [ "$MUTED" != "false" ]; then 7 + ICON="󰖁 " 8 + VOLUME=0 9 + else 10 + case ${VOLUME} in 11 + 100) ICON=" " ;; 12 + [5-9]*) ICON=" " ;; 13 + [0-9]*) ICON=" " ;; 14 + *) ICON=" " ;; 15 + esac 16 + fi 17 + 18 + sketchybar -m \ 19 + --set "$NAME" icon=$ICON \ 20 + --set "$NAME" label="$VOLUME%"
+19
home/darwin/sketchybar/plugins/space.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + source "$HOME/.config/sketchybar/variables.sh" # Loads all defined colors 4 + 5 + SPACE_ICONS=(" " " " "󰺻 " " " " " "6" "7" "8" "9" "10") 6 + 7 + SPACE_CLICK_SCRIPT="yabai -m space --focus $SID 2>/dev/null" 8 + 9 + if [ "$SELECTED" = "true" ]; then 10 + sketchybar --animate tanh 5 --set "$NAME" \ 11 + icon.color="$RED" \ 12 + icon="${SPACE_ICONS[$SID - 1]}" \ 13 + click_script="$SPACE_CLICK_SCRIPT" 14 + else 15 + sketchybar --animate tanh 5 --set "$NAME" \ 16 + icon.color="$COMMENT" \ 17 + icon="${SPACE_ICONS[$SID - 1]}" \ 18 + click_script="$SPACE_CLICK_SCRIPT" 19 + fi
+11
home/darwin/sketchybar/plugins/spotify.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + STATE="$(echo "$INFO" | jq -r '.state')" 4 + APP="$(echo "$INFO" | jq -r '.app')" 5 + 6 + if [ "$STATE" = "playing" ] && [ "$APP" == "Spotify" ]; then 7 + MEDIA="$(echo "$INFO" | jq -r '.title + " - " + .artist')" 8 + sketchybar --set "$NAME" label="$MEDIA" drawing=on 9 + else 10 + sketchybar --set "$NAME" drawing=off 11 + fi
+16
home/darwin/sketchybar/plugins/vpn.sh
··· 1 + #!/bin/bash 2 + 3 + ### You need to edit sudoers file to run wg-quick without password 4 + 5 + # %admin ALL = (ALL) NOPASSWD: /nix/store/s2qw0sxax8pckbzmyw6wrarahmx65bq9-wireguard-tools-1.0.20210914/bin/wg-quick 6 + 7 + WG_PIDFILE="/var/run/wireguard/wg0.name" 8 + 9 + if [ -f $WG_PIDFILE ]; then 10 + sketchybar -m --set vpn icon= \ 11 + label="$VPN" \ 12 + drawing=on \ 13 + click_script="~/.config/sketchybar/plugins/wg_off.sh" 14 + else 15 + sketchybar -m --set vpn drawing=off click_script="~/.config/sketchybar/plugins/wg_on.sh" 16 + fi
+5
home/darwin/sketchybar/plugins/wg_off.sh
··· 1 + ### You need to edit sudoers file to run wg-quick without password 2 + 3 + # %admin ALL = (ALL) NOPASSWD: /nix/store/s2qw0sxax8pckbzmyw6wrarahmx65bq9-wireguard-tools-1.0.20210914/bin/wg-quick 4 + 5 + sudo wg-quick down wg0
+5
home/darwin/sketchybar/plugins/wg_on.sh
··· 1 + ### You need to edit sudoers file to run wg-quick without password 2 + 3 + # %admin ALL = (ALL) NOPASSWD: /nix/store/s2qw0sxax8pckbzmyw6wrarahmx65bq9-wireguard-tools-1.0.20210914/bin/wg-quick 4 + 5 + sudo wg-quick up wg0
+50
home/darwin/sketchybar/variables.sh
··· 1 + #!/usr/bin/env sh 2 + 3 + # Color Palette 4 + # Tokyonight Night 5 + BLACK=0xff24283b 6 + WHITE=0xffa9b1d6 7 + MAGENTA=0xffbb9af7 8 + BLUE=0xff7aa2f7 9 + CYAN=0xff7dcfff 10 + GREEN=0xff9ece6a 11 + YELLOW=0xffe0af68 12 + ORANGE=0xffff9e64 13 + RED=0xfff7768e 14 + BAR_COLOR=0xff1a1b26 15 + COMMENT=0xff565f89 16 + 17 + # Tokyonight Day 18 + # BLACK=0xffe9e9ed 19 + # WHITE=0xff3760bf 20 + # MAGENTA=0xff9854f1 21 + # BLUE=0xff2e7de9 22 + # CYAN=0xff007197 23 + # GREEN=0xff587539 24 + # YELLOW=0xff8c6c3e 25 + # ORANGE=0xffb15c00 26 + # RED=0xfff52a65 27 + # BAR_COLOR=0xffe1e2e7 28 + 29 + TRANSPARENT=0x00000000 30 + 31 + # General bar colors 32 + ICON_COLOR=$WHITE # Color of all icons 33 + LABEL_COLOR=$WHITE # Color of all labels 34 + 35 + ITEM_DIR="$HOME/.config/sketchybar/items" 36 + PLUGIN_DIR="$HOME/.config/sketchybar/plugins" 37 + 38 + FONT="Iosevka Nerd Font" 39 + 40 + PADDINGS=3 41 + 42 + POPUP_BORDER_WIDTH=2 43 + POPUP_CORNER_RADIUS=11 44 + POPUP_BACKGROUND_COLOR=$BLACK 45 + POPUP_BORDER_COLOR=$COMMENT 46 + 47 + CORNER_RADIUS=15 48 + BORDER_WIDTH=2 49 + 50 + SHADOW=on
+43
hosts/darwin/casks/default.nix
··· 1 + { ... }: 2 + 3 + { 4 + homebrew.enable = true; 5 + homebrew.brews = [ 6 + "kind" 7 + "kubectl" 8 + "bazelisk" 9 + "sourcegraph/src-cli/src-cli" 10 + "gh" 11 + # "postgresql@15" 12 + # "redis" 13 + ]; 14 + homebrew.casks = [ 15 + # Development Tools 16 + "homebrew/cask/docker" 17 + # "syncthing" 18 + # "insomnia" 19 + # "tableplus" 20 + # "ngrok" 21 + "postico" 22 + "wireshark" 23 + "1password" 24 + "orbstack" 25 + 26 + # Communication Tools 27 + # Already installed manually 28 + # "loom" 29 + # "slack" 30 + # "zoom" 31 + # "firefox" 32 + # "1password-cli" 33 + 34 + # Utility Tools 35 + # "syncthing" 36 + 37 + # Productivity Tools 38 + "raycast" 39 + 40 + # AI 41 + # "diffusionbee" 42 + ]; 43 + }
+154
hosts/darwin/default.nix
··· 1 + { self, pkgs, config, ... }: 2 + 3 + { 4 + imports = [ 5 + ./sketchybar 6 + ./yabai 7 + # ./casks 8 + # ../../modules/darwin/home-manager.nix 9 + # ../../modules/shared 10 + # ../../modules/shared/cachix 11 + ]; 12 + 13 + environment.systemPackages = [ 14 + pkgs.go 15 + pkgs.python3 16 + pkgs.cargo 17 + pkgs.k9s 18 + pkgs.kubernetes-helm 19 + pkgs.shellcheck 20 + ]; 21 + 22 + age.identityPaths = [ "/Users/anishlakhwara/.ssh/id_ed25519" ]; 23 + age.secrets.work-wg.file = "${self}/secrets/work-wg.age"; 24 + age.secrets.work-wg.owner = "anishlakhwara"; 25 + networking.wg-quick.interfaces = { 26 + wg0 = { 27 + address = [ "10.0.69.7/24" ]; 28 + listenPort = 60990; # to match firewall allowedUDPPorts (without this wg uses random port numbers) 29 + privateKeyFile = config.age.secrets.work-wg.path; 30 + dns = [ "10.0.69.4" ]; 31 + postDown = '' 32 + sudo /usr/sbin/networksetup -setdnsservers Wi-Fi "Empty" 33 + ''; 34 + peers = [ 35 + # For a client configuration, one peer entry for the server will suffice. 36 + { 37 + publicKey = "c1J4p63rD3IlszugMZiki7UBV3YmDdqa3DU4UejXzAI="; 38 + allowedIPs = [ "10.0.69.0/24" ]; 39 + # Set this to the server IP and port. 40 + endpoint = "sealight.xyz:60990"; # ToDo: route to endpoint not automatically configured https://wiki.archlinux.org/index.php/WireGuard#Loop_routing https://discourse.nixos.org/t/solved-minimal-firewall-setup-for-wireguard-client/7577 41 + persistentKeepalive = 25; 42 + } 43 + ]; 44 + }; 45 + }; 46 + 47 + # Auto upgrade nix package and the daemon service. 48 + services.nix-daemon.enable = true; 49 + nixpkgs.hostPlatform = "aarch64-darwin"; 50 + programs.zsh.enable = true; 51 + 52 + # Setup user, packages, programs 53 + nix = { 54 + # package = pkgs.nixUnstable; 55 + settings.trusted-users = [ "@admin" "anishlakhwara" ]; 56 + 57 + gc = { 58 + user = "root"; 59 + automatic = true; 60 + interval = { Weekday = 0; Hour = 2; Minute = 0; }; 61 + options = "--delete-older-than 30d"; 62 + }; 63 + 64 + # Turn this on to make command line easier 65 + extraOptions = '' 66 + experimental-features = nix-command flakes 67 + ''; 68 + }; 69 + 70 + # Turn off NIX_PATH warnings now that we're using flakes 71 + system.checks.verifyNixPath = false; 72 + 73 + # Load configuration that is shared across systems 74 + # environment.systemPackages = with pkgs; [ 75 + # 76 + # ] ++ (import ../../modules/shared/packages.nix { inherit pkgs; }); 77 + 78 + # Enable fonts dir 79 + # fonts.fontDir.enable = true; 80 + fonts.packages = with pkgs; [ 81 + fira-code 82 + fira-code-symbols 83 + hermit 84 + #hack 85 + siji 86 + font-awesome 87 + proggyfonts 88 + (nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "Iosevka" ]; }) 89 + ]; 90 + 91 + system = { 92 + stateVersion = 4; 93 + 94 + keyboard = { 95 + enableKeyMapping = true; 96 + }; 97 + 98 + defaults = { 99 + LaunchServices = { 100 + LSQuarantine = false; 101 + }; 102 + 103 + NSGlobalDomain = { 104 + AppleShowAllExtensions = true; 105 + ApplePressAndHoldEnabled = false; 106 + 107 + # 120, 90, 60, 30, 12, 6, 2 108 + KeyRepeat = 2; 109 + 110 + # 120, 94, 68, 35, 25, 15 111 + InitialKeyRepeat = 15; 112 + 113 + "com.apple.mouse.tapBehavior" = 1; 114 + "com.apple.sound.beep.volume" = 0.0; 115 + "com.apple.sound.beep.feedback" = 0; 116 + }; 117 + 118 + loginwindow = { 119 + # disable guest account 120 + GuestEnabled = false; 121 + # show name instead of username 122 + SHOWFULLNAME = false; 123 + }; 124 + 125 + dock = { 126 + autohide = true; 127 + autohide-delay = 0.0; 128 + autohide-time-modifier = 1.0; 129 + static-only = false; 130 + showhidden = false; 131 + show-recents = false; 132 + launchanim = true; 133 + mouse-over-hilite-stack = true; 134 + orientation = "bottom"; 135 + tilesize = 48; 136 + mru-spaces = false; 137 + }; 138 + 139 + finder = { 140 + _FXShowPosixPathInTitle = false; 141 + }; 142 + 143 + trackpad = { 144 + Clicking = false; 145 + TrackpadThreeFingerDrag = true; 146 + }; 147 + }; 148 + 149 + # keyboard = { 150 + # enableKeyMapping = true; 151 + # remapCapsLockToControl = true; 152 + # }; 153 + }; 154 + }
+10
hosts/darwin/sketchybar/default.nix
··· 1 + { pkgs, ... }: 2 + 3 + { 4 + services.sketchybar = { 5 + enable = true; 6 + config = (builtins.readFile ./sketchybarrc); 7 + extraPackages = [ pkgs.jq ]; 8 + }; 9 + 10 + }
+59
hosts/darwin/sketchybar/sketchybarrc
··· 1 + #!/usr/bin/env bash 2 + 3 + source "$HOME/.config/sketchybar/variables.sh" # Loads all defined colors 4 + 5 + # General bar and defaults 6 + # parts I didn't want 7 + # y_offset=5 \ 8 + # margin=5 \ 9 + 10 + sketchybar --bar height=35 \ 11 + color="$BAR_COLOR" \ 12 + shadow="$SHADOW" \ 13 + position=top \ 14 + sticky=on \ 15 + padding_right=0 \ 16 + padding_left=3 \ 17 + corner_radius="$CORNER_RADIUS" \ 18 + blur_radius=20 \ 19 + notch_width=200 \ 20 + --default updates=when_shown \ 21 + icon.font="$FONT:Bold:13.5" \ 22 + icon.color="$ICON_COLOR" \ 23 + icon.padding_left="$PADDINGS" \ 24 + icon.padding_right="$PADDINGS" \ 25 + label.font="$FONT:Bold:13.0" \ 26 + label.color="$LABEL_COLOR" \ 27 + label.padding_left="$PADDINGS" \ 28 + label.padding_right="$PADDINGS" \ 29 + background.padding_right="$PADDINGS" \ 30 + background.padding_left="$PADDINGS" \ 31 + popup.background.border_width=1 \ 32 + popup.background.corner_radius=11 \ 33 + popup.background.border_color="$POPUP_BORDER_COLOR" \ 34 + popup.background.color="$POPUP_BACKGROUND_COLOR" \ 35 + popup.background.shadow.drawing="$SHADOW" 36 + 37 + # Left 38 + # source "$ITEM_DIR/apple.sh" 39 + source "$ITEM_DIR/spaces.sh" 40 + 41 + # Center (of notch) 42 + # source "$ITEM_DIR/spotify.sh" 43 + source "$ITEM_DIR/front_app.sh" 44 + 45 + # Right 46 + source "$ITEM_DIR/clock.sh" 47 + source "$ITEM_DIR/calendar.sh" 48 + source "$ITEM_DIR/battery.sh" 49 + source "$ITEM_DIR/volume.sh" 50 + source "$ITEM_DIR/cpu.sh" 51 + source "$ITEM_DIR/vpn.sh" 52 + 53 + #################### Finalizing Setup #################### 54 + 55 + # sketchybar --hotload true 56 + 57 + sketchybar --update 58 + 59 + echo "sketchybar configuration loaded.."
+102
hosts/darwin/yabai/default.nix
··· 1 + {pkgs, ... }: 2 + 3 + { 4 + services.yabai = { 5 + enable = true; 6 + config = { 7 + mouse_follows_focus = "off"; 8 + focus_follows_mouse = "off"; 9 + window_placement = "second_child"; 10 + window_topmost = "off"; 11 + window_opacity = "off"; 12 + window_opacity_duration = 0.0; 13 + window_shadow = "on"; 14 + window_border = "off"; 15 + window_border_placement = "inset"; 16 + window_border_width = 4; 17 + window_border_radius = -1.0; 18 + active_window_border_topmost = "off"; 19 + active_window_border_color = "0xff775759"; 20 + normal_window_border_color = "0xff505050"; 21 + insert_window_border_color = "0xffd75f5f"; 22 + active_window_opacity = 1.0; 23 + normal_window_opacity = 0.9; 24 + split_ratio = 0.73; 25 + auto_balance = "on"; 26 + mouse_modifier = "fn"; 27 + mouse_action1 = "move"; 28 + mouse_action2 = "resize"; 29 + layout = "bsp"; 30 + top_padding = 5; 31 + bottom_padding = 5; 32 + left_padding = 5; 33 + right_padding = 5; 34 + window_gap = 5; 35 + }; 36 + extraConfig = '' 37 + # Do not manage windows with certain titles eg. Copying files or moving to bin 38 + yabai -m rule --add title="(Copy|Bin|About This Mac|Info)" manage=off 39 + # Do not manage some apps which are not resizable 40 + yabai -m rule --add app="^(Calculator|System Preferences|[sS]tats|[Jj]et[Bb]rains [Tt]ool[Bb]ox|kftray)$" manage=off 41 + ''; 42 + }; 43 + 44 + system.activationScripts.yabai = { 45 + enable = true; 46 + text = '' 47 + yabai --install-service && yabai --start-service 48 + ''; 49 + }; 50 + 51 + services.skhd = { 52 + enable = true; 53 + skhdConfig = '' 54 + # Open iTerm2 55 + cmd - enter : kitty --single-instance -d ~ 56 + 57 + ################## 58 + # Window Motions # 59 + ################## 60 + # Rotate 61 + lalt - r : yabai -m space --rotate 90 62 + # Mirror verticaly 63 + lalt - x : yabai -m space --mirror y-axis 64 + # Mirror horizontaly 65 + lalt - y : yabai -m space --mirror x-axis 66 + # yes, i know i swapped x and y, but I mainly use y-axis and y is further... 67 + # Fullscreen 68 + cmd - f : yabai -m window --toggle zoom-fullscreen 69 + # Swap 70 + lalt - q : yabai -m window --swap west 71 + lalt - s : yabai -m window --swap south 72 + lalt - z : yabai -m window --swap north 73 + lalt - d : yabai -m window --swap east 74 + # Warp 75 + shift + lalt - q : yabai -m window --warp west 76 + shift + lalt - s : yabai -m window --warp south 77 + shift + lalt - z : yabai -m window --warp north 78 + shift + lalt - d : yabai -m window --warp east 79 + 80 + ######### 81 + # Focus # 82 + ######### 83 + # Clockwise 84 + # alt - tab : yabai -m window --focus "$(yabai -m query --windows --space | jq -re "[sort_by(.id, .frame) | .[] | select(.role == \"AXWindow\" and .subrole == \"AXStandardWindow\") | .id] | nth(index($(yabai -m query --windows --window | jq -re ".id")) - 1)")" 85 + # Counter-clockwise 86 + # shift - tab : yabai -m window --focus "$(yabai -m query --windows --space | jq -re "[sort_by(.id, .frame) | reverse | .[] | select(.role == \"AXWindow\" and .subrole == \"AXStandardWindow\") | .id] | nth(index($(yabai -m query --windows --window | jq -re ".id")) - 1)")" 87 + 88 + ########## 89 + # Spaces # 90 + ########## 91 + ctrl - left : yabai -m space --focus prev 92 + ctrl - right : yabai -m space --focus next 93 + ctrl + shift - right : yabai -m window --space next; yabai -m space --focus next 94 + ctrl + shift - left : yabai -m window --space prev; yabai -m space --focus prev 95 + cmd - 1 : yabai -m window --space 1; yabai -m space --focus 1 96 + cmd - 2 : yabai -m window --space 2; yabai -m space --focus 2 97 + cmd - 3 : yabai -m window --space 3; yabai -m space --focus 3 98 + cmd - 4 : yabai -m window --space 4; yabai -m space --focus 4 99 + cmd - 5 : yabai -m window --space 5; yabai -m space --focus 5 100 + ''; 101 + }; 102 + }
+120
hosts/deck/configuration.nix
··· 1 + # Edit this configuration file to define what should be installed on 2 + # your system. Help is available in the configuration.nix(5) man page 3 + # and in the NixOS manual (accessible by running ‘nixos-help’). 4 + 5 + { config, pkgs, ... }: 6 + 7 + { 8 + imports = 9 + [ # Include the results of the hardware scan. 10 + ./hardware-configuration.nix 11 + ]; 12 + 13 + # Bootloader. 14 + boot.loader.systemd-boot.enable = true; 15 + boot.loader.efi.canTouchEfiVariables = true; 16 + 17 + networking.hostName = "deck"; # Define your hostname. 18 + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. 19 + 20 + # Configure network proxy if necessary 21 + # networking.proxy.default = "http://user:password@proxy:port/"; 22 + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; 23 + 24 + # Enable networking 25 + networking.networkmanager.enable = true; 26 + 27 + # Set your time zone. 28 + # time.timeZone = "America/Los_Angeles"; 29 + 30 + # Select internationalisation properties. 31 + i18n.defaultLocale = "en_US.UTF-8"; 32 + 33 + # i18n.extraLocaleSettings = { 34 + # LC_ADDRESS = "en_US.UTF-8"; 35 + # LC_IDENTIFICATION = "en_US.UTF-8"; 36 + # LC_MEASUREMENT = "en_US.UTF-8"; 37 + # LC_MONETARY = "en_US.UTF-8"; 38 + # LC_NAME = "en_US.UTF-8"; 39 + # LC_NUMERIC = "en_US.UTF-8"; 40 + # LC_PAPER = "en_US.UTF-8"; 41 + # LC_TELEPHONE = "en_US.UTF-8"; 42 + # LC_TIME = "en_US.UTF-8"; 43 + # }; 44 + 45 + # Enable the X11 windowing system. 46 + # services.xserver.enable = true; 47 + 48 + # Enable the GNOME Desktop Environment. 49 + # services.xserver.displayManager.gdm.enable = true; 50 + # services.xserver.desktopManager.gnome.enable = true; 51 + 52 + # Configure keymap in X11 53 + # services.xserver.xkb = { 54 + # layout = "us"; 55 + # variant = ""; 56 + # }; 57 + 58 + 59 + # use the example session manager (no others are packaged yet so this is enabled by default, 60 + # no need to redefine it in your config for now) 61 + #media-session.enable = true; 62 + 63 + # Enable touchpad support (enabled default in most desktopManager). 64 + # services.xserver.libinput.enable = true; 65 + 66 + # Define a user account. Don't forget to set a password with ‘passwd’. 67 + # users.users.anish = { 68 + # isNormalUser = true; 69 + # extraGroups = [ "networkmanager" "wheel" ]; 70 + # packages = with pkgs; [ 71 + # # thunderbird 72 + # ]; 73 + # }; 74 + 75 + # Enable automatic login for the user. 76 + services.xserver.displayManager.autoLogin.enable = true; 77 + services.xserver.displayManager.autoLogin.user = "anish"; 78 + 79 + # Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229 80 + systemd.services."getty@tty1".enable = false; 81 + systemd.services."autovt@tty1".enable = false; 82 + 83 + # Install firefox. 84 + # programs.firefox.enable = true; 85 + 86 + # List packages installed in system profile. To search, run: 87 + # $ nix search wget 88 + environment.systemPackages = with pkgs; [ 89 + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. 90 + # wget 91 + ]; 92 + 93 + # Some programs need SUID wrappers, can be configured further or are 94 + # started in user sessions. 95 + # programs.mtr.enable = true; 96 + # programs.gnupg.agent = { 97 + # enable = true; 98 + # enableSSHSupport = true; 99 + # }; 100 + 101 + # List services that you want to enable: 102 + 103 + # Enable the OpenSSH daemon. 104 + # services.openssh.enable = true; 105 + 106 + # Open ports in the firewall. 107 + # networking.firewall.allowedTCPPorts = [ ... ]; 108 + # networking.firewall.allowedUDPPorts = [ ... ]; 109 + # Or disable the firewall altogether. 110 + # networking.firewall.enable = false; 111 + 112 + # This value determines the NixOS release from which the default 113 + # settings for stateful data, like file locations and database versions 114 + # on your system were taken. It‘s perfectly fine and recommended to leave 115 + # this value at the release version of the first install of this system. 116 + # Before changing this value read the documentation for this option 117 + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). 118 + system.stateVersion = "24.11"; # Did you read the comment? 119 + 120 + }
+51
hosts/deck/default.nix
··· 1 + { self, pkgs, config, ... }: 2 + { 3 + imports = [ 4 + ./configuration.nix 5 + ../users/anish 6 + ../profiles/core 7 + # ../profiles/bluetooth 8 + # ../profiles/music 9 + ../profiles/sync/cal 10 + ../profiles/wifi 11 + ../profiles/desktop 12 + ../profiles/mimetypes 13 + ../profiles/syncthing 14 + ../profiles/mossnet-hosts 15 + # ../profiles/fly-wg 16 + # ../profiles/mount-mossnet 17 + ]; 18 + 19 + # age.secrets.deck-wg.file = "${self}/secrets/deck-wg.age"; 20 + # age.secrets.deck-wg.owner = "deck"; 21 + # mossnet.wg = { 22 + # enable = true; 23 + # ips = [ "10.0.69.6/24" ]; 24 + # privateKeyFile = "/run/agenix/deck-wg"; 25 + # }; 26 + 27 + users.users.anish.extraGroups = [ "adbusers" "wheel" "plugdev" "libvertd" ]; 28 + # boot.plymouth = { 29 + # enable = true; 30 + # themePackages = [ pkgs.plymouth-themes ]; 31 + # theme = "motion"; 32 + # }; 33 + 34 + jovian.steam.enable = true; 35 + jovian.devices.steamdeck.enable = true; 36 + jovian.steam.user = "anish"; 37 + jovian.steam.autoStart = true; 38 + jovian.steam.desktopSession = "gnome"; 39 + # jovian.steam.desktopSession = "none+bspwm"; 40 + 41 + # Install XR drivers 42 + # environment.systemPackages = with pkgs; [ 43 + # xrlinuxdriver 44 + # breezy-gnome 45 + # ]; 46 + 47 + # services.udev.packages = with pkgs; [ 48 + # xrlinuxdriver 49 + # ]; 50 + 51 + }
+40
hosts/deck/hardware-configuration.nix
··· 1 + # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 + # and may be overwritten by future invocations. Please make changes 3 + # to /etc/nixos/configuration.nix instead. 4 + { config, lib, pkgs, modulesPath, ... }: 5 + 6 + { 7 + imports = 8 + [ (modulesPath + "/installer/scan/not-detected.nix") 9 + ]; 10 + 11 + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "sdhci_pci" ]; 12 + boot.initrd.kernelModules = [ ]; 13 + boot.kernelModules = [ "kvm-amd" ]; 14 + boot.extraModulePackages = [ ]; 15 + 16 + fileSystems."/" = 17 + { device = "/dev/disk/by-uuid/d432dae0-3512-4891-9582-56d7ecd8524c"; 18 + fsType = "ext4"; 19 + }; 20 + 21 + fileSystems."/boot" = 22 + { device = "/dev/disk/by-uuid/5B4C-7406"; 23 + fsType = "vfat"; 24 + options = [ "fmask=0077" "dmask=0077" ]; 25 + }; 26 + 27 + swapDevices = 28 + [ { device = "/dev/disk/by-uuid/f75a730e-c849-4edd-a17f-52492d4260dc"; } 29 + ]; 30 + 31 + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 32 + # (the default) this is the recommended approach. When using systemd-networkd it's 33 + # still possible to use this option, but it's recommended to use it in conjunction 34 + # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. 35 + networking.useDHCP = lib.mkDefault true; 36 + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; 37 + 38 + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 39 + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 40 + }
+12
modules/darwin/README.md
··· 1 + 2 + ## Layout 3 + ``` 4 + . 5 + ├── dock # MacOS dock configuration 6 + ├── casks.nix # List of homebrew casks 7 + ├── default.nix # Defines module, system-level config 8 + ├── files.nix # Non-Nix, static configuration files (now immutable!) 9 + ├── home-manager.nix # Defines user programs 10 + ├── packages.nix # List of packages to install for MacOS 11 + ├── secrets.nix # Age-encrypted secrets with agenix 12 + ```
+67
modules/darwin/dock/default.nix
··· 1 + { config, pkgs, lib, ... }: 2 + with lib; 3 + let 4 + cfg = config.local.dock; 5 + inherit (pkgs) stdenv dockutil; 6 + in 7 + { 8 + options = { 9 + local.dock.enable = mkOption { 10 + description = "Enable dock"; 11 + default = stdenv.isDarwin; 12 + example = false; 13 + }; 14 + 15 + local.dock.entries = mkOption 16 + { 17 + description = "Entries on the Dock"; 18 + type = with types; listOf (submodule { 19 + options = { 20 + path = lib.mkOption { type = str; }; 21 + section = lib.mkOption { 22 + type = str; 23 + default = "apps"; 24 + }; 25 + options = lib.mkOption { 26 + type = str; 27 + default = ""; 28 + }; 29 + }; 30 + }); 31 + readOnly = true; 32 + }; 33 + }; 34 + 35 + config = 36 + mkIf cfg.enable 37 + ( 38 + let 39 + normalize = path: if hasSuffix ".app" path then path + "/" else path; 40 + entryURI = path: "file://" + (builtins.replaceStrings 41 + [" " "!" "\"" "#" "$" "%" "&" "'" "(" ")"] 42 + ["%20" "%21" "%22" "%23" "%24" "%25" "%26" "%27" "%28" "%29"] 43 + (normalize path) 44 + ); 45 + wantURIs = concatMapStrings 46 + (entry: "${entryURI entry.path}\n") 47 + cfg.entries; 48 + createEntries = concatMapStrings 49 + (entry: "${dockutil}/bin/dockutil --no-restart --add '${entry.path}' --section ${entry.section} ${entry.options}\n") 50 + cfg.entries; 51 + in 52 + { 53 + system.activationScripts.postUserActivation.text = '' 54 + echo >&2 "Setting up the Dock..." 55 + haveURIs="$(${dockutil}/bin/dockutil --list | ${pkgs.coreutils}/bin/cut -f2)" 56 + if ! diff -wu <(echo -n "$haveURIs") <(echo -n '${wantURIs}') >&2 ; then 57 + echo >&2 "Resetting Dock." 58 + ${dockutil}/bin/dockutil --no-restart --remove all 59 + ${createEntries} 60 + killall Dock 61 + else 62 + echo >&2 "Dock setup complete." 63 + fi 64 + ''; 65 + } 66 + ); 67 + }
+54
modules/darwin/files.nix
··· 1 + { user, config, pkgs, ... }: 2 + 3 + let 4 + xdg_configHome = "${config.users.users.${user}.home}/.config"; 5 + xdg_dataHome = "${config.users.users.${user}.home}/.local/share"; 6 + xdg_stateHome = "${config.users.users.${user}.home}/.local/state"; in 7 + { 8 + 9 + # Raycast script so that "Run Emacs" is available and uses Emacs daemon 10 + "${xdg_dataHome}/bin/emacsclient" = { 11 + executable = true; 12 + text = '' 13 + #!/bin/zsh 14 + # 15 + # Required parameters: 16 + # @raycast.schemaVersion 1 17 + # @raycast.title Run Emacs 18 + # @raycast.mode silent 19 + # 20 + # Optional parameters: 21 + # @raycast.packageName Emacs 22 + # @raycast.icon ${xdg_dataHome}/img/icons/Emacs.icns 23 + # @raycast.iconDark ${xdg_dataHome}/img/icons/Emacs.icns 24 + 25 + if [[ $1 = "-t" ]]; then 26 + # Terminal mode 27 + ${pkgs.emacs}/bin/emacsclient -t $@ 28 + else 29 + # GUI mode 30 + ${pkgs.emacs}/bin/emacsclient -c -n $@ 31 + fi 32 + ''; 33 + }; 34 + 35 + # Script to import Drafts into Emacs org-roam 36 + "${xdg_dataHome}/bin/import-drafts" = { 37 + executable = true; 38 + text = '' 39 + #!/bin/sh 40 + 41 + for f in ${xdg_stateHome}/drafts/* 42 + do 43 + if [[ ! "$f" =~ "done" ]]; then 44 + echo "Importing $f" 45 + filename="$(head -c 10 $f)" 46 + output="${xdg_dataHome}/org-roam/daily/$filename.org" 47 + echo '\n' >> "$output" 48 + tail -n +3 $f >> "$output" 49 + mv $f done 50 + fi 51 + done 52 + ''; 53 + }; 54 + }
+85
modules/darwin/home-manager.nix
··· 1 + { config, pkgs, lib, home-manager, ... }: 2 + 3 + let 4 + user = "anishlakhwara"; 5 + # Define the content of your file as a derivation 6 + myEmacsLauncher = pkgs.writeScript "emacs-launcher.command" '' 7 + #!/bin/sh 8 + emacsclient -c -n & 9 + ''; 10 + sharedFiles = import ../shared/files.nix { inherit config pkgs; }; 11 + additionalFiles = import ./files.nix { inherit user config pkgs; }; 12 + in 13 + { 14 + imports = [ 15 + ./dock 16 + ]; 17 + 18 + # It me 19 + users.users.${user} = { 20 + name = "${user}"; 21 + home = "/Users/${user}"; 22 + isHidden = false; 23 + shell = pkgs.zsh; 24 + }; 25 + 26 + # Enable home-manager 27 + home-manager = { 28 + useGlobalPkgs = true; 29 + users.${user} = { pkgs, config, lib, ... }:{ 30 + home = { 31 + enableNixpkgsReleaseCheck = false; 32 + packages = pkgs.callPackage ./packages.nix {}; 33 + file = lib.mkMerge [ 34 + sharedFiles 35 + additionalFiles 36 + { "emacs-launcher.command".source = myEmacsLauncher; } 37 + ]; 38 + 39 + stateVersion = "23.11"; 40 + }; 41 + 42 + programs = {} // import ../shared/home-manager.nix { inherit config pkgs lib; }; 43 + 44 + # Marked broken Oct 20, 2022 check later to remove this 45 + # https://github.com/nix-community/home-manager/issues/3344 46 + manual.manpages.enable = false; 47 + }; 48 + }; 49 + 50 + # Fully declarative dock using the latest from Nix Store 51 + local = { 52 + dock.enable = true; 53 + dock.entries = [ 54 + { path = "/Applications/Slack.app/"; } 55 + { path = "/System/Applications/Messages.app/"; } 56 + { path = "/System/Applications/Facetime.app/"; } 57 + { path = "/Applications/Telegram.app/"; } 58 + { path = "${pkgs.alacritty}/Applications/Alacritty.app/"; } 59 + { path = "/System/Applications/Music.app/"; } 60 + { path = "/System/Applications/News.app/"; } 61 + { path = "/System/Applications/Photos.app/"; } 62 + { path = "/System/Applications/Photo Booth.app/"; } 63 + { path = "/System/Applications/TV.app/"; } 64 + { path = "${pkgs.jetbrains.phpstorm}/Applications/PhpStorm.app/"; } 65 + { path = "/Applications/TablePlus.app/"; } 66 + { path = "/Applications/Asana.app/"; } 67 + { path = "/Applications/Drafts.app/"; } 68 + { path = "/System/Applications/Home.app/"; } 69 + { 70 + path = toString myEmacsLauncher; 71 + section = "others"; 72 + } 73 + { 74 + path = "${config.users.users.${user}.home}/.local/share/"; 75 + section = "others"; 76 + options = "--sort name --view grid --display folder"; 77 + } 78 + { 79 + path = "${config.users.users.${user}.home}/.local/share/downloads"; 80 + section = "others"; 81 + options = "--sort name --view grid --display stack"; 82 + } 83 + ]; 84 + }; 85 + }
+7
modules/darwin/packages.nix
··· 1 + { pkgs }: 2 + 3 + with pkgs; 4 + let shared-packages = import ../shared/packages.nix { inherit pkgs; }; in 5 + shared-packages ++ [ 6 + dockutil 7 + ]
+47
modules/darwin/secrets.nix
··· 1 + { config, pkgs, agenix, secrets, ... }: 2 + 3 + let user = "dustin"; in 4 + { 5 + age = { 6 + identityPaths = [ 7 + "/Users/${user}/.ssh/id_ed25519" 8 + ]; 9 + 10 + secrets = { 11 + "syncthing-cert" = { 12 + symlink = true; 13 + path = "/Users/${user}/Library/Application Support/Syncthing/cert.pem"; 14 + file = "${secrets}/darwin-syncthing-cert.age"; 15 + mode = "644"; 16 + owner = "${user}"; 17 + group = "staff"; 18 + }; 19 + 20 + "syncthing-key" = { 21 + symlink = true; 22 + path = "/Users/${user}/Library/Application Support/Syncthing/key.pem"; 23 + file = "${secrets}/darwin-syncthing-key.age"; 24 + mode = "600"; 25 + owner = "${user}"; 26 + group = "staff"; 27 + }; 28 + 29 + "github-ssh-key" = { 30 + symlink = true; 31 + path = "/Users/${user}/.ssh/id_github"; 32 + file = "${secrets}/github-ssh-key.age"; 33 + mode = "600"; 34 + owner = "${user}"; 35 + group = "staff"; 36 + }; 37 + 38 + "github-signing-key" = { 39 + symlink = false; 40 + path = "/Users/${user}/.ssh/pgp_github.key"; 41 + file = "${secrets}/github-signing-key.age"; 42 + mode = "600"; 43 + owner = "${user}"; 44 + }; 45 + }; 46 + }; 47 + }
+54
pkgs/breezy-gnome.nix
··· 1 + # Imported from https://github.com/wheaney/breezy-desktop/pull/113/files 2 + # Use flake or nixpkgs once upstreamed 3 + { 4 + self, 5 + lib, 6 + stdenv, 7 + glib, 8 + ... 9 + }: stdenv.mkDerivation { 10 + pname = "breezy-gnome"; 11 + version = "unstable"; 12 + 13 + src = lib.cleanSource "${self}/gnome/src/."; 14 + 15 + buildInputs = [ 16 + glib 17 + ]; 18 + 19 + passthru = { 20 + extensionUuid = "breezydesktop@xronlinux.com"; 21 + }; 22 + 23 + buildPhase = '' 24 + mkdir -p build/schemas 25 + glib-compile-schemas --targetdir="build/schemas" $src/schemas/ 26 + cp $src/*.js build/ 27 + cp $src/*.frag build/ 28 + mkdir -p build/schemas/ 29 + cp $src/schemas/*.xml build/schemas/ 30 + mkdir -p build/dbus-interfaces/ 31 + cp $src/dbus-interfaces/*.xml build/dbus-interfaces/ 32 + mkdir -p build/textures/ 33 + cp -rL $src/textures/* build/textures/ 34 + cp $src/metadata.json build/ 35 + ''; 36 + 37 + installPhase = '' 38 + extra_source=() 39 + for file in "$DEST_DIR"/*; do 40 + extra_source+=("--extra-source=$file") 41 + done 42 + gnome-extensions pack --force "$${extra_source[@]}" "build" -o "$out" 43 + ''; 44 + 45 + doInstallCheck = false; 46 + # The default release is a script which will do an impure download 47 + # just ensure that the application can run without network 48 + 49 + meta = with lib; { 50 + homepage = "https://github.com/wheaney/breezy-desktop"; 51 + maintainers = with maintainers; [shymega]; 52 + platforms = platforms.linux; 53 + }; 54 + }
+114
pkgs/xr-linux-driver.nix
··· 1 + # Imported from https://github.com/wheaney/XRLinuxDriver/pull/80/files 2 + # Use flake or nixpkgs once upstreamed 3 + { 4 + self, 5 + lib, 6 + pkgs, 7 + stdenv, 8 + fetchFromGitLab, 9 + libusb1, 10 + curl, 11 + openssl, 12 + libevdev, 13 + json_c, 14 + hidapi, 15 + wayland, 16 + cmake, 17 + pkg-config, 18 + python3, 19 + libffi, 20 + autoPatchelfHook, 21 + ... 22 + }: let 23 + pythonEnv = python3.withPackages (ps: [ps.pyyaml]); 24 + buildInputs = [ 25 + curl 26 + hidapi 27 + json_c 28 + libevdev 29 + libffi 30 + libusb1 31 + openssl 32 + stdenv.cc.cc.lib 33 + wayland 34 + ]; 35 + arch = 36 + if pkgs.system == "aarch64-linux" 37 + then "aarch64" 38 + else if pkgs.system == "x86_64-linux" 39 + then "x86_64" 40 + else throw "Unsupported system ${pkgs.system}"; 41 + in 42 + stdenv.mkDerivation rec { 43 + pname = "xrlinuxdriver"; 44 + version = "0.12.0.1"; 45 + 46 + srcs = [ 47 + (fetchFromGitLab rec { 48 + domain = "gitlab.com"; 49 + owner = "TheJackiMonster"; 50 + repo = "nrealAirLinuxDriver"; 51 + rev = "3225fcc575e19a8407d5019903567cff1c3ed1a8"; 52 + hash = "sha256-NRbcANt/CqREQZoYIYtTGVbvkZ7uo2Tm90s6prlsrQE="; 53 + fetchSubmodules = true; 54 + name = "${repo}-src"; 55 + }) 56 + (lib.cleanSourceWith { 57 + src = self; 58 + name = "${pname}-src"; 59 + }) 60 + ]; 61 + sourceRoot = "${(builtins.elemAt srcs 1).name}"; 62 + 63 + postUnpack = let 64 + nrealAirLinuxDriver = (builtins.elemAt srcs 0).name; 65 + in '' 66 + mkdir -p $sourceRoot/modules/xrealInterfaceLibrary 67 + cp -R ${nrealAirLinuxDriver}/* $sourceRoot/modules/xrealInterfaceLibrary 68 + chmod -R u+w $sourceRoot 69 + ''; 70 + 71 + nativeBuildInputs = [ 72 + cmake 73 + pkg-config 74 + pythonEnv 75 + autoPatchelfHook 76 + ]; 77 + inherit buildInputs; 78 + 79 + cmakeFlags = [ 80 + "-DCMAKE_SKIP_RPATH=ON" 81 + ]; 82 + cmakeBuildDir = "build"; 83 + cmakeBuildType = "RelWithDebInfo"; 84 + 85 + installPhase = '' 86 + mkdir -p $out/bin $out/lib/systemd/user $out/lib/udev/rules.d $out/lib/${arch} 87 + cp xrDriver ../bin/xr_driver_cli ../bin/xr_driver_verify $out/bin 88 + cp ../udev/* $out/lib/udev/rules.d/ 89 + cp ../lib/${arch}/* $out/lib/${arch}/ 90 + cp ../systemd/xr-driver.service $out/lib/systemd/user/xr-driver.service 91 + cp ${hidapi}/lib/libhidapi-hidraw.so.0 $out/lib/ 92 + substituteInPlace \ 93 + $out/lib/systemd/user/xr-driver.service \ 94 + --replace-fail "ExecStart={bin_dir}/xrDriver" "ExecStart=$out/bin/xrDriver" \ 95 + --replace-fail "{ld_library_path}" "$out/lib/${arch}" 96 + ''; 97 + 98 + preBuild = '' 99 + addAutoPatchelfSearchPath $out/usr/lib/${arch} 100 + ''; 101 + 102 + doInstallCheck = false; 103 + # The default release is a script which will do an impure download 104 + # just ensure that the application can run without network 105 + 106 + meta = with lib; { 107 + homepage = "https://github.com/wheaney/XRLinuxDriver"; 108 + license = licenses.mit; 109 + description = "Linux service for interacting with XR devices."; 110 + mainProgram = "xrDriver"; 111 + maintainers = with maintainers; [shymega]; 112 + platforms = platforms.linux; 113 + }; 114 + }