Compare commits
654 commits
2bf5ae32cf
...
5487f3f5c8
| Author | SHA1 | Date | |
|---|---|---|---|
| 5487f3f5c8 | |||
| b582aff866 | |||
| 1151b2e5ef | |||
| f4b7914894 | |||
| c5c1e159e8 | |||
| a85c73f14f | |||
| bdef8577bd | |||
| 135349c882 | |||
| b965ee15e5 | |||
| 622f9c61e4 | |||
| 224e8f8548 | |||
| 20aebccb92 | |||
| 54e3699c25 | |||
| 89934f5043 | |||
| e5b82f0902 | |||
| fc63759c1a | |||
| 4ea0f8bc51 | |||
| abc67487a3 | |||
| 56dcf94ba0 | |||
| 22fe2778cb | |||
| 62b059ba0e | |||
| b587323095 | |||
| e81af8b3bc | |||
| 70fca2d19b | |||
| 55a40a80b7 | |||
| e03e3d674b | |||
| 473c002c6e | |||
| 11c53b4b1e | |||
| 609cd32001 | |||
| b2be415b15 | |||
| 81df59c95f | |||
| db3950eb3a | |||
| 46bc5cb392 | |||
| 1fa47793e8 | |||
| d4c4349cdb | |||
| 522cc99c03 | |||
| 9616c5cce7 | |||
| c54bbbfbec | |||
| d67c53a278 | |||
| ae64603d54 | |||
| 256c857ac0 | |||
| c987206bc5 | |||
| 799890ca37 | |||
| 7df77a7e0c | |||
| b3662bfe5e | |||
| caf05fbdd8 | |||
| e073cc900c | |||
| 80c2c415fb | |||
| dd7cb5f081 | |||
| 958cd30b33 | |||
| 6530af39d8 | |||
| b9361dada4 | |||
| d118351849 | |||
| 19aabcf6f5 | |||
| 7010ba25f4 | |||
| 5c6d0cd032 | |||
| c936d2e043 | |||
| b322f09147 | |||
| b53bcc5307 | |||
| cb068a42e9 | |||
| 9b0cc37502 | |||
| 7ecaa23f0b | |||
| 2223659681 | |||
| e568b85781 | |||
| e551c44748 | |||
| 53ad71fb7c | |||
| 77e53c1643 | |||
| 2690dbf352 | |||
| e32ce32860 | |||
| 0af000e52e | |||
| 0fd5fb86b1 | |||
| b8406735ba | |||
| 30c676e20b | |||
| ed24bebc04 | |||
| 23c4256769 | |||
| 4e9764920a | |||
| 3fc0201dfa | |||
| d5527912a3 | |||
| 44b2034135 | |||
| 6f7f49dc13 | |||
| d39c0419b7 | |||
| e4622dd6ea | |||
| 52e0a2fd0f | |||
| d5e50b5389 | |||
| fdf1f1617f | |||
| be3391285a | |||
| 435e56d53a | |||
| df92d1c562 | |||
| 8d1535e261 | |||
| 2df0940665 | |||
| 3e0a5ef1a4 | |||
| 52722fb408 | |||
| 93a3a4fb6b | |||
| 1834a7002b | |||
| bcbc9af372 | |||
| 1be9eb517b | |||
| 16fc677509 | |||
| bf7184c260 | |||
| 4627350311 | |||
| 9ef35f06df | |||
| 5b7fa7c09a | |||
| a49e66da80 | |||
| 35d96e1e69 | |||
| 05e7883dab | |||
| 273618ff94 | |||
| 25967e21f1 | |||
| 3df2ad0f1f | |||
| 57e5def998 | |||
| c5d9396a7d | |||
| 5263942970 | |||
| cd20914370 | |||
| 04761da664 | |||
| 14d9837b07 | |||
| adedb42a99 | |||
| 38c140ee86 | |||
| d36f01d937 | |||
| 62f93a852a | |||
| 080d08bb13 | |||
| 6da1c47472 | |||
| 9c023b78a3 | |||
| 3d6580f52b | |||
| f34f2fc706 | |||
| 95df872916 | |||
| 3e86aa5ef4 | |||
| f2f2b2a98a | |||
| 842489a986 | |||
| 4cecb8b987 | |||
| bc56292544 | |||
| c259fe87a0 | |||
| 508b30eadd | |||
| 605da54f24 | |||
| 213d698d56 | |||
| c5fff38942 | |||
| e3b0f9d38f | |||
| af56bc76cf | |||
| 7a9760b0cd | |||
| e8ffddedef | |||
| 44dae3a940 | |||
| b79cee6eee | |||
| 56156e1fe4 | |||
| f551c4fc30 | |||
| f854c49c29 | |||
| ae7c2d921b | |||
| a96fb22d4d | |||
| bd5a15ebe7 | |||
| d26b9f2537 | |||
| b7b3387df7 | |||
| be84a4a6fa | |||
| bbc47b6683 | |||
| 416a4ca0d6 | |||
| 19889f4cbf | |||
| fa836d7df9 | |||
| 8b985cda84 | |||
| 0478efa817 | |||
| 87f255d265 | |||
| b9e5273672 | |||
| dd3bfc74fa | |||
| 5dd9d1c6d0 | |||
| d87fd7b9e1 | |||
| 01d7ead121 | |||
| e701dd06ea | |||
| faa8ae6d1e | |||
| 729f60c471 | |||
| d7a9783ceb | |||
| f54fbcf793 | |||
| 4b92a3fda9 | |||
| 5947ec4217 | |||
| bb512cf838 | |||
| 3aa859861e | |||
| 60b87c90fc | |||
| 5f06b43ad4 | |||
| 58470804d6 | |||
| 58bf5b6b1c | |||
| 367dc1e5a5 | |||
| d9a2c12d3f | |||
| f73f59b06c | |||
| cb389b71b1 | |||
| 4382904060 | |||
| 5ce5057d0f | |||
| d2e410de56 | |||
| 1819c7077d | |||
| 44ed078606 | |||
| 305b0b985c | |||
| 27448ac60a | |||
| f73edd9f8d | |||
| e57ebf4317 | |||
| e8adbb5b20 | |||
| 6d1d0c9488 | |||
| 61cd9cb1a2 | |||
| d6acc175de | |||
| 9dd3dceb83 | |||
| 633a422532 | |||
| b082057170 | |||
| 50c927fea3 | |||
| 42cb742976 | |||
| 5558642d32 | |||
| a66441d496 | |||
| 702bfafe73 | |||
| f4b860d915 | |||
| b565518e2d | |||
| 15a093ff61 | |||
| 06e7134ae0 | |||
| d2db3e52c2 | |||
| 9c009b40eb | |||
| dc8d4c2802 | |||
| afc78bac2a | |||
| 3a313812b8 | |||
| 876dacab85 | |||
| d71a99083c | |||
| 5f3d9b3a22 | |||
| 0becdd4b99 | |||
| 555c474b88 | |||
| 0bf893c8a0 | |||
| 925b872305 | |||
| 2b5fedadd2 | |||
| c7c38865e9 | |||
| 5150bad300 | |||
| 6f643052e1 | |||
| 119504d0b5 | |||
| 2d7f01f035 | |||
| 6ebfa1a8cc | |||
| 7d31aa93db | |||
| cef430ed39 | |||
| 4c5b556bb8 | |||
| 10d35f73c8 | |||
| 4491eaea49 | |||
| 5f47ec564c | |||
| 6633405e42 | |||
| 21f0199791 | |||
| 7c1f379d82 | |||
| e91ebb24f0 | |||
| a602cf4143 | |||
| e428895ba7 | |||
| e7ff83b1bb | |||
| 79265008d2 | |||
| 74a5c50fbe | |||
| 680eeffd3a | |||
| 9b4a92895f | |||
| 2af0fe542f | |||
| fe455ffe9f | |||
| f6381b14b0 | |||
| 7dc177cf44 | |||
| da4acebdde | |||
| 3f7fb26b8f | |||
| ddeeb974a4 | |||
| ea6c3727be | |||
| 40ec169d6e | |||
| a94f349dde | |||
| b83f28f2ba | |||
| 148d6609ec | |||
| 14e4e681aa | |||
| 3058636c87 | |||
| 6bec62073b | |||
| 5241bce29b | |||
| 4f11cf3a9a | |||
| 927dd9e02a | |||
| 9582f8403e | |||
| df1bc0d0d5 | |||
| 760e24a356 | |||
| c280f0cae8 | |||
| cbf6ea9ac9 | |||
| 8edef9d528 | |||
| 708d60bcc6 | |||
| 5e438f9e77 | |||
| 9e33f4ca82 | |||
| c55708ab54 | |||
| 6c25380d5d | |||
| 537fa5c909 | |||
| 8a8256e555 | |||
| 9117df1e72 | |||
| 296833651a | |||
| 158d39bb6e | |||
| b1cff1b8a3 | |||
| e475855e18 | |||
| ef07c9ff43 | |||
| 111ee136c8 | |||
| 8d8904ccef | |||
| 97fa58c220 | |||
| ce5a8a20b9 | |||
| b298607ea7 | |||
| d918bf279d | |||
| 6f3bee895c | |||
| 069987f47e | |||
| 971b6e9b65 | |||
| 8c103a2261 | |||
| 76f33fbd57 | |||
| 7d787a2770 | |||
| 323e99bbb0 | |||
| 8569a8eb55 | |||
| 6d393fdef2 | |||
| a85922b3b3 | |||
| d1cd5bfa32 | |||
| d64a867afc | |||
| cc21d84808 | |||
| 84cdc30037 | |||
| 07cf0fa4da | |||
| 24de1890fc | |||
| 4055ef17f0 | |||
| 7ce69233c1 | |||
| 9f86615e77 | |||
| e805496588 | |||
| 3201445c08 | |||
| 30eaefc1d1 | |||
| 5f41bb1647 | |||
| fec4956063 | |||
| a62c0ad126 | |||
| 2cc13dddb5 | |||
| de92358bc0 | |||
| 167db81c6c | |||
| 738d1760c3 | |||
| e962d4c574 | |||
| 1c0d671fff | |||
| 3bf3980e45 | |||
| f6faa11ff7 | |||
| 67090494e2 | |||
| 0d44b3b9f2 | |||
| 37c20529c1 | |||
| 2449a96652 | |||
| 8a9337710f | |||
| 7b75ea43ad | |||
| fb6e2afe89 | |||
| 51067582e0 | |||
| 78ade4c605 | |||
| 5c2921e00d | |||
| 62a18cd3f6 | |||
| c6cc64e156 | |||
| 875a3d8587 | |||
| 409e0ef357 | |||
| b6af754199 | |||
| ca5e5a53cd | |||
| ba10af0644 | |||
| 0f2c20e51d | |||
| ca218730ff | |||
| ac5fd7f472 | |||
| db37cea907 | |||
| 1cf93825b2 | |||
| 8a2aad9b54 | |||
| 018394b61d | |||
| 1e3c633c72 | |||
| df302465c9 | |||
| 673ead7863 | |||
| 3d10461a6e | |||
| 75312c747b | |||
| 68be7743ad | |||
| 9d362655e2 | |||
| 604b99a7ac | |||
| 8467fda721 | |||
| bad9b8a06b | |||
| 2d26b36e31 | |||
| c93a9e5a98 | |||
| 3fa14ebe71 | |||
| bd1a2000fe | |||
| 4a0c10b897 | |||
| 9f3811ea3b | |||
| 5c95ba1113 | |||
| 37bb7fd625 | |||
| 45321072fc | |||
| ed456c999d | |||
| ad848ef89d | |||
| 680d0c9f37 | |||
| 9a06108603 | |||
| c8633abf6d | |||
| aceb4ef901 | |||
| 5937d43993 | |||
| add6326fdf | |||
| b0e4475586 | |||
| 5c1dd6500a | |||
| 60e977611c | |||
| 99462199bd | |||
| 4fe18ff4cd | |||
| 02ffbcf970 | |||
| 878c92b67e | |||
| 8596ce8638 | |||
| 808058d576 | |||
| 8ffad5d41b | |||
| 52706ab4c4 | |||
| 5ae7b593e4 | |||
| 87613a9163 | |||
| 47d19e5b3f | |||
| a78091c57c | |||
| 9aba0d3ce0 | |||
| 78064bb2a1 | |||
| 70af0ba99a | |||
| dc2a3610a6 | |||
| 894b571745 | |||
| 2049e7a2c5 | |||
| 7032ddef37 | |||
| 81e12969eb | |||
| b97eff2479 | |||
| 4f742b69f2 | |||
| 11fbbd62eb | |||
| d21087ddcd | |||
| 3919a87d9e | |||
| 3fd487bbd2 | |||
| 5916ae631d | |||
| 1a436fd962 | |||
| a48303e66d | |||
| 30fc01b5ae | |||
| 13684ecdc4 | |||
| fe720b2de3 | |||
| ec6b31f4a6 | |||
| 1335bbfe9d | |||
| 2cc1925346 | |||
| eb0c5d5895 | |||
| 8c298c26f9 | |||
| 55a04cfac3 | |||
| 1783c2838b | |||
| e215f7aa1d | |||
| afb683f1cf | |||
| c320387746 | |||
| bbb1231ad3 | |||
| 9f00d8a38e | |||
| 820b52314f | |||
| a3293277d9 | |||
| 2ecd417a68 | |||
| 4e8045716c | |||
| e060476f32 | |||
| 2458ddf59d | |||
| 8927b3182f | |||
| f2dfeeb35b | |||
| 971b610cd5 | |||
| 21f48b5f71 | |||
| a3edf2548b | |||
| ea7b064546 | |||
| ff8e64d601 | |||
| 791109c3c1 | |||
| 6eb3942270 | |||
| 2232062fd9 | |||
| d6e9f9786d | |||
| 5abe4e929e | |||
| 57717d70ef | |||
| 7a382368e8 | |||
| 0f17123d09 | |||
| c6d21493ef | |||
| 5cebb9b54b | |||
| 92c2748747 | |||
| 4cae294cf5 | |||
| 23c6093c36 | |||
| 3fdcfb5b5f | |||
| c9418cc4d3 | |||
| cd02cbff45 | |||
| daa69a54fa | |||
| 212dd299e2 | |||
| cff3811cad | |||
| 8f266245ee | |||
| b8be3d80a8 | |||
| b04c1b09ea | |||
| 3a471433ed | |||
| f8325cc9c7 | |||
| cd1173d2f6 | |||
| e319eaf09f | |||
| e6ba569b36 | |||
| ee21de5b94 | |||
| 6614b47546 | |||
| 06c53620f8 | |||
| d43045c6d6 | |||
| 6113ad154d | |||
| e8982b8bc9 | |||
| 7684489c9a | |||
| 1994ef2b1b | |||
| a434016252 | |||
| 1794eefd30 | |||
| 29437d3e3f | |||
| a827a34501 | |||
| 610b0f2f4b | |||
| 59cb038045 | |||
| 15db81eb3b | |||
| 24efa3edca | |||
| 2fe4f1faad | |||
| 4f1f687eea | |||
| b90be0acdf | |||
| ea4c699b81 | |||
| 8efe75295d | |||
| 2d9b11406a | |||
| 003c08cb09 | |||
| 6728b50d3a | |||
| 2eaf3bf2c7 | |||
| 0077ce1f94 | |||
| 14d9fc89f1 | |||
| f660bf94e9 | |||
| 3b9f01e780 | |||
| 60f1e693d1 | |||
| ce4b0b8c90 | |||
| d2704b17fe | |||
| 31f8ec6e98 | |||
| af67d04992 | |||
| f9bcf79430 | |||
| b0cc830467 | |||
| 9b054d10c7 | |||
| e81aaa8ebc | |||
| 737b5e797b | |||
| 6728b5b949 | |||
| 2999ba7c0b | |||
| 1ac9f0cc8c | |||
| 6074958292 | |||
| da21e7a6f2 | |||
| 395f15f181 | |||
| 059831b532 | |||
| 76d165343e | |||
| f66da6fee6 | |||
| ca1c7962ea | |||
| 796df5475e | |||
| 414606b58e | |||
| 931b67fdb2 | |||
| 8b4966fcbe | |||
| a508db48c9 | |||
| 406eeea9f6 | |||
| 9d3d86365c | |||
| 78d77890de | |||
| a33fbc6659 | |||
| b134aedff0 | |||
| d31e293cef | |||
| 182ec2a4db | |||
| 81647c5a02 | |||
| 8a8f7387f4 | |||
| f2b20c65a8 | |||
| cc37713839 | |||
| e80485018c | |||
| 15abb291ef | |||
| fb56631ef3 | |||
| 9113290161 | |||
| 943ea20b16 | |||
| 129fcdd42c | |||
| d086af7e00 | |||
| e4d8a4d4b2 | |||
| 1a5dd0b91c | |||
| 02c2a23ee5 | |||
| f6ace9d438 | |||
| 2a0b5b7802 | |||
| 2c596395b0 | |||
| 986701d1c8 | |||
| ee33ab11c6 | |||
| 7d0a772cce | |||
| 97ee498405 | |||
| e5fdfd6c44 | |||
| 76148d75b8 | |||
| 9e6bc604f3 | |||
| b4d3b06fbf | |||
| 8de23feee7 | |||
| 0fc3bf3096 | |||
| 7d48b0edab | |||
| d23ad8f5e1 | |||
| f3764ce20e | |||
| f9d849c5da | |||
| 59e833a55b | |||
| 03130ed9ee | |||
| ac4cf0c1a2 | |||
| fab93a5f2f | |||
| f04368a71e | |||
| 30ce91557d | |||
| d46f66842f | |||
| 737484dcfe | |||
| 125935ac0f | |||
| e786eaddde | |||
| e211ac7d73 | |||
| 3f50abcbe0 | |||
| 1c2193d698 | |||
| 12b3397a20 | |||
| ca620a4eb6 | |||
| 885b45d39c | |||
| 0c943d8430 | |||
| 79dfb3a979 | |||
| 00a5d1b076 | |||
| 5e193b3a42 | |||
| bf9de874ce | |||
| 5aaa497653 | |||
| 3887a86650 | |||
| f57fd32088 | |||
| 1c147613e4 | |||
| 15190d4b50 | |||
| 5f7d2c74bc | |||
| 53dd04a0b7 | |||
| 86ab6bf17a | |||
| 6008ac470c | |||
| 717c628ff1 | |||
| 749ef9f072 | |||
| a0c63f00f9 | |||
| d9734dd505 | |||
| 4225bdd103 | |||
| 3a07cffa14 | |||
| 06f9f423e9 | |||
| ad1d907c25 | |||
| ef0f4bdca5 | |||
| b4d002033a | |||
| 8837c7c33c | |||
| f4cc68a650 | |||
| 79525013b0 | |||
| 2b8d01f056 | |||
| b115d94cd6 | |||
| 1022601602 | |||
| 376e60d71e | |||
| a03db294fe | |||
| f2b9040175 | |||
| b1e8664e32 | |||
| b61aca7def | |||
| d388a379d4 | |||
| 3402b92784 | |||
| b55466b791 | |||
| 036d59ec11 | |||
| f89e1ba3e9 | |||
| 8788deac5e | |||
| 676cd03c9c | |||
| e329e7a59a | |||
| 98a8e068ea | |||
| f5fcd2a7a6 | |||
| 1b9b598662 | |||
| 05e0cd4e1f | |||
| 9973e0d32f | |||
| 8231e8feaa | |||
| 8dc89846b2 | |||
| 5a32160954 | |||
| 6612d0226a | |||
| 75e3d9bf70 | |||
| 9dbfb65c27 | |||
| f8d6447ac4 | |||
| 185781a4e2 | |||
| cdc29efafc | |||
| 9f6c614c9f | |||
| 54a20058fb | |||
| 6bad81a644 | |||
| 971ee359ce | |||
| c175964630 | |||
| 046391e26e | |||
| b32fec2c63 | |||
| 3ec448bf03 | |||
| c3c44bceb6 | |||
| e1240c188e | |||
| d5b3b95827 | |||
| c17b5f4004 | |||
| e06edc8f47 | |||
| 4d04dd9b9b | |||
| e6b810b5a1 | |||
| 595720dcd4 | |||
| e6fb00ce9a | |||
| d01b7963cd | |||
| 646768c3b7 | |||
| b254e0f7ac | |||
| fee045d82c | |||
| 76b17e924a | |||
| 9fe78a5a70 | |||
| 90ccf42779 | |||
| cdbe16e703 | |||
| 1da8177ea2 | |||
| fe9f468e06 | |||
| 45cb955433 | |||
| b6fb77fc34 | |||
| f57cfda767 | |||
| 5427f15a17 | |||
| 6acf9f4a19 | |||
| cd7c8e2172 | |||
| e0b0f44a9a | |||
| bd53470e46 | |||
| f634f1b2ed | |||
|
|
dc052386d1 |
302 changed files with 7415 additions and 1818 deletions
43
.drone.yml
43
.drone.yml
|
|
@ -1,24 +1,27 @@
|
|||
---
|
||||
kind: pipeline
|
||||
name: check config
|
||||
type: exec
|
||||
name: NixOS config check
|
||||
|
||||
steps:
|
||||
- name: format check
|
||||
image: nixos/nix
|
||||
commands:
|
||||
- nix-shell -p nixpkgs-fmt --run 'nixpkgs-fmt . --check'
|
||||
- name: nix flake check
|
||||
commands:
|
||||
- nix flake check
|
||||
|
||||
- name: notify
|
||||
image: plugins/matrix
|
||||
settings:
|
||||
homeserver:
|
||||
from_secret: matrix_homeserver
|
||||
roomid:
|
||||
from_secret: matrix_roomid
|
||||
username:
|
||||
from_secret: matrix_username
|
||||
password:
|
||||
from_secret: matrix_password
|
||||
trigger:
|
||||
status:
|
||||
- failure
|
||||
- success
|
||||
- name: notifiy
|
||||
commands:
|
||||
- nix run .#matrix-notifier
|
||||
environment:
|
||||
ADDRESS:
|
||||
from_secret: matrix_homeserver
|
||||
ROOM:
|
||||
from_secret: matrix_roomid
|
||||
USER:
|
||||
from_secret: matrix_username
|
||||
PASS:
|
||||
from_secret: matrix_password
|
||||
when:
|
||||
status:
|
||||
- failure
|
||||
- success
|
||||
...
|
||||
|
|
|
|||
1
.envrc
1
.envrc
|
|
@ -6,3 +6,4 @@ use_flake() {
|
|||
|
||||
ulimit -s unlimited # Bypass current bug in `nix` flakes evaluation
|
||||
use flake
|
||||
eval "$shellHooks"
|
||||
|
|
|
|||
4
.git-crypt/.gitattributes
vendored
4
.git-crypt/.gitattributes
vendored
|
|
@ -1,4 +0,0 @@
|
|||
# Do not edit this file. To specify the files to encrypt, create your own
|
||||
# .gitattributes file in the directory where your files are.
|
||||
* !filter !diff
|
||||
*.gpg binary
|
||||
Binary file not shown.
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/.pre-commit-config.yaml
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
repos:
|
||||
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
|
||||
rev: 'v2.3.0'
|
||||
hooks:
|
||||
- id: 'trailing-whitespace'
|
||||
- id: 'end-of-file-fixer'
|
||||
- id: 'check-yaml'
|
||||
- id: 'check-added-large-files'
|
||||
- repo: 'https://github.com/jumanjihouse/pre-commit-hooks'
|
||||
rev: '2.1.4'
|
||||
hooks:
|
||||
- id: 'forbid-binary'
|
||||
- repo: 'local'
|
||||
hooks:
|
||||
- id: 'nixpkgs-fmt'
|
||||
name: 'nixpkgs-fmt'
|
||||
description: 'Format nix code with nixpkgs-fmt'
|
||||
entry: 'nixpkgs-fmt'
|
||||
language: 'system'
|
||||
files: '\.nix$'
|
||||
always_run: true
|
||||
|
|
@ -17,7 +17,8 @@ Secondly, take care of a few manual steps:
|
|||
* Configure Gitea and Drone
|
||||
* Configure Lohr webhook and SSH key
|
||||
* Configure Jellyfin
|
||||
* Configure Jackett and NZBHydra2
|
||||
* Configure Prowlarr,Jackett and NZBHydra2
|
||||
* Configure Sonarr, Radarr, Bazarr
|
||||
* Configure Transmission's webui port
|
||||
* Configure Quassel user
|
||||
* Configure Flood account
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ get_ssh() {
|
|||
|
||||
get_doc "SysAdmin/SSH" "shared-key-public" "$HOME/.ssh/shared_rsa.pub" 644
|
||||
get_doc "SysAdmin/SSH" "shared-key-private" "$HOME/.ssh/shared_rsa" 600
|
||||
get_doc "SysAdmin/SSH" "agenix-public" "$HOME/.ssh/id_ed25519.pub" 644
|
||||
get_doc "SysAdmin/SSH" "agenix-private" "$HOME/.ssh/id_ed25519" 600
|
||||
}
|
||||
|
||||
get_pgp() {
|
||||
|
|
@ -78,7 +80,7 @@ get_pgp() {
|
|||
}
|
||||
|
||||
get_creds() {
|
||||
BW_SESSION="$(bw login --raw)"
|
||||
BW_SESSION="$(bw login --raw || bw unlock --raw)"
|
||||
export BW_SESSION
|
||||
|
||||
get_ssh
|
||||
|
|
|
|||
147
flake.lock
generated
147
flake.lock
generated
|
|
@ -1,12 +1,64 @@
|
|||
{
|
||||
"nodes": {
|
||||
"agenix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1662046976,
|
||||
"narHash": "sha256-BrTReGRhkVm/Kmmf4zQrL+oYWy0sds/BDBgXNX1CL3c=",
|
||||
"owner": "ryantm",
|
||||
"repo": "agenix",
|
||||
"rev": "9f136ecfa5bf954538aed3245e4408cf87c85097",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "ryantm",
|
||||
"ref": "main",
|
||||
"repo": "agenix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"devshell": {
|
||||
"locked": {
|
||||
"lastModified": 1642188268,
|
||||
"narHash": "sha256-DNz4xScpXIn7rSDohdayBpPR9H9OWCMDOgTYegX081k=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "696acc29668b644df1740b69e1601119bf6da83b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1641205782,
|
||||
"narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"futils": {
|
||||
"locked": {
|
||||
"lastModified": 1619345332,
|
||||
"narHash": "sha256-qHnQkEp1uklKTpx3MvKtY6xzgcqXDsz5nLilbbuL+3A=",
|
||||
"lastModified": 1659877975,
|
||||
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "2ebf2558e5bf978c7fb8ea927dfaed8fefab2e28",
|
||||
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -20,14 +72,17 @@
|
|||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"utils": [
|
||||
"futils"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1619558193,
|
||||
"narHash": "sha256-DljP5/9EX0eXEPhzCUFqFEHkkcFuXJBx1PTgcv0OgyM=",
|
||||
"lastModified": 1661824092,
|
||||
"narHash": "sha256-nSWLWytlXbeLrx5A+r5Pso7CvVrX5EgmIIXW/EXvPHQ=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "18ad12d52b8cebbb57013865eec2be5125de050a",
|
||||
"rev": "5bd66dc6cd967033489c69d486402b75d338eeb6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -37,13 +92,52 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"matrix-appservices": {
|
||||
"inputs": {
|
||||
"devshell": "devshell",
|
||||
"flake-compat": "flake-compat",
|
||||
"nixlib": "nixlib",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1662227278,
|
||||
"narHash": "sha256-n58O7wTmORHg+cwYrbKjnlKi3UQkDug9l0FY9RB6zIM=",
|
||||
"owner": "coffeetables",
|
||||
"repo": "nix-matrix-appservices",
|
||||
"rev": "41c1418781dbdfae5d1c15a29b7f1b8f67e5d69f",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"owner": "coffeetables",
|
||||
"ref": "main",
|
||||
"repo": "nix-matrix-appservices",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"nixlib": {
|
||||
"locked": {
|
||||
"lastModified": 1643502816,
|
||||
"narHash": "sha256-Wrbt6Gs+hjXD3HUICPBJHKnHEUqiyx8rzHCgvqC1Bok=",
|
||||
"owner": "divnix",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "ebed7ec5bcb5d01e298535989c6c321df18b631a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "divnix",
|
||||
"repo": "nixpkgs.lib",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1619464443,
|
||||
"narHash": "sha256-R7WAb8EnkIJxxaF6GTHUPytjonhB4Zm0iatyWoW169A=",
|
||||
"lastModified": 1662019588,
|
||||
"narHash": "sha256-oPEjHKGGVbBXqwwL+UjsveJzghWiWV0n9ogo1X6l4cw=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17",
|
||||
"rev": "2da64a81275b68fdad38af669afeda43d401e94b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -55,11 +149,11 @@
|
|||
},
|
||||
"nur": {
|
||||
"locked": {
|
||||
"lastModified": 1619628114,
|
||||
"narHash": "sha256-s3pQyvMfXVmbQOX224yOWQf6zi8406sShFF4u17LVQ0=",
|
||||
"lastModified": 1662103084,
|
||||
"narHash": "sha256-zE6ftit1nllgrXJ3hnt/h/Ev+JsjkJQLKAgO5M31R5s=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NUR",
|
||||
"rev": "0615e756dc14986c4968fa478c0bd080d621cb2b",
|
||||
"rev": "65fef905eaad9a585a3841103ed3f45608a50c56",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -69,12 +163,39 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pre-commit-hooks": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"futils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1660830093,
|
||||
"narHash": "sha256-HUhx3a82C7bgp2REdGFeHJdhEAzMGCk3V8xIvfBqg1I=",
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "8cb8ea5f1c7bc2984f460587fddd5f2e558f6eb8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"ref": "master",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"agenix": "agenix",
|
||||
"futils": "futils",
|
||||
"home-manager": "home-manager",
|
||||
"matrix-appservices": "matrix-appservices",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nur": "nur"
|
||||
"nur": "nur",
|
||||
"pre-commit-hooks": "pre-commit-hooks"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
136
flake.nix
136
flake.nix
|
|
@ -1,6 +1,16 @@
|
|||
{
|
||||
description = "NixOS configuration with flakes";
|
||||
inputs = {
|
||||
agenix = {
|
||||
type = "github";
|
||||
owner = "ryantm";
|
||||
repo = "agenix";
|
||||
ref = "main";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
futils = {
|
||||
type = "github";
|
||||
owner = "numtide";
|
||||
|
|
@ -15,6 +25,20 @@
|
|||
ref = "master";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
utils.follows = "futils";
|
||||
};
|
||||
};
|
||||
|
||||
matrix-appservices = {
|
||||
type = "gitlab";
|
||||
owner = "coffeetables";
|
||||
repo = "nix-matrix-appservices";
|
||||
ref = "main";
|
||||
inputs = {
|
||||
# devshell.follows = "devshell";
|
||||
# flake-compat.follows = "flake-compat";
|
||||
# nixlib.follows = "nixlib";
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -31,11 +55,40 @@
|
|||
repo = "NUR";
|
||||
ref = "master";
|
||||
};
|
||||
|
||||
pre-commit-hooks = {
|
||||
type = "github";
|
||||
owner = "cachix";
|
||||
repo = "pre-commit-hooks.nix";
|
||||
ref = "master";
|
||||
inputs = {
|
||||
flake-utils.follows = "futils";
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, futils, home-manager, nixpkgs, nur } @ inputs:
|
||||
outputs =
|
||||
inputs @
|
||||
{ self
|
||||
, agenix
|
||||
, futils
|
||||
, home-manager
|
||||
, matrix-appservices
|
||||
, nixpkgs
|
||||
, nur
|
||||
, pre-commit-hooks
|
||||
}:
|
||||
let
|
||||
inherit (futils.lib) eachDefaultSystem;
|
||||
inherit (futils.lib) eachSystem system;
|
||||
|
||||
mySystems = [
|
||||
system.aarch64-linux
|
||||
system.x86_64-darwin
|
||||
system.x86_64-linux
|
||||
];
|
||||
|
||||
eachMySystem = eachSystem mySystems;
|
||||
|
||||
lib = nixpkgs.lib.extend (self: super: {
|
||||
my = import ./lib { inherit inputs; pkgs = nixpkgs; lib = self; };
|
||||
|
|
@ -51,58 +104,83 @@
|
|||
nur.overlay
|
||||
];
|
||||
}
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.users.ambroisie = import ./home;
|
||||
# Nix Flakes compatibility
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
}
|
||||
# Include generic settings
|
||||
./modules
|
||||
# Include bundles of settings
|
||||
./profiles
|
||||
];
|
||||
|
||||
buildHost = name: system: lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = defaultModules ++ [
|
||||
(./. + "/${name}.nix")
|
||||
(./. + "/machines/${name}")
|
||||
];
|
||||
specialArgs = {
|
||||
# Use my extended lib in NixOS configuration
|
||||
inherit lib;
|
||||
# Inject inputs to use them in global registry
|
||||
inherit inputs;
|
||||
};
|
||||
};
|
||||
in
|
||||
eachDefaultSystem
|
||||
eachMySystem
|
||||
(system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
rec {
|
||||
apps = {
|
||||
diff-flake = futils.lib.mkApp { drv = packages.diff-flake; };
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
rec {
|
||||
apps = {
|
||||
diff-flake = futils.lib.mkApp { drv = packages.diff-flake; };
|
||||
default = apps.diff-flake;
|
||||
};
|
||||
|
||||
checks = {
|
||||
pre-commit = pre-commit-hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
|
||||
hooks = {
|
||||
nixpkgs-fmt = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
shellcheck = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
defaultApp = apps.diff-flake;
|
||||
|
||||
devShell = pkgs.mkShell {
|
||||
devShells = {
|
||||
default = pkgs.mkShell {
|
||||
name = "NixOS-config";
|
||||
buildInputs = with pkgs; [
|
||||
git-crypt
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
gitAndTools.pre-commit
|
||||
gnupg
|
||||
nixpkgs-fmt
|
||||
];
|
||||
|
||||
inherit (self.checks.${system}.pre-commit) shellHook;
|
||||
};
|
||||
};
|
||||
|
||||
packages = import ./pkgs { inherit pkgs; };
|
||||
}) // {
|
||||
overlay = self.overlays.pkgs;
|
||||
|
||||
overlays = {
|
||||
packages =
|
||||
let
|
||||
inherit (futils.lib) filterPackages flattenTree;
|
||||
packages = import ./pkgs { inherit pkgs; };
|
||||
flattenedPackages = flattenTree packages;
|
||||
finalPackages = filterPackages system flattenedPackages;
|
||||
in
|
||||
finalPackages;
|
||||
}) // {
|
||||
overlays = import ./overlays // {
|
||||
lib = final: prev: { inherit lib; };
|
||||
pkgs = final: prev: { ambroisie = import ./pkgs { pkgs = prev; }; };
|
||||
pkgs = final: prev: {
|
||||
ambroisie = prev.recurseIntoAttrs (import ./pkgs { pkgs = prev; });
|
||||
};
|
||||
};
|
||||
|
||||
nixosConfigurations = lib.mapAttrs buildHost {
|
||||
aramis = "x86_64-linux";
|
||||
porthos = "x86_64-linux";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ in
|
|||
config.programs.bat = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
config = {
|
||||
theme = "gruvbox-dark";
|
||||
|
||||
pager = with config.home.sessionVariables; "${PAGER} ${LESS}";
|
||||
};
|
||||
};
|
||||
19
home/bluetooth/default.nix
Normal file
19
home/bluetooth/default.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.bluetooth;
|
||||
in
|
||||
{
|
||||
options.my.home.bluetooth = with lib; {
|
||||
enable = mkEnableOption "bluetooth configuration";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.blueman-applet = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.mpris-proxy = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
29
home/comma/default.nix
Normal file
29
home/comma/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.home.comma;
|
||||
in
|
||||
{
|
||||
options.my.home.comma = with lib; {
|
||||
enable = my.mkDisableOption "comma configuration";
|
||||
|
||||
pkgsFlake = mkOption {
|
||||
type = types.str;
|
||||
default = "pkgs";
|
||||
example = "nixpkgs";
|
||||
description = ''
|
||||
Which flake from the registry should be used with
|
||||
<command>nix shell</command>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
ambroisie.comma
|
||||
];
|
||||
|
||||
home.sessionVariables = {
|
||||
COMMA_PKGS_FLAKE = cfg.pkgsFlake;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,20 +1,38 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./bat.nix
|
||||
./direnv.nix
|
||||
./documentation.nix
|
||||
./bat
|
||||
./bluetooth
|
||||
./comma
|
||||
./direnv
|
||||
./discord
|
||||
./documentation
|
||||
./feh
|
||||
./firefox
|
||||
./flameshot
|
||||
./gammastep
|
||||
./gdb
|
||||
./git
|
||||
./gpg.nix
|
||||
./htop.nix
|
||||
./jq.nix
|
||||
./packages.nix
|
||||
./pager.nix
|
||||
./secrets # Home-manager specific secrets
|
||||
./ssh.nix
|
||||
./tmux.nix
|
||||
./gpg
|
||||
./gtk
|
||||
./htop
|
||||
./jq
|
||||
./mail
|
||||
./mpv
|
||||
./nix-index
|
||||
./nm-applet
|
||||
./packages
|
||||
./pager
|
||||
./power-alert
|
||||
./ssh
|
||||
./terminal
|
||||
./tmux
|
||||
./udiskie
|
||||
./vim
|
||||
./xdg.nix
|
||||
./wm
|
||||
./x
|
||||
./xdg
|
||||
./zathura
|
||||
./zsh
|
||||
];
|
||||
|
||||
|
|
@ -23,4 +41,7 @@
|
|||
|
||||
# Who am I?
|
||||
home.username = "ambroisie";
|
||||
|
||||
# Start services automatically
|
||||
systemd.user.startServices = "sd-switch";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.direnv;
|
||||
in
|
||||
{
|
||||
options.my.home.direnv = with lib.my; {
|
||||
enable = mkDisableOption "direnv configuration";
|
||||
};
|
||||
|
||||
config.programs.direnv = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
# A better `use_nix`
|
||||
enableNixDirenvIntegration = true;
|
||||
};
|
||||
}
|
||||
46
home/direnv/default.nix
Normal file
46
home/direnv/default.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.direnv;
|
||||
in
|
||||
{
|
||||
options.my.home.direnv = with lib; {
|
||||
enable = my.mkDisableOption "direnv configuration";
|
||||
|
||||
defaultFlake = mkOption {
|
||||
type = types.str;
|
||||
default = "pkgs";
|
||||
example = "nixpkgs";
|
||||
description = ''
|
||||
Which flake from the registry should be used for
|
||||
<command>use pkgs</command> by default.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv = {
|
||||
# A better `use_nix`
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
xdg.configFile =
|
||||
let
|
||||
libDir = ./lib;
|
||||
contents = builtins.readDir libDir;
|
||||
names = lib.attrNames contents;
|
||||
files = lib.filter (name: contents.${name} == "regular") names;
|
||||
linkLibFile = name:
|
||||
lib.nameValuePair
|
||||
"direnv/lib/${name}"
|
||||
{ source = libDir + "/${name}"; };
|
||||
in
|
||||
lib.my.genAttrs' files linkLibFile;
|
||||
|
||||
home.sessionVariables = {
|
||||
DIRENV_DEFAULT_FLAKE = cfg.defaultFlake;
|
||||
};
|
||||
};
|
||||
}
|
||||
32
home/direnv/lib/nix.sh
Normal file
32
home/direnv/lib/nix.sh
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#shellcheck shell=bash
|
||||
|
||||
use_pkgs() {
|
||||
if ! has nix; then
|
||||
# shellcheck disable=2016
|
||||
log_error 'use_pkgs: `nix` is not in PATH'
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Use user-provided default value, or fallback to nixpkgs
|
||||
local DEFAULT_FLAKE="${DIRENV_DEFAULT_FLAKE:-nixpkgs}"
|
||||
|
||||
# Allow changing the default flake through a command line switch
|
||||
if [ "$1" = "-f" ] || [ "$1" = "--flake" ]; then
|
||||
DEFAULT_FLAKE="$2"
|
||||
shift 2
|
||||
fi
|
||||
|
||||
|
||||
# Allow specifying a full installable, or just a package name and use the default flake
|
||||
local packages=()
|
||||
for pkg; do
|
||||
if [[ $pkg =~ .*#.* ]]; then
|
||||
packages+=("$pkg")
|
||||
else
|
||||
packages+=("$DEFAULT_FLAKE#$pkg")
|
||||
fi
|
||||
done
|
||||
|
||||
# shellcheck disable=2154
|
||||
direnv_load nix shell "${packages[@]}" --command "$direnv" dump
|
||||
}
|
||||
22
home/direnv/lib/postgres.sh
Normal file
22
home/direnv/lib/postgres.sh
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#shellcheck shell=bash
|
||||
|
||||
layout_postgres() {
|
||||
if ! has postgres || ! has initdb; then
|
||||
# shellcheck disable=2016
|
||||
log_error 'layout_postgres: `postgres` and `initdb` are not in PATH'
|
||||
return 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=2155
|
||||
export PGDATA="$(direnv_layout_dir)/postgres"
|
||||
export PGHOST="$PGDATA"
|
||||
|
||||
if [[ ! -d "$PGDATA" ]]; then
|
||||
initdb
|
||||
cat >> "$PGDATA/postgresql.conf" << EOF
|
||||
listen_addresses = ''
|
||||
unix_socket_directories = '$PGHOST'
|
||||
EOF
|
||||
echo "CREATE DATABASE $USER;" | postgres --single -E postgres
|
||||
fi
|
||||
}
|
||||
25
home/direnv/lib/python.sh
Normal file
25
home/direnv/lib/python.sh
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#shellcheck shell=bash
|
||||
|
||||
layout_poetry() {
|
||||
if ! has poetry; then
|
||||
# shellcheck disable=2016
|
||||
log_error 'layout_poetry: `poetry` is not in PATH'
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ ! -f pyproject.toml ]]; then
|
||||
# shellcheck disable=2016
|
||||
log_error 'layout_poetry: no pyproject.toml found. Use `poetry new` or `poetry init` to create one first'
|
||||
return 1
|
||||
fi
|
||||
|
||||
# create venv if it doesn't exist
|
||||
poetry run true
|
||||
|
||||
# shellcheck disable=2155
|
||||
export VIRTUAL_ENV=$(poetry env info --path)
|
||||
export POETRY_ACTIVE=1
|
||||
PATH_add "$VIRTUAL_ENV/bin"
|
||||
watch_file pyproject.toml
|
||||
watch_file poetry.lock
|
||||
}
|
||||
23
home/discord/default.nix
Normal file
23
home/discord/default.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.home.discord;
|
||||
|
||||
jsonFormat = pkgs.formats.json { };
|
||||
in
|
||||
{
|
||||
options.my.home.discord = with lib; {
|
||||
enable = mkEnableOption "discord configuration";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
discord
|
||||
];
|
||||
|
||||
xdg.configFile."discord/settings.json".source =
|
||||
jsonFormat.generate "discord.json" {
|
||||
# Do not keep me from using the app just to force an update
|
||||
SKIP_HOST_UPDATE = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
13
home/feh/default.nix
Normal file
13
home/feh/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.feh;
|
||||
in
|
||||
{
|
||||
options.my.home.feh = with lib; {
|
||||
enable = mkEnableOption "feh configuration";
|
||||
};
|
||||
|
||||
config.programs.feh = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
84
home/firefox/default.nix
Normal file
84
home/firefox/default.nix
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.home.firefox;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./tridactyl
|
||||
];
|
||||
|
||||
options.my.home.firefox = with lib; {
|
||||
enable = mkEnableOption "firefox configuration";
|
||||
|
||||
tridactyl = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
description = "tridactyl configuration";
|
||||
example = false;
|
||||
default = config.my.home.firefox.enable;
|
||||
};
|
||||
};
|
||||
|
||||
ff2mpv = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
description = "ff2mpv configuration";
|
||||
example = false;
|
||||
default = config.my.home.mpv.enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config.programs.firefox = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
|
||||
package = pkgs.firefox.override {
|
||||
cfg = {
|
||||
enableTridactylNative = cfg.tridactyl.enable;
|
||||
};
|
||||
|
||||
extraNativeMessagingHosts = with pkgs; ([ ]
|
||||
# Watch videos using mpv
|
||||
++ lib.optional cfg.ff2mpv.enable ambroisie.ff2mpv-go
|
||||
);
|
||||
};
|
||||
|
||||
profiles = {
|
||||
default = {
|
||||
id = 0;
|
||||
|
||||
settings = {
|
||||
"browser.bookmarks.showMobileBookmarks" = true; # Mobile bookmarks
|
||||
"browser.download.useDownloadDir" = false; # Ask for download location
|
||||
"browser.in-content.dark-mode" = true; # Dark mode
|
||||
"browser.newtabpage.activity-stream.feeds.section.topstories" = false; # Disable top stories
|
||||
"browser.newtabpage.activity-stream.feeds.sections" = false;
|
||||
"browser.newtabpage.activity-stream.feeds.system.topstories" = false; # Disable top stories
|
||||
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false; # Disable pocket
|
||||
"extensions.pocket.enabled" = false; # Disable pocket
|
||||
"media.eme.enabled" = true; # Enable DRM
|
||||
"media.gmp-widevinecdm.visible" = true; # Enable DRM
|
||||
"media.gmp-widevinecdm.enabled" = true; # Enable DRM
|
||||
"signon.autofillForms" = false; # Disable built-in form-filling
|
||||
"signon.rememberSignons" = false; # Disable built-in password manager
|
||||
"ui.systemUsesDarkTheme" = true; # Dark mode
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extensions = with pkgs.nur.repos.rycee.firefox-addons; ([
|
||||
bitwarden
|
||||
consent-o-matic
|
||||
form-history-control
|
||||
https-everywhere
|
||||
reddit-comment-collapser
|
||||
reddit-enhancement-suite
|
||||
refined-github
|
||||
sponsorblock
|
||||
ublock-origin
|
||||
]
|
||||
++ lib.optional (cfg.tridactyl.enable) tridactyl
|
||||
++ lib.optional (cfg.ff2mpv.enable) ff2mpv
|
||||
);
|
||||
};
|
||||
}
|
||||
9
home/firefox/tridactyl/default.nix
Normal file
9
home/firefox/tridactyl/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.firefox.tridactyl;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
xdg.configFile."tridactyl/tridactylrc".source = ./tridactylrc;
|
||||
};
|
||||
}
|
||||
78
home/firefox/tridactyl/tridactylrc
Normal file
78
home/firefox/tridactyl/tridactylrc
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
" Shamelessly taken from bovine3dom's example configuration file from the docs
|
||||
|
||||
" Basics {{{
|
||||
" Use dark color scheme
|
||||
colorscheme dark
|
||||
|
||||
" Make tridactyl open Vim in my prefered terminal
|
||||
" FIXME: make it follow my prefered terminal
|
||||
set editorcmd termite --class tridactyl_editor -e 'vim %f'
|
||||
" }}}
|
||||
|
||||
" Binds {{{
|
||||
" Reddit et al. {{{
|
||||
" Toggle comments on Reddit, Hacker News, Lobste.rs
|
||||
bind ;c hint -Jc [class*="expand"],[class*="togg"],[class="comment_folder"]
|
||||
|
||||
" Make `gu` take me back to subreddit from comments
|
||||
bindurl reddit.com gu urlparent 3
|
||||
|
||||
" Only hint search results on Google
|
||||
bindurl www.google.com f hint -Jc #search div:not(.action-menu) > a
|
||||
bindurl www.google.com F hint -Jbc #search div:not(.action-menu) > a
|
||||
|
||||
" Only hint search results on DuckDuckGo
|
||||
bindurl ^https://duckduckgo.com f hint -Jc [class~=result__a]
|
||||
bindurl ^https://duckduckgo.com F hint -Jbc [class~=result__a]
|
||||
|
||||
" Only hint item pages on Hacker News
|
||||
bindurl news.ycombinator.com ;f hint -Jc .age > a
|
||||
bindurl news.ycombinator.com ;F hint -Jtc .age > a
|
||||
" }}}
|
||||
|
||||
" Better bindings {{{
|
||||
" Handy multiwindow binds
|
||||
bind gd tabdetach
|
||||
bind gD composite tabduplicate; tabdetach
|
||||
|
||||
" Duplicate a tab without detaching window
|
||||
bind <Space>d tabduplicate
|
||||
|
||||
" Make yy use canonical links on the few websites that support them
|
||||
bind yy clipboard yankcanon
|
||||
" }}}
|
||||
|
||||
" Search {{{
|
||||
" Case insensitive only if fully lowercase
|
||||
set findcase smart
|
||||
|
||||
" Search forward/backward
|
||||
bind / fillcmdline find
|
||||
bind ? fillcmdline find -?
|
||||
|
||||
" Go to next/previous match
|
||||
bind n findnext 1
|
||||
bind N findnext -1
|
||||
|
||||
" Because :nohls never works
|
||||
bind <Space><Space> nohlsearch
|
||||
|
||||
" Use browser's native find when using Ctrl-F
|
||||
unbind <C-f>
|
||||
" }}}
|
||||
" }}}
|
||||
|
||||
" Redirections {{{
|
||||
" Always redirect Reddit to the old site
|
||||
autocmd DocStart ^http(s?)://www.reddit.com js tri.excmds.urlmodify("-t", "www", "old")
|
||||
" Use a better Twitter front-end
|
||||
autocmd DocStart ^http(s?)://twitter.com js tri.excmds.urlmodify("-t", "twitter.com", "nitter.net")
|
||||
" }}}
|
||||
|
||||
" Disabled websites {{{
|
||||
blacklistadd netflix.com
|
||||
blacklistadd primevideo.com
|
||||
blacklistadd jellyfin.belanyi.fr
|
||||
" }}}
|
||||
|
||||
" vim: set filetype=vim foldmethod=marker:
|
||||
13
home/flameshot/default.nix
Normal file
13
home/flameshot/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.flameshot;
|
||||
in
|
||||
{
|
||||
options.my.home.flameshot = with lib; {
|
||||
enable = mkEnableOption "flameshot configuration";
|
||||
};
|
||||
|
||||
config.services.flameshot = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
44
home/gammastep/default.nix
Normal file
44
home/gammastep/default.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.gammastep;
|
||||
|
||||
mkTempOption = with lib; description: default: mkOption {
|
||||
inherit description default;
|
||||
type = types.int;
|
||||
example = 1000;
|
||||
};
|
||||
|
||||
mkTimeOption = with lib; description: default: mkOption {
|
||||
inherit description default;
|
||||
type = types.str;
|
||||
example = "12:00-14:00";
|
||||
};
|
||||
in
|
||||
{
|
||||
options.my.home.gammastep = with lib; {
|
||||
enable = mkEnableOption "gammastep configuration";
|
||||
|
||||
temperature = {
|
||||
day = mkTempOption "Colour temperature to use during the day" 6500;
|
||||
night = mkTempOption "Colour temperature to use during the night" 2000;
|
||||
};
|
||||
|
||||
times = {
|
||||
dawn = mkTimeOption "Dawn time" "6:00-7:30";
|
||||
dusk = mkTimeOption "Dusk time" "18:30-20:00";
|
||||
};
|
||||
};
|
||||
|
||||
config.services.gammastep = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
|
||||
tray = true;
|
||||
|
||||
dawnTime = cfg.times.dawn;
|
||||
duskTime = cfg.times.dusk;
|
||||
|
||||
temperature = {
|
||||
inherit (cfg.temperature) day night;
|
||||
};
|
||||
};
|
||||
}
|
||||
38
home/gdb/default.nix
Normal file
38
home/gdb/default.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.home.gdb;
|
||||
in
|
||||
{
|
||||
options.my.home.gdb = with lib; {
|
||||
enable = my.mkDisableOption "gdb configuration";
|
||||
|
||||
rr = {
|
||||
enable = my.mkDisableOption "rr configuration";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.rr;
|
||||
defaultText = literalExample "pkgs.rr";
|
||||
description = ''
|
||||
Package providing rr
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
gdb
|
||||
];
|
||||
|
||||
xdg.configFile."gdb/gdbinit".source = ./gdbinit;
|
||||
})
|
||||
|
||||
(lib.mkIf cfg.rr.enable {
|
||||
home.packages = [
|
||||
cfg.rr.package
|
||||
];
|
||||
})
|
||||
];
|
||||
}
|
||||
24
home/gdb/gdbinit
Normal file
24
home/gdb/gdbinit
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Keep a history of all commands in each directory
|
||||
set history save on
|
||||
|
||||
# Enable those pretty-printers
|
||||
enable pretty-printer
|
||||
|
||||
# Pretty formatting of structures
|
||||
set print pretty on
|
||||
# Show derived type based on VTable
|
||||
set print object on
|
||||
# Show static members
|
||||
set print static-members on
|
||||
# Show VTable
|
||||
set print vtbl on
|
||||
# Demangle types
|
||||
set print demangle on
|
||||
|
||||
# Read python scrips in the load path
|
||||
set auto-load python-scripts
|
||||
|
||||
# Allow autoloading project-local .gdbinit files
|
||||
add-auto-load-safe-path ~/git/
|
||||
# Allow autoloading from the Nix store
|
||||
add-auto-load-safe-path /nix/store
|
||||
|
|
@ -24,3 +24,7 @@ compile_commands.json
|
|||
# Swap and backup files
|
||||
*~
|
||||
~.swp
|
||||
|
||||
# Direnv files
|
||||
.envrc
|
||||
.direnv/
|
||||
|
|
|
|||
|
|
@ -1,34 +1,72 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.git;
|
||||
|
||||
inherit (lib.my) mkMailAddress;
|
||||
in
|
||||
{
|
||||
options.my.home.git = with lib.my; {
|
||||
enable = mkDisableOption "git configuration";
|
||||
};
|
||||
|
||||
config.home.packages = with pkgs.gitAndTools; lib.mkIf cfg.enable [
|
||||
gitAndTools.git-absorb
|
||||
gitAndTools.git-revise
|
||||
gitAndTools.tig
|
||||
];
|
||||
|
||||
config.programs.git = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
|
||||
# Who am I?
|
||||
userEmail = "bruno@belanyi.fr";
|
||||
userEmail = mkMailAddress "bruno" "belanyi.fr";
|
||||
userName = "Bruno BELANYI";
|
||||
|
||||
# I want the full experience
|
||||
package = pkgs.gitAndTools.gitFull;
|
||||
|
||||
aliases = {
|
||||
lol = "log --graph --decorate --pretty=oneline --abbrev-commit";
|
||||
git = "!git";
|
||||
lol = "log --graph --decorate --pretty=oneline --abbrev-commit --topo-order";
|
||||
lola = "lol --all";
|
||||
assume = "update-index --assume-unchanged";
|
||||
unassume = "update-index --no-assume-unchanged";
|
||||
assumed = "!git ls-files -v | grep ^h | cut -c 3-";
|
||||
pick = "log -p -G";
|
||||
push-new = "!git push -u origin "
|
||||
+ ''"$(git branch | grep '^* ' | cut -f2- -d' ')"'';
|
||||
};
|
||||
|
||||
lfs.enable = true;
|
||||
|
||||
delta = {
|
||||
enable = true;
|
||||
|
||||
options = {
|
||||
features = "diff-highlight decorations";
|
||||
|
||||
# Less jarring style for `diff-highlight` emulation
|
||||
diff-highlight = {
|
||||
minus-style = "red";
|
||||
minus-non-emph-style = "red";
|
||||
minus-emph-style = "bold red 52";
|
||||
|
||||
plus-style = "green";
|
||||
plus-non-emph-style = "green";
|
||||
plus-emph-style = "bold green 22";
|
||||
|
||||
whitespace-error-style = "reverse red";
|
||||
};
|
||||
|
||||
# Personal preference for easier reading
|
||||
decorations = {
|
||||
commit-style = "raw"; # Do not recolor meta information
|
||||
keep-plus-minus-markers = true;
|
||||
paging = "always";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# There's more
|
||||
extraConfig = {
|
||||
# Makes it a bit more readable
|
||||
|
|
@ -62,13 +100,6 @@ in
|
|||
whitespace = "red reverse";
|
||||
};
|
||||
|
||||
"color.diff-highlight" = {
|
||||
oldNormal = "red bold";
|
||||
oldHighlight = "red bold 52";
|
||||
newNormal = "green bold";
|
||||
newHighlight = "green bold 22";
|
||||
};
|
||||
|
||||
commit = {
|
||||
# Show my changes when writing the message
|
||||
verbose = true;
|
||||
|
|
@ -89,15 +120,9 @@ in
|
|||
defaultBranch = "main";
|
||||
};
|
||||
|
||||
pager =
|
||||
let
|
||||
diff-highlight = "${pkgs.gitAndTools.gitFull}/share/git/contrib/diff-highlight/diff-highlight";
|
||||
in
|
||||
{
|
||||
diff = "${diff-highlight} | less";
|
||||
log = "${diff-highlight} | less";
|
||||
show = "${diff-highlight} | less";
|
||||
};
|
||||
merge = {
|
||||
conflictStyle = "zdiff3";
|
||||
};
|
||||
|
||||
pull = {
|
||||
# Avoid useless merge commits
|
||||
|
|
@ -114,11 +139,33 @@ in
|
|||
autoSquash = true;
|
||||
autoStash = true;
|
||||
};
|
||||
|
||||
url = {
|
||||
"git@gitea.belanyi.fr:" = {
|
||||
insteadOf = "https://gitea.belanyi.fr/";
|
||||
};
|
||||
|
||||
"git@github.com:" = {
|
||||
insteadOf = "https://github.com/";
|
||||
};
|
||||
|
||||
"git@gitlab.com:" = {
|
||||
insteadOf = "https://gitlab.com/";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Multiple identities
|
||||
includes = [
|
||||
{ path = ./epita.config; condition = "gitdir:~/git/EPITA/"; }
|
||||
{
|
||||
condition = "gitdir:~/git/EPITA/";
|
||||
contents = {
|
||||
user = {
|
||||
name = "Bruno BELANYI";
|
||||
email = mkMailAddress "bruno.belanyi" "epita.fr";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
ignores =
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
[user]
|
||||
email = bruno.belanyi@epita.fr
|
||||
name = Bruno BELANYI
|
||||
# vim: set ft=gitconfig:
|
||||
|
|
@ -3,8 +3,15 @@ let
|
|||
cfg = config.my.home.gpg;
|
||||
in
|
||||
{
|
||||
options.my.home.gpg = with lib.my; {
|
||||
enable = mkDisableOption "gpg configuration";
|
||||
options.my.home.gpg = with lib; {
|
||||
enable = my.mkDisableOption "gpg configuration";
|
||||
|
||||
pinentry = mkOption {
|
||||
type = types.str;
|
||||
default = "tty";
|
||||
example = "gtk2";
|
||||
description = "Which pinentry interface to use";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
|
@ -15,7 +22,7 @@ in
|
|||
services.gpg-agent = {
|
||||
enable = true;
|
||||
enableSshSupport = true; # One agent to rule them all
|
||||
pinentryFlavor = "tty";
|
||||
pinentryFlavor = cfg.pinentry;
|
||||
extraConfig = ''
|
||||
allow-loopback-pinentry
|
||||
'';
|
||||
33
home/gtk/default.nix
Normal file
33
home/gtk/default.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.home.gtk;
|
||||
in
|
||||
{
|
||||
options.my.home.gtk = with lib; {
|
||||
enable = mkEnableOption "GTK configuration";
|
||||
};
|
||||
|
||||
config.gtk = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
|
||||
font = {
|
||||
package = pkgs.dejavu_fonts;
|
||||
name = "DejaVu Sans";
|
||||
};
|
||||
|
||||
gtk2 = {
|
||||
# That sweet, sweet clean home that I am always aiming for...
|
||||
configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||
};
|
||||
|
||||
iconTheme = {
|
||||
package = pkgs.gnome.gnome-themes-extra;
|
||||
name = "Adwaita";
|
||||
};
|
||||
|
||||
theme = {
|
||||
package = pkgs.gnome.gnome-themes-extra;
|
||||
name = "Adwaita";
|
||||
};
|
||||
};
|
||||
}
|
||||
91
home/mail/accounts/default.nix
Normal file
91
home/mail/accounts/default.nix
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.home.mail;
|
||||
|
||||
inherit (lib.my) mkMailAddress;
|
||||
|
||||
mkConfig = { domain, address, passName, aliases ? [ ], primary ? false }: {
|
||||
realName = lib.mkDefault "Bruno BELANYI";
|
||||
userName = lib.mkDefault (mkMailAddress address domain);
|
||||
passwordCommand =
|
||||
lib.mkDefault [ "${pkgs.ambroisie.bw-pass}/bin/bw-pass" "Mail" passName ];
|
||||
|
||||
address = mkMailAddress address domain;
|
||||
aliases = builtins.map (lib.flip mkMailAddress domain) aliases;
|
||||
|
||||
inherit primary;
|
||||
|
||||
himalaya = {
|
||||
enable = cfg.himalaya.enable;
|
||||
};
|
||||
|
||||
msmtp = {
|
||||
enable = cfg.msmtp.enable;
|
||||
};
|
||||
};
|
||||
|
||||
migaduConfig = {
|
||||
imap = {
|
||||
host = "imap.migadu.com";
|
||||
port = 993;
|
||||
tls = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
smtp = {
|
||||
host = "smtp.migadu.com";
|
||||
port = 465;
|
||||
tls = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
gmailConfig = {
|
||||
flavor = "gmail.com";
|
||||
folders = {
|
||||
drafts = "[Gmail]/Drafts";
|
||||
sent = "[Gmail]/Sent Mail";
|
||||
trash = "[Gmail]/Trash";
|
||||
};
|
||||
};
|
||||
|
||||
office365Config = {
|
||||
flavor = "outlook.office365.com";
|
||||
};
|
||||
in
|
||||
{
|
||||
config.accounts.email.accounts = {
|
||||
personal = lib.mkMerge [
|
||||
# Common configuraton
|
||||
(mkConfig {
|
||||
domain = "belanyi.fr";
|
||||
address = "bruno";
|
||||
passName = "Migadu";
|
||||
aliases = [ "admin" "postmaster" ];
|
||||
primary = true; # This is my primary email
|
||||
})
|
||||
migaduConfig
|
||||
];
|
||||
|
||||
gmail = lib.mkMerge [
|
||||
# Common configuraton
|
||||
(mkConfig {
|
||||
domain = "gmail.com";
|
||||
address = "brunobelanyi";
|
||||
passName = "GMail";
|
||||
})
|
||||
gmailConfig
|
||||
];
|
||||
|
||||
epita = lib.mkMerge [
|
||||
# Common configuration
|
||||
(mkConfig {
|
||||
domain = "epita.fr";
|
||||
address = "bruno.belanyi";
|
||||
passName = "EPITA";
|
||||
})
|
||||
office365Config
|
||||
];
|
||||
};
|
||||
}
|
||||
31
home/mail/default.nix
Normal file
31
home/mail/default.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.mail;
|
||||
|
||||
mkRelatedOption = desc: lib.mkEnableOption desc // { default = cfg.enable; };
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./accounts
|
||||
./himalaya
|
||||
./msmtp
|
||||
];
|
||||
|
||||
options.my.home.mail = with lib; {
|
||||
enable = my.mkDisableOption "email configuration";
|
||||
|
||||
himalaya = {
|
||||
enable = mkRelatedOption "himalaya configuration";
|
||||
};
|
||||
|
||||
msmtp = {
|
||||
enable = mkRelatedOption "msmtp configuration";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
accounts.email = {
|
||||
maildirBasePath = "mail";
|
||||
};
|
||||
};
|
||||
}
|
||||
23
home/mail/himalaya/default.nix
Normal file
23
home/mail/himalaya/default.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.home.mail.himalaya;
|
||||
in
|
||||
{
|
||||
config.programs.himalaya = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
notify-cmd =
|
||||
let
|
||||
notify-send = "${pkgs.libnotify}/bin/notify-send";
|
||||
in
|
||||
pkgs.writeScript "mail-notifier" ''
|
||||
SENDER="$1"
|
||||
SUBJECT="$2"
|
||||
${notify-send} \
|
||||
-c himalaya \
|
||||
-- "$(printf 'Received email from %s\n\n%s' "$SENDER" "$SUBJECT")"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
9
home/mail/msmtp/default.nix
Normal file
9
home/mail/msmtp/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.mail.msmtp;
|
||||
in
|
||||
{
|
||||
config.programs.msmtp = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
19
home/mpv/default.nix
Normal file
19
home/mpv/default.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.home.mpv;
|
||||
in
|
||||
{
|
||||
options.my.home.mpv = with lib; {
|
||||
enable = mkEnableOption "mpv configuration";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
|
||||
scripts = [
|
||||
pkgs.mpvScripts.mpris # Allow controlling using media keys
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
13
home/nix-index/default.nix
Normal file
13
home/nix-index/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.nix-index;
|
||||
in
|
||||
{
|
||||
options.my.home.nix-index = with lib.my; {
|
||||
enable = mkDisableOption "nix-index configuration";
|
||||
};
|
||||
|
||||
config.programs.nix-index = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
13
home/nm-applet/default.nix
Normal file
13
home/nm-applet/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.nm-applet;
|
||||
in
|
||||
{
|
||||
options.my.home.nm-applet = with lib; {
|
||||
enable = mkEnableOption "network-manager-applet configuration";
|
||||
};
|
||||
|
||||
config.services.network-manager-applet = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.home.packages;
|
||||
in
|
||||
{
|
||||
options.my.home.packages = with lib.my; {
|
||||
enable = mkDisableOption "user packages";
|
||||
};
|
||||
|
||||
config.home.packages = with pkgs; lib.mkIf cfg.enable [
|
||||
# Git related
|
||||
gitAndTools.git-absorb
|
||||
gitAndTools.git-revise
|
||||
gitAndTools.tig
|
||||
# Dev work
|
||||
rr
|
||||
# Terminal prettiness
|
||||
termite.terminfo
|
||||
];
|
||||
}
|
||||
27
home/packages/default.nix
Normal file
27
home/packages/default.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.home.packages;
|
||||
in
|
||||
{
|
||||
options.my.home.packages = with lib; {
|
||||
enable = my.mkDisableOption "user packages";
|
||||
|
||||
additionalPackages = mkOption {
|
||||
type = with types; listOf package;
|
||||
default = [ ];
|
||||
example = literalExample ''
|
||||
with pkgs; [
|
||||
quasselClient
|
||||
]
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config.home.packages = with pkgs; lib.mkIf cfg.enable ([
|
||||
fd
|
||||
file
|
||||
mosh
|
||||
ripgrep
|
||||
termite.terminfo
|
||||
] ++ cfg.additionalPackages);
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.pager;
|
||||
in
|
||||
{
|
||||
options.my.home.pager = with lib.my; {
|
||||
enable = mkDisableOption "pager configuration";
|
||||
};
|
||||
|
||||
config.programs.lesspipe.enable = cfg.enable;
|
||||
|
||||
config.home.sessionVariables = lib.mkIf cfg.enable {
|
||||
# My default pager
|
||||
PAGER = "less";
|
||||
# Clear the screen on start and exit
|
||||
LESS = "-R -+X -c";
|
||||
};
|
||||
}
|
||||
36
home/pager/default.nix
Normal file
36
home/pager/default.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.pager;
|
||||
in
|
||||
{
|
||||
options.my.home.pager = with lib.my; {
|
||||
enable = mkDisableOption "pager configuration";
|
||||
};
|
||||
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.sessionVariables = {
|
||||
# My default pager
|
||||
PAGER = "less";
|
||||
# Clear the screen on start and exit
|
||||
LESS = "-R -+X -c";
|
||||
};
|
||||
|
||||
programs.zsh.localVariables = {
|
||||
# Colored man pages
|
||||
LESS_TERMCAP_mb = "$(tput bold; tput setaf 2)";
|
||||
LESS_TERMCAP_md = "$(tput bold; tput setaf 6)";
|
||||
LESS_TERMCAP_me = "$(tput sgr0)";
|
||||
LESS_TERMCAP_so = "$(tput bold; tput setaf 3; tput setab 4)";
|
||||
LESS_TERMCAP_se = "$(tput rmso; tput sgr0)";
|
||||
LESS_TERMCAP_us = "$(tput bold; tput setaf 2)";
|
||||
LESS_TERMCAP_ue = "$(tput rmul; tput sgr0)";
|
||||
LESS_TERMCAP_mr = "$(tput rev)";
|
||||
LESS_TERMCAP_mh = "$(tput dim)";
|
||||
LESS_TERMCAP_ZN = "$(tput ssubm)";
|
||||
LESS_TERMCAP_ZV = "$(tput rsubm)";
|
||||
LESS_TERMCAP_ZO = "$(tput ssupm)";
|
||||
LESS_TERMCAP_ZW = "$(tput rsupm)";
|
||||
};
|
||||
};
|
||||
}
|
||||
15
home/power-alert/default.nix
Normal file
15
home/power-alert/default.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.power-alert;
|
||||
in
|
||||
{
|
||||
options.my.home.power-alert = with lib; {
|
||||
enable = mkEnableOption "power-alert configuration";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.poweralertd = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
3
home/secrets/.gitattributes
vendored
3
home/secrets/.gitattributes
vendored
|
|
@ -1,3 +0,0 @@
|
|||
* filter=git-crypt diff=git-crypt
|
||||
.gitattributes !filter !diff
|
||||
/default.nix !filter !diff
|
||||
Binary file not shown.
|
|
@ -1,19 +0,0 @@
|
|||
{ lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
canaryHash = builtins.hashFile "sha256" ./canary;
|
||||
expectedHash =
|
||||
"9df8c065663197b5a1095122d48e140d3677d860343256abd5ab6e4fb4c696ab";
|
||||
in
|
||||
if canaryHash != expectedHash then
|
||||
abort "Secrets are not readable. Have you run `git-crypt unlock`?"
|
||||
else {
|
||||
options.my.secrets = mkOption {
|
||||
type = types.attrs;
|
||||
};
|
||||
|
||||
config.my.secrets = {
|
||||
# Home-manager secrets go here
|
||||
};
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ in
|
|||
enable = mkDisableOption "ssh configuration";
|
||||
};
|
||||
|
||||
config.programs.ssh = {
|
||||
config.programs.ssh = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
|
||||
matchBlocks = {
|
||||
|
|
@ -40,6 +40,12 @@ in
|
|||
identityFile = "~/.ssh/shared_rsa";
|
||||
user = "ambroisie";
|
||||
};
|
||||
|
||||
work = {
|
||||
hostname = "workspaces.dgexsol.fr";
|
||||
identityFile = "~/.ssh/shared_rsa";
|
||||
user = "bruno_belanyi";
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
61
home/terminal/default.nix
Normal file
61
home/terminal/default.nix
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
mkColorOption = with lib; description: default: mkOption {
|
||||
inherit description default;
|
||||
example = "#abcdef";
|
||||
type = types.strMatching "#[0-9a-f]{6}";
|
||||
};
|
||||
|
||||
cfg = config.my.home.terminal;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./termite
|
||||
];
|
||||
|
||||
options.my.home = with lib; {
|
||||
terminal = {
|
||||
program = mkOption {
|
||||
type = with types; nullOr (enum [ "termite" ]);
|
||||
default = null;
|
||||
example = "termite";
|
||||
description = "Which terminal to use for home session";
|
||||
};
|
||||
|
||||
colors = {
|
||||
background = mkColorOption "Background color" "#161616";
|
||||
foreground = mkColorOption "Foreground color" "#ffffff";
|
||||
foregroundBold = mkColorOption "Foreground bold color" "#ffffff";
|
||||
cursor = mkColorOption "Cursor color" "#ffffff";
|
||||
|
||||
black = mkColorOption "Black" "#222222";
|
||||
blackBold = mkColorOption "Black bold" "#666666";
|
||||
|
||||
red = mkColorOption "Red" "#e84f4f";
|
||||
redBold = mkColorOption "Red bold" "#d23d3d";
|
||||
|
||||
green = mkColorOption "Green" "#b7ce42";
|
||||
greenBold = mkColorOption "Green bold" "#bde077";
|
||||
|
||||
yellow = mkColorOption "Yellow" "#fea63c";
|
||||
yellowBold = mkColorOption "Yellow bold" "#ffe863";
|
||||
|
||||
blue = mkColorOption "Blue" "#66aabb";
|
||||
blueBold = mkColorOption "Blue bold" "#aaccbb";
|
||||
|
||||
magenta = mkColorOption "Magenta" "#b7416e";
|
||||
magentaBold = mkColorOption "Magenta bold" "#e16a98";
|
||||
|
||||
cyan = mkColorOption "Cyan" "#6d878d";
|
||||
cyanBold = mkColorOption "Cyan bold" "#42717b";
|
||||
|
||||
white = mkColorOption "White" "#dddddd";
|
||||
whiteBold = mkColorOption "White bold" "#cccccc";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config.home.sessionVariables = lib.mkIf (cfg.program != null) {
|
||||
TERMINAL = cfg.program;
|
||||
};
|
||||
}
|
||||
53
home/terminal/termite/default.nix
Normal file
53
home/terminal/termite/default.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.home.terminal;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf (cfg.program == "termite") {
|
||||
programs.termite = {
|
||||
enable = true;
|
||||
|
||||
# Niceties
|
||||
browser = "${pkgs.xdg-utils}/bin/xdg-open";
|
||||
clickableUrl = true;
|
||||
dynamicTitle = true;
|
||||
fullscreen = false;
|
||||
mouseAutohide = true;
|
||||
urgentOnBell = true;
|
||||
|
||||
# Look and feel
|
||||
allowBold = true;
|
||||
audibleBell = false;
|
||||
cursorBlink = "system";
|
||||
font = "Monospace 9";
|
||||
scrollbar = "off";
|
||||
|
||||
|
||||
# Colors
|
||||
backgroundColor = cfg.colors.background;
|
||||
cursorColor = cfg.colors.cursor;
|
||||
foregroundColor = cfg.colors.foreground;
|
||||
foregroundBoldColor = cfg.colors.foregroundBold;
|
||||
colorsExtra = with cfg.colors; ''
|
||||
# Normal colors
|
||||
color0 = ${black}
|
||||
color1 = ${red}
|
||||
color2 = ${green}
|
||||
color3 = ${yellow}
|
||||
color4 = ${blue}
|
||||
color5 = ${magenta}
|
||||
color6 = ${cyan}
|
||||
color7 = ${white}
|
||||
# Bold colors
|
||||
color8 = ${blackBold}
|
||||
color9 = ${redBold}
|
||||
color10 = ${greenBold}
|
||||
color11 = ${yellowBold}
|
||||
color12 = ${blueBold}
|
||||
color13 = ${magentaBold}
|
||||
color14 = ${cyanBold}
|
||||
color15 = ${whiteBold}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.home.tmux;
|
||||
hasGUI = config.my.home.x.enable || (config.my.home.wm != null);
|
||||
in
|
||||
{
|
||||
options.my.home.tmux = with lib.my; {
|
||||
|
|
@ -13,7 +14,7 @@ in
|
|||
keyMode = "vi"; # Home-row keys and other niceties
|
||||
clock24 = true; # I'm one of those heathens
|
||||
escapeTime = 0; # Let vim do its thing instead
|
||||
historyLimit = 5000; # Bigger buffer
|
||||
historyLimit = 50000; # Bigger buffer
|
||||
terminal = "tmux-256color"; # I want accurate termcap info
|
||||
|
||||
plugins = with pkgs.tmuxPlugins; [
|
||||
|
|
@ -23,8 +24,16 @@ in
|
|||
pain-control
|
||||
# Better session management
|
||||
sessionist
|
||||
# X clipboard integration
|
||||
yank
|
||||
(lib.optionalAttrs hasGUI {
|
||||
# X clipboard integration
|
||||
plugin = yank;
|
||||
extraConfig = ''
|
||||
# Use 'clipboard' because of misbehaving apps (e.g: firefox)
|
||||
set -g @yank_selection_mouse 'clipboard'
|
||||
# Stay in copy mode after yanking
|
||||
set -g @yank_action 'copy-pipe'
|
||||
'';
|
||||
})
|
||||
{
|
||||
# Show when prefix has been pressed
|
||||
plugin = prefix-highlight;
|
||||
|
|
@ -41,7 +50,13 @@ in
|
|||
extraConfig = ''
|
||||
# Better vim mode
|
||||
bind-key -T copy-mode-vi 'v' send -X begin-selection
|
||||
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
|
||||
${
|
||||
lib.optionalString
|
||||
(!hasGUI)
|
||||
"bind-key -T copy-mode-vi 'y' send -X copy-selection"
|
||||
}
|
||||
# Block selection in vim mode
|
||||
bind-key -Tcopy-mode-vi 'C-v' send -X begin-selection \; send -X rectangle-toggle
|
||||
'';
|
||||
};
|
||||
}
|
||||
13
home/udiskie/default.nix
Normal file
13
home/udiskie/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.udiskie;
|
||||
in
|
||||
{
|
||||
options.my.home.udiskie = with lib; {
|
||||
enable = mkEnableOption "udiskie configuration";
|
||||
};
|
||||
|
||||
config.services.udiskie = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Use shfmt as ALE fixer for bash
|
||||
let b:ale_fixers=[ 'shfmt' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
|
||||
" Indent with 4 spaces, simplify script, indent switch cases, use Bash variant
|
||||
let b:ale_sh_shfmt_options='-i 4 -s -ci -ln bash'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_sh_shfmt_options'
|
||||
|
||||
" Use bash dialect explicitly, require explicit empty string test
|
||||
let b:ale_sh_shellcheck_options='-s bash -o avoid-nullary-conditions'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_sh_shellcheck_options'
|
||||
|
|
@ -7,7 +7,3 @@ let b:undo_ftplugin.='|setlocal shiftwidth<'
|
|||
|
||||
" Have automatic padding of transactions so that decimal is on 52nd column
|
||||
let g:beancount_separator_col=52
|
||||
|
||||
" Automatic padding for transactions
|
||||
nnoremap <buffer> <leader>= :AlignCommodity<CR>
|
||||
vnoremap <buffer> <leader>= :AlignCommodity<CR>
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" More warnings and the usual version in flags for Clang
|
||||
let b:ale_c_clang_options='-Wall -Wextra -pedantic -std=c99'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_c_clang_options'
|
||||
|
||||
" More warnings and the usual version in flags for GCC
|
||||
let b:ale_c_gcc_options='-Wall -Wextra -pedantic -std=c99'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_c_gcc_options'
|
||||
|
||||
" Use compile_commands.json to look for additional flags
|
||||
let b:ale_c_parse_compile_commands=1
|
||||
let b:undo_ftplugin.='|unlet! b:ale_c_parse_compile_commands'
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" More warnings and the usual version in flags for Clang
|
||||
let b:ale_cpp_clang_options='-Wall -Wextra -pedantic -std=c++17'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_cpp_clang_options'
|
||||
|
||||
" More warnings and the usual version in flags for GCC
|
||||
let b:ale_cpp_gcc_options='-Wall -Wextra -pedantic -std=c++17'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_cpp_gcc_options'
|
||||
|
||||
" Use compile_commands.json to look for additional flags
|
||||
let b:ale_c_parse_compile_commands=1
|
||||
let b:undo_ftplugin.='|unlet! b:ale_c_parse_compile_commands'
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Use my desired ALE fixer for D
|
||||
let b:ale_fixers=[ 'dfmt' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
|
@ -5,26 +5,6 @@ call ftplugined#check_undo_ft()
|
|||
setlocal shiftwidth=2
|
||||
let b:undo_ftplugin.='|setlocal shiftwidth<'
|
||||
|
||||
" Use my desired ALE fixers for Haskell
|
||||
let b:ale_fixers=[ 'brittany' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
|
||||
" Use stack-managed `hlint`
|
||||
let b:ale_haskell_hlint_executable='stack'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_haskell_hlint_executable'
|
||||
|
||||
" Use stack-managed `brittany`
|
||||
let b:ale_haskell_brittany_executable='stack'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_haskell_brittany_executable'
|
||||
|
||||
" Use dynamic libraries because of Arch linux, with default ALE options
|
||||
let b:ale_haskell_ghc_options='--dynamic -fno-code -v0'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_haskell_ghc_options'
|
||||
|
||||
" Automatically format files when saving them
|
||||
let b:ale_fix_on_save=1
|
||||
let b:undo_ftplugin='|unlet! b:ale_lint_on_save'
|
||||
|
||||
" Change max length of a line to 100 for this buffer to match official guidelines
|
||||
setlocal colorcolumn=100
|
||||
let b:undo_ftplugin.='|setlocal colorcolumn<'
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Use my desired ALE fixer for JSON
|
||||
let b:ale_fixers=[ 'jq' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
|
|
@ -1,10 +1,6 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Let ALE know that I want Markdown linters
|
||||
let b:ale_linter_aliases=[ 'markdown' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_linter_aliases'
|
||||
|
||||
" Use a small indentation value on Pandoc files
|
||||
setlocal shiftwidth=2
|
||||
let b:undo_ftplugin.='|setlocal shiftwidth<'
|
||||
|
|
|
|||
|
|
@ -1,40 +0,0 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Use my desired ALE fixers for python
|
||||
let b:ale_fixers=[ 'black', 'isort' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
" Use my desired ALE linters for python
|
||||
let b:ale_linters=[ 'flake8', 'mypy', 'pylint', 'pyls' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_linters'
|
||||
|
||||
" Use pyls inside the python environment if needed
|
||||
let b:ale_python_pyls_auto_pipenv=1
|
||||
let b:undo_ftplugin.='|unlet! b:ale_python_pyls_auto_pipenv'
|
||||
|
||||
" Disable pycodestyle checks from pyls because I'm already using flake8
|
||||
let b:ale_python_pyls_config={
|
||||
\ 'pyls': {
|
||||
\ 'plugins': {
|
||||
\ 'pycodestyle': {
|
||||
\ 'enabled': v:false
|
||||
\ },
|
||||
\ },
|
||||
\ },
|
||||
\ }
|
||||
let b:undo_ftplugin.='|unlet! b:ale_python_pyls_config'
|
||||
|
||||
" Don't use mypy to check for syntax errors
|
||||
let b:ale_python_mypy_ignore_invalid_syntax=1
|
||||
let b:undo_ftplugin.='|unlet! b:ale_python_mypy_ignore_invalid_syntax'
|
||||
" Use mypy inside the python environment if needed
|
||||
let b:ale_python_mypy_auto_pipenv=1
|
||||
let b:undo_ftplugin.='|unlet! b:ale_python_mypy_auto_pipenv'
|
||||
|
||||
" Automatically format files when saving them
|
||||
let b:ale_fix_on_save=1
|
||||
let b:undo_ftplugin='|unlet! b:ale_lint_on_save'
|
||||
|
||||
" Change max length of a line to 88 for this buffer to match black's settings
|
||||
setlocal colorcolumn=88
|
||||
let b:undo_ftplugin.='|setlocal colorcolumn<'
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Use h/l to go to the previous/next non-empty quickfix or location list
|
||||
nnoremap <silent> <buffer> h :call quickfixed#older()<CR>
|
||||
let b:undo_ftplugin.='|nunmap <buffer> h'
|
||||
nnoremap <silent> <buffer> l :call quickfixed#newer()<CR>
|
||||
let b:undo_ftplugin.='|nunmap <buffer> l'
|
||||
|
|
@ -1,31 +1,6 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Check tests too
|
||||
let b:ale_rust_cargo_check_tests=1
|
||||
let b:undo_ftplugin='|unlet! b:ale_rust_cargo_check_tests'
|
||||
|
||||
" Check examples too
|
||||
let b:ale_rust_cargo_check_examples=1
|
||||
let b:undo_ftplugin='|unlet! b:ale_rust_cargo_check_examples'
|
||||
|
||||
" Use clippy if it's available instead of just cargo check
|
||||
let b:ale_rust_cargo_use_clippy=executable('cargo-clippy')
|
||||
let b:undo_ftplugin='|unlet! b:ale_rust_cargo_use_clippy'
|
||||
|
||||
" Use rust-analyzer instead of RLS as a linter
|
||||
let b:ale_linters=[ 'cargo', 'analyzer' ]
|
||||
let b:undo_ftplugin='|unlet! b:ale_linters'
|
||||
|
||||
|
||||
" Use rustfmt as ALE fixer for rust
|
||||
let b:ale_fixers=[ 'rustfmt' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
|
||||
" Automatically format files when saving them
|
||||
let b:ale_fix_on_save=1
|
||||
let b:undo_ftplugin='|unlet! b:ale_lint_on_save'
|
||||
|
||||
" Change max length of a line to 99 for this buffer to match official guidelines
|
||||
setlocal colorcolumn=99
|
||||
let b:undo_ftplugin.='|setlocal colorcolumn<'
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Use shfmt as ALE fixer for sh
|
||||
let b:ale_fixers=[ 'shfmt' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
|
||||
" Indent with 4 spaces, simplify the code, indent switch cases, use POSIX
|
||||
let b:ale_sh_shfmt_options='-i 4 -s -ci -ln posix'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_sh_shfmt_options'
|
||||
|
||||
" Require explicit empty string test
|
||||
let b:ale_sh_shellcheck_options='-o avoid-nullary-conditions'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_sh_shellcheck_options'
|
||||
6
home/vim/after/ftplugin/tiger.vim
Normal file
6
home/vim/after/ftplugin/tiger.vim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Use a small indentation value on tiger files
|
||||
setlocal shiftwidth=2
|
||||
let b:undo_ftplugin.='|setlocal shiftwidth<'
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Use shfmt as ALE fixer for zsh
|
||||
let b:ale_fixers=[ 'shfmt' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
|
||||
" Indent with 4 spaces, simplify script, indent switch cases, use Bash variant
|
||||
let b:ale_sh_shfmt_options='-i 4 -s -ci -ln bash'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_sh_shfmt_options'
|
||||
|
||||
" Use bash dialect explicitly, require explicit empty string test
|
||||
let b:ale_sh_shellcheck_options='-s bash -o avoid-nullary-conditions'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_sh_shellcheck_options'
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
" Use ALE LSP-powered symbol information
|
||||
nnoremap <Leader>K :ALEHover<CR>
|
||||
12
home/vim/after/plugin/mappings/commentary.vim
Normal file
12
home/vim/after/plugin/mappings/commentary.vim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
lua << EOF
|
||||
local wk = require("which-key")
|
||||
|
||||
local keys = {
|
||||
name = "Comment/uncomment",
|
||||
c = "Current line",
|
||||
u = "Uncomment the current and adjacent commented lines",
|
||||
["gc"] = "Uncomment the current and adjacent commented lines",
|
||||
}
|
||||
|
||||
wk.register(keys, { prefix = "gc" })
|
||||
EOF
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
" Visual bindings for merging diffs as in normal mode
|
||||
xnoremap dp :diffput<cr>
|
||||
xnoremap do :diffget<cr>
|
||||
|
||||
" Open status window
|
||||
nnoremap <Leader>gs :Gstatus<CR>
|
||||
" Open diff view of current buffer: the up/left window is the current index
|
||||
nnoremap <Leader>gd :Gdiffsplit!<CR>
|
||||
" Open current file log in new tab, populate its location list with history
|
||||
nnoremap <Leader>gl :sp<CR><C-w>T:Gllog --follow -- %:p<CR>
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
" Only git-tracked files, Vim needs to be in a Git repository
|
||||
nnoremap <Leader>fg :GFiles<CR>
|
||||
|
||||
" All files
|
||||
nnoremap <Leader>ff :Files<CR>
|
||||
|
||||
" Currently open buffers
|
||||
nnoremap <Leader>fb :Buffers<CR>
|
||||
|
||||
" Buffer history
|
||||
nnoremap <Leader>fh :History<CR>
|
||||
|
||||
" Tags in buffer
|
||||
nnoremap <Leader>ft :BTags<CR>
|
||||
|
||||
" Tags in all project files
|
||||
nnoremap <Leader>fT :Tags<CR>
|
||||
|
||||
" Snippets for the current fileytpe (using Ultisnips)
|
||||
nnoremap <Leader>fs :Snippets<CR>
|
||||
|
||||
" All available commands
|
||||
nnoremap <Leader>f: :Commands<CR>
|
||||
|
||||
" All commits (using fugitive)
|
||||
nnoremap <Leader>fc :Commits<CR>
|
||||
|
||||
" All commits for the current buffer (using fugitive)
|
||||
nnoremap <Leader>fC :BCommits<CR>
|
||||
|
||||
" Select normal mode mapping by searching for its name
|
||||
nmap <Leader><Tab> <Plug>(fzf-maps-n)
|
||||
|
||||
" Select visual mode mapping by searching for its name
|
||||
xmap <Leader><Tab> <Plug>(fzf-maps-x)
|
||||
|
||||
" Select operator pending mode mapping by searching for its name
|
||||
omap <Leader><Tab> <Plug>(fzf-maps-o)
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
" Yank until the end of line with Y, to be more consistent with D and C
|
||||
nnoremap Y y$
|
||||
lua << EOF
|
||||
local wk = require("which-key")
|
||||
|
||||
" Run make silently, then skip the 'Press ENTER to continue'
|
||||
noremap <Leader>m :silent! :make! \| :redraw!<CR>
|
||||
local keys = {
|
||||
["<leader>"] = { "<cmd>nohls<CR>", "Clear search highlight" },
|
||||
}
|
||||
|
||||
" Remove search-highlighting
|
||||
noremap <Leader><Leader> :nohls<CR>
|
||||
wk.register(keys, { prefix = "<leader>" })
|
||||
EOF
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
" Next and previous in quick-fix list
|
||||
nmap <Leader>fn <Plug>(qf_qf_next)
|
||||
nmap <Leader>fp <Plug>(qf_qf_previous)
|
||||
|
||||
" Next and previous in location list
|
||||
nmap <Leader>ln <Plug>(qf_loc_next)
|
||||
nmap <Leader>lp <Plug>(qf_loc_previous)
|
||||
|
||||
" Toggle quick-fix and location lists
|
||||
nmap <Leader>tf <Plug>(qf_qf_toggle)
|
||||
nmap <Leader>tl <Plug>(qf_loc_toggle)
|
||||
18
home/vim/after/plugin/mappings/telescope.vim
Normal file
18
home/vim/after/plugin/mappings/telescope.vim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
lua << EOF
|
||||
local wk = require("which-key")
|
||||
local telescope_builtin = require("telescope.builtin")
|
||||
|
||||
local keys = {
|
||||
f = {
|
||||
name = "Fuzzy finder",
|
||||
b = { telescope_builtin.buffers, "Open buffers" },
|
||||
f = { telescope_builtin.git_files, "Git tracked files" },
|
||||
F = { telescope_builtin.find_files, "Files" },
|
||||
g = { telescope_builtin.live_grep, "Grep string" },
|
||||
G = { telescope_builtin.grep_string, "Grep string under cursor" },
|
||||
},
|
||||
}
|
||||
|
||||
wk.register(keys, { prefix = "<leader>" })
|
||||
EOF
|
||||
|
||||
32
home/vim/after/plugin/mappings/tree-sitter-textobjects.vim
Normal file
32
home/vim/after/plugin/mappings/tree-sitter-textobjects.vim
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
lua << EOF
|
||||
local wk = require("which-key")
|
||||
|
||||
local motions = {
|
||||
["]m"] = "Next method start",
|
||||
["]M"] = "Next method end",
|
||||
["]S"] = "Next statement start",
|
||||
["]]"] = "Next class start",
|
||||
["]["] = "Next class end",
|
||||
["[m"] = "Previous method start",
|
||||
["[M"] = "Previous method end",
|
||||
["[S"] = "Previous statement start",
|
||||
["[["] = "Previous class start",
|
||||
["[]"] = "Previous class end",
|
||||
}
|
||||
|
||||
local objects = {
|
||||
["aa"] = "a parameter",
|
||||
["ia"] = "inner parameter",
|
||||
["ab"] = "a block",
|
||||
["ib"] = "inner block",
|
||||
["ac"] = "a class",
|
||||
["ic"] = "inner class",
|
||||
["af"] = "a function",
|
||||
["if"] = "inner function",
|
||||
["ak"] = "a comment",
|
||||
["aS"] = "a statement",
|
||||
}
|
||||
|
||||
wk.register(motions, { mode = "n" })
|
||||
wk.register(objects, { mode = "o" })
|
||||
EOF
|
||||
|
|
@ -1,7 +1,125 @@
|
|||
" Better fr layout mappings for vim-unimpaired and other '[' and ']' commands
|
||||
nmap ( [
|
||||
nmap ) ]
|
||||
omap ( [
|
||||
omap ) ]
|
||||
xmap ( [
|
||||
xmap ) ]
|
||||
lua << EOF
|
||||
local wk = require("which-key")
|
||||
|
||||
local keys = {
|
||||
-- Edition and navigation mappins
|
||||
["["] = {
|
||||
name = "Previous",
|
||||
["<space>"] = "Insert blank line above",
|
||||
["<C-L>"] = "Previous location list file",
|
||||
["<C-Q>"] = "Previous quickfix list file",
|
||||
["<C-T>"] = "Previous tag in preview window",
|
||||
a = "Previous argument",
|
||||
A = "First argument",
|
||||
b = "Previous buffer",
|
||||
B = "First buffer",
|
||||
e = "Exchange previous line",
|
||||
f = "Previous file in directory",
|
||||
l = "Previous location list entry",
|
||||
L = "First Location list entry",
|
||||
n = "Previous conflict marker/diff hunk",
|
||||
p = "Paste line above",
|
||||
P = "Paste line above",
|
||||
q = "Previous quickfix list entry",
|
||||
Q = "First quickfix list entry",
|
||||
t = "Previous matching tag",
|
||||
T = "First matching tag",
|
||||
z = "Previous fold",
|
||||
-- Encoding
|
||||
C = "C string encode",
|
||||
u = "URL encode",
|
||||
x = "XML encode",
|
||||
y = "C string encode",
|
||||
-- Custom
|
||||
d = { vim.diagnostic.goto_prev, "Previous diagnostic" }
|
||||
},
|
||||
["]"] = {
|
||||
name = "Next",
|
||||
["<space>"] = "Insert blank line below",
|
||||
["<C-L>"] = "Next location list file",
|
||||
["<C-Q>"] = "Next quickfix list file",
|
||||
["<C-T>"] = "Next tag in preview window",
|
||||
a = "Next argument",
|
||||
A = "Last argument",
|
||||
b = "Next buffer",
|
||||
B = "Last buffer",
|
||||
e = "Exchange next line",
|
||||
f = "Next file in directory",
|
||||
l = "Next location list entry",
|
||||
L = "Last Location list entry",
|
||||
n = "Next conflict marker/diff hunk",
|
||||
p = "Paste line below",
|
||||
P = "Paste line below",
|
||||
q = "Next quickfix list entry",
|
||||
Q = "Last quickfix list entry",
|
||||
t = "Next matching tag",
|
||||
T = "Last matching tag",
|
||||
z = "Next fold",
|
||||
-- Decoding
|
||||
C = "C string decode",
|
||||
u = "URL decode",
|
||||
x = "XML decode",
|
||||
y = "C string decode",
|
||||
-- Custom
|
||||
d = { vim.diagnostic.goto_next, "Next diagnostic" }
|
||||
},
|
||||
|
||||
-- Option mappings
|
||||
["[o"] = {
|
||||
name = "Enable option",
|
||||
b = "Light background",
|
||||
c = "Cursor line",
|
||||
d = "Diff",
|
||||
e = { "<cmd>lwindow<CR>", "Location list" },
|
||||
f = { "<cmd>cwindow<CR>", "Quickfix list" },
|
||||
h = "Search high-lighting",
|
||||
i = "Case insensitive search",
|
||||
l = "List mode",
|
||||
n = "Line numbers",
|
||||
r = "Relative line numbers",
|
||||
u = "Cursor column",
|
||||
v = "Virtual editing",
|
||||
w = "Text wrapping",
|
||||
x = "Cursor line and column",
|
||||
z = "Spell checking",
|
||||
},
|
||||
["]o"] = {
|
||||
name = "Option off",
|
||||
b = "Light background",
|
||||
c = "Cursor line",
|
||||
d = "Diff",
|
||||
e = { "<cmd>lclose<CR>", "Location list" },
|
||||
f = { "<cmd>cclose<CR>", "Quickfix list" },
|
||||
h = "Search high-lighting",
|
||||
i = "Case insensitive search",
|
||||
l = "List mode",
|
||||
n = "Line numbers",
|
||||
r = "Relative line numbers",
|
||||
u = "Cursor column",
|
||||
v = "Virtual editing",
|
||||
w = "Text wrapping",
|
||||
x = "Cursor line and column",
|
||||
z = "Spell checking",
|
||||
},
|
||||
["yo"] = {
|
||||
name = "Option toggle",
|
||||
b = "Light background",
|
||||
c = "Cursor line",
|
||||
d = "Diff",
|
||||
e = { "<Plug>(qf_loc_toggle)", "Location list" },
|
||||
f = { "<Plug>(qf_qf_toggle)", "Quickfix list" },
|
||||
h = "Search high-lighting",
|
||||
i = "Case insensitive search",
|
||||
l = "List mode",
|
||||
n = "Line numbers",
|
||||
r = "Relative line numbers",
|
||||
u = "Cursor column",
|
||||
v = "Virtual editing",
|
||||
w = "Text wrapping",
|
||||
x = "Cursor line and column",
|
||||
z = "Spell checking",
|
||||
},
|
||||
}
|
||||
|
||||
wk.register(keys)
|
||||
EOF
|
||||
|
|
|
|||
|
|
@ -1,68 +0,0 @@
|
|||
" Taken from the Vimways article
|
||||
|
||||
function! s:isLocation()
|
||||
" Get dictionary of properties of the current window
|
||||
let wininfo = filter(getwininfo(), {i,v -> v.winnr == winnr()})[0]
|
||||
return wininfo.loclist
|
||||
endfunction
|
||||
|
||||
function! s:length()
|
||||
" Get the size of the current quickfix/location list
|
||||
return len(s:isLocation() ? getloclist(0) : getqflist())
|
||||
endfunction
|
||||
|
||||
function! s:getProperty(key, ...)
|
||||
" getqflist() and getloclist() expect a dictionary argument
|
||||
" If a 2nd argument has been passed in, use it as the value, else 0
|
||||
let l:what = {a:key : a:0 ? a:1 : 0}
|
||||
let l:listdict = s:isLocation() ? getloclist(0, l:what) : getqflist(l:what)
|
||||
return get(l:listdict, a:key)
|
||||
endfunction
|
||||
|
||||
function! s:isFirst()
|
||||
return s:getProperty('nr') <= 1
|
||||
endfunction
|
||||
|
||||
function! s:isLast()
|
||||
return s:getProperty('nr') == s:getProperty('nr', '$')
|
||||
endfunction
|
||||
|
||||
function! s:history(goNewer)
|
||||
" Build the command: one of colder/cnewer/lolder/lnewer
|
||||
let l:cmd = (s:isLocation() ? 'l' : 'c') . (a:goNewer ? 'newer' : 'older')
|
||||
|
||||
" Apply the cmd repeatedly until we hit a non-empty list, or first/last list
|
||||
" is reached
|
||||
while 1
|
||||
if (a:goNewer && s:isLast()) || (!a:goNewer && s:isFirst()) | break | endif
|
||||
" Run the command. Use :silent to suppress message-history output.
|
||||
" Note that the :try wrapper is no longer necessary
|
||||
silent execute l:cmd
|
||||
if s:length() | break | endif
|
||||
endwhile
|
||||
|
||||
" Echo a description of the new quickfix / location list.
|
||||
" And make it look like a rainbow.
|
||||
let l:nr = s:getProperty('nr')
|
||||
let l:last = s:getProperty('nr', '$')
|
||||
echohl MoreMsg | echon '('
|
||||
echohl Identifier | echon l:nr
|
||||
if l:last > 1
|
||||
echohl LineNr | echon ' of '
|
||||
echohl Identifier | echon l:last
|
||||
endif
|
||||
echohl MoreMsg | echon ') '
|
||||
echohl MoreMsg | echon '['
|
||||
echohl Identifier | echon s:length()
|
||||
echohl MoreMsg | echon '] '
|
||||
echohl Normal | echon s:getProperty('title')
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
function! quickfixed#older()
|
||||
call s:history(0)
|
||||
endfunction
|
||||
|
||||
function! quickfixed#newer()
|
||||
call s:history(1)
|
||||
endfunction
|
||||
|
|
@ -13,6 +13,7 @@ let
|
|||
"after"
|
||||
"autoload"
|
||||
"ftdetect"
|
||||
"lua"
|
||||
"plugin"
|
||||
];
|
||||
in
|
||||
|
|
@ -30,11 +31,9 @@ in
|
|||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
# Theming
|
||||
lightline-vim # Fancy status bar
|
||||
{
|
||||
plugin = onedark-vim; # Nice dark theme
|
||||
optional = true; # Needs to be `packadd`-ed manually...
|
||||
}
|
||||
vim-gruvbox8 # Nice dark theme
|
||||
lualine-nvim # A lua-based status line
|
||||
lualine-lsp-progress # Show progress for LSP servers
|
||||
|
||||
# tpope essentials
|
||||
vim-commentary # Easy comments
|
||||
|
|
@ -43,7 +42,6 @@ in
|
|||
vim-git # Sane git syntax files
|
||||
vim-repeat # Enanche '.' for plugins
|
||||
vim-rsi # Readline mappings
|
||||
vim-surround # Deal with pairs
|
||||
vim-unimpaired # Some ex command mappings
|
||||
vim-vinegar # Better netrw
|
||||
|
||||
|
|
@ -57,20 +55,54 @@ in
|
|||
vim-toml
|
||||
|
||||
# General enhancements
|
||||
fastfold # Better folding
|
||||
vim-qf # Better quick-fix list
|
||||
|
||||
# Other wrappers
|
||||
fzfWrapper # The vim plugin inside the 'fzf' package
|
||||
fzf-vim # Fuzzy commands
|
||||
git-messenger-vim # A simple blame window
|
||||
|
||||
# LSP and linting
|
||||
ale # Asynchronous Linting Engine
|
||||
lightline-ale # Status bar integration
|
||||
nvim-lspconfig # Easy LSP configuration
|
||||
lsp_lines-nvim # Show diagnostics *over* regions
|
||||
null-ls-nvim # LSP integration for linters and formatters
|
||||
(nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars)) # Better highlighting
|
||||
nvim-treesitter-textobjects # More textobjects
|
||||
nvim-ts-context-commentstring # Comment string in nested language blocks
|
||||
plenary-nvim # 'null-ls', 'telescope' dependency
|
||||
|
||||
# Completion
|
||||
nvim-cmp # Completion engine
|
||||
cmp-buffer # Words from open buffers
|
||||
cmp-nvim-lsp # LSP suggestions
|
||||
cmp-nvim-lua # NeoVim lua API
|
||||
cmp-path # Path name suggestions
|
||||
cmp-under-comparator # Sort items that start with '_' lower
|
||||
friendly-snippets # LSP snippets collection
|
||||
luasnip # Snippet manager compatible with LSP
|
||||
|
||||
# UX improvements
|
||||
dressing-nvim # Integrate native UI hooks with Telescope etc...
|
||||
gitsigns-nvim # Fast git UI integration
|
||||
nvim-surround # Deal with pairs, now in Lua
|
||||
telescope-fzf-native-nvim # Use 'fzf' fuzzy matching algorithm
|
||||
telescope-lsp-handlers-nvim # Use 'telescope' for various LSP actions
|
||||
telescope-nvim # Fuzzy finder interface
|
||||
which-key-nvim # Show available mappings
|
||||
];
|
||||
|
||||
extraConfig = builtins.readFile ./init.vim;
|
||||
|
||||
# Linters, formatters, etc...
|
||||
extraPackages = with pkgs; [
|
||||
# C/C++
|
||||
clang-tools
|
||||
|
||||
# Nix
|
||||
nixpkgs-fmt
|
||||
|
||||
# Shell
|
||||
shellcheck
|
||||
shfmt
|
||||
];
|
||||
};
|
||||
|
||||
config.xdg.configFile = lib.mkIf cfg.enable configFiles;
|
||||
|
|
|
|||
3
home/vim/ftdetect/tiger.vim
Normal file
3
home/vim/ftdetect/tiger.vim
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
" Use Tiger filetype for programs and header files
|
||||
au BufNewFile,BufRead *.tig setfiletype tiger
|
||||
au BufNewFile,BufRead *.tih setfiletype tiger
|
||||
|
|
@ -13,6 +13,13 @@ set wildmenu
|
|||
" Enable syntax high-lighting and file-type specific plugins
|
||||
syntax on
|
||||
filetype plugin indent on
|
||||
|
||||
" Map leader to space (needs the noremap trick to avoid moving the cursor)
|
||||
nnoremap <Space> <Nop>
|
||||
let mapleader=" "
|
||||
|
||||
" Map localleader to '!' (if I want to filter text, I use visual mode)
|
||||
let maplocalleader="!"
|
||||
" }}}
|
||||
|
||||
" Indentation configuration {{{
|
||||
|
|
@ -65,13 +72,20 @@ set lazyredraw
|
|||
" Timeout quickly on shortcuts, I can't wait two seconds to delete in visual
|
||||
set timeoutlen=500
|
||||
|
||||
" Timeout quickly for CursorHold events (and also swap file)
|
||||
set updatetime=250
|
||||
|
||||
" Set dark mode by default
|
||||
set background=dark
|
||||
|
||||
" Load it manually because of autoload functions...
|
||||
packadd! onedark-vim
|
||||
" Use onedark
|
||||
colorscheme onedark
|
||||
" Include plug-in integration
|
||||
let g:gruvbox_plugin_hi_groups=1
|
||||
" Include filetype integration
|
||||
let g:gruvbox_filetype_hi_groups=1
|
||||
" 24 bit colors
|
||||
set termguicolors
|
||||
" Use my preferred colorscheme
|
||||
colorscheme gruvbox8
|
||||
" }}}
|
||||
|
||||
" Search parameters {{{
|
||||
|
|
|
|||
84
home/vim/lua/ambroisie/lsp.lua
Normal file
84
home/vim/lua/ambroisie/lsp.lua
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
local M = {}
|
||||
|
||||
-- shared LSP configuration callback
|
||||
-- @param client native client configuration
|
||||
-- @param bufnr int? buffer number of the attched client
|
||||
M.on_attach = function(client, bufnr)
|
||||
-- Diagnostics
|
||||
vim.diagnostic.config({
|
||||
-- Disable virtual test next to affected regions
|
||||
virtual_text = false,
|
||||
-- Show diagnostics signs
|
||||
signs = true,
|
||||
-- Underline offending regions
|
||||
underline = true,
|
||||
-- Do not bother me in the middle of insertion
|
||||
update_in_insert = false,
|
||||
-- Show highest severity first
|
||||
severity_sort = true,
|
||||
})
|
||||
|
||||
vim.cmd([[
|
||||
augroup DiagnosticsHover
|
||||
autocmd! * <buffer>
|
||||
" Show diagnostics on "hover"
|
||||
autocmd CursorHold,CursorHoldI <buffer> lua vim.diagnostic.open_float(nil, {focus=false, scope="cursor"})
|
||||
augroup END
|
||||
]])
|
||||
|
||||
-- Format on save
|
||||
if client.resolved_capabilities.document_formatting then
|
||||
vim.cmd([[
|
||||
augroup LspFormatting
|
||||
autocmd! * <buffer>
|
||||
autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()
|
||||
augroup END
|
||||
]])
|
||||
end
|
||||
|
||||
-- Mappings
|
||||
local wk = require("which-key")
|
||||
|
||||
local function list_workspace_folders()
|
||||
local utils = require("ambroisie.utils")
|
||||
utils.dump(vim.lsp.buf.list_workspace_folders())
|
||||
end
|
||||
|
||||
local function show_line_diagnostics()
|
||||
vim.diagnostic.open_float(nil, { scope="line" })
|
||||
end
|
||||
|
||||
local function show_buffer_diagnostics()
|
||||
vim.diagnostic.open_float(nil, { scope="buffer" })
|
||||
end
|
||||
|
||||
local keys = {
|
||||
K = { vim.lsp.buf.hover, "Show symbol information" },
|
||||
["<C-k>"] = { vim.lsp.buf.signature_help, "Show signature information" },
|
||||
["gd"] = { vim.lsp.buf.definition, "Go to definition" },
|
||||
["gD"] = { vim.lsp.buf.declaration, "Go to declaration" },
|
||||
["gi"] = { vim.lsp.buf.implementation, "Go to implementation" },
|
||||
["gr"] = { vim.lsp.buf.references, "List all references" },
|
||||
|
||||
["<leader>c"] = {
|
||||
name = "Code",
|
||||
a = { vim.lsp.buf.code_action, "Code actions" },
|
||||
d = { show_line_diagnostics, "Show line diagnostics" },
|
||||
D = { show_buffer_diagnostics, "Show buffer diagnostics" },
|
||||
r = { vim.lsp.buf.rename, "Rename symbol" },
|
||||
s = { vim.lsp.buf.signature_help, "Show signature" },
|
||||
t = { vim.lsp.buf.type_definition, "Go to type definition" },
|
||||
w = {
|
||||
name = "Workspace",
|
||||
a = { vim.lsp.buf.add_workspace_folder, "Add folder to workspace" },
|
||||
l = { list_workspace_folders, "List folders in workspace" },
|
||||
r = { vim.lsp.buf.remove_workspace_folder, "Remove folder from workspace" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
wk.register(keys, { buffer = bufnr })
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
37
home/vim/lua/ambroisie/utils.lua
Normal file
37
home/vim/lua/ambroisie/utils.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
local M = {}
|
||||
|
||||
-- pretty print lua object
|
||||
-- @param obj any object to pretty print
|
||||
M.dump = function(obj)
|
||||
print(vim.inspect(obj))
|
||||
end
|
||||
|
||||
--- checks if a given command is executable
|
||||
---@param cmd string? command to check
|
||||
---@return boolean executable
|
||||
M.is_executable = function(cmd)
|
||||
return cmd and vim.fn.executable(cmd) == 1
|
||||
end
|
||||
|
||||
--- return a function that checks if a given command is executable
|
||||
---@param cmd string? command to check
|
||||
---@return fun(cmd: string): boolean executable
|
||||
M.is_executable_condition = function(cmd)
|
||||
return function() return M.is_executable(cmd) end
|
||||
end
|
||||
|
||||
-- list all active LSP clients for current buffer
|
||||
-- @param bufnr int? buffer number
|
||||
-- @return table all active LSP client names
|
||||
M.list_lsp_clients = function(bufnr)
|
||||
local clients = vim.lsp.buf_get_clients(bufnr)
|
||||
local names = {}
|
||||
|
||||
for _, client in ipairs(clients) do
|
||||
table.insert(names, client.name)
|
||||
end
|
||||
|
||||
return names
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
" Map leader to space (needs the noremap trick to avoid moving the cursor)
|
||||
nnoremap <Space> <Nop>
|
||||
let mapleader=" "
|
||||
|
||||
" Map localleader to '!' (if I want to filter text, I use visual mode)
|
||||
let maplocalleader="!"
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
" Always display the sign column to avoid moving the buffer all the time
|
||||
let g:ale_sign_column_always=1
|
||||
|
||||
" Change the way ALE display messages
|
||||
let g:ale_echo_msg_info_str='I'
|
||||
let g:ale_echo_msg_warning_str='W'
|
||||
let g:ale_echo_msg_error_str='E'
|
||||
|
||||
" The message displayed in the command line area
|
||||
let g:ale_echo_msg_format='[%linter%][%severity%]%(code):% %s'
|
||||
|
||||
" The message displayed in the location list
|
||||
let g:ale_loclist_msg_format='[%linter%]%(code):% %s'
|
||||
|
||||
" Don't lint every time I change the buffer
|
||||
let g:ale_lint_on_text_changed=0
|
||||
" Don't lint on leaving insert mode
|
||||
let g:ale_lint_on_insert_leave=0
|
||||
" Don't lint on entering a buffer
|
||||
let g:ale_lint_on_enter=0
|
||||
" Do lint on save
|
||||
let g:ale_lint_on_save=1
|
||||
" Lint on changing the filetype
|
||||
let g:ale_lint_on_filetype_changed=1
|
||||
64
home/vim/plugin/settings/completion.vim
Normal file
64
home/vim/plugin/settings/completion.vim
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
" Show completion menu in all cases, and don't select anything
|
||||
set completeopt=menu,menuone,noselect
|
||||
|
||||
lua << EOF
|
||||
local cmp = require("cmp")
|
||||
local cmp_under_comparator = require("cmp-under-comparator")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<Tab>"] = function(fallback)
|
||||
if luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
["<S-Tab>"] = function(fallback)
|
||||
if luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
["<C-n>"] = cmp.mapping(cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), { "i", "c" }),
|
||||
["<C-p>"] = cmp.mapping(cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), { "i", "c" }),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-5),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(5),
|
||||
["<C-y>"] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = false }),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
},
|
||||
view = {
|
||||
entries = "native",
|
||||
},
|
||||
sources = {
|
||||
{ name = "path", priority_weight = 110 },
|
||||
{ name = "nvim_lsp", priority_weight = 100 },
|
||||
{ name = "nvim_lua", priority_weight = 90 },
|
||||
{ name = "luasnip", priority_weight = 80 },
|
||||
{ name = "buffer", max_item_count = 5, priority_weight = 50 },
|
||||
},
|
||||
sorting = {
|
||||
priority_weight = 100,
|
||||
comparators = {
|
||||
cmp.config.compare.offset,
|
||||
cmp.config.compare.exact,
|
||||
cmp.config.compare.score,
|
||||
cmp_under_comparator.under,
|
||||
cmp.config.compare.kind,
|
||||
cmp.config.compare.sort_text,
|
||||
cmp.config.compare.length,
|
||||
cmp.config.compare.order,
|
||||
},
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = true,
|
||||
},
|
||||
})
|
||||
EOF
|
||||
8
home/vim/plugin/settings/dressing.vim
Normal file
8
home/vim/plugin/settings/dressing.vim
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
lua << EOF
|
||||
local dressing = require("dressing")
|
||||
|
||||
dressing.setup({
|
||||
-- Use a relative prompt size
|
||||
prefer_width = 0.4,
|
||||
})
|
||||
EOF
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
" Use a floating window when availble
|
||||
if has('nvim-0.4.0') || has("patch-8.2.0191")
|
||||
let g:fzf_layout = { 'window': {
|
||||
\ 'width': 0.9,
|
||||
\ 'height': 0.7,
|
||||
\ 'highlight': 'Comment',
|
||||
\ 'rounded': v:false } }
|
||||
endif
|
||||
63
home/vim/plugin/settings/git.vim
Normal file
63
home/vim/plugin/settings/git.vim
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
lua << EOF
|
||||
local gitsigns = require('gitsigns')
|
||||
local wk = require("which-key")
|
||||
|
||||
gitsigns.setup({
|
||||
-- I dislike the full-green sign column when this happens
|
||||
attach_to_untracked = false,
|
||||
|
||||
current_line_blame_opts = {
|
||||
-- Show the blame quickly
|
||||
delay = 100,
|
||||
},
|
||||
})
|
||||
|
||||
local keys = {
|
||||
-- Navigation
|
||||
["[c"] = { "&diff ? '[c' : '<cmd>Gitsigns prev_hunk<CR>'", "Previous hunk/diff", expr = true },
|
||||
["]c"] = { "&diff ? ']c' : '<cmd>Gitsigns next_hunk<CR>'", "Next hunk/diff", expr = true },
|
||||
|
||||
|
||||
-- Commands
|
||||
["<leader>g"] = {
|
||||
name = "Git",
|
||||
-- Actions
|
||||
b = { gitsigns.toggle_current_line_blame, "Toggle blame virtual text" },
|
||||
d = { gitsigns.diffthis, "Diff buffer" },
|
||||
D = { function() gitsigns.diffthis("~") end, "Diff buffer against last commit" },
|
||||
g = { "<cmd>Git<CR>", "Git status" },
|
||||
h = { gitsigns.toggle_deleted, "Show deleted hunks" },
|
||||
L = { "<cmd>:sp<CR><C-w>T:Gllog --follow -- %:p<CR>", "Current buffer log" },
|
||||
m = { "<Plug>(git-messenger)", "Current line blame" },
|
||||
p = { gitsigns.preview_hunk, "Preview hunk" },
|
||||
r = { gitsigns.reset_hunk, "Restore hunk" },
|
||||
R = { gitsigns.reset_buffer, "Restore buffer" },
|
||||
s = { gitsigns.stage_hunk, "Stage hunk" },
|
||||
S = { gitsigns.stage_buffer, "Stage buffer" },
|
||||
u = { gitsigns.undo_stage_hunk, "Undo stage hunk" },
|
||||
["["] = { gitsigns.prev_hunk, "Previous hunk" },
|
||||
["]"] = { gitsigns.next_hunk, "Next hunk" },
|
||||
},
|
||||
}
|
||||
|
||||
local objects = {
|
||||
["ih"] = { gitsigns.select_hunk, "Git hunk" },
|
||||
}
|
||||
|
||||
local visual = {
|
||||
["ih"] = { gitsigns.select_hunk, "Git hunk" },
|
||||
|
||||
-- Only the actual command can make use of the visual selection...
|
||||
["<leader>g"] = {
|
||||
name = "Git",
|
||||
p = { ":Gitsigns preview_hunk<CR>", "Preview selection" },
|
||||
r = { ":Gitsigns reset_hunk<CR>", "Restore selection" },
|
||||
s = { ":Gitsigns stage_hunk<CR>", "Stage selection" },
|
||||
u = { ":Gitsigns undo_stage_hunk<CR>", "Undo stage selection" },
|
||||
},
|
||||
}
|
||||
|
||||
wk.register(keys, { buffer = bufnr })
|
||||
wk.register(objects, { buffer = bufnr, mode = "o" })
|
||||
wk.register(visual, { buffer = bufnr, mode = "x" })
|
||||
EOF
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
" Use the high-contrast theme
|
||||
let g:gruvbox_contrast_dark='hard'
|
||||
|
||||
" Enable italics because urxvt supports them
|
||||
let g:gruvbox_italic=1
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
" Initialise light-line setting structure
|
||||
let g:lightline={}
|
||||
|
||||
" Use the wombat colorscheme
|
||||
let g:lightline.colorscheme='onedark'
|
||||
|
||||
" Status-line for active buffer
|
||||
let g:lightline.active={
|
||||
\ 'left': [
|
||||
\ [ 'mode', 'paste' ],
|
||||
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ],
|
||||
\ [ 'spell' ],
|
||||
\ ],
|
||||
\ 'right': [
|
||||
\ [ 'lineinfo' ],
|
||||
\ [ 'percent' ],
|
||||
\ [ 'fileformat', 'fileencoding', 'filetype' ],
|
||||
\ [ 'linter_check', 'linter_errors', 'linter_warn', 'linter_ok' ],
|
||||
\ [ 'ctags_status' ],
|
||||
\ ]
|
||||
\ }
|
||||
|
||||
" Status-line for inactive buffer
|
||||
let g:lightline.inactive={
|
||||
\ 'left': [
|
||||
\ [ 'filename' ],
|
||||
\ ],
|
||||
\ 'right': [
|
||||
\ [ 'lineinfo' ],
|
||||
\ [ 'percent' ],
|
||||
\ ],
|
||||
\ }
|
||||
|
||||
" Which component should be written using which function
|
||||
let g:lightline.component_function={
|
||||
\ 'readonly': 'LightlineReadonly',
|
||||
\ 'modified': 'LightlineModified',
|
||||
\ 'gitbranch': 'LightlineFugitive',
|
||||
\ }
|
||||
|
||||
" Which component can be expanded by using which function
|
||||
let g:lightline.component_expand={
|
||||
\ 'linter_check': 'lightline#ale#checking',
|
||||
\ 'linter_warn': 'lightline#ale#warnings',
|
||||
\ 'linter_errors': 'lightline#ale#errors',
|
||||
\ 'linter_ok': 'lightline#ale#ok',
|
||||
\ }
|
||||
|
||||
" How to color custom components
|
||||
let g:lightline.component_type={
|
||||
\ 'readonly': 'error',
|
||||
\ 'linter_checking': 'left',
|
||||
\ 'linter_warn': 'warning',
|
||||
\ 'linter_errors': 'error',
|
||||
\ 'linter_ok': 'left',
|
||||
\ }
|
||||
|
||||
" Show pretty icons instead of text for linting status
|
||||
let g:lightline#ale#indicator_checking='⏳'
|
||||
let g:lightline#ale#indicator_warnings='◆'
|
||||
let g:lightline#ale#indicator_errors='✗'
|
||||
let g:lightline#ale#indicator_ok='✓'
|
||||
|
||||
" Show a lock icon when editing a read-only file when it makes sense
|
||||
function! LightlineReadonly()
|
||||
return &ft!~?'help\|vimfiler\|netrw' && &readonly ? '' : ''
|
||||
endfunction
|
||||
|
||||
" Show a '+' when the buffer is modified, '-' if not, when it makes sense
|
||||
function! LightlineModified()
|
||||
return &ft=~'help\|vimfiler\|netrw' ? '' : &modified ? '+' : &modifiable ? '' : '-'
|
||||
endfunction
|
||||
|
||||
" Show branch name with nice icon in status line, when it makes sense
|
||||
function! LightlineFugitive()
|
||||
if &ft!~?'help\|vimfiler\|netrw' && exists('*fugitive#head')
|
||||
let branch=fugitive#head()
|
||||
return branch!=#'' ? ' '.branch : ''
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
41
home/vim/plugin/settings/lspconfig.vim
Normal file
41
home/vim/plugin/settings/lspconfig.vim
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
lua << EOF
|
||||
local lspconfig = require("lspconfig")
|
||||
local lsp = require("ambroisie.lsp")
|
||||
local utils = require("ambroisie.utils")
|
||||
|
||||
-- Inform servers we are able to do completion, snippets, etc...
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
|
||||
|
||||
-- C/C++
|
||||
if utils.is_executable("clangd") then
|
||||
lspconfig.clangd.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = lsp.on_attach,
|
||||
})
|
||||
end
|
||||
|
||||
-- Nix
|
||||
if utils.is_executable("rnix-lsp") then
|
||||
lspconfig.rnix.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = lsp.on_attach,
|
||||
})
|
||||
end
|
||||
|
||||
-- Python
|
||||
if utils.is_executable("pyright") then
|
||||
lspconfig.pyright.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = lsp.on_attach,
|
||||
})
|
||||
end
|
||||
|
||||
-- Rust
|
||||
if utils.is_executable("rust-analyzer") then
|
||||
lspconfig.rust_analyzer.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = lsp.on_attach,
|
||||
})
|
||||
end
|
||||
EOF
|
||||
63
home/vim/plugin/settings/lualine.vim
Normal file
63
home/vim/plugin/settings/lualine.vim
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
lua << EOF
|
||||
local lualine = require("lualine")
|
||||
local utils = require("ambroisie.utils")
|
||||
|
||||
local function list_spell_languages()
|
||||
if not vim.opt.spell:get() then
|
||||
return ""
|
||||
end
|
||||
|
||||
return table.concat(vim.opt.spelllang:get(), ", ")
|
||||
end
|
||||
|
||||
local function list_lsp_clients()
|
||||
local client_names = utils.list_lsp_clients()
|
||||
|
||||
if #client_names == 0 then
|
||||
return ""
|
||||
end
|
||||
|
||||
return "[ " .. table.concat(client_names, " ") .. " ]"
|
||||
end
|
||||
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
section_separators = "",
|
||||
component_separators = "|",
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {
|
||||
{ "mode" },
|
||||
},
|
||||
lualine_b = {
|
||||
{ "FugitiveHead" },
|
||||
{ "filename", symbols = { readonly = "🔒" } },
|
||||
},
|
||||
lualine_c = {
|
||||
{ list_spell_languages },
|
||||
{ "lsp_progress" },
|
||||
},
|
||||
lualine_x = {
|
||||
{ list_lsp_clients },
|
||||
{
|
||||
"diagnostics",
|
||||
-- Only use the diagnostics API
|
||||
sources = { "nvim_diagnostic" },
|
||||
},
|
||||
},
|
||||
lualine_y = {
|
||||
{ "fileformat" },
|
||||
{ "encoding" },
|
||||
{ "filetype" },
|
||||
},
|
||||
lualine_z = {
|
||||
"location",
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
"fugitive",
|
||||
"quickfix",
|
||||
},
|
||||
})
|
||||
EOF
|
||||
3
home/vim/plugin/settings/luasnip.vim
Normal file
3
home/vim/plugin/settings/luasnip.vim
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
lua << EOF
|
||||
require("luasnip.loaders.from_vscode").load()
|
||||
EOF
|
||||
125
home/vim/plugin/settings/null-ls.vim
Normal file
125
home/vim/plugin/settings/null-ls.vim
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
lua << EOF
|
||||
local null_ls = require("null-ls")
|
||||
local lsp = require("ambroisie.lsp")
|
||||
local utils = require("ambroisie.utils")
|
||||
|
||||
null_ls.setup({
|
||||
on_attach = lsp.on_attach,
|
||||
})
|
||||
|
||||
-- C, C++
|
||||
null_ls.register({
|
||||
null_ls.builtins.formatting.clang_format.with({
|
||||
-- Only used if available, but prefer clangd formatting if available
|
||||
condition = function()
|
||||
return utils.is_executable("clang-format") and not utils.is_executable("clangd")
|
||||
end,
|
||||
}),
|
||||
})
|
||||
|
||||
-- Haskell
|
||||
null_ls.register({
|
||||
null_ls.builtins.formatting.brittany.with({
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("brittany"),
|
||||
}),
|
||||
})
|
||||
|
||||
-- Nix
|
||||
null_ls.register({
|
||||
null_ls.builtins.formatting.nixpkgs_fmt.with({
|
||||
-- Only used if available, but prefer rnix if available
|
||||
condition = function()
|
||||
return utils.is_executable("nixpkgs-fmt") and not utils.is_executable("rnix-lsp")
|
||||
end,
|
||||
}),
|
||||
})
|
||||
|
||||
-- Python
|
||||
null_ls.register({
|
||||
null_ls.builtins.diagnostics.flake8.with({
|
||||
-- Only used if available, but prefer pflake8 if available
|
||||
condition = function()
|
||||
return utils.is_executable("flake8") and not utils.is_executable("pflake8")
|
||||
end,
|
||||
}),
|
||||
null_ls.builtins.diagnostics.pyproject_flake8.with({
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("pflake8"),
|
||||
}),
|
||||
null_ls.builtins.diagnostics.mypy.with({
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("mypy"),
|
||||
}),
|
||||
null_ls.builtins.diagnostics.pylint.with({
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("pylint"),
|
||||
}),
|
||||
null_ls.builtins.formatting.black.with({
|
||||
extra_args = { "--fast" },
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("black"),
|
||||
}),
|
||||
null_ls.builtins.formatting.isort.with({
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("isort"),
|
||||
}),
|
||||
})
|
||||
|
||||
|
||||
-- Shell (non-POSIX)
|
||||
null_ls.register({
|
||||
null_ls.builtins.code_actions.shellcheck.with({
|
||||
-- Restrict to bash and zsh
|
||||
filetypes = { "bash", "zsh" },
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("shellcheck"),
|
||||
}),
|
||||
null_ls.builtins.diagnostics.shellcheck.with({
|
||||
-- Show error code in message
|
||||
diagnostics_format = "[#{c}] #{m}",
|
||||
-- Require explicit empty string test, use bash dialect
|
||||
extra_args = { "-s", "bash", "-o", "avoid-nullary-conditions" },
|
||||
-- Restrict to bash and zsh
|
||||
filetypes = { "bash", "zsh" },
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("shellcheck"),
|
||||
}),
|
||||
null_ls.builtins.formatting.shfmt.with({
|
||||
-- Indent with 4 spaces, simplify the code, indent switch cases,
|
||||
-- add space after redirection, use bash dialect
|
||||
extra_args = { "-i", "4", "-s", "-ci", "-sr", "-ln", "bash" },
|
||||
-- Restrict to bash and zsh
|
||||
filetypes = { "bash", "zsh" },
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("shfmt"),
|
||||
}),
|
||||
})
|
||||
|
||||
-- Shell (POSIX)
|
||||
null_ls.register({
|
||||
null_ls.builtins.code_actions.shellcheck.with({
|
||||
-- Restrict to POSIX sh
|
||||
filetypes = { "sh" },
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("shellcheck"),
|
||||
}),
|
||||
null_ls.builtins.diagnostics.shellcheck.with({
|
||||
-- Show error code in message
|
||||
diagnostics_format = "[#{c}] #{m}",
|
||||
-- Require explicit empty string test
|
||||
extra_args = { "-o", "avoid-nullary-conditions" },
|
||||
-- Restrict to POSIX sh
|
||||
filetypes = { "sh" },
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("shellcheck"),
|
||||
}),
|
||||
null_ls.builtins.formatting.shfmt.with({
|
||||
-- Indent with 4 spaces, simplify the code, indent switch cases,
|
||||
-- add space after redirection, use POSIX
|
||||
extra_args = { "-i", "4", "-s", "-ci", "-sr", "-ln", "posix" },
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("shfmt"),
|
||||
}),
|
||||
})
|
||||
EOF
|
||||
5
home/vim/plugin/settings/surround.vim
Normal file
5
home/vim/plugin/settings/surround.vim
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
lua << EOF
|
||||
require("nvim-surround").setup({
|
||||
-- No configuration at the moment
|
||||
})
|
||||
EOF
|
||||
26
home/vim/plugin/settings/telescope.vim
Normal file
26
home/vim/plugin/settings/telescope.vim
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
lua << EOF
|
||||
local telescope = require("telescope")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-h>"] = "which_key",
|
||||
-- I want the normal readline mappings rather than scrolling
|
||||
["<C-u>"] = false,
|
||||
}
|
||||
}
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true,
|
||||
override_generic_sorter = true,
|
||||
override_file_sorter = true,
|
||||
case_mode = "smart_case",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
telescope.load_extension("fzf")
|
||||
telescope.load_extension("lsp_handlers")
|
||||
EOF
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue