Compare commits
746 commits
Author | SHA1 | Date | |
---|---|---|---|
28b5e266e1 | |||
b2671bb298 | |||
f8914b61d5 | |||
6834946774 | |||
aaae9a96e2 | |||
8a97a7a669 | |||
12488bd45e | |||
46e362f6c1 | |||
10bee5c017 | |||
edba50dfed | |||
bed7e26924 | |||
07c9950cb8 | |||
7df555a756 | |||
bc197b4cfd | |||
b445b56e8e | |||
6b5cd07c86 | |||
f43c468799 | |||
9fe5aadc2c | |||
9a9c4d8235 | |||
35c527c421 | |||
51d99e7e9f | |||
d2d674f5c9 | |||
b7482c6871 | |||
1cfe62e4a7 | |||
604e19a794 | |||
78fcbbf4d7 | |||
0b5232d97f | |||
3c861454fb | |||
5204aa90b6 | |||
9dd59c8232 | |||
6e0f806538 | |||
5b52d1d0c5 | |||
5c3f1cf54a | |||
782dc4da70 | |||
b45ffc7a10 | |||
40bf5452f3 | |||
134c4a8fd8 | |||
92d9dd8249 | |||
81344afdba | |||
5a123f274c | |||
b9685178d4 | |||
45492cb10a | |||
06a36e534d | |||
0e62da006c | |||
680899a0c0 | |||
2a8c12dbcc | |||
c9691cc89a | |||
651f16a326 | |||
b9d2c624c0 | |||
a4dcceecf9 | |||
be680e5b65 | |||
b4bc4ce599 | |||
f2ea15fa7c | |||
ccad1cefd5 | |||
fb4fa6f78d | |||
c5f6190a66 | |||
afaa34df91 | |||
43c3db7f8a | |||
4982ab72e3 | |||
50c06ebd7f | |||
0baa4cadc7 | |||
5149e4aef0 | |||
7078e5b872 | |||
cce109e79d | |||
43f35b76ce | |||
4f8aea1ef4 | |||
0e38f4dd2a | |||
a49df451a2 | |||
df79b8dc4a | |||
ebfe621f4c | |||
9fdea1fd17 | |||
8c0dd0aa54 | |||
ab352eb08e | |||
d32bba279a | |||
9b24af3def | |||
d5d4a1d96c | |||
5481cdb362 | |||
08f8e07f03 | |||
76ee9ce49b | |||
78cfa9d619 | |||
e0c8f39121 | |||
46d30b8959 | |||
99b8097aa6 | |||
83e98441a7 | |||
db9ec77114 | |||
b7ce066115 | |||
7e8a92ddc7 | |||
6ff76be7e4 | |||
3a7c517435 | |||
6e4d4cfafc | |||
7373b9af7e | |||
50b5b24d0f | |||
88e55cbd3a | |||
a9b1a299cd | |||
849bb6bc9b | |||
e9f6f85251 | |||
fd4d4ffa1a | |||
25d8cf48d5 | |||
196bd09206 | |||
c11e683a6a | |||
fdc1fe0e16 | |||
787124b6fa | |||
b43ada1c2b | |||
df933bdc6f | |||
d8ed1f42ae | |||
444502d6f1 | |||
78daebdbb3 | |||
c53d4b832b | |||
724c4fdbda | |||
c520b80cee | |||
57ae703b38 | |||
f7b0b54871 | |||
f735072e34 | |||
c5b0de57c4 | |||
e32f46fa20 | |||
30cddbdc37 | |||
c7e033e1d6 | |||
48c8072611 | |||
7c057bf169 | |||
e5bde15acf | |||
da5f4d9a9c | |||
13ad12efda | |||
f577a0bc73 | |||
bedc9dd741 | |||
1f9860f39f | |||
8278796bb1 | |||
ffdbc3891d | |||
5ad3a220a7 | |||
06427b694c | |||
66c0f17e46 | |||
c8bf3ae618 | |||
8afad6f40c | |||
0cfb985723 | |||
303ca8c871 | |||
e8dd91e345 | |||
2b4b1c5850 | |||
a1acf60896 | |||
2c541801e6 | |||
352d4412f2 | |||
a3997d519a | |||
64e4c9c1b2 | |||
337e587f92 | |||
1bb83efeef | |||
a7b81162d5 | |||
1bec150b17 | |||
bec787e6ff | |||
3eba3a553d | |||
9630de5237 | |||
a3fa043cb9 | |||
6624b11014 | |||
226c7993b1 | |||
ce00bd6fed | |||
556c58f0fb | |||
c007790ecf | |||
095bfdddfc | |||
e8564cbae0 | |||
9cc15d53fa | |||
a33de2c711 | |||
9e8ce71b65 | |||
1469810d2b | |||
b8ac83f1a1 | |||
f676b4d7a5 | |||
a733249377 | |||
494a9727c7 | |||
8aab4b1056 | |||
035fdc710b | |||
09b4567c92 | |||
c2e03c50ae | |||
379c26527a | |||
3b7aefac96 | |||
3df1eeecca | |||
529dcce37a | |||
fbdac308ec | |||
c92314e731 | |||
c2095697ef | |||
f247344b05 | |||
637c4e4273 | |||
c20b5d540f | |||
20eaf3acbd | |||
0ee453de49 | |||
5b80da7323 | |||
8c77376e36 | |||
8d0e080906 | |||
b72c71a272 | |||
8bb7b4cac2 | |||
262ef3bb45 | |||
2fc5333362 | |||
b7925c965e | |||
727a70d843 | |||
a7ec834c6a | |||
a633ccc36f | |||
e7ecd05161 | |||
c520512399 | |||
4c07dcacc1 | |||
9616fb1df0 | |||
3d9a29b857 | |||
11e159c7c9 | |||
003b5516fe | |||
f6eb6a72ad | |||
cf2f2ecf0a | |||
524a34d819 | |||
352e3d72a2 | |||
26f2784f0f | |||
25abed953f | |||
f8b68daf1e | |||
6ddc70bcaa | |||
67fe4216f2 | |||
0ff4336088 | |||
66e96e2960 | |||
0984c7aef0 | |||
efe20354ea | |||
bbd09488ff | |||
379adc7ec6 | |||
639aad8c8a | |||
da602beac6 | |||
a1a5aea93d | |||
98c46632a6 | |||
e2c3b08fc7 | |||
72a49c2f28 | |||
6f1b5bb86d | |||
6c1120b992 | |||
c297aff739 | |||
d68b988bbe | |||
39eef52762 | |||
e7067bef8c | |||
a84ea621bc | |||
61ab5f0f58 | |||
abd60eceef | |||
2ea8ff3ccc | |||
de02a81c92 | |||
6dfef5d07b | |||
6c85391b37 | |||
26a5d991c5 | |||
2ad87cfe68 | |||
e40ed7ce05 | |||
d10f49780d | |||
e6bbf8acab | |||
32f412e195 | |||
f1169c4b2b | |||
befae3aad3 | |||
662ccffa98 | |||
411be6cac0 | |||
2c7730d609 | |||
7af174dd08 | |||
14f39df41a | |||
63ca02f6dc | |||
0fe9222e42 | |||
6f643a1858 | |||
1952460606 | |||
5337459609 | |||
85b37c83cf | |||
f838affdb0 | |||
e7ac232b50 | |||
1b09e32625 | |||
20b836dd9d | |||
1f793e5296 | |||
ecd5caf514 | |||
2a14742b5a | |||
078f29bcbe | |||
53f119285e | |||
e7b4d34399 | |||
7c1b5afc31 | |||
46823d62e5 | |||
e356a7ccba | |||
ab03e929d4 | |||
63047aec55 | |||
2c801461fd | |||
2563ecbfed | |||
3b73fe8ca4 | |||
12e6f87d1b | |||
594078f84f | |||
dbabc70e2f | |||
afa7d0a5b6 | |||
a6f5f6baa7 | |||
dc5e526698 | |||
624229a035 | |||
5a20df95ba | |||
8f09dd06b0 | |||
0009ed8b19 | |||
c23487b544 | |||
af7eaf7c57 | |||
2ef8592e54 | |||
37dc6efd14 | |||
8e9da1df88 | |||
d2059a2845 | |||
48be7c8395 | |||
cec692bffc | |||
b157935e93 | |||
a33bc7e455 | |||
c11035d929 | |||
f178ef477c | |||
53df50c8d6 | |||
11948b8e2e | |||
69688a053e | |||
14cd9f8006 | |||
fdcead0d7b | |||
4361355794 | |||
58afc27d85 | |||
1b755432cc | |||
d87fe696e3 | |||
93e4d760ff | |||
1bbed3bfd6 | |||
c56659cc56 | |||
5273a5e9ff | |||
c1c0a2cf26 | |||
53ae7cd68d | |||
b34ec46b56 | |||
bea284a645 | |||
f655e43ec7 | |||
94966a089e | |||
474e76ba18 | |||
462a0b8593 | |||
803e78147a | |||
57cbceb82b | |||
172a97176d | |||
7fbe64b448 | |||
9564cbc740 | |||
f4f9ed92e8 | |||
a0d378a0e6 | |||
481e5909c9 | |||
4a4a092940 | |||
93117c886b | |||
3c4e5edd55 | |||
e21b0f019e | |||
78c2222162 | |||
1364e4b6e9 | |||
a0b505e226 | |||
8c140dd3db | |||
70499bc218 | |||
e6553c3370 | |||
eeda716b9b | |||
a2c6a0fe93 | |||
e6e1225858 | |||
bebdd082d2 | |||
2b34c907b7 | |||
55530d8b26 | |||
dff621fe42 | |||
cbe4b8619a | |||
cde4925ec1 | |||
696d77ca54 | |||
a6052994f0 | |||
5f4f69ae26 | |||
5dfbcbebd3 | |||
cc44a2e793 | |||
8fb3ea82b7 | |||
2c6484f66a | |||
8bb731e21c | |||
3b685c6d40 | |||
fc7a7355ea | |||
27b94ccb51 | |||
14fabcbe20 | |||
14bf7cbb24 | |||
464997aa5d | |||
2b86faa7fe | |||
011d57c17d | |||
bb015fc244 | |||
3361c316b9 | |||
3a4d389201 | |||
098817dd79 | |||
6469c70d3b | |||
98f36353f4 | |||
a8c0774435 | |||
5c15f1f338 | |||
52c3f11b41 | |||
ed9ae0bd07 | |||
93173c3445 | |||
ed9d331f8d | |||
9ffbf37ca6 | |||
e41fb2b1ea | |||
c8894d90d9 | |||
d150f994ec | |||
b9b14effff | |||
8ebd884eb4 | |||
985c365ed4 | |||
a783f6c146 | |||
f87fbad500 | |||
7efd72ded7 | |||
9f4edbe16d | |||
41b16a7173 | |||
c5a473c557 | |||
ada6443dd5 | |||
5badc90690 | |||
da2842e247 | |||
688bf7bd41 | |||
deb34a3383 | |||
498caa4578 | |||
c9787b39f8 | |||
2b95f07c46 | |||
aad7afd5e5 | |||
4c0760495f | |||
ca023db81f | |||
69c8c4777b | |||
091a9e2485 | |||
12149bb2f6 | |||
afe1bb4809 | |||
1286e23914 | |||
f0973aa3cf | |||
5ef9bfb602 | |||
dd1cf0685a | |||
400b6cc066 | |||
6888a2f3e1 | |||
f7949285f2 | |||
453a635538 | |||
998fccd132 | |||
6156b6db72 | |||
a86c25c85b | |||
ed675db195 | |||
18c2274529 | |||
cfdcc4ae48 | |||
977b6940cf | |||
a236f88d02 | |||
7c588680e3 | |||
b138325f45 | |||
bda77522db | |||
f3072c8214 | |||
f386180bb7 | |||
6b1654ea47 | |||
ed7f780338 | |||
6a379b4f82 | |||
39e94c820f | |||
0225aa2010 | |||
d3996bb9e2 | |||
8226b5bc00 | |||
91e9d48c82 | |||
867cacfe49 | |||
7630d503b6 | |||
0d49f191cf | |||
e42c330c06 | |||
fc54c447a8 | |||
3607c2ffb6 | |||
2784badab9 | |||
cfaa3e4c12 | |||
3a3406c796 | |||
bdddcdfcf9 | |||
2daa90de72 | |||
c0f72cd01e | |||
038badd1a9 | |||
98551750da | |||
1c0e1e04dc | |||
98b0ebdd51 | |||
f35bb3e43c | |||
d50255b748 | |||
ccc3d17747 | |||
1c6e73bc33 | |||
143c2f2508 | |||
b489673f31 | |||
f1ed65d50c | |||
e1145f734c | |||
4170c92d44 | |||
213f531f7c | |||
9c17acb9fd | |||
e8f498c5e9 | |||
06c57aa29f | |||
7f6894bf39 | |||
9fba494811 | |||
5eb3516f18 | |||
9390153ffc | |||
d571fabd4f | |||
59bb4a9fb7 | |||
aa27b55609 | |||
c6fdb6838a | |||
74635d6ef2 | |||
0dc4c8151c | |||
92cd2922b2 | |||
f514f5addc | |||
57f9e3deba | |||
1b3e043e42 | |||
a01dc19b5f | |||
4104af7f5e | |||
afb5e5aa93 | |||
14949fb6d6 | |||
ed5f8840b7 | |||
d2a5c90021 | |||
e209716a07 | |||
fafd242e46 | |||
701be10014 | |||
8c4a196883 | |||
580f59f820 | |||
6e245ac69d | |||
4665d93a1a | |||
a7dda92091 | |||
409f228586 | |||
57110ddd81 | |||
85efa83e66 | |||
7762e62809 | |||
85fa907283 | |||
5632cf75f5 | |||
93f60a925e | |||
a44fc2764e | |||
06a7949edb | |||
bde0ce2e51 | |||
a602cc8ad2 | |||
f8ae2b7664 | |||
0f33a266bd | |||
884bc9f277 | |||
6c82be899e | |||
8865494eef | |||
e75d54bcdd | |||
ca3d080775 | |||
3d15c98a38 | |||
9185ce668c | |||
1d192f702c | |||
0c51d44c08 | |||
a1ae78113a | |||
d3a881b597 | |||
d035874f27 | |||
40abda7ae9 | |||
ed94ea8c2a | |||
65eb9d2175 | |||
f09bd37695 | |||
b0e1def9dc | |||
006535e93e | |||
f55594b02c | |||
7442479948 | |||
5dc4873036 | |||
b2f8891ebe | |||
fd4757d697 | |||
f78e1d5e7d | |||
86de1944fe | |||
f692217356 | |||
6a13c7421a | |||
054cbfc93d | |||
44b0b89f64 | |||
0711b7cbb1 | |||
e7167055b2 | |||
ac31bfe22d | |||
7ee7c88315 | |||
39090f4d45 | |||
2219adcd53 | |||
a60f780361 | |||
4a1859a1f7 | |||
a5bff82fb2 | |||
8a24e59c78 | |||
f2c0b533cf | |||
788fb87fdc | |||
65241635b2 | |||
34a538489a | |||
4c030b37f0 | |||
c2a246295b | |||
d9fbabff3c | |||
e22369983f | |||
88f7482f22 | |||
69de429142 | |||
aa520ec9b1 | |||
b77283f7ba | |||
de5089e614 | |||
4da7f66fa5 | |||
b34723fc80 | |||
2c783aaa7f | |||
f9c274f61a | |||
014ed7f199 | |||
e702bc16d5 | |||
c6e835d726 | |||
3135d7b4ab | |||
06887379d4 | |||
1f2cb8746c | |||
49ea63c786 | |||
3d80d8aef9 | |||
17f628832d | |||
c15642693e | |||
0ac2434ed9 | |||
a2f727f848 | |||
b266417c69 | |||
97540d460a | |||
0ed6bd5c28 | |||
0803ac1277 | |||
add9976272 | |||
e9a25dad20 | |||
1712d88695 | |||
04dc5a5094 | |||
a225e6d55d | |||
69b372d036 | |||
cf89dc9e8b | |||
a8accc6b71 | |||
ce1a01c5d1 | |||
decb9e46df | |||
d7ce3ec0a7 | |||
2bec61cc0c | |||
c77c4d5c79 | |||
474b59ebe3 | |||
66a3b0394b | |||
d0a1f1ade9 | |||
473da6e976 | |||
f27a46d2e9 | |||
54d91634cb | |||
f17a54ca68 | |||
576f09d4e0 | |||
6791f73744 | |||
fd8055f1ab | |||
768dca4c83 | |||
2841de2e3d | |||
c276247f21 | |||
586fd9524b | |||
34db815986 | |||
3b134dc131 | |||
593530c21f | |||
48932dc77e | |||
544b53a7ba | |||
58a425fe27 | |||
c3bf12b896 | |||
e27cd1b85d | |||
7ca48ea2fc | |||
1db1d422c5 | |||
0925b57461 | |||
f48badb047 | |||
739c256785 | |||
b06f24fcb7 | |||
4ae49a53c8 | |||
4239e603ad | |||
fe5931ff4e | |||
91a71561e4 | |||
b7027a4ab1 | |||
000ef1fb2c | |||
9b228e61bc | |||
f44d8ab87d | |||
8a9a3ea0cb | |||
d2e880c76e | |||
834e4c77ec | |||
f7baafbc1e | |||
6e4ef9602e | |||
a96bf2ad36 | |||
74032212ae | |||
315059c5d8 | |||
5d0d010ae6 | |||
deaad9e095 | |||
666182e699 | |||
b5b091a324 | |||
1328226299 | |||
b4ad6f6710 | |||
e2a57a71cc | |||
eb9bcceed0 | |||
0e450a7a7d | |||
bcbcacfab8 | |||
3e8ba3e2d7 | |||
0071a3c7bc | |||
9bd4f65fe5 | |||
a665227a69 | |||
5ed4178245 | |||
cdb3b7c5bf | |||
ccd91af1bd | |||
729327c671 | |||
9804db0df0 | |||
2ead8292da | |||
36e9f9c51e | |||
e700880c9f | |||
17973277ae | |||
c12d5e74b3 | |||
6760c5ba9e | |||
1675f40ec3 | |||
ceace24dae | |||
1c23d43137 | |||
dd9e35b240 | |||
dab54a00bd | |||
cd26723a0c | |||
e661c7df71 | |||
6b9878ae4c | |||
3504ffef09 | |||
63eb8f543a | |||
638c9c66dc | |||
5940b2b08e | |||
e887cf9556 | |||
9b32c0ae1f | |||
8a1500ad8d | |||
1dcfed1313 | |||
b28e9a9b80 | |||
c6be703e8b | |||
84529916c7 | |||
e581c4533e | |||
f141a0ee04 | |||
46cc02538f | |||
30c300f3b7 | |||
b4d101349a | |||
4185d3a230 | |||
6dd14d78c1 | |||
08f3939bf8 | |||
f3524267b8 | |||
bd9d9a56f3 | |||
76ba885da8 | |||
c3bc8fc684 | |||
97b5ae6a5e | |||
de0e62fd88 | |||
a2a871d549 | |||
c4d2982944 | |||
30ae0e0969 | |||
c5b6f2b62b | |||
4251eedde5 | |||
1106e2d08c | |||
c56ba89284 | |||
6d9c53bae2 | |||
e685cd5624 | |||
5b73c62d2d | |||
5a0d5b01b1 | |||
840e93de8a | |||
e8ddf4607a | |||
df05866ff5 | |||
4ce3f4efa8 | |||
9448da57f5 | |||
c4bd15f7bb | |||
8a2e78dfba | |||
987059222d | |||
90b16952a0 | |||
83f24eb562 | |||
c68885643d | |||
0de2f0c90e | |||
2ca199eaa9 | |||
4ba81018a0 | |||
698b534592 | |||
67be7fb446 | |||
4a893acaee | |||
4269f2a1de | |||
fa9478a427 | |||
28de029076 | |||
537a4de532 | |||
ffca372e29 | |||
bce7da7e64 | |||
0a2987b31f | |||
88449a48c2 | |||
60b8d36a03 | |||
4e3e8f8c0d | |||
186dc37971 | |||
d1449fa5cc | |||
762f7689f6 | |||
399d52f850 | |||
6338112a9d | |||
4fe7ad524d | |||
8c98bdc15f | |||
7b40f8745a | |||
1b9bf47194 | |||
bfd2395d12 | |||
507c4e53d0 | |||
a758ff909f | |||
1ba3c9475c | |||
6c32cf3b5e | |||
a2070deda9 | |||
762c642959 | |||
70b67e1c36 | |||
cd6d44121d | |||
4ad872e626 | |||
479a2283a2 | |||
69713dfa48 | |||
75d10e2b7e | |||
bd542366f5 | |||
48ad18ab16 | |||
d702e2cb24 | |||
a79d4f2426 | |||
8f431a09b0 |
201 changed files with 16738 additions and 4041 deletions
2
.envrc
Normal file
2
.envrc
Normal file
|
@ -0,0 +1,2 @@
|
|||
nix_direnv_manual_reload
|
||||
use flake
|
37
.forgejo/workflows/nix-build.yaml
Normal file
37
.forgejo/workflows/nix-build.yaml
Normal file
|
@ -0,0 +1,37 @@
|
|||
on: [push]
|
||||
jobs:
|
||||
check:
|
||||
runs-on: nixos-host
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# cache not needed since we now run on the host directly
|
||||
# - name: Load cached nix store
|
||||
# id: cache-nix-store
|
||||
# uses: actions/cache/restore@v4
|
||||
# with:
|
||||
# path: /nix/store
|
||||
# key: ${{ runner.os }}-nix-store
|
||||
|
||||
- name: Build server
|
||||
run: |
|
||||
nix shell nixpkgs#nixos-rebuild -c nixos-rebuild build --flake .#beefcake
|
||||
|
||||
- name: Build router
|
||||
run: |
|
||||
nix shell nixpkgs#nixos-rebuild -c nixos-rebuild build --flake .#router
|
||||
|
||||
- name: Build desktop
|
||||
run: |
|
||||
nix shell nixpkgs#nixos-rebuild -c nixos-rebuild build --flake .#dragon
|
||||
|
||||
- name: Build laptop
|
||||
run: |
|
||||
nix shell nixpkgs#nixos-rebuild -c nixos-rebuild build --flake .#foxtrot
|
||||
|
||||
# - name: Save nix store
|
||||
# uses: actions/cache/save@v4
|
||||
# with:
|
||||
# path: /nix/store
|
||||
# key: ${{ steps.cache-nix-store.outputs.cache-primary-key }}
|
25
.forgejo/workflows/nix-flake-check.yaml
Normal file
25
.forgejo/workflows/nix-flake-check.yaml
Normal file
|
@ -0,0 +1,25 @@
|
|||
on: [push]
|
||||
jobs:
|
||||
check:
|
||||
runs-on: nixos-host
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# cache not needed since we now run on the host directly
|
||||
# - name: Load cached nix store
|
||||
# id: cache-nix-store
|
||||
# uses: actions/cache/restore@v4
|
||||
# with:
|
||||
# path: /nix/store
|
||||
# key: ${{ runner.os }}-nix-store
|
||||
|
||||
- name: Check nix flake
|
||||
run: |
|
||||
nix flake check
|
||||
|
||||
# - name: Save nix store
|
||||
# uses: actions/cache/save@v4
|
||||
# with:
|
||||
# path: /nix/store
|
||||
# key: ${{ steps.cache-nix-store.outputs.cache-primary-key }}
|
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1,2 +1,7 @@
|
|||
/.direnv
|
||||
result
|
||||
|
||||
.pre-commit-config.yaml
|
||||
|
||||
*.log
|
||||
*.qcow2
|
||||
|
|
33
.sops.yaml
33
.sops.yaml
|
@ -1,6 +1,20 @@
|
|||
keys:
|
||||
- &daniel age1stdue5q5teskee057ced6rh9pzzr93xsy66w4sc3zu49rgxl7cjshztt45 # pass age-key | rg '# pub'
|
||||
- &sshd-at-beefcake age1k8s590x34ghz7yrjyrgzkd24j252srf0mhfy34halp4frwr065csrlt2ev # ssh beefcake "nix-shell -p ssh-to-age --run 'cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age'"
|
||||
# list any public keys here
|
||||
|
||||
# if you need the private key, refer to the readme
|
||||
# pass age-key | rg '# pub'
|
||||
- &daniel age1stdue5q5teskee057ced6rh9pzzr93xsy66w4sc3zu49rgxl7cjshztt45
|
||||
|
||||
# per-host keys can be derived from a target host's ssh keys like so:
|
||||
# ssh host "nix shell nixpkgs#ssh-to-age -c $SHELL -c 'cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age'"
|
||||
- &sshd-at-beefcake age1etv56f7kf78a55lxqtydrdd32dpmsjnxndf4u28qezxn6p7xt9esqvqdq7
|
||||
- &sshd-at-router age1zd7c3g5d20shdftq8ghqm0r92488dg4pdp4gulur7ex3zx2yq35ssxawpn
|
||||
- &sshd-at-dragon age14ewl97x5g52ajf269cmmwzrgf22m9dsr7mw7czfa356qugvf4gvq5dttfv
|
||||
- &ssh-foxtrot age1njnet9ltjuxasqv3ckn67r5natke6xgd8wlx8psf64pyc4duvurqhedw80
|
||||
|
||||
# after updating this file, you may need to update the keys for any associated files like so:
|
||||
# sops updatekeys secrets.file
|
||||
|
||||
creation_rules:
|
||||
- path_regex: secrets/[^/]+\.(ya?ml|json|env|ini)$
|
||||
key_groups:
|
||||
|
@ -11,3 +25,18 @@ creation_rules:
|
|||
- age:
|
||||
- *daniel
|
||||
- *sshd-at-beefcake
|
||||
- path_regex: secrets/router/[^/]+\.(ya?ml|json|env|ini)$
|
||||
key_groups:
|
||||
- age:
|
||||
- *daniel
|
||||
- *sshd-at-router
|
||||
- path_regex: secrets/dragon/[^/]+\.(ya?ml|json|env|ini)$
|
||||
key_groups:
|
||||
- age:
|
||||
- *daniel
|
||||
- *sshd-at-dragon
|
||||
- path_regex: secrets/foxtrot/[^/]+\.(ya?ml|json|env|ini)$
|
||||
key_groups:
|
||||
- age:
|
||||
- *daniel
|
||||
- *ssh-foxtrot
|
||||
|
|
|
@ -1,35 +1,137 @@
|
|||
{
|
||||
standard = {disks ? ["/dev/vda"], ...}: {
|
||||
{lib, ...}: let
|
||||
inherit (lib.attrsets) mapAttrs' filterAttrs;
|
||||
ESP = inputs @ {
|
||||
size ? "4G",
|
||||
label ? "ESP",
|
||||
name ? "ESP",
|
||||
}:
|
||||
{
|
||||
priority = 1;
|
||||
start = "1M";
|
||||
label = label;
|
||||
name = name;
|
||||
end = size;
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [
|
||||
"umask=0077"
|
||||
];
|
||||
};
|
||||
}
|
||||
// inputs;
|
||||
in rec {
|
||||
standardWithHibernateSwap = {
|
||||
esp ? {
|
||||
label = "ESP";
|
||||
size = "4G";
|
||||
name = "ESP";
|
||||
},
|
||||
rootfsName ? "/rootfs",
|
||||
homeName ? "/home",
|
||||
disk,
|
||||
swapSize,
|
||||
...
|
||||
}: {
|
||||
/*
|
||||
this is my standard partitioning scheme for my machines which probably want hibernation capabilities
|
||||
a UEFI-compatible boot partition
|
||||
it includes an LUKS-encrypted btrfs volume
|
||||
a swap partition big enough to dump all the machine's RAM into
|
||||
*/
|
||||
|
||||
disko.devices = {
|
||||
disk = {
|
||||
primary = {
|
||||
type = "disk";
|
||||
device = disk;
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = ESP esp;
|
||||
swap = {
|
||||
size = swapSize;
|
||||
content = {
|
||||
type = "swap";
|
||||
discardPolicy = "both";
|
||||
resumeDevice = true; # resume from hiberation from this device
|
||||
};
|
||||
};
|
||||
luks = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "luks";
|
||||
name = "crypted";
|
||||
# if you want to use the key for interactive login be sure there is no trailing newline
|
||||
# for example use `echo -n "password" > /tmp/secret.key`
|
||||
keyFile = "/tmp/secret.key"; # Interactive
|
||||
# settings.keyFile = "/tmp/password.key";
|
||||
# additionalKeyFiles = ["/tmp/additionalSecret.key"];
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = ["-f"];
|
||||
subvolumes = {
|
||||
${rootfsName} = {
|
||||
mountpoint = "/";
|
||||
mountOptions = ["compress=zstd"];
|
||||
};
|
||||
${homeName} = {
|
||||
mountpoint = "/home";
|
||||
mountOptions = ["compress=zstd"];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = ["compress=zstd" "noatime"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
foxtrot = standardWithHibernateSwap {
|
||||
disk = "nvme0n1";
|
||||
swapSize = "32G";
|
||||
rootfsName = "/nixos-rootfs";
|
||||
homeName = "/nixos-home";
|
||||
esp = {
|
||||
label = "disk-primary-ESP";
|
||||
name = "disk-primary-ESP";
|
||||
};
|
||||
};
|
||||
|
||||
standard = {
|
||||
esp ? {
|
||||
label = "ESP";
|
||||
size = "4G";
|
||||
name = "ESP";
|
||||
},
|
||||
disk,
|
||||
...
|
||||
}: {
|
||||
# this is my standard partitioning scheme for my machines: an LUKS-encrypted
|
||||
# btrfs volume
|
||||
disko.devices = {
|
||||
disk = {
|
||||
primary = {
|
||||
type = "disk";
|
||||
device = builtins.elemAt disks 0;
|
||||
device = disk;
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
label = "EFI";
|
||||
name = "ESP";
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
];
|
||||
};
|
||||
};
|
||||
ESP = ESP esp;
|
||||
luks = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "luks";
|
||||
name = "crypted";
|
||||
extraOpenArgs = ["--allow-discards"];
|
||||
# if you want to use the key for interactive login be sure there is no trailing newline
|
||||
# for example use `echo -n "password" > /tmp/secret.key`
|
||||
keyFile = "/tmp/secret.key"; # Interactive
|
||||
|
@ -41,119 +143,7 @@
|
|||
subvolumes = {
|
||||
"/root" = {
|
||||
mountpoint = "/";
|
||||
mountOptions = ["compress=zstd" "noatime"];
|
||||
};
|
||||
"/home" = {
|
||||
mountpoint = "/home";
|
||||
mountOptions = ["compress=zstd" "noatime"];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = ["compress=zstd" "noatime"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
# TODO: figure out what I can't have an optiona/default 'name' attribute here so I can DRY with "standard"
|
||||
thinker = {disks ? ["/dev/vda"], ...}: {
|
||||
disko.devices = {
|
||||
disk = {
|
||||
vdb = {
|
||||
type = "disk";
|
||||
device = builtins.elemAt disks 0;
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
label = "EFI";
|
||||
name = "ESP";
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
];
|
||||
};
|
||||
};
|
||||
luks = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "luks";
|
||||
name = "crypted";
|
||||
extraOpenArgs = ["--allow-discards"];
|
||||
# if you want to use the key for interactive login be sure there is no trailing newline
|
||||
# for example use `echo -n "password" > /tmp/secret.key`
|
||||
keyFile = "/tmp/secret.key"; # Interactive
|
||||
# settings.keyFile = "/tmp/password.key";
|
||||
# additionalKeyFiles = ["/tmp/additionalSecret.key"];
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = ["-f"];
|
||||
subvolumes = {
|
||||
"/root" = {
|
||||
mountpoint = "/";
|
||||
mountOptions = ["compress=zstd" "noatime"];
|
||||
};
|
||||
"/home" = {
|
||||
mountpoint = "/home";
|
||||
mountOptions = ["compress=zstd" "noatime"];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = ["compress=zstd" "noatime"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
unencrypted = {disks ? ["/dev/vda"], ...}: {
|
||||
disko.devices = {
|
||||
disk = {
|
||||
primary = {
|
||||
type = "disk";
|
||||
device = builtins.elemAt disks 0;
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
label = "EFI";
|
||||
name = "ESP";
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
];
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = ["-f"];
|
||||
subvolumes = {
|
||||
"/root" = {
|
||||
mountpoint = "/";
|
||||
mountOptions = [];
|
||||
mountOptions = ["compress=zstd"];
|
||||
};
|
||||
"/home" = {
|
||||
mountpoint = "/home";
|
||||
|
@ -172,4 +162,289 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
thablet = standard {
|
||||
disk = "nvme0n1";
|
||||
esp = {
|
||||
label = "EFI";
|
||||
size = "4G";
|
||||
name = "EFI";
|
||||
};
|
||||
};
|
||||
|
||||
unencrypted = {disk, ...}: {
|
||||
disko.devices = {
|
||||
disk = {
|
||||
primary = {
|
||||
type = "disk";
|
||||
device = disk;
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = ESP {size = "5G";};
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = ["-f"];
|
||||
mountpoint = "/partition-root";
|
||||
subvolumes = {
|
||||
"/rootfs" = {
|
||||
mountpoint = "/";
|
||||
mountOptions = ["compress=zstd"];
|
||||
};
|
||||
"/home" = {
|
||||
mountpoint = "/home";
|
||||
mountOptions = ["compress=zstd"];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = ["compress=zstd" "noatime"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
beefcake = let
|
||||
zpools = {
|
||||
zroot = {
|
||||
/*
|
||||
TODO: at the time of writing, disko does not support draid6
|
||||
so I'm building/managing the array manually for the time being
|
||||
the root pool is just a single disk right now
|
||||
*/
|
||||
name = "zroot";
|
||||
config = {
|
||||
type = "zpool";
|
||||
# mode = "draid6";
|
||||
rootFsOptions = {
|
||||
compression = "zstd";
|
||||
"com.sun:auto-snapshot" = "false";
|
||||
};
|
||||
mountpoint = "/";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank";
|
||||
|
||||
datasets = {
|
||||
zfs_fs = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/zfs_fs";
|
||||
options."com.sun:auto-snapshot" = "true";
|
||||
};
|
||||
zfs_unmounted_fs = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "none";
|
||||
};
|
||||
zfs_legacy_fs = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/zfs_legacy_fs";
|
||||
};
|
||||
zfs_testvolume = {
|
||||
type = "zfs_volume";
|
||||
size = "10M";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/ext4onzfs";
|
||||
};
|
||||
};
|
||||
encrypted = {
|
||||
type = "zfs_fs";
|
||||
options = {
|
||||
mountpoint = "none";
|
||||
encryption = "aes-256-gcm";
|
||||
keyformat = "passphrase";
|
||||
keylocation = "file:///tmp/secret.key";
|
||||
};
|
||||
# use this to read the key during boot
|
||||
/*
|
||||
postCreateHook = ''
|
||||
zfs set keylocation="prompt" "zroot/$name";
|
||||
'';
|
||||
*/
|
||||
};
|
||||
"encrypted/test" = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/zfs_crypted";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
zstorage = {
|
||||
/*
|
||||
PARITY_COUNT=3 NUM_DRIVES=8 HOT_SPARES=2 sudo -E zpool create -f -O mountpoint=none -O compression=on -O xattr=sa -O acltype=posixacl -o ashift=12 -O atime=off -O recordsize=64K zstorage draid{$PARITY_COUNT}:{$NUM_DRIVES}c:{$HOT_SPARES}s /dev/disk/by-id/scsi-35000039548cb637c /dev/disk/by-id/scsi-35000039548cb7c8c /dev/disk/by-id/scsi-35000039548cb85c8 /dev/disk/by-id/scsi-35000039548d9b504 /dev/disk/by-id/scsi-35000039548da2b08 /dev/disk/by-id/scsi-35000039548dad2fc /dev/disk/by-id/scsi-350000399384be921 /dev/disk/by-id/scsi-35000039548db096c
|
||||
sudo zfs create -o mountpoint=legacy zstorage/nix
|
||||
sudo zfs create -o canmount=on -o mountpoint=/storage zstorage/storage
|
||||
*/
|
||||
name = "zstorage";
|
||||
config = {};
|
||||
};
|
||||
};
|
||||
diskClass = {
|
||||
storage = {
|
||||
type = "zfs";
|
||||
pool = zpools.zroot.name;
|
||||
};
|
||||
boot = {
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
size = "1G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
zfs = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = zpools.zroot.name;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
bootDisks = {
|
||||
"/dev/sdi" = {
|
||||
name = "i";
|
||||
enable = true;
|
||||
};
|
||||
"/dev/sdj" = {
|
||||
name = "j";
|
||||
enable = true;
|
||||
}; # TODO: join current boot drive to new boot pool
|
||||
};
|
||||
storageDisks = {
|
||||
"/dev/sda" = {
|
||||
enable = true;
|
||||
name = "a";
|
||||
};
|
||||
"/dev/sdb" = {
|
||||
enable = true;
|
||||
name = "b";
|
||||
};
|
||||
"/dev/sdc" = {
|
||||
enable = true;
|
||||
name = "c";
|
||||
};
|
||||
"/dev/sdd" = {
|
||||
enable = true;
|
||||
name = "d";
|
||||
};
|
||||
|
||||
# TODO: start small
|
||||
"/dev/sde" = {
|
||||
enable = false;
|
||||
name = "e";
|
||||
};
|
||||
"/dev/sdf" = {
|
||||
enable = false;
|
||||
name = "f";
|
||||
};
|
||||
"/dev/sdg" = {
|
||||
enable = false;
|
||||
name = "g";
|
||||
};
|
||||
"/dev/sdh" = {
|
||||
enable = false;
|
||||
name = "h";
|
||||
};
|
||||
|
||||
# gap for two boot drives
|
||||
|
||||
"/dev/sdk" = {
|
||||
enable = false;
|
||||
name = "k";
|
||||
};
|
||||
"/dev/sdl" = {
|
||||
enable = false;
|
||||
name = "l";
|
||||
};
|
||||
"/dev/sdm" = {
|
||||
enable = false;
|
||||
name = "m";
|
||||
};
|
||||
"/dev/sdn" = {
|
||||
# TODO: this is my holding cell for random stuff right now
|
||||
enable = false;
|
||||
name = "n";
|
||||
};
|
||||
};
|
||||
|
||||
diskoBoot = mapAttrs' (device: {name, ...}: {
|
||||
name = "boot-${name}";
|
||||
value = {
|
||||
inherit device;
|
||||
type = "disk";
|
||||
content = diskClass.boot.content;
|
||||
};
|
||||
}) (filterAttrs (_: {enable, ...}: enable) bootDisks);
|
||||
|
||||
diskoStorage = mapAttrs' (device: {name, ...}: {
|
||||
name = "storage-${name}";
|
||||
value = {
|
||||
inherit device;
|
||||
type = "disk";
|
||||
content = diskClass.storage.content;
|
||||
};
|
||||
}) (filterAttrs (_: {enable, ...}: enable) storageDisks);
|
||||
in {
|
||||
disko.devices = {
|
||||
disk = diskoBoot // diskoStorage;
|
||||
zpool = {
|
||||
zroot = zpools.zroot.config;
|
||||
};
|
||||
};
|
||||
};
|
||||
legacy = {disks, ...}: {
|
||||
disko.devices = {
|
||||
disk = {
|
||||
primary = {
|
||||
device = builtins.elemAt disks 0;
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
label = "EFI";
|
||||
name = "ESP";
|
||||
size = "512M";
|
||||
bootable = true;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "root";
|
||||
start = "500M";
|
||||
end = "100%";
|
||||
part-type = "primary";
|
||||
bootable = true;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
1086
flake.lock
1086
flake.lock
File diff suppressed because it is too large
Load diff
897
flake.nix
897
flake.nix
|
@ -1,125 +1,844 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.05";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
home-manager.url = "github:nix-community/home-manager/master";
|
||||
helix.url = "github:helix-editor/helix/75c0a5ceb32d8a503915a93ccc1b64c8ad1cba8b";
|
||||
disko.url = "github:nix-community/disko/master";
|
||||
sops-nix.url = "github:Mic92/sops-nix";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
hardware.url = "github:nixos/nixos-hardware";
|
||||
|
||||
disko.url = "github:nix-community/disko/master";
|
||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
sops-nix.url = "github:Mic92/sops-nix";
|
||||
sops-nix.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
# sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs";
|
||||
|
||||
git-hooks.url = "github:cachix/git-hooks.nix";
|
||||
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
home-manager.url = "github:nix-community/home-manager/release-24.11";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
home-manager-unstable.url = "github:nix-community/home-manager";
|
||||
home-manager-unstable.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
|
||||
helix.url = "github:helix-editor/helix/master";
|
||||
helix.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
|
||||
hyprland.url = "github:hyprwm/Hyprland";
|
||||
nix-colors.url = "github:misterio77/nix-colors";
|
||||
hyprland.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
|
||||
api-lyte-dev.url = "git+ssh://gitea@git.lyte.dev/lytedev/api.lyte.dev.git";
|
||||
hyprgrass.url = "github:horriblename/hyprgrass";
|
||||
hyprgrass.inputs.hyprland.follows = "hyprland";
|
||||
|
||||
# TODO: ssbm.url = "github:djanatyn/ssbm-nix";
|
||||
iio-hyprland.url = "github:JeanSchoeller/iio-hyprland";
|
||||
iio-hyprland.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
# need to bump ishiiruka upstream I think
|
||||
# slippi-desktop.url = "github:project-slippi/slippi-desktop-app";
|
||||
# slippi-desktop.flake = false;
|
||||
# ssbm.inputs.slippi-desktop.follows = "slippi-desktop";
|
||||
wezterm.url = "github:wez/wezterm?dir=nix";
|
||||
wezterm.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
|
||||
slippi.url = "github:lytedev/slippi-nix";
|
||||
# slippi.url = "git+file:///home/daniel/code/open-source/slippi-nix";
|
||||
slippi.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
slippi.inputs.home-manager.follows = "home-manager-unstable";
|
||||
|
||||
jovian.url = "github:Jovian-Experiments/Jovian-NixOS/development";
|
||||
jovian.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
|
||||
ghostty.url = "github:ghostty-org/ghostty";
|
||||
ghostty.inputs.nixpkgs-unstable.follows = "nixpkgs-unstable";
|
||||
ghostty.inputs.nixpkgs-stable.follows = "nixpkgs";
|
||||
|
||||
# nnf.url = "github:thelegy/nixos-nftables-firewall?rev=71fc2b79358d0dbacde83c806a0f008ece567b7b";
|
||||
|
||||
mobile-nixos = {
|
||||
url = "github:lytedev/mobile-nixos";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
nixConfig = {
|
||||
extra-experimental-features = ["nix-command" "flakes"];
|
||||
|
||||
extra-substituters = [
|
||||
"https://cache.nixos.org/"
|
||||
"https://helix.cachix.org"
|
||||
"https://nix-community.cachix.org"
|
||||
"https://nix.h.lyte.dev"
|
||||
"https://hyprland.cachix.org"
|
||||
"https://ghostty.cachix.org"
|
||||
];
|
||||
|
||||
extra-trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"h.lyte.dev-2:te9xK/GcWPA/5aXav8+e5RHImKYMug8hIIbhHsKPN0M="
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
"ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns="
|
||||
];
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs-stable,
|
||||
nixpkgs,
|
||||
nixpkgs-unstable,
|
||||
disko,
|
||||
sops-nix,
|
||||
git-hooks,
|
||||
wezterm,
|
||||
home-manager,
|
||||
nix-colors,
|
||||
home-manager-unstable,
|
||||
helix,
|
||||
hardware,
|
||||
jovian,
|
||||
mobile-nixos,
|
||||
hyprland,
|
||||
# nnf,
|
||||
# hyprland,
|
||||
slippi,
|
||||
ghostty,
|
||||
...
|
||||
} @ inputs: let
|
||||
}: let
|
||||
inherit (self) outputs;
|
||||
inherit (outputs) nixosModules homeManagerModules overlays;
|
||||
|
||||
systems = [
|
||||
"aarch64-linux"
|
||||
# "i686-linux"
|
||||
"x86_64-linux"
|
||||
"aarch64-darwin"
|
||||
"x86_64-darwin"
|
||||
# TODO: make @ inputs unnecessary by making arguments explicit in all modules?
|
||||
systems = ["aarch64-linux" "aarch64-darwin" "x86_64-darwin" "x86_64-linux"];
|
||||
forSystems = nixpkgs.lib.genAttrs systems;
|
||||
pkgsFor = system: (import nixpkgs {inherit system;}).extend overlays.default;
|
||||
genPkgs = func: (forSystems (system: func (pkgsFor system)));
|
||||
# pkg = callee: overrides: genPkgs (pkgs: pkgs.callPackage callee overrides);
|
||||
|
||||
unstable = {
|
||||
forSystems = nixpkgs-unstable.lib.genAttrs systems;
|
||||
pkgsFor = system: (import nixpkgs-unstable {inherit system;}).extend overlays.default;
|
||||
genPkgs = func: (forSystems (system: func (pkgsFor system)));
|
||||
pkg = callee: overrides: genPkgs (pkgs: pkgs.callPackage callee overrides);
|
||||
};
|
||||
|
||||
style = {
|
||||
colors = (import ./lib/colors.nix {inherit (nixpkgs) lib;}).schemes.catppuccin-mocha-sapphire;
|
||||
|
||||
font = {
|
||||
name = "IosevkaLyteTerm";
|
||||
size = 12;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
moduleArgs = {
|
||||
# inherit style;
|
||||
inherit helix slippi hyprland hardware disko home-manager;
|
||||
inherit (outputs) nixosModules homeManagerModules diskoConfigurations overlays;
|
||||
};
|
||||
*/
|
||||
|
||||
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev";
|
||||
in {
|
||||
/*
|
||||
kind of a quirk, but package definitions are actually in the "additions"
|
||||
overlay I did this to work around some recursion problems
|
||||
TODO: https://discourse.nixos.org/t/infinite-recursion-getting-started-with-overlays/48880
|
||||
*/
|
||||
packages = genPkgs (pkgs: {inherit (pkgs) iosevkaLyteTerm iosevkaLyteTermSubset nix-base-container-image;});
|
||||
diskoConfigurations = import ./disko {inherit (nixpkgs) lib;};
|
||||
templates = import ./templates;
|
||||
formatter = genPkgs (p: p.alejandra);
|
||||
|
||||
checks = genPkgs ({system, ...}: {
|
||||
git-hooks = git-hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
alejandra.enable = true;
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
devShells = genPkgs ({
|
||||
system,
|
||||
pkgs,
|
||||
mkShell,
|
||||
...
|
||||
}: {
|
||||
default = mkShell {
|
||||
inherit (outputs.checks.${system}.git-hooks) shellHook;
|
||||
packages = with pkgs; [
|
||||
lua-language-server
|
||||
nodePackages.bash-language-server
|
||||
];
|
||||
};
|
||||
});
|
||||
|
||||
overlays = {
|
||||
# the default overlay composes all the other overlays together
|
||||
default = final: prev: {
|
||||
overlays = with overlays; [
|
||||
additions
|
||||
modifications
|
||||
unstable-packages
|
||||
];
|
||||
};
|
||||
|
||||
additions = final: prev: let
|
||||
iosevkaLyteTerm = prev.callPackage ./packages/iosevkaLyteTerm.nix {};
|
||||
in {
|
||||
inherit iosevkaLyteTerm;
|
||||
iosevkaLyteTermSubset = prev.callPackage ./packages/iosevkaLyteTermSubset.nix {
|
||||
inherit iosevkaLyteTerm;
|
||||
};
|
||||
nix-base-container-image = final.dockerTools.buildImageWithNixDb {
|
||||
name = "git.lyte.dev/lytedev/nix";
|
||||
tag = "latest";
|
||||
|
||||
copyToRoot = with final; [
|
||||
bash
|
||||
coreutils
|
||||
curl
|
||||
gawk
|
||||
gitFull
|
||||
git-lfs
|
||||
gnused
|
||||
nodejs
|
||||
wget
|
||||
sudo
|
||||
nixVersions.stable
|
||||
cacert
|
||||
gnutar
|
||||
gzip
|
||||
openssh
|
||||
xz
|
||||
(pkgs.writeTextFile {
|
||||
name = "nix.conf";
|
||||
destination = "/etc/nix/nix.conf";
|
||||
text = ''
|
||||
accept-flake-config = true
|
||||
experimental-features = nix-command flakes
|
||||
build-users-group =
|
||||
substituters = https://nix.h.lyte.dev https://cache.nixos.org/
|
||||
trusted-substituters = https://nix.h.lyte.dev https://cache.nixos.org/
|
||||
trusted-public-keys = h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
|
||||
'';
|
||||
})
|
||||
];
|
||||
|
||||
forAllSystems = nixpkgs-stable.lib.genAttrs systems;
|
||||
in {
|
||||
# Your custom packages
|
||||
# Acessible through 'nix build', 'nix shell', etc
|
||||
packages = forAllSystems (system: import ./pkgs nixpkgs-stable.legacyPackages.${system});
|
||||
extraCommands = ''
|
||||
# enable /usr/bin/env for scripts
|
||||
mkdir -p usr
|
||||
ln -s ../bin usr/bin
|
||||
|
||||
# Formatter for your nix files, available through 'nix fmt'
|
||||
# Other options beside 'alejandra' include 'nixpkgs-fmt'
|
||||
formatter = forAllSystems (system: nixpkgs-unstable.legacyPackages.${system}.alejandra);
|
||||
# create /tmp
|
||||
mkdir -p tmp
|
||||
|
||||
# Your custom packages and modifications, exported as overlays
|
||||
overlays = import ./overlays {inherit inputs;};
|
||||
|
||||
# Reusable nixos modules you might want to export
|
||||
# These are usually stuff you would upstream into nixpkgs
|
||||
nixosModules = import ./modules/nixos;
|
||||
|
||||
# Reusable home-manager modules you might want to export
|
||||
# These are usually stuff you would upstream into home-manager
|
||||
homeManagerModules = import ./modules/home-manager;
|
||||
|
||||
# NixOS configuration entrypoint
|
||||
# Available through 'nixos-rebuild --flake .#your-hostname'
|
||||
nixosConfigurations = let
|
||||
mkNixosSystem = cb: system: modules:
|
||||
cb {
|
||||
system = system;
|
||||
specialArgs = {
|
||||
inherit inputs outputs system nix-colors;
|
||||
flake = self;
|
||||
# create HOME
|
||||
mkdir -vp root
|
||||
'';
|
||||
config = {
|
||||
Cmd = ["/bin/bash"];
|
||||
Env = [
|
||||
"LANG=en_GB.UTF-8"
|
||||
"ENV=/etc/profile.d/nix.sh"
|
||||
"BASH_ENV=/etc/profile.d/nix.sh"
|
||||
"NIX_BUILD_SHELL=/bin/bash"
|
||||
"PAGER=cat"
|
||||
"PATH=/usr/bin:/bin"
|
||||
"SSL_CERT_FILE=${final.cacert}/etc/ssl/certs/ca-bundle.crt"
|
||||
"USER=root"
|
||||
];
|
||||
};
|
||||
modules =
|
||||
[
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
self.nixosModules.common
|
||||
]
|
||||
++ modules
|
||||
++ [
|
||||
# all nixos hosts should use our home manager config
|
||||
# TODO: unify with the module list in outputs.homeConfigurations.daniel
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
};
|
||||
};
|
||||
|
||||
modifications = final: prev: let
|
||||
wezterm-input = wezterm;
|
||||
hyprland-input = hyprland;
|
||||
in rec {
|
||||
helix = helix.outputs.packages.${prev.system}.helix;
|
||||
final.helix = helix;
|
||||
/*
|
||||
TODO: would love to use a current wezterm build so I can make use of ssh/mux functionality without breakage
|
||||
source: https://github.com/wez/wezterm/issues/3771
|
||||
not-yet-merged (abandoned?): https://github.com/wez/wezterm/pull/4737
|
||||
I did try using the latest code via the flake, but alas it did not resolve my issues with mux'ing
|
||||
*/
|
||||
wezterm = wezterm-input.outputs.packages.${prev.system}.default;
|
||||
# wezterm = (import nixpkgs {inherit (prev) system;}).wezterm;
|
||||
final.wezterm = wezterm;
|
||||
|
||||
hyprland = hyprland-input.outputs.packages.${prev.system}.default;
|
||||
final.hyprland = hyprland;
|
||||
|
||||
# zellij = prev.zellij.overrideAttrs rec {
|
||||
# version = "0.41.0";
|
||||
# src = prev.fetchFromGitHub {
|
||||
# owner = "zellij-org";
|
||||
# repo = "zellij";
|
||||
# rev = "v0.41.0";
|
||||
# hash = "sha256-A+JVWYz0t9cVA8XZciOwDkCecsC2r5TU2O9i9rVg7do=";
|
||||
# };
|
||||
# cargoDeps = prev.zellij.cargoDeps.overrideAttrs (prev.lib.const {
|
||||
# name = "zellij-vendor.tar.gz";
|
||||
# inherit src;
|
||||
# outputHash = "sha256-WxrMI7fV0pNsGjbNpXLr+xnMdWYkC4WxIeN4OK3ZPIE=";
|
||||
# });
|
||||
# };
|
||||
# final.zellij = zellij;
|
||||
};
|
||||
|
||||
unstable-packages = final: _prev: {
|
||||
unstable-packages = import nixpkgs-unstable {
|
||||
system = final.system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nixosModules = import ./modules/nixos {
|
||||
inherit home-manager home-manager-unstable helix nixosModules homeManagerModules pubkey overlays style sops-nix disko;
|
||||
flakeInputs = self.inputs;
|
||||
};
|
||||
|
||||
homeManagerModules = import ./modules/home-manager {
|
||||
inherit home-manager home-manager-unstable helix nixosModules homeManagerModules pubkey overlays style;
|
||||
inherit (nixpkgs) lib;
|
||||
flakeInputs = self.inputs;
|
||||
};
|
||||
|
||||
nixosConfigurations = {
|
||||
beefcake = let
|
||||
system = "x86_64-linux";
|
||||
in
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = with nixosModules; [
|
||||
home-manager-defaults
|
||||
|
||||
# TODO: disko?
|
||||
hardware.nixosModules.common-cpu-intel
|
||||
|
||||
outputs.nixosModules.deno-netlify-ddns-client
|
||||
{
|
||||
home-manager = {
|
||||
extraSpecialArgs = {inherit inputs outputs system nix-colors;};
|
||||
users.daniel = {
|
||||
imports = [./home ./home/linux.nix];
|
||||
services.deno-netlify-ddns-client = {
|
||||
enable = true;
|
||||
username = "beefcake.h";
|
||||
# TODO: router doesn't even do ipv6 yet...
|
||||
ipv6 = false;
|
||||
};
|
||||
}
|
||||
|
||||
family-users
|
||||
common
|
||||
podman
|
||||
troubleshooting-tools
|
||||
virtual-machines
|
||||
virtual-machines-gui
|
||||
linux
|
||||
fonts
|
||||
|
||||
./nixos/beefcake.nix
|
||||
|
||||
{
|
||||
services.kanidm.package = (unstable.pkgsFor system).kanidm;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
dragon = nixpkgs-unstable.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
home-manager-unstable-defaults
|
||||
|
||||
outputs.diskoConfigurations.unencrypted
|
||||
hardware.nixosModules.common-cpu-amd
|
||||
hardware.nixosModules.common-pc-ssd
|
||||
|
||||
common
|
||||
password-manager
|
||||
wifi
|
||||
graphical-workstation
|
||||
virtual-machines
|
||||
virtual-machines-gui
|
||||
music-production
|
||||
# plasma6
|
||||
gaming
|
||||
slippi.nixosModules.default
|
||||
|
||||
outputs.nixosModules.deno-netlify-ddns-client
|
||||
{
|
||||
services.deno-netlify-ddns-client = {
|
||||
enable = true;
|
||||
username = "dragon.h";
|
||||
# TODO: router doesn't even do ipv6 yet...
|
||||
ipv6 = false;
|
||||
};
|
||||
}
|
||||
|
||||
./nixos/dragon.nix
|
||||
|
||||
{
|
||||
home-manager.users.daniel = {
|
||||
imports = with homeManagerModules; [
|
||||
niri
|
||||
senpai
|
||||
iex
|
||||
cargo
|
||||
firefox-no-tabs
|
||||
linux-desktop-environment-config
|
||||
slippi.homeManagerModules.default
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
# mkNixosStableSystem = mkNixosSystem nixpkgs-stable.lib.nixosSystem;
|
||||
mkNixosUnstableSystem = mkNixosSystem nixpkgs-unstable.lib.nixosSystem;
|
||||
in {
|
||||
dragon = mkNixosUnstableSystem "x86_64-linux" [./nixos/dragon];
|
||||
thinker = mkNixosUnstableSystem "x86_64-linux" [./nixos/thinker];
|
||||
beefcake = mkNixosUnstableSystem "x86_64-linux" [
|
||||
inputs.api-lyte-dev.nixosModules.x86_64-linux.api-lyte-dev
|
||||
./nixos/beefcake
|
||||
|
||||
bigtower = nixpkgs-unstable.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
home-manager-unstable-defaults
|
||||
|
||||
outputs.diskoConfigurations.unencrypted
|
||||
hardware.nixosModules.common-cpu-amd
|
||||
hardware.nixosModules.common-pc-ssd
|
||||
|
||||
common
|
||||
# wifi
|
||||
graphical-workstation
|
||||
music-production
|
||||
gaming
|
||||
|
||||
./nixos/bigtower.nix
|
||||
|
||||
{
|
||||
home-manager.users.daniel = {
|
||||
imports = with homeManagerModules; [
|
||||
firefox-no-tabs
|
||||
linux-desktop-environment-config
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
rascal = mkNixosUnstableSystem "x86_64-linux" [./nixos/rascal];
|
||||
musicbox = mkNixosUnstableSystem "x86_64-linux" [./nixos/musicbox];
|
||||
};
|
||||
|
||||
# Standalone home-manager configuration entrypoint
|
||||
# Available through 'home-manager --flake .#your-username@your-hostname'
|
||||
homeConfigurations = let
|
||||
mkHome = system: modules:
|
||||
home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs-unstable.legacyPackages.${system};
|
||||
extraSpecialArgs = {inherit inputs outputs system nix-colors;};
|
||||
modules = modules;
|
||||
htpc = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
home-manager-defaults
|
||||
|
||||
hardware.nixosModules.common-pc-ssd
|
||||
common
|
||||
gaming
|
||||
graphical-workstation
|
||||
plasma6
|
||||
|
||||
./nixos/htpc.nix
|
||||
|
||||
{
|
||||
home-manager.users.daniel = {
|
||||
imports = with homeManagerModules; [
|
||||
linux-desktop-environment-config
|
||||
];
|
||||
};
|
||||
in {
|
||||
"daniel" = mkHome "x86_64-linux" [./home ./home/linux.nix];
|
||||
"daniel.flanagan" = mkHome "aarch64-darwin" [./home];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# TODO: darwin for work?
|
||||
# TODO: nixos ISO?
|
||||
steamdeck1 = nixpkgs-unstable.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
home-manager-unstable-defaults
|
||||
|
||||
# Disk partition schemes and functions
|
||||
diskoConfigurations = import ./disko;
|
||||
outputs.diskoConfigurations.standard
|
||||
hardware.nixosModules.common-pc-ssd
|
||||
common
|
||||
gaming
|
||||
graphical-workstation
|
||||
plasma6
|
||||
|
||||
jovian.outputs.nixosModules.jovian
|
||||
|
||||
{
|
||||
networking.hostName = "steamdeck1";
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
hardware.bluetooth.enable = true;
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
home-manager.users.daniel = {
|
||||
imports = with homeManagerModules; [
|
||||
firefox-no-tabs
|
||||
linux-desktop-environment-config
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
foxtrot = nixpkgs-unstable.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
home-manager-unstable-defaults
|
||||
|
||||
outputs.diskoConfigurations.foxtrot
|
||||
hardware.nixosModules.framework-13-7040-amd
|
||||
|
||||
common
|
||||
kde-connect
|
||||
password-manager
|
||||
graphical-workstation
|
||||
# plasma6
|
||||
# virtual-machines
|
||||
# virtual-machines-gui
|
||||
laptop
|
||||
gaming
|
||||
cross-compiler
|
||||
|
||||
./nixos/foxtrot.nix
|
||||
|
||||
({pkgs, ...}: {
|
||||
home-manager.users.daniel = {
|
||||
imports = with homeManagerModules; [
|
||||
senpai
|
||||
iex
|
||||
niri
|
||||
cargo
|
||||
firefox-no-tabs
|
||||
linux-desktop-environment-config
|
||||
];
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
ghostty.outputs.packages.${pkgs.system}.ghostty
|
||||
fw-ectool
|
||||
(writeShellApplication
|
||||
{
|
||||
name = "reset-wifi-module";
|
||||
runtimeInputs = with pkgs; [kmod];
|
||||
text = ''
|
||||
modprobe -rv mt7921e
|
||||
modprobe -v mt7921e
|
||||
'';
|
||||
})
|
||||
(writeShellApplication
|
||||
{
|
||||
name = "perfmode";
|
||||
# we use command -v $cmd here because we only want to invoke these calls _if_ the related package is installed on the system
|
||||
# otherwise, they will likely have no effect anyways
|
||||
text = ''
|
||||
command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set balanced'
|
||||
command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@120Hz'
|
||||
'';
|
||||
})
|
||||
(writeShellApplication
|
||||
{
|
||||
name = "battmode";
|
||||
text = ''
|
||||
command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set power-saver'
|
||||
command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@60Hz'
|
||||
'';
|
||||
})
|
||||
];
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
thablet = nixpkgs-unstable.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
home-manager-unstable-defaults
|
||||
outputs.diskoConfigurations.thablet
|
||||
hardware.nixosModules.lenovo-thinkpad-x1-yoga
|
||||
|
||||
common
|
||||
password-manager
|
||||
graphical-workstation
|
||||
# plasma6
|
||||
music-production
|
||||
laptop
|
||||
touchscreen
|
||||
gaming
|
||||
|
||||
./nixos/thablet.nix
|
||||
|
||||
{
|
||||
home-manager.users.daniel = {
|
||||
imports = with homeManagerModules; [
|
||||
senpai
|
||||
iex
|
||||
cargo
|
||||
firefox-no-tabs
|
||||
linux-desktop-environment-config
|
||||
# slippi.homeManagerModules.default
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
/*
|
||||
grablet = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
common
|
||||
|
||||
outputs.diskoConfigurations.standard
|
||||
hardware.nixosModules.common-cpu-intel-kaby-lake
|
||||
hardware.nixosModules.common-pc-laptopp-ssd
|
||||
graphical-workstation
|
||||
laptop
|
||||
gaming
|
||||
|
||||
./nixos/thablet.nix
|
||||
|
||||
{
|
||||
home-manager.users.daniel = {
|
||||
imports = with homeManagerModules; [
|
||||
iex
|
||||
cargo
|
||||
linux-desktop-environment-config
|
||||
];
|
||||
};
|
||||
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
||||
}
|
||||
];
|
||||
};
|
||||
*/
|
||||
|
||||
thinker = nixpkgs-unstable.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
home-manager-unstable-defaults
|
||||
|
||||
{
|
||||
_module.args = {
|
||||
disks = ["/dev/nvme0n1"];
|
||||
swapSize = "32G";
|
||||
};
|
||||
}
|
||||
outputs.diskoConfigurations.standard
|
||||
hardware.nixosModules.lenovo-thinkpad-t480
|
||||
hardware.nixosModules.common-pc-laptop-ssd
|
||||
|
||||
music-production
|
||||
common
|
||||
password-manager
|
||||
graphical-workstation
|
||||
# plasma6
|
||||
laptop
|
||||
gaming
|
||||
|
||||
./nixos/thinker.nix
|
||||
|
||||
{
|
||||
home-manager.users.daniel = {
|
||||
imports = with homeManagerModules; [
|
||||
senpai
|
||||
iex
|
||||
cargo
|
||||
firefox-no-tabs
|
||||
linux-desktop-environment-config
|
||||
slippi.homeManagerModules.default
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
musicbox = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
home-manager-defaults
|
||||
|
||||
{
|
||||
_module.args = {
|
||||
disks = ["/dev/sda"];
|
||||
# swapSize = "8G";
|
||||
};
|
||||
}
|
||||
outputs.diskoConfigurations.unencrypted
|
||||
hardware.nixosModules.common-pc-laptop-ssd
|
||||
|
||||
music-production
|
||||
common
|
||||
graphical-workstation
|
||||
wifi
|
||||
|
||||
# ./nixos/musicbox.nix
|
||||
|
||||
{
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
hardware.bluetooth.enable = true;
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
home-manager.users.daniel = {
|
||||
imports = with homeManagerModules; [
|
||||
firefox-no-tabs
|
||||
linux-desktop-environment-config
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
rascal = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
home-manager-defaults
|
||||
hardware.nixosModules.common-cpu-amd
|
||||
common
|
||||
linux
|
||||
./nixos/rascal.nix
|
||||
];
|
||||
};
|
||||
|
||||
router = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
home-manager-defaults
|
||||
outputs.diskoConfigurations.unencrypted
|
||||
common
|
||||
linux
|
||||
troubleshooting-tools
|
||||
|
||||
outputs.nixosModules.deno-netlify-ddns-client
|
||||
{
|
||||
services.deno-netlify-ddns-client = {
|
||||
enable = true;
|
||||
username = "router.h";
|
||||
# TODO: ipv6
|
||||
ipv6 = false;
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
NOTE: maybe use this someday, but I think I need more concrete
|
||||
networking knowledge before I know how to use it well. Additionally,
|
||||
I can use my existing firewall configuration more easily if I manage
|
||||
it directly.
|
||||
nnf.nixosModules.default
|
||||
*/
|
||||
|
||||
./nixos/router.nix
|
||||
];
|
||||
};
|
||||
|
||||
# pinephone-image =
|
||||
# (import "${mobile-nixos}/lib/eval-with-configuration.nix" {
|
||||
# configuration = with nixosModules; [
|
||||
# linux
|
||||
# home-manager-defaults
|
||||
|
||||
# # outputs.diskoConfigurations.unencrypted # can I even disko with an image-based installation?
|
||||
# common
|
||||
# wifi
|
||||
|
||||
# # TODO: how do I get a minimally useful mobile environment?
|
||||
# # for me, this means an on-screen keyboard and suspend support I think?
|
||||
# # I can live in a tty if needed and graphical stuff can all evolve later
|
||||
# # not worried about modem
|
||||
# # maybe/hopefully I can pull in or define my own sxmo via nix?
|
||||
# ];
|
||||
# device = "pine64-pinephone";
|
||||
# pkgs = pkgsFor "aarch64-linux";
|
||||
# })
|
||||
# .outputs
|
||||
# .disk-image;
|
||||
|
||||
pinephone = let
|
||||
inherit (nixpkgs-unstable) lib;
|
||||
in
|
||||
lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
# lib.nixosSystem {
|
||||
|
||||
modules = with nixosModules; [
|
||||
{
|
||||
imports = [
|
||||
(import "${mobile-nixos}/lib/configuration.nix" {
|
||||
device = "pine64-pinephone";
|
||||
})
|
||||
];
|
||||
|
||||
# nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||
nixpkgs.buildPlatform = "x86_64-linux";
|
||||
|
||||
# TODO: quirk: since the pinephone kernel doesn't seem to have "rpfilter" support, firewall ain't working
|
||||
networking.firewall.enable = lib.mkForce false;
|
||||
|
||||
# TODO: quirk: since git send-email requires perl support, which we don't seem to have on the pinephone, we're just disabling git for now
|
||||
# TODO: would likely be easier/better to somehow ignore the assertion? probably a way to do that...
|
||||
programs.git.enable = lib.mkForce false;
|
||||
|
||||
# this option is conflicted, presumably due to some assumption in my defaults/common config
|
||||
# the sd-image module we're importing above has this set to true, so we better go with that?
|
||||
# that said, I think the mobile-nixos bootloader module has this set to false, so...
|
||||
# TODO: what does this mean?
|
||||
boot.loader.generic-extlinux-compatible.enable = lib.mkForce true;
|
||||
|
||||
# another conflicting option since I think I default to NetworkManager and this conflicts with networking.wireless.enable
|
||||
networking.networkmanager.enable = lib.mkForce false;
|
||||
networking.wireless.enable = lib.mkForce true;
|
||||
}
|
||||
|
||||
# TODO: how do I build this as a .img to flash to an SD card?
|
||||
|
||||
# for testing, this seems to work `nixos-rebuild build --impure --flake .#pinephone`
|
||||
|
||||
# TODO: would like to use the mobile-nixos installer?
|
||||
"${nixpkgs-unstable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix"
|
||||
|
||||
linux
|
||||
home-manager-unstable-defaults
|
||||
|
||||
# outputs.diskoConfigurations.unencrypted # can I even disko with an image-based installation?
|
||||
common
|
||||
wifi
|
||||
|
||||
{
|
||||
system.stateVersion = "24.11";
|
||||
}
|
||||
|
||||
{
|
||||
# nixpkgs.buildPlatform = "x86_64-linux";
|
||||
# nixpkgs.hostPlatform = lib.systems.examples.aarch64-multiplatform;
|
||||
# nixpkgs.localSystem.system = lib.systems.examples.x86_64-linux;
|
||||
# nixpkgs.crossSystem = lib.mkForce null;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
images.pinephone = outputs.nixosConfigurations.pinephone.config.system.build.sdImage;
|
||||
|
||||
homeConfigurations = {
|
||||
"deck" = let
|
||||
system = "x86_64-linux";
|
||||
pkgs = unstable.pkgsFor system;
|
||||
in
|
||||
home-manager-unstable.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
modules = with homeManagerModules; [
|
||||
common
|
||||
{
|
||||
home = {
|
||||
homeDirectory = "/home/deck";
|
||||
username = "deck";
|
||||
stateVersion = "24.11";
|
||||
};
|
||||
}
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
ludusavi
|
||||
rclone
|
||||
];
|
||||
}
|
||||
linux
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
TODO: nix-on-droid for phone terminal usage? mobile-nixos?
|
||||
TODO: nix-darwin for work?
|
||||
TODO: nixos ISO?
|
||||
*/
|
||||
};
|
||||
}
|
||||
|
|
848
home/default.nix
848
home/default.nix
|
@ -1,848 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
system,
|
||||
inputs,
|
||||
nix-colors,
|
||||
...
|
||||
}: let
|
||||
email = "daniel@lyte.dev";
|
||||
name = "Daniel Flanagan";
|
||||
in {
|
||||
# TODO: email access?
|
||||
# accounts.email.accounts = {
|
||||
# google = {
|
||||
# address = "wraithx2@gmail.com";
|
||||
# };
|
||||
# };
|
||||
|
||||
# TODO: fonts? right now they are only handled at the nixos-level (desktop-usage module)
|
||||
# TODO: wallpaper?
|
||||
|
||||
imports = [
|
||||
nix-colors.homeManagerModules.default
|
||||
];
|
||||
|
||||
colorScheme = nix-colors.colorSchemes.catppuccin-mocha;
|
||||
# copied here for easy lookups:
|
||||
# https://github.com/tinted-theming/base16-schemes/blob/main/catppuccin-mocha.yaml
|
||||
|
||||
# base00: "1e1e2e" # base
|
||||
# base01: "181825" # mantle
|
||||
# base02: "313244" # surface0
|
||||
# base03: "45475a" # surface1
|
||||
# base04: "585b70" # surface2
|
||||
# base05: "cdd6f4" # text
|
||||
# base06: "f5e0dc" # rosewater
|
||||
# base07: "b4befe" # lavender
|
||||
# base08: "f38ba8" # red
|
||||
# base09: "fab387" # peach
|
||||
# base0A: "f9e2af" # yellow
|
||||
# base0B: "a6e3a1" # green
|
||||
# base0C: "94e2d5" # teal
|
||||
# base0D: "89b4fa" # blue
|
||||
# base0E: "cba6f7" # mauve
|
||||
# base0F: "f2cdcd" # flamingo
|
||||
|
||||
home = {
|
||||
username = lib.mkDefault "daniel";
|
||||
homeDirectory = lib.mkDefault "/home/daniel/.home";
|
||||
stateVersion = "23.11";
|
||||
|
||||
packages = [
|
||||
# I use gawk for my fish prompt
|
||||
pkgs.gawk
|
||||
|
||||
inputs.helix.packages.${system}.helix
|
||||
|
||||
pkgs.nil
|
||||
pkgs.alejandra
|
||||
|
||||
# TODO: os-specific scripts? macOS versus Linux (arch or nixos? do I need to distinguish at that point?)
|
||||
(pkgs.buildEnv {
|
||||
name = "my-scripts-common";
|
||||
paths = [./scripts/common];
|
||||
})
|
||||
];
|
||||
|
||||
file = {
|
||||
".iex.exs" = {
|
||||
enable = true;
|
||||
text = ''
|
||||
Application.put_env(:elixir, :ansi_enabled, true)
|
||||
|
||||
# PROTIP: to break, `#iex:break`
|
||||
|
||||
IEx.configure(
|
||||
colors: [enabled: true],
|
||||
inspect: [
|
||||
pretty: true,
|
||||
printable_limit: :infinity,
|
||||
limit: :infinity
|
||||
],
|
||||
default_prompt:
|
||||
[
|
||||
# ANSI CHA, move cursor to column 1
|
||||
"\e[G",
|
||||
:magenta,
|
||||
# IEx prompt variable
|
||||
"%prefix",
|
||||
"#",
|
||||
# IEx prompt variable
|
||||
"%counter",
|
||||
# plain string
|
||||
">",
|
||||
:reset
|
||||
]
|
||||
|> IO.ANSI.format()
|
||||
|> IO.chardata_to_string()
|
||||
)
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
password-store = {
|
||||
enable = true;
|
||||
package = pkgs.pass.withExtensions (exts: [exts.pass-otp]);
|
||||
};
|
||||
|
||||
git = {
|
||||
enable = true;
|
||||
|
||||
userEmail = email;
|
||||
userName = name;
|
||||
|
||||
delta = {
|
||||
enable = true;
|
||||
options = {};
|
||||
};
|
||||
|
||||
lfs = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
signing = {
|
||||
signByDefault = true;
|
||||
key = "daniel@lyte.dev";
|
||||
};
|
||||
|
||||
aliases = {
|
||||
a = "add -A";
|
||||
ac = "commit -a";
|
||||
b = "rev-parse --symbolic-full-name HEAD";
|
||||
c = "commit";
|
||||
cm = "commit -m";
|
||||
cnv = "commit --no-verify";
|
||||
co = "checkout";
|
||||
d = "diff";
|
||||
ds = "diff --staged";
|
||||
dt = "difftool";
|
||||
f = "fetch";
|
||||
l = "log --graph --abbrev-commit --decorate --oneline --all";
|
||||
plainlog = " log --pretty=format:'%h %ad%x09%an%x09%s' --date=short --decorate";
|
||||
ls = "ls-files";
|
||||
mm = "merge master";
|
||||
p = "push";
|
||||
pf = "push --force-with-lease";
|
||||
pl = "pull";
|
||||
rim = "rebase -i master";
|
||||
s = "status";
|
||||
};
|
||||
|
||||
extraConfig = {
|
||||
push = {
|
||||
autoSetupRemote = true;
|
||||
};
|
||||
|
||||
branch = {
|
||||
autoSetupMerge = true;
|
||||
};
|
||||
|
||||
sendemail = {
|
||||
smtpserver = "smtp.mailgun.org";
|
||||
smtpuser = "daniel@lyte.dev";
|
||||
smtrpencryption = "tls";
|
||||
smtpserverport = 587;
|
||||
};
|
||||
|
||||
url = {
|
||||
# TODO: how to have per-machine not-in-git configuration?
|
||||
"git@git.hq.bill.com:" = {
|
||||
insteadOf = "https://git.hq.bill.com";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
gitui = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
helix = {
|
||||
enable = true;
|
||||
package = inputs.helix.packages.${system}.helix;
|
||||
languages = {
|
||||
language-server = {
|
||||
lexical = {
|
||||
command = "lexical";
|
||||
args = ["start"];
|
||||
};
|
||||
|
||||
next-ls = {
|
||||
command = "next-ls";
|
||||
args = ["--stdout"];
|
||||
};
|
||||
|
||||
deno = {
|
||||
command = "deno";
|
||||
args = ["lsp"];
|
||||
config = {
|
||||
enable = true;
|
||||
lint = true;
|
||||
unstable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
language = [
|
||||
{
|
||||
name = "elixir";
|
||||
language-servers = ["elixir-ls"]; # "lexical" "next-ls"
|
||||
auto-format = true;
|
||||
}
|
||||
{
|
||||
name = "html";
|
||||
auto-format = false;
|
||||
}
|
||||
{
|
||||
name = "nix";
|
||||
auto-format = true;
|
||||
formatter = {
|
||||
command = "alejandra";
|
||||
args = ["-"];
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "fish";
|
||||
auto-format = true;
|
||||
indent = {
|
||||
tab-width = 2;
|
||||
unit = "\t";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
name = "javascript";
|
||||
language-id = "javascript";
|
||||
grammar = "javascript";
|
||||
scope = "source.js";
|
||||
injection-regex = "^(js|javascript)$";
|
||||
file-types = ["js" "mjs"];
|
||||
shebangs = ["deno"];
|
||||
language-servers = ["deno"];
|
||||
roots = ["deno.jsonc" "deno.json"];
|
||||
formatter = {
|
||||
command = "deno";
|
||||
args = ["fmt"];
|
||||
};
|
||||
auto-format = true;
|
||||
comment-token = "//";
|
||||
indent = {
|
||||
tab-width = 2;
|
||||
unit = "\t";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
name = "typescript";
|
||||
language-id = "typescript";
|
||||
grammar = "typescript";
|
||||
scope = "source.ts";
|
||||
injection-regex = "^(ts|typescript)$";
|
||||
file-types = ["ts"];
|
||||
shebangs = ["deno"];
|
||||
language-servers = ["deno"];
|
||||
roots = ["deno.jsonc" "deno.json"];
|
||||
formatter = {
|
||||
command = "deno";
|
||||
args = ["fmt"];
|
||||
};
|
||||
auto-format = true;
|
||||
comment-token = "//";
|
||||
indent = {
|
||||
tab-width = 2;
|
||||
unit = "\t";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
name = "jsonc";
|
||||
language-id = "json";
|
||||
grammar = "jsonc";
|
||||
scope = "source.jsonc";
|
||||
injection-regex = "^(jsonc)$";
|
||||
roots = ["deno.jsonc" "deno.json"];
|
||||
file-types = ["jsonc"];
|
||||
language-servers = ["deno"];
|
||||
indent = {
|
||||
tab-width = 2;
|
||||
unit = " ";
|
||||
};
|
||||
auto-format = true;
|
||||
}
|
||||
|
||||
# [[language]]
|
||||
# name = "jsx"
|
||||
# scope = "source.jsx"
|
||||
# injection-regex = "jsx"
|
||||
# file-types = ["jsx"]
|
||||
# shebangs = ["deno", "node"]
|
||||
# roots = ["deno.jsonc", "deno.json", "package.json", "tsconfig.json"]
|
||||
# comment-token = "//"
|
||||
# config = { enable = true, lint = true, unstable = true }
|
||||
# language-server = { command = "deno", args = ["lsp"], language-id = "javascriptreact" }
|
||||
# indent = { tab-width = 2, unit = " " }
|
||||
# grammar = "javascript"
|
||||
# auto-format = true
|
||||
|
||||
# [[language]]
|
||||
# name = "tsx"
|
||||
# scope = "source.tsx"
|
||||
# injection-regex = "^(tsx)$" # |typescript
|
||||
# file-types = ["tsx"]
|
||||
# shebangs = ["deno", "node"]
|
||||
# roots = ["deno.jsonc", "deno.json", "package.json", "tsconfig.json"]
|
||||
# config = { enable = true, lint = true, unstable = true }
|
||||
# language-server = { command = "deno", args = ["lsp"], language-id = "typescriptreact" }
|
||||
# indent = { tab-width = 2, unit = " " }
|
||||
# auto-format = true
|
||||
|
||||
# [[language]]
|
||||
# name = "jsonc"
|
||||
# scope = "source.jsonc"
|
||||
# injection-regex = "^(jsonc)$"
|
||||
# file-types = ["jsonc"]
|
||||
# shebangs = ["deno", "node"]
|
||||
# roots = ["deno.jsonc", "deno.json", "package.json", "tsconfig.json"]
|
||||
# config = { enable = true, lint = true, unstable = true }
|
||||
# language-server = { command = "deno", args = ["lsp"], language-id = "jsonc" }
|
||||
# indent = { tab-width = 2, unit = " " }
|
||||
# auto-format = true
|
||||
];
|
||||
};
|
||||
|
||||
settings = {
|
||||
theme = "custom";
|
||||
|
||||
editor = {
|
||||
soft-wrap.enable = true;
|
||||
auto-pairs = false;
|
||||
auto-save = false;
|
||||
completion-trigger-len = 1;
|
||||
color-modes = false;
|
||||
bufferline = "multiple";
|
||||
scrolloff = 8;
|
||||
rulers = [80 120];
|
||||
cursorline = true;
|
||||
|
||||
cursor-shape = {
|
||||
normal = "block";
|
||||
insert = "bar";
|
||||
select = "underline";
|
||||
};
|
||||
|
||||
file-picker.hidden = false;
|
||||
indent-guides = {
|
||||
render = true;
|
||||
character = "▏";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
display-messages = true;
|
||||
display-inlay-hints = true;
|
||||
};
|
||||
statusline = {
|
||||
left = ["mode" "spinner" "selections" "primary-selection-length" "position" "position-percentage" "diagnostics" "workspace-diagnostics"];
|
||||
center = ["file-name"];
|
||||
right = ["version-control" "total-line-numbers" "file-encoding"];
|
||||
};
|
||||
};
|
||||
keys = {
|
||||
insert = {
|
||||
j = {
|
||||
k = "normal_mode";
|
||||
j = "normal_mode";
|
||||
K = "normal_mode";
|
||||
J = "normal_mode";
|
||||
};
|
||||
};
|
||||
|
||||
normal = {
|
||||
D = "kill_to_line_end";
|
||||
"^" = "goto_line_start";
|
||||
"C-k" = "jump_view_up";
|
||||
"C-j" = "jump_view_down";
|
||||
"C-h" = "jump_view_left";
|
||||
"C-l" = "jump_view_right";
|
||||
"C-q" = ":quit-all!";
|
||||
"L" = "repeat_last_motion";
|
||||
space = {
|
||||
q = ":reflow 80";
|
||||
Q = ":reflow 120";
|
||||
v = ":run-shell-command fish -c 'env > /tmp/env'";
|
||||
C = ":bc!";
|
||||
h = ":toggle lsp.display-inlay-hints";
|
||||
# O = ["select_textobject_inner WORD", ":pipe-to xargs xdg-open"];
|
||||
};
|
||||
};
|
||||
|
||||
select = {
|
||||
space = {
|
||||
q = ":reflow 80";
|
||||
Q = ":reflow 120";
|
||||
};
|
||||
"L" = "repeat_last_motion";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
themes = {
|
||||
custom = {
|
||||
"inherits" = "catppuccin_mocha";
|
||||
|
||||
"ui.background" = "default";
|
||||
|
||||
# "ui.cursorline.primary" = { bg = "default" }
|
||||
# "ui.cursorline.secondary" = { bg = "default" }
|
||||
# "ui.cursorcolumn.primary" = { bg = "default" }
|
||||
# "ui.cursorcolumn.secondary" = { bg = "default" }
|
||||
# "ui.virtual.ruler" = { bg = "default" }
|
||||
|
||||
"ui.bufferline.active" = {
|
||||
fg = "sapphire";
|
||||
bg = "base";
|
||||
underline = {
|
||||
color = "sapphire";
|
||||
style = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
bat = {
|
||||
enable = true;
|
||||
config = {
|
||||
theme = "Catppuccin-mocha";
|
||||
};
|
||||
themes = {
|
||||
"Catppuccin-mocha" = builtins.readFile (pkgs.fetchFromGitHub
|
||||
{
|
||||
owner = "catppuccin";
|
||||
repo = "bat";
|
||||
rev = "477622171ec0529505b0ca3cada68fc9433648c6";
|
||||
sha256 = "6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw=";
|
||||
}
|
||||
+ "/Catppuccin-mocha.tmTheme");
|
||||
};
|
||||
};
|
||||
|
||||
kitty = {
|
||||
enable = true;
|
||||
darwinLaunchOptions = ["--single-instance"];
|
||||
shellIntegration = {
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
settings = {
|
||||
"font_family" = "IosevkaLyteTerm";
|
||||
"bold_font" = "IosevkaLyteTerm Heavy";
|
||||
"italic_font" = "IosevkaLyteTerm Italic";
|
||||
"bold_italic_font" = "IosevkaLyteTerm Heavy Italic";
|
||||
"font_size" = "12.5";
|
||||
"inactive_text_alpha" = "0.5";
|
||||
"copy_on_select" = true;
|
||||
|
||||
"scrollback_lines" = 500000;
|
||||
|
||||
"symbol_map" = "U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono";
|
||||
|
||||
# use `kitty + list-fonts --psnames` to get the font's PostScript name
|
||||
|
||||
"allow_remote_control" = true;
|
||||
"listen_on" = "unix:/tmp/kitty";
|
||||
"repaint_delay" = 3;
|
||||
"input_delay" = 3;
|
||||
"sync_to_monitor" = true;
|
||||
|
||||
"adjust_line_height" = 0;
|
||||
"window_padding_width" = "10.0";
|
||||
"window_margin_width" = "0.0";
|
||||
|
||||
"confirm_os_window_close" = 0;
|
||||
|
||||
"enabled_layouts" = "splits:split_axis=vertical,stack";
|
||||
|
||||
"shell_integration" = "disabled";
|
||||
|
||||
"enable_audio_bell" = true;
|
||||
"visual_bell_duration" = "0.25";
|
||||
"visual_bell_color" = "#333033";
|
||||
|
||||
"url_style" = "single";
|
||||
|
||||
"strip_trailing_spaces" = "smart";
|
||||
|
||||
# open_url_modifiers ctrl
|
||||
|
||||
"tab_bar_align" = "center";
|
||||
"tab_bar_style" = "separator";
|
||||
"tab_separator" = ''""'';
|
||||
"tab_bar_edge" = "top";
|
||||
"tab_title_template" = ''"{fmt.fg.tab}{fmt.bg.tab} {activity_symbol}{title} "'';
|
||||
"active_tab_font_style" = "normal";
|
||||
|
||||
## name: Catppuccin Kitty Mocha
|
||||
## author: Catppuccin Org
|
||||
## license: MIT
|
||||
## upstream: https://github.com/catppuccin/kitty/blob/main/mocha.conf
|
||||
## blurb: Soothing pastel theme for the high-spirited!
|
||||
|
||||
# The basic colors
|
||||
"foreground" = "#CDD6F4";
|
||||
"background" = "#1E1E2E";
|
||||
"selection_foreground" = "#1E1E2E";
|
||||
"selection_background" = "#F5E0DC";
|
||||
|
||||
# Cursor colors
|
||||
"cursor" = "#F5E0DC";
|
||||
"cursor_text_color" = "#1E1E2E";
|
||||
|
||||
# URL underline color when hovering with mouse
|
||||
"url_color" = "#F5E0DC";
|
||||
|
||||
# Kitty window border colors
|
||||
"active_border_color" = "#74c7ec";
|
||||
"inactive_border_color" = "#313244";
|
||||
"bell_border_color" = "#F9E2AF";
|
||||
|
||||
# OS Window titlebar colors
|
||||
"wayland_titlebar_color" = "system";
|
||||
"macos_titlebar_color" = "system";
|
||||
|
||||
# Tab bar colors
|
||||
"active_tab_foreground" = "#11111B";
|
||||
"active_tab_background" = "#74c7ec";
|
||||
"inactive_tab_foreground" = "#CDD6F4";
|
||||
"inactive_tab_background" = "#181825";
|
||||
"tab_bar_background" = "#11111B";
|
||||
|
||||
# Colors for marks (marked text in the terminal)
|
||||
"mark1_foreground" = "#1E1E2E";
|
||||
"mark1_background" = "#B4BEFE";
|
||||
"mark2_foreground" = "#1E1E2E";
|
||||
"mark2_background" = "#74c7ec";
|
||||
"mark3_foreground" = "#1E1E2E";
|
||||
"mark3_background" = "#74C7EC";
|
||||
|
||||
# The 16 terminal colors
|
||||
|
||||
# black
|
||||
"color0" = "#45475A";
|
||||
"color8" = "#585B70";
|
||||
|
||||
# red
|
||||
"color1" = "#F38BA8";
|
||||
"color9" = "#F38BA8";
|
||||
|
||||
# green
|
||||
"color2" = "#A6E3A1";
|
||||
"color10" = "#A6E3A1";
|
||||
|
||||
# yellow
|
||||
"color3" = "#F9E2AF";
|
||||
"color11" = "#F9E2AF";
|
||||
|
||||
# blue
|
||||
"color4" = "#89B4FA";
|
||||
"color12" = "#89B4FA";
|
||||
|
||||
# magenta
|
||||
"color5" = "#F5C2E7";
|
||||
"color13" = "#F5C2E7";
|
||||
|
||||
# cyan
|
||||
"color6" = "#94E2D5";
|
||||
"color14" = "#94E2D5";
|
||||
|
||||
# white
|
||||
"color7" = "#BAC2DE";
|
||||
"color15" = "#A6ADC8";
|
||||
};
|
||||
keybindings = {
|
||||
"ctrl+shift+1" = "change_font_size all 12.5";
|
||||
"ctrl+shift+2" = "change_font_size all 18.5";
|
||||
"ctrl+shift+3" = "change_font_size all 26";
|
||||
"ctrl+shift+4" = "change_font_size all 32";
|
||||
"ctrl+shift+5" = "change_font_size all 48";
|
||||
"ctrl+shift+o" = "launch --type=tab --stdin-source=@screen_scrollback $EDITOR";
|
||||
|
||||
"ctrl+shift+equal" = "change_font_size all +0.5";
|
||||
"ctrl+shift+minus" = "change_font_size all -0.5";
|
||||
|
||||
"shift+insert" = "paste_from_clipboard";
|
||||
"ctrl+shift+v" = "paste_from_selection";
|
||||
"ctrl+shift+c" = "copy_to_clipboard";
|
||||
|
||||
# kill pane
|
||||
"ctrl+shift+q" = "close_window";
|
||||
|
||||
# kill tab
|
||||
"ctrl+alt+shift+q" = "close_tab";
|
||||
|
||||
"ctrl+shift+j" = "launch --location=hsplit --cwd=current";
|
||||
"ctrl+shift+l" = "launch --location=vsplit --cwd=current";
|
||||
|
||||
"ctrl+alt+shift+k" = "move_window up";
|
||||
"ctrl+alt+shift+h" = "move_window left";
|
||||
"ctrl+alt+shift+l" = "move_window right";
|
||||
"ctrl+alt+shift+j" = "move_window down";
|
||||
|
||||
"ctrl+h" = "neighboring_window left";
|
||||
"ctrl+l" = "neighboring_window right";
|
||||
"ctrl+k" = "neighboring_window up";
|
||||
"ctrl+j" = "neighboring_window down";
|
||||
"ctrl+shift+n" = "nth_window -1";
|
||||
"ctrl+shift+space>u" = "kitten hints --type=url --program @";
|
||||
|
||||
"ctrl+shift+z" = "toggle_layout stack";
|
||||
};
|
||||
};
|
||||
|
||||
zellij = {
|
||||
# TODO: enable after port config
|
||||
enable = false;
|
||||
enableFishIntegration = true;
|
||||
settings = {
|
||||
# TODO: port config
|
||||
};
|
||||
};
|
||||
|
||||
broot = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
settings = {
|
||||
modal = true;
|
||||
skin = {
|
||||
# this is a crappy copy of broot's catppuccin mocha theme
|
||||
input = "rgb(205, 214, 244) none";
|
||||
selected_line = "none rgb(88, 91, 112)";
|
||||
default = "rgb(205, 214, 244) none";
|
||||
tree = "rgb(108, 112, 134) none";
|
||||
parent = "rgb(116, 199, 236) none";
|
||||
file = "none none";
|
||||
|
||||
perm__ = "rgb(186, 194, 222) none";
|
||||
perm_r = "rgb(250, 179, 135) none";
|
||||
perm_w = "rgb(235, 160, 172) none";
|
||||
perm_x = "rgb(166, 227, 161) none";
|
||||
owner = "rgb(148, 226, 213) none";
|
||||
group = "rgb(137, 220, 235) none";
|
||||
|
||||
dates = "rgb(186, 194, 222) none";
|
||||
|
||||
directory = "rgb(180, 190, 254) none Bold";
|
||||
exe = "rgb(166, 227, 161) none";
|
||||
link = "rgb(249, 226, 175) none";
|
||||
pruning = "rgb(166, 173, 200) none Italic";
|
||||
|
||||
preview_title = "rgb(205, 214, 244) rgb(24, 24, 37)";
|
||||
preview = "rgb(205, 214, 244) rgb(24, 24, 37)";
|
||||
preview_line_number = "rgb(108, 112, 134) none";
|
||||
|
||||
char_match = "rgb(249, 226, 175) rgb(69, 71, 90) Bold Italic";
|
||||
content_match = "rgb(249, 226, 175) rgb(69, 71, 90) Bold Italic";
|
||||
preview_match = "rgb(249, 226, 175) rgb(69, 71, 90) Bold Italic";
|
||||
|
||||
count = "rgb(249, 226, 175) none";
|
||||
sparse = "rgb(243, 139, 168) none";
|
||||
content_extract = "rgb(243, 139, 168) none Italic";
|
||||
|
||||
git_branch = "rgb(250, 179, 135) none";
|
||||
git_insertions = "rgb(250, 179, 135) none";
|
||||
git_deletions = "rgb(250, 179, 135) none";
|
||||
git_status_current = "rgb(250, 179, 135) none";
|
||||
git_status_modified = "rgb(250, 179, 135) none";
|
||||
git_status_new = "rgb(250, 179, 135) none Bold";
|
||||
git_status_ignored = "rgb(250, 179, 135) none";
|
||||
git_status_conflicted = "rgb(250, 179, 135) none";
|
||||
git_status_other = "rgb(250, 179, 135) none";
|
||||
staging_area_title = "rgb(250, 179, 135) none";
|
||||
|
||||
flag_label = "rgb(243, 139, 168) none";
|
||||
flag_value = "rgb(243, 139, 168) none Bold";
|
||||
|
||||
status_normal = "none rgb(24, 24, 37)";
|
||||
status_italic = "rgb(243, 139, 168) rgb(24, 24, 37) Italic";
|
||||
status_bold = "rgb(235, 160, 172) rgb(24, 24, 37) Bold";
|
||||
status_ellipsis = "rgb(235, 160, 172) rgb(24, 24, 37) Bold";
|
||||
status_error = "rgb(205, 214, 244) rgb(243, 139, 168)";
|
||||
status_job = "rgb(235, 160, 172) rgb(40, 38, 37)";
|
||||
status_code = "rgb(235, 160, 172) rgb(24, 24, 37) Italic";
|
||||
mode_command_mark = "rgb(235, 160, 172) rgb(24, 24, 37) Bold";
|
||||
|
||||
help_paragraph = "rgb(205, 214, 244) none";
|
||||
help_headers = "rgb(243, 139, 168) none Bold";
|
||||
help_bold = "rgb(250, 179, 135) none Bold";
|
||||
help_italic = "rgb(249, 226, 175) none Italic";
|
||||
help_code = "rgb(166, 227, 161) rgb(49, 50, 68)";
|
||||
help_table_border = "rgb(108, 112, 134) none";
|
||||
|
||||
hex_null = "rgb(205, 214, 244) none";
|
||||
hex_ascii_graphic = "rgb(250, 179, 135) none";
|
||||
hex_ascii_whitespace = "rgb(166, 227, 161) none";
|
||||
hex_ascii_other = "rgb(148, 226, 213) none";
|
||||
hex_non_ascii = "rgb(243, 139, 168) none";
|
||||
|
||||
file_error = "rgb(251, 73, 52) none";
|
||||
|
||||
purpose_normal = "none none";
|
||||
purpose_italic = "rgb(177, 98, 134) none Italic";
|
||||
purpose_bold = "rgb(177, 98, 134) none Bold";
|
||||
purpose_ellipsis = "none none";
|
||||
|
||||
scrollbar_track = "rgb(49, 50, 68) none";
|
||||
scrollbar_thumb = "rgb(88, 91, 112) none";
|
||||
|
||||
good_to_bad_0 = "rgb(166, 227, 161) none";
|
||||
good_to_bad_1 = "rgb(148, 226, 213) none";
|
||||
good_to_bad_2 = "rgb(137, 220, 235) none";
|
||||
good_to_bad_3 = "rgb(116, 199, 236) none";
|
||||
good_to_bad_4 = "rgb(137, 180, 250) none";
|
||||
good_to_bad_5 = "rgb(180, 190, 254) none";
|
||||
good_to_bad_6 = "rgb(203, 166, 247) none";
|
||||
good_to_bad_7 = "rgb(250, 179, 135) none";
|
||||
good_to_bad_8 = "rgb(235, 160, 172) none";
|
||||
good_to_bad_9 = "rgb(243, 139, 168) none";
|
||||
};
|
||||
|
||||
verbs = [
|
||||
{
|
||||
invocation = "edit";
|
||||
shortcut = "e";
|
||||
execution = "$EDITOR {file}";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
|
||||
fish = {
|
||||
enable = true;
|
||||
# I load long scripts from files for a better editing experience
|
||||
shellInit = builtins.readFile ./fish/shellInit.fish;
|
||||
interactiveShellInit = builtins.readFile ./fish/interactiveShellInit.fish;
|
||||
loginShellInit = "";
|
||||
functions = {
|
||||
# TODO: I think these should be loaded from fish files too for better editor experience?
|
||||
d = ''
|
||||
# --wraps=cd --description "Quickly jump to NICE_HOME (or given relative or absolute path) and list files."
|
||||
if count $argv > /dev/null
|
||||
cd $argv
|
||||
else
|
||||
cd $NICE_HOME
|
||||
end
|
||||
la
|
||||
'';
|
||||
|
||||
c = ''
|
||||
if count $argv > /dev/null
|
||||
cd $NICE_HOME && d $argv
|
||||
else
|
||||
d $NICE_HOME
|
||||
end
|
||||
'';
|
||||
|
||||
g = ''
|
||||
if test (count $argv) -gt 0
|
||||
git $argv
|
||||
else
|
||||
git status
|
||||
end
|
||||
'';
|
||||
|
||||
ltl = ''
|
||||
set d $argv[1] .
|
||||
set -l l ""
|
||||
for f in $d[1]/*
|
||||
if test -z $l; set l $f; continue; end
|
||||
if command test $f -nt $l; and test ! -d $f
|
||||
set l $f
|
||||
end
|
||||
end
|
||||
echo $l
|
||||
'';
|
||||
|
||||
has_command = "command --quiet --search $argv[1]";
|
||||
};
|
||||
shellAbbrs = {};
|
||||
shellAliases = {
|
||||
l = "br";
|
||||
ls = "eza --group-directories-first --classify";
|
||||
la = "eza -la --group-directories-first --classify";
|
||||
lA = "eza -la --all --group-directories-first --classify";
|
||||
tree = "eza --tree --level=3";
|
||||
lt = "eza -l --sort=modified";
|
||||
lat = "eza -la --sort=modified";
|
||||
lc = "lt --sort=accessed";
|
||||
lT = "lt --reverse";
|
||||
lC = "lc --reverse";
|
||||
lD = "la --only-dirs";
|
||||
"cd.." = "d ..";
|
||||
"cdc" = "d $XDG_CONFIG_HOME";
|
||||
"cdn" = "d $NOTES_PATH";
|
||||
"cdl" = "d $XDG_DOWNLOAD_DIR";
|
||||
"cdg" = "d $XDG_GAMES_DIR";
|
||||
".." = "d ..";
|
||||
"..." = "d ../..";
|
||||
"...." = "d ../../..";
|
||||
"....." = "d ../../../..";
|
||||
"......" = "d ../../../../..";
|
||||
"......." = "d ../../../../../..";
|
||||
"........" = "d ../../../../../../..";
|
||||
"........." = "d ../../../../../../../..";
|
||||
cat = "bat";
|
||||
p = "ping";
|
||||
dc = "docker compose";
|
||||
k = "kubectl";
|
||||
kg = "kubectl get";
|
||||
v = "$EDITOR";
|
||||
sv = "sudo $EDITOR";
|
||||
kssh = "kitty +kitten ssh";
|
||||
};
|
||||
};
|
||||
|
||||
eza = {
|
||||
enable = true;
|
||||
package = inputs.nixpkgs-unstable.legacyPackages.${system}.eza;
|
||||
};
|
||||
|
||||
skim = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
|
||||
nix-index = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
};
|
||||
|
||||
# maybe we can share somehow so things for nix-y systems and non-nix-y systems alike
|
||||
# am I going to _have_ non-nix systems anymore?
|
||||
}
|
|
@ -1,153 +0,0 @@
|
|||
# prompt
|
||||
function get_hostname
|
||||
if test (uname) = Linux || test (uname) = Darwin
|
||||
has_command hostname && hostname | cut -d. -f1 || cat /etc/hostname
|
||||
else
|
||||
# assume bsd
|
||||
hostname | head -n 1 | cut -d. -f1
|
||||
end
|
||||
end
|
||||
|
||||
function fish_greeting
|
||||
_prompt_prefix
|
||||
printf "%s\n" (date)
|
||||
end
|
||||
|
||||
function preprocess_pwd
|
||||
test (pwd) = / && echo "/" && return 1
|
||||
test (pwd) = $NICE_HOME && echo "~" && return 0
|
||||
pwd \
|
||||
| cut -c2- \
|
||||
| gawk '{n=split($0,p,"/");for(i=1;i<=n;i++){if(i==n){printf "/%s",p[i]}else{printf "/%.3s",p[i]}}}'
|
||||
end
|
||||
|
||||
function _maybe_sudo_prefix
|
||||
if set -q SUDO_USER
|
||||
set_color -b yellow black
|
||||
printf " SUDO "
|
||||
set_color -b normal normal
|
||||
printf " "
|
||||
end
|
||||
end
|
||||
|
||||
function _maybe_aws_profile
|
||||
if set -q AWS_PROFILE && test $AWS_PROFILE = prd
|
||||
printf " "
|
||||
set_color -b yellow black
|
||||
printf " AWS_PROFILE=prd "
|
||||
set_color -b normal normal
|
||||
end
|
||||
end
|
||||
|
||||
function _user_and_host
|
||||
if test $argv[1] -eq 0
|
||||
set_color -b normal blue
|
||||
else
|
||||
set_color -b normal red
|
||||
end
|
||||
printf "%s@%s" $USER (get_hostname)
|
||||
end
|
||||
|
||||
function _cur_work_dir
|
||||
set_color -b normal magenta
|
||||
printf " %s" (preprocess_pwd)
|
||||
end
|
||||
|
||||
function _last_cmd_duration
|
||||
set_color -b normal green
|
||||
set -q CMD_DURATION && printf " %dms" $CMD_DURATION
|
||||
end
|
||||
|
||||
function _maybe_jobs_summary
|
||||
if jobs -q
|
||||
set_color -b normal cyan
|
||||
printf " &%d" (jobs -p | wc -l)
|
||||
end
|
||||
end
|
||||
|
||||
function _user_prompt
|
||||
printf "\n"
|
||||
set_color brblack
|
||||
if test (id -u) -eq 0
|
||||
printf '# '
|
||||
else
|
||||
printf '$ '
|
||||
end
|
||||
set_color -b normal normal
|
||||
end
|
||||
|
||||
function _maybe_git_summary
|
||||
set_color -b normal yellow
|
||||
set cur_sha (git rev-parse --short HEAD 2>/dev/null)
|
||||
if test $status = 0
|
||||
set num_changes (git status --porcelain | wc -l | string trim)
|
||||
if test $num_changes = 0
|
||||
set num_changes "✔"
|
||||
else
|
||||
set num_changes "+$num_changes"
|
||||
end
|
||||
printf " %s %s %s" (git branch --show-current) $cur_sha $num_changes
|
||||
end
|
||||
end
|
||||
|
||||
function _prompt_marker
|
||||
# printf "%b133;A%b" "\x1b\x5d" "\x1b\x5c"
|
||||
end
|
||||
|
||||
function _prompt_continuation_marker
|
||||
# printf "%b133;A;k=s%b" "\x1b\x5d" "\x1b\x5c"
|
||||
end
|
||||
|
||||
function cmd_marker --on-variable _
|
||||
# printf "%b133;C%b" "\x1b\x5d" "\x1b\x5c"
|
||||
end
|
||||
|
||||
function _prompt_prefix
|
||||
set_color -b normal brblack
|
||||
printf "# "
|
||||
end
|
||||
|
||||
function fish_prompt
|
||||
set last_cmd_status $status
|
||||
_prompt_marker
|
||||
_prompt_prefix
|
||||
_maybe_sudo_prefix
|
||||
_user_and_host $last_cmd_status
|
||||
_cur_work_dir
|
||||
_maybe_git_summary
|
||||
_maybe_aws_profile
|
||||
_last_cmd_duration
|
||||
_maybe_jobs_summary
|
||||
_user_prompt
|
||||
end
|
||||
|
||||
function fish_mode_prompt; end
|
||||
function fish_right_prompt; end
|
||||
|
||||
# key bindings
|
||||
fish_vi_key_bindings
|
||||
|
||||
set --universal fish_cursor_default block
|
||||
set --universal fish_cursor_insert line
|
||||
set --universal fish_cursor_block block
|
||||
fish_vi_cursor
|
||||
set --universal fish_vi_force_cursor 1
|
||||
|
||||
bind --mode insert --sets-mode default jk repaint
|
||||
bind --mode insert --sets-mode default jK repaint
|
||||
bind --mode insert --sets-mode default Jk repaint
|
||||
bind --mode insert --sets-mode default JK repaint
|
||||
bind --mode insert --sets-mode default jj repaint
|
||||
bind --mode insert --sets-mode default jJ repaint
|
||||
bind --mode insert --sets-mode default Jj repaint
|
||||
bind --mode insert --sets-mode default JJ repaint
|
||||
|
||||
bind -M insert \cg skim-cd-widget
|
||||
|
||||
bind -M insert \cp up-or-search
|
||||
bind -M insert \cn down-or-search
|
||||
bind -M insert \ce end-of-line
|
||||
bind -M insert \ca beginning-of-line
|
||||
|
||||
bind -M insert \cv edit_command_buffer
|
||||
bind -M default \cv edit_command_buffer
|
856
home/linux.nix
856
home/linux.nix
|
@ -1,856 +0,0 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
home.pointerCursor = {
|
||||
name = "Bibata-Modern-Classic";
|
||||
package = pkgs.bibata-cursors;
|
||||
size = 64; # TODO: this doesn't seem to work -- at least in Sway
|
||||
# some icons are also missing (hand2?)
|
||||
};
|
||||
|
||||
services = {
|
||||
mako = with config.colorScheme.colors; {
|
||||
enable = true;
|
||||
borderSize = 1;
|
||||
maxVisible = 5;
|
||||
defaultTimeout = 15000;
|
||||
font = "Symbols Nerd Font 12,IosevkaLyteTerm 12";
|
||||
# TODO: config
|
||||
|
||||
backgroundColor = "#${base01}";
|
||||
textColor = "#${base05}";
|
||||
borderColor = "#${base0C}";
|
||||
progressColor = "#${base0A}";
|
||||
|
||||
extraConfig = ''
|
||||
[urgency=high]
|
||||
border-color=#${base0F}
|
||||
[urgency=high]
|
||||
background-color=#${base03}
|
||||
'';
|
||||
};
|
||||
|
||||
# this doesn't work due to weird quoting bugs AFAICT
|
||||
# swayidle = let
|
||||
# bins = rec {
|
||||
# swaylock = builtins.trace "${pkgs.swaylock}/bin/swaylock" "${pkgs.swaylock}/bin/swaylock";
|
||||
# swaymsg = "${pkgs.sway}/bin/swaymsg";
|
||||
# notify-send = "${swaymsg} exec -- ${pkgs.libnotify}/bin/notify-send";
|
||||
# };
|
||||
# in (with bins; {
|
||||
# enable = true;
|
||||
|
||||
# events = [
|
||||
# {
|
||||
# event = "before-sleep";
|
||||
# command = swaylock;
|
||||
# }
|
||||
# ];
|
||||
|
||||
# timeouts = [
|
||||
# {
|
||||
# timeout = 5;
|
||||
# command = "${notify-send} \\\"Idling in 300 seconds\\\"";
|
||||
# resumeCommand = "${notify-send} \\\"Idling cancelled.\\\"";
|
||||
# }
|
||||
# {
|
||||
# # timeout = 540;
|
||||
# timeout = 6;
|
||||
# command = "${notify-send} 'Idling in 90 seconds'";
|
||||
# }
|
||||
# {
|
||||
# # timeout = 570;
|
||||
# timeout = 7;
|
||||
# command = "${notify-send} 'Idling in 60 seconds'";
|
||||
# }
|
||||
# {
|
||||
# # timeout = 600;
|
||||
# timeout = 8;
|
||||
# command = "${notify-send} 'Idling in 30 seconds...'";
|
||||
# }
|
||||
# {
|
||||
# # timeout = 630;
|
||||
# timeout = 9;
|
||||
# command = "${swaylock} -f";
|
||||
# }
|
||||
# {
|
||||
# # timeout = 660;
|
||||
# timeout = 10;
|
||||
# command = "${swaymsg} 'output * dpms off'";
|
||||
# resumeCommand = "${swaymsg} 'output * dpms on' & ${swaymsg} exec -- maybe-good-morning &";
|
||||
# }
|
||||
# ];
|
||||
# });
|
||||
};
|
||||
|
||||
wayland.windowManager.sway = {
|
||||
# TODO:
|
||||
# + Super+r should rotate the selected group of windows.
|
||||
# + Super+Control+{1-9} should control the size of the preselect space.
|
||||
# + Super+Shift+b should balance the size of all selected nodes.
|
||||
# set $tilers "(wezterm.*|kitty.*|firefox.*|slack.*|Slack.*|thunar.*|Alacritty.*|alacritty.*|Discord.*|discord.*)"
|
||||
# for_window [title=".*"] floating enable
|
||||
# for_window [app_id=$tilers] floating disable
|
||||
#
|
||||
# # for_window [title=".*"] opacity $opacity
|
||||
#
|
||||
# client.focused #74c7ec #74c7ec #74c7ec #74c7ec #74c7ec
|
||||
# client.focused_inactive #100814 #100814 #9b9ebf #100814 #100814
|
||||
# client.unfocused #100814 #100814 #9b9ebf #100814 #100814
|
||||
#
|
||||
# # TODO: I forget why I needed this - could google it I expect?
|
||||
# exec /usr/lib/polkit-kde-authentication-agent-1
|
||||
#
|
||||
# # prevent all windows from stealing focus
|
||||
# no_focus [class=".*"]
|
||||
|
||||
enable = true;
|
||||
|
||||
systemd = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
config = {
|
||||
output = {
|
||||
"*" = {
|
||||
background = "$HOME/.wallpaper fill";
|
||||
};
|
||||
};
|
||||
|
||||
# TODO: popup_during_fullscreen smart
|
||||
focus = {
|
||||
wrapping = "no";
|
||||
followMouse = "no";
|
||||
mouseWarping = false;
|
||||
};
|
||||
|
||||
modifier = "Mod4";
|
||||
|
||||
gaps = {
|
||||
smartBorders = "on";
|
||||
};
|
||||
|
||||
window = {
|
||||
border = 2;
|
||||
titlebar = false;
|
||||
};
|
||||
|
||||
floating = {
|
||||
modifier = config.wayland.windowManager.sway.config.modifier;
|
||||
titlebar = false;
|
||||
};
|
||||
|
||||
startup = [
|
||||
{
|
||||
command = "systemctl --user restart waybar";
|
||||
always = true;
|
||||
}
|
||||
{
|
||||
command = lib.concatStringsSep " " [
|
||||
"swayidle -w"
|
||||
"timeout 300 'notify-send \"Idling in 300 seconds\"'"
|
||||
"resume 'notify-send \"Idling cancelled.\"'"
|
||||
"timeout 480 'notify-send \"Idling in 120 seconds\"'"
|
||||
"timeout 510 'notify-send \"Idling in 90 seconds\"'"
|
||||
"timeout 540 'notify-send \"Idling in 60 seconds!\"'"
|
||||
"timeout 570 'notify-send \"Idling in 30 seconds!\"'"
|
||||
"timeout 590 'notify-send \"Idling in 10 seconds!\"'"
|
||||
"timeout 591 'notify-send \"Idling in 9 seconds!\"'"
|
||||
"timeout 592 'notify-send \"Idling in 8 seconds!\"'"
|
||||
"timeout 593 'notify-send \"Idling in 7 seconds!\"'"
|
||||
"timeout 594 'notify-send \"Idling in 6 seconds!\"'"
|
||||
"timeout 595 'notify-send \"Idling in 5 seconds!\"'"
|
||||
"timeout 596 'notify-send \"Idling in 4 seconds!\"'"
|
||||
"timeout 597 'notify-send \"Idling in 3 seconds!\"'"
|
||||
"timeout 598 'notify-send \"Idling in 2 seconds!\"'"
|
||||
"timeout 599 'notify-send \"Idling in 1 second!\"'"
|
||||
"timeout 600 'swaylock -f'"
|
||||
"timeout 600 'swaymsg \"output * dpms off\"'"
|
||||
"resume 'swaymsg \"output * dpms on\" & maybe-good-morning &'"
|
||||
"before-sleep 'swaylock'"
|
||||
];
|
||||
}
|
||||
{command = "firefox";}
|
||||
{command = "kitty --single-instance";}
|
||||
];
|
||||
|
||||
modes = {
|
||||
resize = {
|
||||
"h" = "resize shrink width 10 px or 10 ppt";
|
||||
"j" = "resize grow height 10 px or 10 ppt";
|
||||
"k" = "resize shrink height 10 px or 10 ppt";
|
||||
"l" = "resize grow width 10 px or 10 ppt";
|
||||
|
||||
"left" = "resize shrink width 10 px or 10 ppt";
|
||||
"down" = "resize grow height 10 px or 10 ppt";
|
||||
"up" = "resize shrink height 10 px or 10 ppt";
|
||||
"right" = "resize grow width 10 px or 10 ppt";
|
||||
|
||||
"return" = ''mode "default"'';
|
||||
"escape" = ''mode "default"'';
|
||||
};
|
||||
};
|
||||
|
||||
input = {
|
||||
"type:keyboard" = {
|
||||
xkb_options = "ctrl:nocaps";
|
||||
repeat_delay = "200";
|
||||
repeat_rate = "60";
|
||||
};
|
||||
|
||||
"type:pointer" = {
|
||||
accel_profile = "flat";
|
||||
pointer_accel = "0";
|
||||
};
|
||||
|
||||
"type:touchpad" = {
|
||||
dwt = "disabled";
|
||||
tap = "enabled";
|
||||
natural_scroll = "enabled";
|
||||
middle_emulation = "enabled";
|
||||
# pointer_accel
|
||||
};
|
||||
};
|
||||
keybindings = let
|
||||
mod = config.wayland.windowManager.sway.config.modifier;
|
||||
in {
|
||||
# bindsym $mod+shift+space exec wofi --show drun
|
||||
"${mod}+control+space" = "exec makoctl dismiss";
|
||||
"${mod}+shift+space" = "exec makoctl invoke";
|
||||
"${mod}+return" = "exec kitty --single-instance";
|
||||
"${mod}+shift+return" = "exec floating-term";
|
||||
"${mod}+shift+alt+return" = "exec kitty";
|
||||
"${mod}+c" = "kill";
|
||||
"${mod}+shift+c" = "kill # TODO: kill -9?";
|
||||
"${mod}+space" = "exec wofi --show drun";
|
||||
"${mod}+shift+s" = "exec clipshot";
|
||||
"${mod}+e" = "exec thunar";
|
||||
"${mod}+shift+r" = "reload";
|
||||
"${mod}+control+Escape" = "exit";
|
||||
"${mod}+shift+e" = "exit";
|
||||
"${mod}+shift+p" = "exec pass-chooser";
|
||||
"${mod}+control+j" = "split v";
|
||||
"${mod}+control+l" = "split h";
|
||||
"${mod}+control+f" = "focus mode_toggle";
|
||||
|
||||
"${mod}+h" = "focus left";
|
||||
"${mod}+j" = "focus down";
|
||||
"${mod}+k" = "focus up";
|
||||
"${mod}+l" = "focus right";
|
||||
|
||||
"${mod}+left" = "focus left";
|
||||
"${mod}+down" = "focus down";
|
||||
"${mod}+up" = "focus up";
|
||||
"${mod}+right" = "focus right";
|
||||
|
||||
"${mod}+shift+h" = "move left";
|
||||
"${mod}+shift+j" = "move down";
|
||||
"${mod}+shift+k" = "move up";
|
||||
"${mod}+shift+l" = "move right";
|
||||
|
||||
"${mod}+shift+left" = "move left";
|
||||
"${mod}+shift+down" = "move down";
|
||||
"${mod}+shift+up" = "move up";
|
||||
"${mod}+shift+right" = "move right";
|
||||
|
||||
"${mod}+1" = "workspace 1";
|
||||
"${mod}+2" = "workspace 2";
|
||||
"${mod}+3" = "workspace 3";
|
||||
"${mod}+4" = "workspace 4";
|
||||
"${mod}+5" = "workspace 5";
|
||||
"${mod}+6" = "workspace 6";
|
||||
"${mod}+7" = "workspace 7";
|
||||
"${mod}+8" = "workspace 8";
|
||||
"${mod}+9" = "workspace 9";
|
||||
"${mod}+0" = "workspace 10";
|
||||
|
||||
"${mod}+shift+1" = "move container to workspace 1";
|
||||
"${mod}+shift+2" = "move container to workspace 2";
|
||||
"${mod}+shift+3" = "move container to workspace 3";
|
||||
"${mod}+shift+4" = "move container to workspace 4";
|
||||
"${mod}+shift+5" = "move container to workspace 5";
|
||||
"${mod}+shift+6" = "move container to workspace 6";
|
||||
"${mod}+shift+7" = "move container to workspace 7";
|
||||
"${mod}+shift+8" = "move container to workspace 8";
|
||||
"${mod}+shift+9" = "move container to workspace 9";
|
||||
"${mod}+shift+0" = "move container to workspace 10";
|
||||
|
||||
"${mod}+b" = "splith";
|
||||
"${mod}+v" = "splitv";
|
||||
|
||||
"${mod}+shift+f" = "fullscreen toggle";
|
||||
"${mod}+f" = "floating toggle";
|
||||
"${mod}+s" = "floating disable";
|
||||
"${mod}+alt+f" = "focus mode_toggle";
|
||||
"${mod}+p" = "focus parent";
|
||||
"${mod}+period" = "focus child";
|
||||
"${mod}+comma" = "focus child";
|
||||
"${mod}+tab" = "workspace back_and_forth";
|
||||
|
||||
"${mod}+minus" = "gaps inner current minus 5";
|
||||
"${mod}+plus" = "gaps inner current plus 5";
|
||||
"${mod}+control+alt+h" = "gaps horizontal current minus 5";
|
||||
"${mod}+control+alt+l" = "gaps horizontal current plus 5";
|
||||
"${mod}+control+alt+j" = "gaps vertical current minus 5";
|
||||
"${mod}+control+alt+k" = "gaps vertical current plus 5";
|
||||
|
||||
# TODO: this should also reset the horizontal and vertical gaps?
|
||||
"${mod}+control+equal" = "gaps inner current set 0";
|
||||
|
||||
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||
"XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||
"control+XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%";
|
||||
"control+XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%";
|
||||
"XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
"XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||
"XF86MonBrightnessDown" = "exec brightnessctl set 10%-";
|
||||
"XF86MonBrightnessUp" = "exec brightnessctl set +10%";
|
||||
"shift+XF86MonBrightnessDown" = "exec brightnessctl set 1%";
|
||||
"shift+XF86MonBrightnessUp" = "exec brightnessctl set 100%";
|
||||
"control+XF86MonBrightnessDown" = "exec brightnessctl set 1%-";
|
||||
"control+XF86MonBrightnessUp" = "exec brightnessctl set +1%";
|
||||
"XF86AudioPlay" = "exec playerctl play-pause";
|
||||
"XF86AudioNext" = "exec playerctl next";
|
||||
"XF86AudioPrev" = "exec playerctl previous";
|
||||
"${mod}+shift+v" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||
|
||||
"${mod}+control+shift+l" = "exec swaylock";
|
||||
|
||||
"${mod}+shift+alt+f" = "for_window [class=$tilers] floating toggle";
|
||||
};
|
||||
assigns = {};
|
||||
bars = [];
|
||||
colors = with config.colorScheme.colors; {
|
||||
background = "#1e1e2e";
|
||||
focused = {
|
||||
background = base03;
|
||||
border = base0C;
|
||||
childBorder = base0C;
|
||||
indicator = base0C;
|
||||
text = base05;
|
||||
};
|
||||
focusedInactive = {
|
||||
background = base03;
|
||||
border = base0D;
|
||||
childBorder = base0D;
|
||||
indicator = base0D;
|
||||
text = base05;
|
||||
};
|
||||
placeholder = {
|
||||
background = base03;
|
||||
border = base0D;
|
||||
childBorder = base0D;
|
||||
indicator = base0D;
|
||||
text = base05;
|
||||
};
|
||||
unfocused = {
|
||||
background = base03;
|
||||
border = base03;
|
||||
childBorder = base03;
|
||||
indicator = base03;
|
||||
text = base05;
|
||||
};
|
||||
urgent = {
|
||||
background = base03;
|
||||
border = base0F;
|
||||
childBorder = base0F;
|
||||
indicator = base0F;
|
||||
text = base05;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme = {
|
||||
name = "Catppuccin-Mocha-Compact-Sapphire-dark";
|
||||
package = pkgs.catppuccin-gtk.override {
|
||||
accents = ["sapphire"];
|
||||
size = "compact";
|
||||
tweaks = ["rimless" "black"];
|
||||
variant = "mocha";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = [
|
||||
(pkgs.buildEnv {
|
||||
name = "my-linux-scripts";
|
||||
paths = [./scripts/linux];
|
||||
})
|
||||
];
|
||||
|
||||
programs = {
|
||||
# TODO: hyprland = {
|
||||
# enable = true;
|
||||
# };
|
||||
|
||||
waybar = {
|
||||
enable = true;
|
||||
settings = {
|
||||
mainBar = {
|
||||
"layer" = "top";
|
||||
"position" = "bottom";
|
||||
"output" = ["eDP-1" "DP-3"];
|
||||
"height" = 32;
|
||||
"modules-left" = ["clock" "sway/window"];
|
||||
"modules-center" = ["sway/workspaces"];
|
||||
"modules-right" = [
|
||||
"mpris"
|
||||
"idle_inhibitor"
|
||||
"bluetooth"
|
||||
# "wireplumber",
|
||||
"pulseaudio"
|
||||
# "network",
|
||||
"cpu"
|
||||
"memory"
|
||||
# "temperature",
|
||||
"backlight"
|
||||
"battery"
|
||||
"tray"
|
||||
];
|
||||
"bluetooth" = {
|
||||
"format" = "<span</span>";
|
||||
"format-connected" = "<span></span>";
|
||||
"format-connected-battery" = "<span></span>";
|
||||
# "format-device-preference" = [ "device1", "device2" ], # preference list deciding the displayed devic;
|
||||
"tooltip-format" = "{controller_alias}@{controller_address} ({num_connections} connected)";
|
||||
"tooltip-format-connected" = "{controller_alias}@{controller_address} ({num_connections} connected)\n{device_enumerate}";
|
||||
"tooltip-format-enumerate-connected" = "{device_alias}@{device_address}";
|
||||
"tooltip-format-enumerate-connected-battery" = "{device_alias}@{device_address} ( {device_battery_percentage}%)";
|
||||
};
|
||||
# "wireplumber" = ;
|
||||
# "format" = "{volume}% {icon}";
|
||||
# "format-muted" = "";
|
||||
# "on-click" = "helvum;
|
||||
# },
|
||||
"sway/workspaces" = {
|
||||
"disable-scroll" = false;
|
||||
"persistent_workspaces" = {
|
||||
"1" = [];
|
||||
"2" = [];
|
||||
"3" = [];
|
||||
"4" = [];
|
||||
"5" = [];
|
||||
"6" = [];
|
||||
"7" = [];
|
||||
"8" = [];
|
||||
"9" = [];
|
||||
# "10" = [;
|
||||
};
|
||||
"all-outputs" = true;
|
||||
"format" = "{name}";
|
||||
};
|
||||
"idle_inhibitor" = {
|
||||
"format" = "{icon}";
|
||||
"format-icons" = {
|
||||
"activated" = "";
|
||||
"deactivated" = "";
|
||||
};
|
||||
};
|
||||
"tray" = {
|
||||
"icon-size" = 24;
|
||||
"spacing" = 4;
|
||||
};
|
||||
"clock" = {
|
||||
"interval" = 1;
|
||||
"format" = "{:%a %b %d %H:%M:%S}";
|
||||
};
|
||||
"cpu" = {
|
||||
"format" = "{usage} <span></span>";
|
||||
"tooltip" = true;
|
||||
"interval" = 3;
|
||||
};
|
||||
"memory" = {
|
||||
"format" = "{} ";
|
||||
};
|
||||
"temperature" = {
|
||||
# "thermal-zone" = 2;
|
||||
# "hwmon-path" = "/sys/class/hwmon/hwmon2/temp1_input";
|
||||
"critical-threshold" = 80;
|
||||
# "format-critical" = "{temperatureC}°C {icon}";
|
||||
"format" = "{temperatureC}°C {icon}";
|
||||
"format-icons" = ["" "" ""];
|
||||
};
|
||||
"backlight" = {
|
||||
# "device" = "acpi_video1";
|
||||
"format" = "{percent}% {icon}";
|
||||
"format-icons" = ["" ""];
|
||||
};
|
||||
"battery" = {
|
||||
"states" = {
|
||||
# "good" = 95;
|
||||
"warning" = 30;
|
||||
"critical" = 1;
|
||||
};
|
||||
"format" = "{capacity}% {icon}";
|
||||
"format-charging" = "{capacity}% ";
|
||||
"format-plugged" = "{capacity}% ";
|
||||
"format-alt" = "{time} {icon}";
|
||||
"format-good" = ""; # An empty format will hide the modul;
|
||||
"format-full" = "";
|
||||
"format-icons" = ["" "" "" "" ""];
|
||||
};
|
||||
"network" = {
|
||||
"format-wifi" = "{essid} ({signalStrength}%) ";
|
||||
"format-ethernet" = "{ifname}: {ipaddr}/{cidr} ";
|
||||
"format-linked" = "{ifname} (No IP) ";
|
||||
"format-disconnected" = "Disconnected ⚠";
|
||||
"format-alt" = "{ifname}: {ipaddr}/{cidr}";
|
||||
};
|
||||
"mpris" = {
|
||||
"format" = "{title} by {artist}";
|
||||
};
|
||||
"pulseaudio" = {
|
||||
# "scroll-step" = 1, # %, can be a floa;
|
||||
"format" = "{volume} {icon} <span>{format_source}</span>";
|
||||
#"format" = "{volume}% {icon} {format_source}";
|
||||
#"format-bluetooth" = "{volume}% {icon} {format_source}";
|
||||
#"format-bluetooth-muted" = " {icon} {format_source}";
|
||||
#"format-muted" = " {format_source}";
|
||||
"format-muted" = " {format_source}";
|
||||
"format-source" = "";
|
||||
"format-source-muted" = "";
|
||||
"format-icons" = {
|
||||
"headphones" = "";
|
||||
"handsfree" = "";
|
||||
"headset" = "";
|
||||
"phone" = "";
|
||||
"portable" = "";
|
||||
"car" = "";
|
||||
"default" = ["" "" ""];
|
||||
};
|
||||
# TODO: toggle mute?
|
||||
"on-click" = "pavucontrol";
|
||||
};
|
||||
};
|
||||
};
|
||||
style = ''
|
||||
@define-color base #1e1e2e;
|
||||
@define-color mantle #181825;
|
||||
@define-color crust #11111b;
|
||||
|
||||
@define-color text #cdd6f4;
|
||||
@define-color subtext0 #a6adc8;
|
||||
@define-color subtext1 #bac2de;
|
||||
|
||||
@define-color surface0 #313244;
|
||||
@define-color surface1 #45475a;
|
||||
@define-color surface2 #585b70;
|
||||
|
||||
@define-color overlay0 #6c7086;
|
||||
@define-color overlay1 #7f849c;
|
||||
@define-color overlay2 #9399b2;
|
||||
|
||||
@define-color blue #89b4fa;
|
||||
@define-color lavender #b4befe;
|
||||
@define-color sapphire #74c7ec;
|
||||
@define-color sky #89dceb;
|
||||
@define-color teal #94e2d5;
|
||||
@define-color green #a6e3a1;
|
||||
@define-color yellow #f9e2af;
|
||||
@define-color peach #fab387;
|
||||
@define-color maroon #eba0ac;
|
||||
@define-color red #f38ba8;
|
||||
@define-color mauve #cba6f7;
|
||||
@define-color pink #f5c2e7;
|
||||
@define-color flamingo #f2cdcd;
|
||||
@define-color rosewater #f5e0dc;
|
||||
|
||||
* {
|
||||
border-radius: 0;
|
||||
font-family: "IosevkaLyteTerm", "Symbols Nerd Font Mono", sans-serif;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
min-height: 32px;
|
||||
background-color: @base;
|
||||
color: @crust;
|
||||
border-top: solid @sapphire 1px;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
/* opacity: 0.2; */
|
||||
}
|
||||
|
||||
window#waybar.empty {
|
||||
/* opacity: 0.2; */
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 0.75em;
|
||||
background-color: transparent;
|
||||
border-top: solid @sapphire 1px;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
/*
|
||||
* background: rgba(0, 0, 0, 0.2);
|
||||
* box-shadow: inherit;
|
||||
*/
|
||||
}
|
||||
|
||||
#workspaces button.visible {
|
||||
background-color: @base;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
color: @base;
|
||||
background-color: @sapphire;
|
||||
}
|
||||
|
||||
#workspaces button.persistent {
|
||||
color: @surface2;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
color: @base;
|
||||
background-color: @red;
|
||||
border-top: solid @red 1px;
|
||||
}
|
||||
|
||||
#mode {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#clock,
|
||||
#battery,
|
||||
#cpu,
|
||||
#memory,
|
||||
#temperature,
|
||||
#backlight,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#custom-media,
|
||||
#tray,
|
||||
#mode,
|
||||
#idle_inhibitor,
|
||||
#mpris,
|
||||
#window,
|
||||
#mpd {
|
||||
margin-top: 1px;
|
||||
padding: 0 0.75em;
|
||||
background-color: inherit;
|
||||
color: @text;
|
||||
}
|
||||
|
||||
#clock {}
|
||||
|
||||
#battery {
|
||||
/* background-color: #ffffff; */
|
||||
/* color: #000000; */
|
||||
}
|
||||
|
||||
#battery.charging {
|
||||
/* color: #ffffff; */
|
||||
/* background-color: #26A65B; */
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
background-color: @red;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
#bluetooth,
|
||||
#bluetooth.connected-battery,
|
||||
#bluetooth.connected.battery,
|
||||
#bluetooth.connected {
|
||||
color: @text;
|
||||
}
|
||||
|
||||
label:focus {
|
||||
/* background-color: #000000; */
|
||||
}
|
||||
|
||||
#cpu {
|
||||
/* background-color: #2ecc71; */
|
||||
/* color: #000000; */
|
||||
}
|
||||
|
||||
#memory {
|
||||
/* background-color: #9b59b6; */
|
||||
}
|
||||
|
||||
#backlight {
|
||||
/* background-color: #90b1b1; */
|
||||
}
|
||||
|
||||
#network {
|
||||
/* background-color: #2980b9; */
|
||||
}
|
||||
|
||||
#network.disconnected {
|
||||
/* background-color: #f53c3c; */
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
color: @red;
|
||||
/* background-color: #f1c40f; */
|
||||
/* color: #000000; */
|
||||
}
|
||||
|
||||
#pulseaudio.source-muted {
|
||||
/* background-color: #90b1b1; */
|
||||
color: @text;
|
||||
}
|
||||
|
||||
#custom-media {
|
||||
/* background-color: #66cc99; */
|
||||
/* color: #2a5c45; */
|
||||
/* min-width: 100px; */
|
||||
}
|
||||
|
||||
#custom-media.custom-spotify {
|
||||
/* background-color: #66cc99; */
|
||||
}
|
||||
|
||||
#custom-media.custom-vlc {
|
||||
/* background-color: #ffa000; */
|
||||
}
|
||||
|
||||
#temperature {
|
||||
/* background-color: #f0932b; */
|
||||
}
|
||||
|
||||
#temperature.critical {
|
||||
/* background-color: #eb4d4b; */
|
||||
}
|
||||
|
||||
#tray {
|
||||
/* background-color: #2980b9; */
|
||||
}
|
||||
|
||||
#idle_inhibitor {
|
||||
/* background-color: #2d3436; */
|
||||
}
|
||||
|
||||
#idle_inhibitor.activated {
|
||||
/* background-color: #ecf0f1; */
|
||||
/* color: #2d3436; */
|
||||
}
|
||||
|
||||
#mpd {
|
||||
/* background-color: #66cc99; */
|
||||
/* color: #2a5c45; */
|
||||
}
|
||||
|
||||
#mpd.disconnected {
|
||||
/* background-color: #f53c3c; */
|
||||
}
|
||||
|
||||
#mpd.stopped {
|
||||
/* background-color: #90b1b1; */
|
||||
}
|
||||
|
||||
#mpd.paused {
|
||||
/* background-color: #51a37a; */
|
||||
}
|
||||
'';
|
||||
systemd = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
firefox = {
|
||||
# TODO: this should be able to work on macos, no?
|
||||
# TODO: enable dark theme by default
|
||||
enable = true;
|
||||
|
||||
# TODO: uses nixpkgs.pass so pass otp doesn't work
|
||||
package = pkgs.firefox.override {extraNativeMessagingHosts = [pkgs.passff-host];};
|
||||
|
||||
# extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||
# ublock-origin
|
||||
# ]; # TODO: would be nice to have _all_ my firefox stuff managed here instead of Firefox Sync maybe?
|
||||
|
||||
profiles = {
|
||||
daniel = {
|
||||
id = 0;
|
||||
settings = {
|
||||
"general.smoothScroll" = true;
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);
|
||||
// user_pref("full-screen-api.ignore-widgets", true);
|
||||
user_pref("media.ffmpeg.vaapi.enabled", true);
|
||||
user_pref("media.rdd-vpx.enabled", true);
|
||||
'';
|
||||
|
||||
userChrome = ''
|
||||
#TabsToolbar {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
#webrtcIndicator {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#main-window[tabsintitlebar="
|
||||
true "]:not([extradragspace="
|
||||
true "]) #TabsToolbar>.toolbar-items {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#main-window:not([tabsintitlebar="
|
||||
true "]) #TabsToolbar {
|
||||
visibility: collapse !important;
|
||||
}
|
||||
'';
|
||||
|
||||
# userContent = ''
|
||||
# '';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
swaylock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
color = "ffffffff";
|
||||
image = "~/.wallpaper";
|
||||
font = "IosevkaLyteTerm";
|
||||
show-failed-attempts = true;
|
||||
ignore-empty-password = true;
|
||||
|
||||
indicator-radius = "150";
|
||||
indicator-thickness = "30";
|
||||
|
||||
inside-color = "11111100";
|
||||
inside-clear-color = "11111100";
|
||||
inside-ver-color = "11111100";
|
||||
inside-wrong-color = "11111100";
|
||||
|
||||
key-hl-color = "a1efe4";
|
||||
separator-color = "11111100";
|
||||
|
||||
line-color = "111111cc";
|
||||
line-uses-ring = true;
|
||||
|
||||
ring-color = "111111cc";
|
||||
ring-clear-color = "f4bf75";
|
||||
ring-ver-color = "66d9ef";
|
||||
ring-wrong-color = "f92672";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
yay -Syu --nodiffmenu --nocleanmenu --noeditmenu
|
||||
|
||||
# TODO: update kernel with a flag?
|
||||
# yes | pacman -Syu && kexec -l --initrd=/boot/initramfs-linux.img /boot/vmlinuz-linux && kexec -e
|
|
@ -1,21 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
usage() {
|
||||
echo "at - waits until after the specified datetime"
|
||||
echo "Usage:"
|
||||
echo " at <DATETIME> && command..."
|
||||
echo
|
||||
echo "Examples:"
|
||||
echo " at 15:00:00 && echo \"it is 3 o'clock\""
|
||||
}
|
||||
|
||||
[[ -z "$1" ]] && { echo "Error: No DATE argument provided." >&2; usage; exit 1; }
|
||||
|
||||
d="$(date -d "${@}" +%s)"
|
||||
while [[ "$d" -ge "$(date +%s)" ]]; do
|
||||
_dt=$((d - $(date +%s)))
|
||||
days=$((_dt / 86400))
|
||||
echo -ne "\rTime Remaining: ${days}d $(date -u --date @$((_dt)) +%H:%M:%S) ";
|
||||
sleep 0.1
|
||||
done
|
||||
exit 0
|
|
@ -1,15 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
[[ $# -lt 1 ]] && { echo "No argument provided." >&2 ; exit 1; }
|
||||
|
||||
d=$(($(date +%s) + $1));
|
||||
echo "Countdown started at $(date)"
|
||||
|
||||
while [[ "$d" -ge "$(date +%s)" ]]; do
|
||||
_dt=$((d - $(date +%s)))
|
||||
days=$((_dt / 86400))
|
||||
echo -ne "\r${days}d $(date -u --date @$((_dt)) +%H:%M:%S) ";
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
echo -ne "\rCountdown finished $(date)\n"
|
|
@ -1,4 +0,0 @@
|
|||
#!/usr/bin/env fish
|
||||
N work/divvy/(date +%Y-%m-%d) && \
|
||||
pushd $NOTES_PATH && git add -A && \
|
||||
git commit -m "Edit work journal entry for "(date +%Y-%m-%d) && nsync
|
|
@ -1,6 +0,0 @@
|
|||
{lib, ...}: let
|
||||
username = "daniel.flanagan@divvypay.com";
|
||||
in {
|
||||
home.username = username;
|
||||
home.homeDirectory = "/Users/${username}";
|
||||
}
|
BIN
images/Nix_snowflake_lytedev.png
Normal file
BIN
images/Nix_snowflake_lytedev.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
380
images/Nix_snowflake_lytedev.svg
Normal file
380
images/Nix_snowflake_lytedev.svg
Normal file
|
@ -0,0 +1,380 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="141.5919mm"
|
||||
height="122.80626mm"
|
||||
viewBox="0 0 501.70361 435.14028"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)"
|
||||
sodipodi:docname="Nix_snowflake_lytedev.svg"
|
||||
inkscape:export-filename="Nix_snowflake_lytedev.png"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5562">
|
||||
<stop
|
||||
style="stop-color:#699ad7;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop5564" />
|
||||
<stop
|
||||
id="stop5566"
|
||||
offset="0.24345198"
|
||||
style="stop-color:#7eb1dd;stop-opacity:1" />
|
||||
<stop
|
||||
style="stop-color:#7ebae4;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop5568" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5053">
|
||||
<stop
|
||||
style="stop-color:#415e9a;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop5055" />
|
||||
<stop
|
||||
id="stop5057"
|
||||
offset="0.23168644"
|
||||
style="stop-color:#4a6baf;stop-opacity:1" />
|
||||
<stop
|
||||
style="stop-color:#5277c3;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop5059" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5960"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop5962"
|
||||
offset="0"
|
||||
style="stop-color:#637ddf;stop-opacity:1" />
|
||||
<stop
|
||||
style="stop-color:#649afa;stop-opacity:1"
|
||||
offset="0.23168644"
|
||||
id="stop5964" />
|
||||
<stop
|
||||
id="stop5966"
|
||||
offset="1"
|
||||
style="stop-color:#719efa;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5867">
|
||||
<stop
|
||||
style="stop-color:#7363df;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop5869" />
|
||||
<stop
|
||||
id="stop5871"
|
||||
offset="0.23168644"
|
||||
style="stop-color:#6478fa;stop-opacity:1" />
|
||||
<stop
|
||||
style="stop-color:#719efa;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop5873" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
y2="515.97058"
|
||||
x2="282.26105"
|
||||
y1="338.62445"
|
||||
x1="213.95642"
|
||||
gradientTransform="translate(983.36076,601.38885)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient5855"
|
||||
xlink:href="#linearGradient5960"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="515.97058"
|
||||
x2="282.26105"
|
||||
y1="338.62445"
|
||||
x1="213.95642"
|
||||
gradientTransform="translate(-197.75174,-337.1451)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient5855-8"
|
||||
xlink:href="#linearGradient5867"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="247.58188"
|
||||
x2="-702.75317"
|
||||
y1="102.74675"
|
||||
x1="-775.20807"
|
||||
gradientTransform="translate(983.36076,601.38885)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient4544"
|
||||
xlink:href="#linearGradient5960"
|
||||
inkscape:collect="always" />
|
||||
<clipPath
|
||||
id="clipPath4501"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<circle
|
||||
r="241.06563"
|
||||
cy="686.09473"
|
||||
cx="335.13995"
|
||||
id="circle4503"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#adadad;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipPath5410"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<circle
|
||||
r="241.13741"
|
||||
cy="340.98975"
|
||||
cx="335.98114"
|
||||
id="circle5412"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
</clipPath>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5053"
|
||||
id="linearGradient5137"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(864.55062,-2197.497)"
|
||||
x1="-584.19934"
|
||||
y1="782.33563"
|
||||
x2="-496.29703"
|
||||
y2="937.71399" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5053"
|
||||
id="linearGradient5147"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(864.55062,-2197.497)"
|
||||
x1="-584.19934"
|
||||
y1="782.33563"
|
||||
x2="-496.29703"
|
||||
y2="937.71399" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5562"
|
||||
id="linearGradient5162"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(70.505061,-1761.3076)"
|
||||
x1="200.59668"
|
||||
y1="351.41116"
|
||||
x2="290.08701"
|
||||
y2="506.18814" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5562"
|
||||
id="linearGradient5172"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(70.505061,-1761.3076)"
|
||||
x1="200.59668"
|
||||
y1="351.41116"
|
||||
x2="290.08701"
|
||||
y2="506.18814" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5562"
|
||||
id="linearGradient5182"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(70.505061,-1761.3076)"
|
||||
x1="200.59668"
|
||||
y1="351.41116"
|
||||
x2="290.08701"
|
||||
y2="506.18814" />
|
||||
<linearGradient
|
||||
y2="506.18814"
|
||||
x2="290.08701"
|
||||
y1="351.41116"
|
||||
x1="200.59668"
|
||||
gradientTransform="translate(70.505061,-1761.3076)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient5201"
|
||||
xlink:href="#linearGradient5562"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="937.71399"
|
||||
x2="-496.29703"
|
||||
y1="782.33563"
|
||||
x1="-584.19934"
|
||||
gradientTransform="translate(864.55062,-2197.497)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient5205"
|
||||
xlink:href="#linearGradient5053"
|
||||
inkscape:collect="always" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.98318225"
|
||||
inkscape:cx="112.8987"
|
||||
inkscape:cy="191.21582"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="2059"
|
||||
inkscape:window-height="1588"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:snap-global="true"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:showpageshadow="0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#505050" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="print-logo"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
style="display:inline"
|
||||
transform="translate(-156.33871,933.1905)">
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5277c3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 309.40365,-710.2521 122.19683,211.6751 -56.15706,0.5268 -32.6236,-56.8692 -32.85645,56.5653 -27.90237,-0.011 -14.29086,-24.6896 46.81047,-80.4902 -33.22946,-57.8256 z"
|
||||
id="path4861"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccc" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#df3c59;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 353.50926,-797.4433 -122.21756,211.6631 -28.53477,-48.37 32.93839,-56.6875 -65.41521,-0.1719 -13.9414,-24.1698 14.23637,-24.721 93.11177,0.2939 33.46371,-57.6903 z"
|
||||
id="use4863"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccc" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#df3c59;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 362.88537,-628.243 244.41439,0.012 -27.62229,48.8968 -65.56199,-0.1817 32.55876,56.7371 -13.96098,24.1585 -28.52722,0.032 -46.3013,-80.7841 -66.69317,-0.1353 z"
|
||||
id="use4865"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccc" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#df3c59;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 505.14318,-720.9886 -122.19683,-211.6751 56.15706,-0.5268 32.6236,56.8692 32.85645,-56.5653 27.90237,0.011 14.29086,24.6896 -46.81047,80.4902 33.22946,57.8256 z"
|
||||
id="use4867"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccc" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4873"
|
||||
d="m 309.40365,-710.2521 122.19683,211.6751 -56.15706,0.5268 -32.6236,-56.8692 -32.85645,56.5653 -27.90237,-0.011 -14.29086,-24.6896 46.81047,-80.4902 -33.22946,-57.8256 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#8e293b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="use4875"
|
||||
d="m 451.3364,-803.53264 -244.4144,-0.012 27.62229,-48.89685 65.56199,0.18175 -32.55875,-56.73717 13.96097,-24.15851 28.52722,-0.0315 46.3013,80.78414 66.69317,0.13524 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#8e293b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="use4877"
|
||||
d="m 460.87178,-633.8425 122.21757,-211.66304 28.53477,48.37003 -32.93839,56.68751 65.4152,0.1718 13.9414,24.1698 -14.23636,24.7211 -93.11177,-0.294 -33.46371,57.6904 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#8e293b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<g
|
||||
id="layer2"
|
||||
inkscape:label="guides"
|
||||
style="display:none"
|
||||
transform="translate(72.039038,-1799.4476)">
|
||||
<path
|
||||
d="M 460.60629,594.72881 209.74183,594.7288 84.309616,377.4738 209.74185,160.21882 l 250.86446,1e-5 125.43222,217.255 z"
|
||||
inkscape:randomized="0"
|
||||
inkscape:rounded="0"
|
||||
inkscape:flatsided="true"
|
||||
sodipodi:arg2="1.5707963"
|
||||
sodipodi:arg1="1.0471976"
|
||||
sodipodi:r2="217.25499"
|
||||
sodipodi:r1="250.86446"
|
||||
sodipodi:cy="377.47382"
|
||||
sodipodi:cx="335.17407"
|
||||
sodipodi:sides="6"
|
||||
id="path6032"
|
||||
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.236;fill:#4e4d52;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
|
||||
sodipodi:type="star" />
|
||||
<path
|
||||
transform="translate(0,-308.26772)"
|
||||
sodipodi:type="star"
|
||||
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#4e4d52;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
|
||||
id="path5875"
|
||||
sodipodi:sides="6"
|
||||
sodipodi:cx="335.17407"
|
||||
sodipodi:cy="685.74158"
|
||||
sodipodi:r1="100.83495"
|
||||
sodipodi:r2="87.32563"
|
||||
sodipodi:arg1="1.0471976"
|
||||
sodipodi:arg2="1.5707963"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m 385.59154,773.06721 -100.83495,0 -50.41747,-87.32564 50.41748,-87.32563 100.83495,10e-6 50.41748,87.32563 z" />
|
||||
<path
|
||||
transform="translate(0,-308.26772)"
|
||||
sodipodi:nodetypes="ccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5851"
|
||||
d="m 1216.5591,938.53395 123.0545,228.14035 -42.6807,-1.2616 -43.4823,-79.7725 -39.6506,80.3267 -32.6875,-19.7984 53.4737,-100.2848 -37.1157,-73.88955 z"
|
||||
style="fill:url(#linearGradient5855);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<rect
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.415;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#c53a3a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect5884"
|
||||
width="48.834862"
|
||||
height="226.22897"
|
||||
x="-34.74221"
|
||||
y="446.17056"
|
||||
transform="rotate(-30)" />
|
||||
<path
|
||||
transform="translate(0,-308.26772)"
|
||||
sodipodi:type="star"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.509;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="path3428"
|
||||
sodipodi:sides="6"
|
||||
sodipodi:cx="223.93674"
|
||||
sodipodi:cy="878.63831"
|
||||
sodipodi:r1="28.048939"
|
||||
sodipodi:r2="24.291094"
|
||||
sodipodi:arg1="0"
|
||||
sodipodi:arg2="0.52359878"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m 251.98568,878.63831 -14.02447,24.29109 h -28.04894 l -14.02447,-24.29109 14.02447,-24.2911 h 28.04894 z" />
|
||||
<use
|
||||
x="0"
|
||||
y="0"
|
||||
xlink:href="#rect5884"
|
||||
id="use4252"
|
||||
transform="rotate(60,268.29786,489.4515)"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
<rect
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:0.650794;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect4254"
|
||||
width="5.3947482"
|
||||
height="115.12564"
|
||||
x="545.71014"
|
||||
y="467.07007"
|
||||
transform="rotate(30,575.23539,-154.13386)" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 19 KiB |
101
lib/colors.nix
Normal file
101
lib/colors.nix
Normal file
|
@ -0,0 +1,101 @@
|
|||
{lib, ...}: {
|
||||
schemes = let
|
||||
mkColorScheme = scheme @ {
|
||||
scheme-name,
|
||||
bg,
|
||||
bg2,
|
||||
bg3,
|
||||
bg4,
|
||||
bg5,
|
||||
fg,
|
||||
fg2,
|
||||
fg3,
|
||||
fgdim,
|
||||
# pink,
|
||||
purple,
|
||||
red,
|
||||
orange,
|
||||
yellow,
|
||||
green,
|
||||
# teal,
|
||||
blue,
|
||||
}: let
|
||||
base =
|
||||
{
|
||||
text = fg;
|
||||
primary = blue;
|
||||
urgent = red;
|
||||
|
||||
# blacks
|
||||
"0" = bg4;
|
||||
"8" = bg5;
|
||||
|
||||
"1" = red;
|
||||
"9" = red;
|
||||
"2" = green;
|
||||
"10" = green;
|
||||
"3" = orange;
|
||||
"11" = orange;
|
||||
"4" = blue;
|
||||
"12" = blue;
|
||||
"5" = purple;
|
||||
"13" = purple;
|
||||
"6" = yellow;
|
||||
"14" = yellow;
|
||||
|
||||
# whites
|
||||
"7" = fg2;
|
||||
"15" = fg3;
|
||||
}
|
||||
// scheme;
|
||||
in
|
||||
base
|
||||
// {
|
||||
withHashPrefix = lib.mapAttrs (_: value: "#${value}") base;
|
||||
};
|
||||
in {
|
||||
donokai = mkColorScheme {
|
||||
scheme-name = "donokai";
|
||||
bg = "110f0a";
|
||||
bg2 = "181818";
|
||||
bg3 = "222222";
|
||||
bg4 = "292929";
|
||||
bg5 = "333333";
|
||||
|
||||
fg = "f8f8f8";
|
||||
fg2 = "d8d8d8";
|
||||
fg3 = "c8c8c8";
|
||||
fgdim = "666666";
|
||||
|
||||
red = "f92672";
|
||||
green = "a6e22e";
|
||||
yellow = "f4bf75";
|
||||
blue = "66d9ef";
|
||||
purple = "ae81ff";
|
||||
# teal = "a1efe4";
|
||||
orange = "fab387";
|
||||
};
|
||||
catppuccin-mocha-sapphire = mkColorScheme {
|
||||
scheme-name = "catppuccin-mocha-sapphire";
|
||||
bg = "1e1e2e";
|
||||
bg2 = "181825";
|
||||
bg3 = "313244";
|
||||
bg4 = "45475a";
|
||||
bg5 = "585b70";
|
||||
|
||||
fg = "cdd6f4";
|
||||
fg2 = "bac2de";
|
||||
fg3 = "a6adc8";
|
||||
fgdim = "6c7086";
|
||||
|
||||
# pink = "f5e0dc";
|
||||
purple = "cba6f7";
|
||||
red = "f38ba8";
|
||||
orange = "fab387";
|
||||
yellow = "f9e2af";
|
||||
green = "a6e3a1";
|
||||
# teal = "94e2d5";
|
||||
blue = "74c7ec";
|
||||
};
|
||||
};
|
||||
}
|
114
lib/internal.md
Normal file
114
lib/internal.md
Normal file
|
@ -0,0 +1,114 @@
|
|||
# Internal Usage
|
||||
|
||||
## Update Server
|
||||
|
||||
**NOTE**: I want to establish a solid way to do this without `root@`.
|
||||
|
||||
```fish
|
||||
g a; set host beefcake; nix run nixpkgs#nixos-rebuild -- --flake ".#$host" \
|
||||
--target-host "root@$host" --build-host "root@$host" \
|
||||
switch --show-trace
|
||||
```
|
||||
|
||||
## Safer Method
|
||||
|
||||
```bash
|
||||
# make sure all files are at least staged so nix flakes will see them
|
||||
git add -A
|
||||
|
||||
# initialize a delayed reboot by a process you can kill later if things look good
|
||||
# note that the amount of time you give it probably needs to be enough time to both complete the upgrade
|
||||
# _and_ perform whatever testing you need
|
||||
host=your_host
|
||||
ssh -t "root@$host" "bash -c '
|
||||
set -m
|
||||
# sleep 30 mins
|
||||
(sleep 1800; reboot;) &
|
||||
jobs -p
|
||||
bg
|
||||
disown
|
||||
'"
|
||||
|
||||
# build the system and start running it, but do NOT set the machine up to boot to that system yet
|
||||
# we will test things and make sure it works first
|
||||
# if it fails, the reboot we started previously will automatically kick in once the timeout is reached
|
||||
# and the machine will boot to the now-previous iteration
|
||||
nix run nixpkgs#nixos-rebuild -- --flake ".#$host" \
|
||||
--target-host "root@$host" --build-host "root@$host" \
|
||||
test --show-trace
|
||||
|
||||
# however you like, verify the system is running as expected
|
||||
# if it is, run the same command with "switch" instead of "test"
|
||||
# otherwise, we will wait until the machine reboots back into the
|
||||
# this is crude, but should be pretty foolproof
|
||||
# the main gotcha is that the system is already unbootable or non-workable, but
|
||||
# if you always use this method, that should be an impossible state to get into
|
||||
|
||||
# if we still have ssh access and the machine fails testing, just rollback
|
||||
# instead of waiting for the reboot
|
||||
ssh "root@$host" nixos-rebuild --rollback switch
|
||||
```
|
||||
|
||||
## Provisioning New NixOS Hosts
|
||||
|
||||
Note that for best results the target flake attribute should first be built and
|
||||
cached to the binary cache at `nix.h.lyte.dev`.
|
||||
|
||||
```bash
|
||||
# establish network access
|
||||
# plug in ethernet or do the wpa_cli song and dance for wifi
|
||||
wpa_cli scan
|
||||
wpa_cli scan_results
|
||||
wpa_cli add_network 0
|
||||
wpa_cli set_network 0 ssid "MY_SSID"
|
||||
wpa_cli set_network 0 psk "MY_WIFI_PASSWORD"
|
||||
wpa_cli enable_network 0
|
||||
wpa_cli save_config
|
||||
|
||||
# disk encryption key (if needed)
|
||||
echo -n "password" > /tmp/secret.key
|
||||
|
||||
# partition disks
|
||||
nix-shell --packages git --run "sudo nix run \
|
||||
--extra-experimental-features nix-command \
|
||||
--extra-experimental-features flakes \
|
||||
github:nix-community/disko -- \
|
||||
--flake 'git+https://git.lyte.dev/lytedev/nix#${PARTITION_SCHEME}' \
|
||||
--mode disko \
|
||||
--arg disks '[ \"/dev/${DISK}\" ]'"
|
||||
|
||||
# install
|
||||
nix-shell --packages git \
|
||||
--run "sudo nixos-install \
|
||||
--no-write-lock-file \
|
||||
--flake 'git+https://git.lyte.dev/lytedev/nix#${FLAKE_ATTR}' \
|
||||
--option trusted-substituters 'https://cache.nixos.org https://nix.h.lyte.dev' \
|
||||
--option trusted-public-keys 'cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0='"
|
||||
```
|
||||
|
||||
Then:
|
||||
|
||||
1. Setup/copy any GPG/SSH keys.
|
||||
|
||||
```shell
|
||||
# from a machine with the key
|
||||
$ gpg --export-secret-key --armor daniel@lyte.dev | ssh $host "umask 077; cat - > p.key"
|
||||
$ rsync -r ~/.ssh $host:~/.ssh
|
||||
|
||||
# on the target machine
|
||||
$ gpg --import ~/p.key && rm ~/p.key
|
||||
$ gpg --edit-key daniel@lyte.dev # trust ultimately
|
||||
```
|
||||
|
||||
2. Setup/copy any password stores.
|
||||
|
||||
```shell
|
||||
$ rsync -r ~/.local/share/password-store $host:~/.local/share/password-store
|
||||
```
|
||||
|
||||
3. Tailscale connection and roles.
|
||||
4. Firefox sync configured.
|
||||
|
||||
# Temporary Firewall Changes
|
||||
|
||||
Source: https://discourse.nixos.org/t/how-to-temporarily-open-a-tcp-port-in-nixos/12306/2
|
File diff suppressed because it is too large
Load diff
114
modules/home-manager/eww/eww.scss
Normal file
114
modules/home-manager/eww/eww.scss
Normal file
|
@ -0,0 +1,114 @@
|
|||
$base: #1e1e2e;
|
||||
$mantle: #181825;
|
||||
$crust: #11111b;
|
||||
$text: #cdd6f4;
|
||||
$subtext0: #a6adc8;
|
||||
$subtext1: #bac2de;
|
||||
$surface0: #313244;
|
||||
$surface1: #45475a;
|
||||
$surface2: #585b70;
|
||||
$overlay0: #6c7086;
|
||||
$overlay1: #7f849c;
|
||||
$overlay2: #9399b2;
|
||||
$blue: #89b4fa;
|
||||
$lavender: #b4befe;
|
||||
$sapphire: #74c7ec;
|
||||
$sky: #89dceb;
|
||||
$teal: #94e2d5;
|
||||
$green: #a6e3a1;
|
||||
$yellow: #f9e2af;
|
||||
$peach: #fab387;
|
||||
$maroon: #eba0ac;
|
||||
$red: #f38ba8;
|
||||
$mauve: #cba6f7;
|
||||
$pink: #f5c2e7;
|
||||
$flamingo: #f2cdcd;
|
||||
$rosewater: #f5e0dc;
|
||||
|
||||
* {
|
||||
all: unset;
|
||||
}
|
||||
|
||||
.bar0,
|
||||
.bar1,
|
||||
.bar {
|
||||
background-color: $base;
|
||||
color: $text;
|
||||
border-radius: 5px;
|
||||
border: solid 0px $base;
|
||||
font-family: IosevkaLyteTerm;
|
||||
font-size: 12.0pt;
|
||||
}
|
||||
|
||||
.leftsidestuff slider {
|
||||
color: $sapphire;
|
||||
}
|
||||
|
||||
.metric {}
|
||||
|
||||
.metric label {
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.metric scale {
|
||||
/*background-color: #ff00ff;*/
|
||||
}
|
||||
|
||||
.metric scale trough {
|
||||
background-color: $surface1;
|
||||
color: $mantle;
|
||||
border-radius: 50px;
|
||||
min-height: 5px;
|
||||
min-width: 50px;
|
||||
}
|
||||
|
||||
.metric scale trough highlight {
|
||||
background-color: $flamingo;
|
||||
color: $base;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.bar0>*,
|
||||
.bar1>*,
|
||||
.bar>* {
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
|
||||
.vol .muted,
|
||||
.mic .live {
|
||||
color: $red;
|
||||
}
|
||||
|
||||
.vol .live,
|
||||
.mic .muted {
|
||||
color: $sapphire;
|
||||
}
|
||||
|
||||
.workspace {
|
||||
/* height: 100%; */
|
||||
/* height: 32px; */
|
||||
margin: 0;
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.workspace.occupied {
|
||||
color: $text;
|
||||
}
|
||||
|
||||
.workspace.occupied.active,
|
||||
.workspace.active {
|
||||
color: $base;
|
||||
background-color: $subtext1;
|
||||
}
|
||||
|
||||
.workspace.occupied.focused.active,
|
||||
.workspace.occupied.focused,
|
||||
.workspace.focused {
|
||||
color: $base;
|
||||
background-color: $sapphire;
|
||||
}
|
105
modules/home-manager/eww/eww.yuck
Normal file
105
modules/home-manager/eww/eww.yuck
Normal file
|
@ -0,0 +1,105 @@
|
|||
(defwidget bar []
|
||||
(centerbox :orientation "h"
|
||||
(leftsidestuff)
|
||||
(box)
|
||||
(rightsidestuff)
|
||||
))
|
||||
|
||||
(defwindow bar0
|
||||
:monitor 0
|
||||
:stacking "fg"
|
||||
:exclusive true
|
||||
:geometry
|
||||
(geometry
|
||||
:x "0%"
|
||||
:y "5px"
|
||||
:width "80%"
|
||||
:height "32px"
|
||||
:anchor "bottom center")
|
||||
(bar))
|
||||
|
||||
(defwindow bar1
|
||||
:monitor 1
|
||||
:stacking "fg"
|
||||
:exclusive true
|
||||
:geometry
|
||||
(geometry
|
||||
:x "0%"
|
||||
:y "5px"
|
||||
:width "80%"
|
||||
:height "32px"
|
||||
:anchor "bottom center")
|
||||
(bar))
|
||||
|
||||
(defwidget rightsidestuff []
|
||||
(box :class "rightsidestuff" :orientation "h" :space-evenly false :halign "end" :valign "center" :spacing 10
|
||||
(music)
|
||||
(systray)
|
||||
))
|
||||
|
||||
(defwidget leftsidestuff []
|
||||
(box :class "leftsidestuff" :orientation "h" :space-evenly false :halign "start" :valign "center" :spacing 10
|
||||
time
|
||||
; TODO: idle inhibitor?
|
||||
; TODO: get these to align properly? icons seem lower than they should be?
|
||||
(box :class "mic" (
|
||||
box :class {micMuted == "false" ? "live" : "muted"} {micMuted == "false" ? " " : " "}
|
||||
) {"${micVolume}%"}
|
||||
)
|
||||
(box :class "vol" (
|
||||
box :class {muted == "false" ? "live" : "muted"} {muted == "false" ? " " : " "}
|
||||
) {"${volume}%"}
|
||||
)
|
||||
{" ${round(EWW_CPU["avg"], 0)}%"}
|
||||
{" ${round(EWW_RAM["used_mem_perc"], 0)}%"}
|
||||
; TODO: have these "widgets" be omitted entirely instead of just empty strings
|
||||
{(showBrightness == "true") ? (" ${brightness}%") : ""}
|
||||
{(showBattery == "true") ? (" ${EWW_BATTERY["BAT1"]["capacity"]}% (${batteryTime})") : ""}
|
||||
(box :orientation "h" :space-evenly false :halign "start" :valign "center" (workspaces))
|
||||
))
|
||||
|
||||
(defwidget music []
|
||||
(box :class "music"
|
||||
:orientation "h"
|
||||
:halign "end"
|
||||
:space-evenly false
|
||||
{music != "" ? "${music}" : ""}))
|
||||
|
||||
(deflisten music :initial ""
|
||||
"playerctl --follow metadata --format '{{ title }} by {{ artist }}' || true")
|
||||
|
||||
(deflisten volume :initial "0"
|
||||
"pamixer --get-volume; pactl subscribe | grep sink --line-buffered | while read i; do pamixer --get-volume; done")
|
||||
|
||||
(deflisten muted :initial "false"
|
||||
"pamixer --get-mute; pactl subscribe | grep sink --line-buffered | while read i; do pamixer --get-mute; done")
|
||||
|
||||
(deflisten micVolume :initial "0"
|
||||
"pamixer --default-source --get-volume; pactl subscribe | grep source --line-buffered | while read i; do pamixer --default-source --get-volume; done")
|
||||
|
||||
(deflisten micMuted :initial "false"
|
||||
"pamixer --default-source --get-mute; pactl subscribe | grep source --line-buffered | while read i; do pamixer --default-source --get-mute; done")
|
||||
|
||||
; "upower -d | rg '\\s*(time to empty|time to full):\\s*(\\d.*)\$' -r '\$2'; upower --monitor-detail | rg '\\s*(time to empty|time to full):\\s*(\\d.*)\$' -r '\$2'")
|
||||
|
||||
; (deflisten batteryTime :initial "unknown"
|
||||
; "upower -d | rg '\s*time to empty:\s*(\d.*)\$' -r '\$1'; upower --monitor-detail | rg '\\s*time to empty:\\s*(\\d.*)\$' -r '\$1'")
|
||||
|
||||
(defpoll time :interval "1s"
|
||||
"date '+%a %b %d %H:%M:%S'")
|
||||
|
||||
(defpoll showBrightness :interval "24h"
|
||||
; if we have at least one file in /sys/class/backlight, we should try and show brightness
|
||||
"if [ \"$(find /sys/class/backlight -mindepth 1 -maxdepth 1 | head -n 1 | wc -l)\" == \"1\" ]; then echo true; else echo false; fi")
|
||||
|
||||
(defpoll showBattery :interval "24h"
|
||||
; if we have at least one battery in /sys/class/power_supply, we should try and show battery levels
|
||||
"if find /sys/class/power_supply -mindepth 1 -maxdepth 1 2>&1 | rg '\/sys\/class\/power_supply\/BAT' 2>&1 > /dev/null; then echo true; else echo false; fi")
|
||||
|
||||
(defpoll brightness :interval "10s"
|
||||
"echo $(((100 * $(brightnessctl get)) / $(brightnessctl max)))")
|
||||
|
||||
(deflisten batteryTime :initial "unknown" "scripts/battery-time.bash")
|
||||
|
||||
(deflisten workspace "scripts/hypr-workspaces.bash")
|
||||
(defwidget workspaces [] (literal :content workspace))
|
3
modules/home-manager/eww/scripts/battery-time.bash
Executable file
3
modules/home-manager/eww/scripts/battery-time.bash
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
{ upower -d; upower --monitor-detail; } \
|
||||
| rg '\s*time to.*:\s*(\d.*)\s*$' -r '$1'
|
78
modules/home-manager/eww/scripts/hypr-workspaces.bash
Executable file
78
modules/home-manager/eww/scripts/hypr-workspaces.bash
Executable file
|
@ -0,0 +1,78 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# TODO: we're mixing bash arrays and not-arrays - get it together
|
||||
declare -A OCCUPIED
|
||||
declare -A ACTIVE
|
||||
declare -A FOCUSED
|
||||
|
||||
#define icons for workspaces 1-9
|
||||
spaces=(1 2 3 4 5 6 7 8 9)
|
||||
icons=(1 2 3 4 5 6 7 8 9)
|
||||
|
||||
occupy() { export OCCUPIED["$1"]=occupied; }
|
||||
unoccupy() { unset "OCCUPIED[$1]"; }
|
||||
|
||||
activate() { export ACTIVE["$1"]=active; }
|
||||
deactivate() { unset "ACTIVE[$1]"; }
|
||||
|
||||
focus() { export FOCUSED["$1"]=focused; }
|
||||
unfocus() { unset "FOCUSED[$1]"; }
|
||||
|
||||
workspaces() {
|
||||
for s in "${spaces[@]}"; do
|
||||
unfocus "$s"
|
||||
deactivate "$s"
|
||||
unoccupy "$s"
|
||||
done
|
||||
|
||||
# TODO: avoid recomputing these each time and actually listen to the events?
|
||||
mons_json=$(hyprctl monitors -j)
|
||||
for num in $(hyprctl workspaces -j | jq -r '.[] | select(.windows > 0) | .id'); do
|
||||
occupy "$num"
|
||||
done
|
||||
|
||||
for num in $(echo "$mons_json" | jq -r '.[].activeWorkspace.id'); do
|
||||
activate "$num"
|
||||
done
|
||||
|
||||
for num in $(echo "$mons_json" | jq -r '.[] | select(.focused) | .activeWorkspace.id'); do
|
||||
focus "$num"
|
||||
done
|
||||
|
||||
# TODO: would be nice to have monitors' workspaces show up in left-to-right
|
||||
# order as laid out in physical/pixel space
|
||||
# this would make glancing at the workspace indicator more intuitive
|
||||
#
|
||||
# TODO: might be nice to exclude certain windows as counting towards "occupation" such as xwaylandvideobridge or w/e
|
||||
#
|
||||
# NOTE: maybe I can group workspaces by their monitor with some mechanism for "unassigned" workspace to show up by a "primary" monitor
|
||||
|
||||
# render eww widget
|
||||
echo "(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace\" \
|
||||
(box :class \"workspaces\" :orientation \"h\" :spacing 0 :space-evenly \"true\" \
|
||||
(button :onclick \"hyprctl dispatch workspace 1\" :onrightclick \"hyprctl dispatch workspace 1\" :class \"workspace ${ACTIVE[1]} ${OCCUPIED[1]} ${FOCUSED[1]}\" \"${icons[0]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 2\" :onrightclick \"hyprctl dispatch workspace 2\" :class \"workspace ${ACTIVE[2]} ${OCCUPIED[2]} ${FOCUSED[2]}\" \"${icons[1]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 3\" :onrightclick \"hyprctl dispatch workspace 3\" :class \"workspace ${ACTIVE[3]} ${OCCUPIED[3]} ${FOCUSED[3]}\" \"${icons[2]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 4\" :onrightclick \"hyprctl dispatch workspace 4\" :class \"workspace ${ACTIVE[4]} ${OCCUPIED[4]} ${FOCUSED[4]}\" \"${icons[3]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 5\" :onrightclick \"hyprctl dispatch workspace 5\" :class \"workspace ${ACTIVE[5]} ${OCCUPIED[5]} ${FOCUSED[5]}\" \"${icons[4]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 6\" :onrightclick \"hyprctl dispatch workspace 6\" :class \"workspace ${ACTIVE[6]} ${OCCUPIED[6]} ${FOCUSED[6]}\" \"${icons[5]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 7\" :onrightclick \"hyprctl dispatch workspace 7\" :class \"workspace ${ACTIVE[7]} ${OCCUPIED[7]} ${FOCUSED[7]}\" \"${icons[6]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 8\" :onrightclick \"hyprctl dispatch workspace 8\" :class \"workspace ${ACTIVE[8]} ${OCCUPIED[8]} ${FOCUSED[8]}\" \"${icons[7]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 9\" :onrightclick \"hyprctl dispatch workspace 9\" :class \"workspace ${ACTIVE[9]} ${OCCUPIED[9]} ${FOCUSED[9]}\" \"${icons[8]}\") \
|
||||
) \
|
||||
)"
|
||||
}
|
||||
|
||||
workspace_reader() {
|
||||
while read -r l; do
|
||||
workspaces "$l"
|
||||
done
|
||||
}
|
||||
|
||||
# initial render
|
||||
workspaces
|
||||
|
||||
# listen to events and re-render
|
||||
nc -U "$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | workspace_reader
|
||||
|
||||
echo '(box "EXITING")'
|
2
modules/home-manager/eww/scripts/workspaces/.gitignore
vendored
Normal file
2
modules/home-manager/eww/scripts/workspaces/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
./target
|
||||
./result
|
20
modules/home-manager/eww/scripts/workspaces/default.nix
Normal file
20
modules/home-manager/eww/scripts/workspaces/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{pkgs ? import <nixpkgs> {}}: let
|
||||
# lock = builtins.fromJSON (builtins.readFile ../../../../../flake.lock);
|
||||
# nixpkgsRev = lock.nodes.nixpkgs.locked.rev;
|
||||
# pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/${nixpkgsRev}.tar.gz") {};
|
||||
pname = "hyprland-workspaces-eww";
|
||||
version = "1.0.0";
|
||||
src = ./src;
|
||||
in
|
||||
pkgs.rustPlatform.buildRustPackage {
|
||||
inherit pname version src;
|
||||
cargoHash = "sha256-6Wl3cOIxlPJjzEuzNhCBZJXayL8runQfAxPruvzh2Vc=";
|
||||
# cargoHash = pkgs.lib.fakeHash;
|
||||
checkType = "release";
|
||||
postBuild = ''
|
||||
# pushd target/*/release
|
||||
# ls -la
|
||||
# ${pkgs.upx}/bin/upx --best --lzma hyprland-workspaces-eww
|
||||
# popd
|
||||
'';
|
||||
}
|
1
modules/home-manager/eww/scripts/workspaces/src/.gitignore
vendored
Normal file
1
modules/home-manager/eww/scripts/workspaces/src/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
target
|
96
modules/home-manager/eww/scripts/workspaces/src/Cargo.lock
generated
Normal file
96
modules/home-manager/eww/scripts/workspaces/src/Cargo.lock
generated
Normal file
|
@ -0,0 +1,96 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "hyprland-workspaces-eww"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.93"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.38"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.217"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.217"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.137"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"memchr",
|
||||
"ryu",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.96"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
|
19
modules/home-manager/eww/scripts/workspaces/src/Cargo.toml
Normal file
19
modules/home-manager/eww/scripts/workspaces/src/Cargo.toml
Normal file
|
@ -0,0 +1,19 @@
|
|||
[package]
|
||||
name = "hyprland-workspaces-eww"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[[bin]]
|
||||
name = "hyprland-workspaces-eww"
|
||||
path = "./main.rs"
|
||||
|
||||
[dependencies]
|
||||
serde = "1.0.217"
|
||||
serde_json = "1.0.137"
|
||||
|
||||
[profile.release]
|
||||
strip = true
|
||||
opt-level = "z"
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
186
modules/home-manager/eww/scripts/workspaces/src/main.rs
Normal file
186
modules/home-manager/eww/scripts/workspaces/src/main.rs
Normal file
|
@ -0,0 +1,186 @@
|
|||
mod workspace {
|
||||
pub struct Workspace {
|
||||
id: usize,
|
||||
icon: char,
|
||||
pub is_active: bool,
|
||||
pub is_occupied: bool,
|
||||
pub is_focused: bool,
|
||||
}
|
||||
|
||||
impl Workspace {
|
||||
pub fn new(id: usize) -> Self {
|
||||
Self {
|
||||
id,
|
||||
icon: id.to_string().chars().next().unwrap_or('?'),
|
||||
is_active: false,
|
||||
is_occupied: false,
|
||||
is_focused: false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn id(&self) -> usize {
|
||||
return self.id;
|
||||
}
|
||||
|
||||
pub fn icon(&self) -> char {
|
||||
return self.icon;
|
||||
}
|
||||
|
||||
pub fn clear_states(&mut self) {
|
||||
self.is_active = false;
|
||||
self.is_occupied = false;
|
||||
self.is_focused = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mod eww {}
|
||||
|
||||
mod hypr {
|
||||
pub mod hyprland {
|
||||
|
||||
pub mod workspace {
|
||||
pub type Id = usize;
|
||||
pub type Name = String;
|
||||
}
|
||||
|
||||
pub mod socket2 {
|
||||
use super::workspace;
|
||||
use std::{error::Error, fmt::Display, num::ParseIntError, str::FromStr};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Event {
|
||||
Workspace(workspace::Id),
|
||||
Exit(),
|
||||
WorkspaceV2(String, String),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum EventParseError {
|
||||
UnknownEventType(String),
|
||||
MissingParameters(String),
|
||||
InvalidParameters(String, String),
|
||||
ParseIntError(ParseIntError),
|
||||
}
|
||||
|
||||
impl From<ParseIntError> for EventParseError {
|
||||
fn from(value: ParseIntError) -> Self {
|
||||
Self::ParseIntError(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for EventParseError {}
|
||||
|
||||
impl Display for EventParseError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
EventParseError::UnknownEventType(event_type) => {
|
||||
write!(f, "unknown event type: {event_type}")
|
||||
}
|
||||
|
||||
EventParseError::MissingParameters(event_type) => {
|
||||
write!(f, "missing parameters for event type: {event_type}")
|
||||
}
|
||||
|
||||
EventParseError::ParseIntError(err) => {
|
||||
write!(f, "error parsing integer: {err}")
|
||||
}
|
||||
EventParseError::InvalidParameters(event_type, params) => {
|
||||
write!(
|
||||
f,
|
||||
"invalid parameters for event type {event_type}: {params}"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for Event {
|
||||
type Err = EventParseError;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let (event_type, rest): (&str, Option<&str>) = s
|
||||
.find(">>")
|
||||
.map(|n| {
|
||||
let (a, b) = s.split_at(n);
|
||||
(a, Option::Some(&b[2..]))
|
||||
})
|
||||
.unwrap_or((s, Option::None));
|
||||
match (event_type, rest) {
|
||||
("workspace", None) => {
|
||||
Err(EventParseError::MissingParameters(event_type.to_string()))
|
||||
}
|
||||
("workspace", Some(workspace)) => Ok(Event::Workspace(workspace.parse()?)),
|
||||
("workspacev2", Some(args)) => {
|
||||
let args: (String, String) = args
|
||||
.split_once(',')
|
||||
.map(|(a, b)| (a.to_string(), b.to_string()))
|
||||
.ok_or(EventParseError::InvalidParameters(
|
||||
event_type.to_string(),
|
||||
args.to_string(),
|
||||
))?;
|
||||
Ok(Event::WorkspaceV2(args.0, args.1))
|
||||
}
|
||||
("exit", _) => Ok(Event::Exit()),
|
||||
_ => Err(EventParseError::UnknownEventType(event_type.to_string())),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
use hypr::hyprland::socket2::Event;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
env,
|
||||
error::Error,
|
||||
io::{BufRead, BufReader},
|
||||
os::unix::net::UnixStream,
|
||||
};
|
||||
use workspace::Workspace;
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let mut workspaces: HashMap<usize, Workspace> =
|
||||
(1..=9).map(|n| (n, Workspace::new(n))).collect();
|
||||
let path = format!(
|
||||
"{}/hypr/{}/.socket2.sock",
|
||||
env::var("XDG_RUNTIME_DIR")?,
|
||||
env::var("HYPRLAND_INSTANCE_SIGNATURE")?
|
||||
);
|
||||
|
||||
eprintln!("opening {}", path);
|
||||
let stream = UnixStream::connect(&path)?;
|
||||
let event_lines = BufReader::new(stream).lines();
|
||||
for l in event_lines.into_iter() {
|
||||
match l?.parse::<Event>() {
|
||||
Ok(e) => match e {
|
||||
Event::Workspace(i) => match workspaces.get_mut(&i) {
|
||||
Some(related_workspace) => {
|
||||
eprintln!(
|
||||
"setting workspace {} (id: {}) as active",
|
||||
related_workspace.icon(),
|
||||
related_workspace.id()
|
||||
);
|
||||
related_workspace.is_active = true
|
||||
}
|
||||
None => {
|
||||
eprintln!("event for untracked workspace {}", i);
|
||||
}
|
||||
},
|
||||
Event::Exit() => break,
|
||||
other => {
|
||||
eprintln!("unhandled event: {:?}", other);
|
||||
}
|
||||
},
|
||||
Err(e) => eprintln!("error parsing event: {}", e),
|
||||
}
|
||||
render(&workspaces)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn render(workspaces: &HashMap<usize, Workspace>) -> Result<(), Box<dyn Error>> {
|
||||
Ok(())
|
||||
}
|
190
modules/home-manager/fish/interactiveShellInit.fish
Normal file
190
modules/home-manager/fish/interactiveShellInit.fish
Normal file
|
@ -0,0 +1,190 @@
|
|||
set this_shell_should_notify 1
|
||||
|
||||
# prompt
|
||||
function get_hostname
|
||||
if test (uname) = Linux || test (uname) = Darwin
|
||||
has_command hostname && hostname | cut -d. -f1 || cat /etc/hostname
|
||||
else
|
||||
# assume bsd
|
||||
hostname | head -n 1 | cut -d. -f1
|
||||
end
|
||||
end
|
||||
|
||||
function fish_greeting
|
||||
_prompt_prefix
|
||||
printf "%s\n" (date)
|
||||
end
|
||||
|
||||
function preprocess_pwd
|
||||
test (pwd) = / && echo / && return 1
|
||||
test (pwd) = $NICE_HOME && echo "~" && return 0
|
||||
pwd \
|
||||
| cut -c2- \
|
||||
| gawk '{n=split($0,p,"/");for(i=1;i<=n;i++){if(i==n){printf "/%s",p[i]}else{printf "/%.3s",p[i]}}}'
|
||||
end
|
||||
|
||||
function _maybe_elevated_access_prefix
|
||||
if set -q SUDO_USER
|
||||
set_color -b yellow black
|
||||
printf " SUDO "
|
||||
set_color -b normal normal
|
||||
printf " "
|
||||
else if test $USER = root
|
||||
set_color -b red black
|
||||
printf " ROOT "
|
||||
set_color -b normal normal
|
||||
printf " "
|
||||
end
|
||||
end
|
||||
|
||||
function _maybe_aws_profile
|
||||
if set -q AWS_PROFILE && test $AWS_PROFILE = prd
|
||||
printf " "
|
||||
set_color -b yellow black
|
||||
printf " AWS_PROFILE=prd "
|
||||
set_color -b normal normal
|
||||
end
|
||||
end
|
||||
|
||||
function _user_and_host
|
||||
if test $argv[1] -eq 0
|
||||
set_color -b normal blue
|
||||
else
|
||||
set_color -b normal red
|
||||
end
|
||||
printf "%s@%s" $USER (get_hostname)
|
||||
end
|
||||
|
||||
function _cur_work_dir
|
||||
set_color -b normal magenta
|
||||
printf " %s" (preprocess_pwd)
|
||||
end
|
||||
|
||||
function _last_cmd_duration
|
||||
set_color -b normal green
|
||||
set -q CMD_DURATION && printf " %dms" $CMD_DURATION
|
||||
if test $CMD_DURATION -gt 5000 && test $this_shell_should_notify = 1
|
||||
printf "\e]777;notify;%s;%s\e\\" "WezTerm: Command Finished" (history --max 1)
|
||||
set this_shell_should_notify 0
|
||||
end
|
||||
end
|
||||
|
||||
function _maybe_jobs_summary
|
||||
if jobs -q
|
||||
set_color -b normal cyan
|
||||
printf " &%d" (jobs -p | wc -l)
|
||||
end
|
||||
end
|
||||
|
||||
function _user_prompt
|
||||
printf "\n"
|
||||
set_color brblack
|
||||
if test (id -u) -eq 0
|
||||
printf '# '
|
||||
else
|
||||
printf '$ '
|
||||
end
|
||||
set_color -b normal normal
|
||||
end
|
||||
|
||||
function _maybe_git_summary
|
||||
set_color -b normal yellow
|
||||
set cur_sha (git rev-parse --short HEAD 2>/dev/null)
|
||||
if test $status = 0
|
||||
set num_changes (git status --porcelain | wc -l | string trim)
|
||||
if test $num_changes = 0
|
||||
set num_changes "✔"
|
||||
else
|
||||
set num_changes "+$num_changes"
|
||||
end
|
||||
printf " %s %s %s" (git branch --show-current) $cur_sha $num_changes
|
||||
end
|
||||
end
|
||||
|
||||
function _prompt_marker
|
||||
# printf "%b133;A%b" "\x1b\x5d" "\x1b\x5c"
|
||||
end
|
||||
|
||||
function _prompt_continuation_marker
|
||||
# printf "%b133;A;k=s%b" "\x1b\x5d" "\x1b\x5c"
|
||||
end
|
||||
|
||||
function cmd_marker --on-variable _
|
||||
# printf "%b133;C%b" "\x1b\x5d" "\x1b\x5c"
|
||||
end
|
||||
|
||||
function _prompt_prefix
|
||||
set_color -b normal brblack
|
||||
printf "# "
|
||||
end
|
||||
|
||||
function preexec --on-event fish_preexec
|
||||
set this_shell_should_notify 1
|
||||
end
|
||||
|
||||
function fish_prompt
|
||||
set last_cmd_status $status
|
||||
_prompt_marker
|
||||
_prompt_prefix
|
||||
_maybe_elevated_access_prefix
|
||||
_user_and_host $last_cmd_status
|
||||
_cur_work_dir
|
||||
_maybe_git_summary
|
||||
_maybe_aws_profile
|
||||
_last_cmd_duration
|
||||
_maybe_jobs_summary
|
||||
_user_prompt
|
||||
end
|
||||
|
||||
function fish_mode_prompt
|
||||
end
|
||||
function fish_right_prompt
|
||||
end
|
||||
|
||||
# key bindings
|
||||
fish_vi_key_bindings
|
||||
|
||||
set --universal fish_cursor_default block
|
||||
set --universal fish_cursor_insert line
|
||||
set --universal fish_cursor_block block
|
||||
fish_vi_cursor
|
||||
set --universal fish_vi_force_cursor 1
|
||||
|
||||
bind --mode insert --sets-mode default jk repaint
|
||||
bind --mode insert --sets-mode default jK repaint
|
||||
bind --mode insert --sets-mode default Jk repaint
|
||||
bind --mode insert --sets-mode default JK repaint
|
||||
# bind --mode insert --sets-mode default jj repaint
|
||||
# bind --mode insert --sets-mode default jJ repaint
|
||||
# bind --mode insert --sets-mode default Jj repaint
|
||||
# bind --mode insert --sets-mode default JJ repaint
|
||||
|
||||
if has_command skim
|
||||
bind -M insert \cg skim-cd-widget
|
||||
end
|
||||
|
||||
if has_command fzf
|
||||
bind -M insert \cg fzf-cd-widget
|
||||
end
|
||||
|
||||
bind -M insert \cp up-or-search
|
||||
bind -M insert \cn down-or-search
|
||||
bind -M insert \ce end-of-line
|
||||
bind -M insert \ca beginning-of-line
|
||||
|
||||
bind -M insert \cv edit_command_buffer
|
||||
bind -M default \cv edit_command_buffer
|
||||
|
||||
test $PWD = $HOME && begin
|
||||
cd $NICE_HOME || cd
|
||||
end
|
||||
|
||||
# tmux has issues when pasting sometimes where it seems to interpret a newline
|
||||
# as C-j and jumps a pane and screws up the previous pane somehow
|
||||
# I think a tput reset can fix it, but it's just annoying and I don't think I
|
||||
# currently make heavy enough use of sessions and detaching and tmux-resurrect for
|
||||
# it to be worth it
|
||||
|
||||
# if has_command tmux && ! set -q DO_NOT_AUTOSTART_TMUX && ! set -q TMUX
|
||||
# tmux new-session -D -s "default" &>/dev/null || tmux attach -t "default"
|
||||
# end
|
|
@ -33,12 +33,16 @@ set --export --universal EXA_COLORS '*=0'
|
|||
|
||||
set --export --universal ERL_AFLAGS "-kernel shell_history enabled -kernel shell_history_file_bytes 1024000"
|
||||
|
||||
set --export --universal BROWSER firefox
|
||||
set --export --universal BROWSER (which firefox)
|
||||
|
||||
set --export --universal SOPS_AGE_KEY_FILE "$XDG_CONFIG_HOME/sops/age/keys.txt"
|
||||
|
||||
set --export --universal SKIM_ALT_C_COMMAND "fd --hidden --type directory"
|
||||
set --export --universal SKIM_CTRL_T_COMMAND "fd --hidden"
|
||||
if has_command skim
|
||||
set --export --universal SKIM_ALT_C_COMMAND "fd --hidden --type directory"
|
||||
set --export --universal SKIM_CTRL_T_COMMAND "fd --hidden"
|
||||
end
|
||||
|
||||
set --export --universal NEWT_COLORS "root=black,black:border=black,blue"
|
||||
|
||||
# colors
|
||||
set -U fish_color_normal normal # default color
|
||||
|
@ -64,6 +68,10 @@ set -U fish_pager_color_prefix blue # the string being completed
|
|||
set -U fish_pager_color_progress white\x1e\x2d\x2dbackground\x3d333 # status indicator at the bottom
|
||||
# set -U fish_pager_color_secondary \x2d\x2dbackground\x3d181818 # alternating rows
|
||||
|
||||
if test -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish'
|
||||
source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish'
|
||||
end
|
||||
|
||||
function has_command --wraps=command --description "Exits non-zero if the given command cannot be found"
|
||||
command --quiet --search $argv[1]
|
||||
end
|
||||
|
@ -72,6 +80,9 @@ if has_command rtx
|
|||
rtx activate fish | source
|
||||
end
|
||||
|
||||
for dir in ~/.cargo/bin ~/.nimble/bin ~/.local/bin
|
||||
fish_add_path $dir
|
||||
for dir in ~/.cargo/bin ~/.nimble/bin ~/.local/bin /opt/homebrew/bin
|
||||
test -d $dir && fish_add_path $dir
|
||||
end
|
||||
|
||||
# don't let other users read my files by default
|
||||
umask 077
|
2384
modules/home-manager/ghostty/config
Normal file
2384
modules/home-manager/ghostty/config
Normal file
File diff suppressed because it is too large
Load diff
430
modules/home-manager/hyprland.nix
Normal file
430
modules/home-manager/hyprland.nix
Normal file
|
@ -0,0 +1,430 @@
|
|||
{
|
||||
pkgs,
|
||||
style,
|
||||
config,
|
||||
lib,
|
||||
# font,
|
||||
...
|
||||
}: let
|
||||
inherit (style) colors;
|
||||
in {
|
||||
# TODO: Hyprland seems to sometimes use a ton of CPU?
|
||||
|
||||
home.packages = with pkgs; [
|
||||
glib
|
||||
swayosd
|
||||
];
|
||||
|
||||
home.file."${config.xdg.configHome}/hypr/hyprpaper.conf" = {
|
||||
enable = true;
|
||||
text = ''
|
||||
preload = ~/.wallpaper
|
||||
wallpaper = ,~/.wallpaper
|
||||
'';
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
settings = {
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
monitor = [
|
||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||
",preferred,auto,auto"
|
||||
];
|
||||
|
||||
xwayland = {
|
||||
force_zero_scaling = true;
|
||||
};
|
||||
|
||||
exec-once = [
|
||||
"hyprpaper"
|
||||
"mako"
|
||||
"swayosd-server"
|
||||
"eww daemon"
|
||||
"[workspace 1 silent] firefox"
|
||||
"[workspace 1 silent] wezterm"
|
||||
"xwaylandvideobridge"
|
||||
"systemctl --user import-environment QT_QPA_PLATFORMTHEME"
|
||||
"hypridle"
|
||||
];
|
||||
|
||||
exec = [
|
||||
''gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark"''
|
||||
''gsettings set org.gnome.desktop.interface color-scheme "prefer-dark"''
|
||||
];
|
||||
|
||||
env = [
|
||||
"XCURSOR_SIZE,24"
|
||||
"QT_QPA_PLATFORMTHEME,qt6ct"
|
||||
"GTK_THEME,Adwaita-dark"
|
||||
];
|
||||
|
||||
input = {
|
||||
kb_layout = "us";
|
||||
kb_options = "ctrl:nocaps";
|
||||
|
||||
/*
|
||||
kb_variant =
|
||||
kb_model =
|
||||
kb_rules =
|
||||
*/
|
||||
|
||||
follow_mouse = 2;
|
||||
|
||||
repeat_delay = 180;
|
||||
repeat_rate = 120;
|
||||
|
||||
touchpad = {
|
||||
natural_scroll = "yes";
|
||||
tap-to-click = true;
|
||||
middle_button_emulation = true;
|
||||
disable_while_typing = false;
|
||||
};
|
||||
};
|
||||
|
||||
misc = {
|
||||
disable_hyprland_logo = true;
|
||||
disable_splash_rendering = true;
|
||||
};
|
||||
|
||||
binds = {
|
||||
allow_workspace_cycles = true;
|
||||
};
|
||||
|
||||
cursor = {
|
||||
no_warps = true;
|
||||
};
|
||||
|
||||
general = {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
"col.active_border" = "0xff${colors.primary} 0xff${colors.green} 45deg";
|
||||
"col.inactive_border" = "0xff${colors.fgdim}";
|
||||
|
||||
gaps_in = 3;
|
||||
gaps_out = 6;
|
||||
border_size = 2;
|
||||
resize_on_border = true;
|
||||
no_focus_fallback = false;
|
||||
|
||||
layout = "dwindle";
|
||||
};
|
||||
|
||||
decoration = {
|
||||
rounding = 10;
|
||||
rounding_power = 4.0;
|
||||
|
||||
/*
|
||||
blur = "no";
|
||||
blur_size = 3
|
||||
blur_passes = 1
|
||||
blur_new_optimizations = on
|
||||
*/
|
||||
|
||||
shadow = {
|
||||
enabled = true;
|
||||
color = "rgba(1a1a1aee)";
|
||||
range = 4;
|
||||
render_power = 3;
|
||||
};
|
||||
|
||||
dim_inactive = false;
|
||||
};
|
||||
|
||||
"$mod" = "SUPER";
|
||||
bind = [
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
/*
|
||||
"$mod, return, exec, wezterm"
|
||||
"$mod SHIFT, return, exec, wezterm"
|
||||
*/
|
||||
"$mod, return, exec, wezterm"
|
||||
"$mod SHIFT, return, exec, [float] wezterm start --always-new-process"
|
||||
"$mod, U, exec, firefox"
|
||||
"$mod, space, exec, tofi-run | xargs hyprctl dispatch exec --"
|
||||
"$mod, D, exec, tofi-drun | xargs hyprctl dispatch exec --"
|
||||
"$mod, C, killactive,"
|
||||
"$mod SHIFT, E, exit,"
|
||||
"$mod, E, exec, dolphin"
|
||||
"$mod, F, togglefloating,"
|
||||
"$mod SHIFT, F, fullscreen,"
|
||||
"$mod, R, exec, anyrun"
|
||||
"$mod, S, pseudo, # dwindle"
|
||||
"$mod, P, togglesplit, # dwindle"
|
||||
|
||||
# Move focus with mod + arrow keys
|
||||
"$mod, left, movefocus, l"
|
||||
"$mod, right, movefocus, r"
|
||||
"$mod, up, movefocus, u"
|
||||
"$mod, down, movefocus, d"
|
||||
"$mod, h, movefocus, l"
|
||||
"$mod, l, movefocus, r"
|
||||
"$mod, k, movefocus, u"
|
||||
"$mod, j, movefocus, d"
|
||||
"$mod SHIFT, H, movewindow, l silent"
|
||||
"$mod SHIFT, L, movewindow, r silent"
|
||||
"$mod SHIFT, K, movewindow, u silent"
|
||||
"$mod SHIFT, J, movewindow, d silent"
|
||||
|
||||
"$mod SHIFT, V, exec, swayosd-client --input-volume mute-toggle"
|
||||
", XF86AudioMicMute, exec, swayosd-client --input-volume mute-toggle"
|
||||
", XF86AudioMute, exec, swayosd-client --output-volume mute-toggle"
|
||||
", XF86AudioRaiseVolume, exec, swayosd-client --output-volume raise"
|
||||
", XF86AudioLowerVolume, exec, swayosd-client --output-volume lower"
|
||||
|
||||
", XF86MonBrightnessUp, exec, swayosd-client --brightness raise"
|
||||
", XF86MonBrightnessDown, exec, swayosd-client --brightness lower"
|
||||
|
||||
", XF86AudioPlay, exec, playerctl play-pause"
|
||||
", XF86AudioNext, exec, playerctl next"
|
||||
", XF86AudioPrev, exec, playerctl previous"
|
||||
|
||||
"$mod, tab, workspace, previous"
|
||||
"ALT, tab, workspace, previous"
|
||||
|
||||
# Switch workspaces with mod + [0-9]
|
||||
"$mod, 1, workspace, 1"
|
||||
"$mod, 2, workspace, 2"
|
||||
"$mod, 3, workspace, 3"
|
||||
"$mod, 4, workspace, 4"
|
||||
"$mod, 5, workspace, 5"
|
||||
"$mod, 6, workspace, 6"
|
||||
"$mod, 7, workspace, 7"
|
||||
"$mod, 8, workspace, 8"
|
||||
"$mod, 9, workspace, 9"
|
||||
"$mod, 0, workspace, 10"
|
||||
|
||||
# Move active window to a workspace with mod + SHIFT + [0-9]
|
||||
"$mod SHIFT, 1, movetoworkspacesilent, 1"
|
||||
"$mod SHIFT, 2, movetoworkspacesilent, 2"
|
||||
"$mod SHIFT, 3, movetoworkspacesilent, 3"
|
||||
"$mod SHIFT, 4, movetoworkspacesilent, 4"
|
||||
"$mod SHIFT, 5, movetoworkspacesilent, 5"
|
||||
"$mod SHIFT, 6, movetoworkspacesilent, 6"
|
||||
"$mod SHIFT, 7, movetoworkspacesilent, 7"
|
||||
"$mod SHIFT, 8, movetoworkspacesilent, 8"
|
||||
"$mod SHIFT, 9, movetoworkspacesilent, 9"
|
||||
"$mod SHIFT, 0, movetoworkspacesilent, 10"
|
||||
"$mod SHIFT, S, exec, clipshot"
|
||||
|
||||
# Scroll through existing workspaces with mod + scroll
|
||||
"$mod, mouse_down, workspace, e+1"
|
||||
"$mod, mouse_up, workspace, e-1"
|
||||
"CTRL SHIFT $mod, L, exec, hyprlock"
|
||||
"$mod CTRL, space, exec, makoctl dismiss"
|
||||
"$mod SHIFT CTRL, space, exec, makoctl restore"
|
||||
"$mod SHIFT, space, exec, makoctl invoke default"
|
||||
"$mod, E, exec, thunar"
|
||||
];
|
||||
|
||||
# Move/resize windows with mod + LMB/RMB and dragging
|
||||
bindm = ["$mod, mouse:272, movewindow" "$mod, mouse:273, resizewindow"];
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
animations {
|
||||
enabled = yes
|
||||
|
||||
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
|
||||
|
||||
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
|
||||
bezier = overshot, 0.05, 0.9, 0.1, 1.1
|
||||
|
||||
# name, onoff, speed, curve, style
|
||||
animation = global, 1, 2, default
|
||||
animation = fadeDim, 1, 2, default
|
||||
animation = windowsOut, 1, 2, default, popin 80%
|
||||
}
|
||||
|
||||
dwindle {
|
||||
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
|
||||
# master switch for pseudotiling. Enabling is bound to mod + P in the keybinds section below
|
||||
pseudotile = yes
|
||||
preserve_split = 1
|
||||
# no_gaps_when_only = true
|
||||
}
|
||||
|
||||
master {
|
||||
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
|
||||
# new_is_master = true
|
||||
}
|
||||
|
||||
gestures {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
workspace_swipe = on
|
||||
}
|
||||
|
||||
## Example per-device config
|
||||
## See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
|
||||
## device:epic-mouse-v1 {
|
||||
## sensitivity = -0.5
|
||||
## }
|
||||
|
||||
## See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||
windowrulev2 = idleinhibit,class:^.*([Ss]lippi).*$
|
||||
windowrulev2 = float,class:^.*$
|
||||
windowrulev2 = tile,class:^.*([Kk]itty|[Ff]irefox|[Ww]ezterm|[Dd]iscord|[Ss]potify|[Ss]lack).*$
|
||||
# windowrulev2 = opacity 1.0 0.95,class:^.*$
|
||||
windowrulev2 = center 1,floating:1
|
||||
|
||||
windowrulev2 = opacity 0.0 override, class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = noanim, class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = noinitialfocus, class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = maxsize 1 1, class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = noblur, class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = nofocus, class:^(xwaylandvideobridge)$
|
||||
'';
|
||||
};
|
||||
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
# docs: https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock
|
||||
|
||||
general = {
|
||||
grace = 0;
|
||||
no_fade_out = true;
|
||||
};
|
||||
|
||||
input-field = [
|
||||
{
|
||||
monitor = "";
|
||||
fade_on_empty = false;
|
||||
placeholder_text = "Locked";
|
||||
rounding = 5;
|
||||
font_size = 20;
|
||||
font_color = "rgba(255, 255, 255, 1.0)";
|
||||
inner_color = "rgba(31, 31, 47, 0.95)";
|
||||
outer_color = "0xff74c7ec 0xff74c7ec 45deg";
|
||||
outline_thickness = 3;
|
||||
position = "0, -200";
|
||||
|
||||
dots_size = 0.1;
|
||||
size = "300 75";
|
||||
font_family = "IosevkaLyteTerm";
|
||||
|
||||
shadow_passes = 3;
|
||||
shadow_size = 8;
|
||||
shadow_color = "rgba(0, 0, 0, 1.0)";
|
||||
shadow_boost = 0.8;
|
||||
}
|
||||
];
|
||||
|
||||
background = [
|
||||
{
|
||||
path = "~/.wallpaper";
|
||||
blur_passes = 2;
|
||||
}
|
||||
];
|
||||
|
||||
label = [
|
||||
{
|
||||
monitor = "";
|
||||
font_size = 64;
|
||||
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
text_align = "center";
|
||||
|
||||
# rotate = 10;
|
||||
position = "0, 250";
|
||||
font_family = "IosevkaLyteTerm";
|
||||
text = ''Locked for <span foreground="##74c7ec">$USER</span>'';
|
||||
|
||||
shadow_passes = 1;
|
||||
shadow_size = 8;
|
||||
shadow_color = "rgba(0, 0, 0, 1.0)";
|
||||
shadow_boost = 0.5;
|
||||
}
|
||||
|
||||
{
|
||||
monitor = "";
|
||||
font_size = 32;
|
||||
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
text_align = "center";
|
||||
color = "rgba(255, 255, 255, 0.5)";
|
||||
|
||||
position = "0 100";
|
||||
font_family = "IosevkaLyteTerm";
|
||||
text = "cmd[update:1000] date '+%a %b %d %H:%M:%S'";
|
||||
|
||||
shadow_passes = 3;
|
||||
shadow_size = 1;
|
||||
shadow_color = "rgba(0, 0, 0, 1.0)";
|
||||
shadow_boost = 1.0;
|
||||
}
|
||||
|
||||
{
|
||||
monitor = "";
|
||||
font_size = 200;
|
||||
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
text_align = "center";
|
||||
color = "rgba(220, 240, 255, 0.8)";
|
||||
position = "0 500";
|
||||
font_family = "NerdFontSymbolsOnly";
|
||||
text = "";
|
||||
|
||||
shadow_passes = 3;
|
||||
shadow_size = 1;
|
||||
shadow_color = "rgba(0, 0, 0, 1.0)";
|
||||
shadow_boost = 1.0;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
services.hypridle = let
|
||||
secondsPerMinute = 60;
|
||||
lockSeconds = 10 * secondsPerMinute;
|
||||
in {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
after_sleep_cmd = "hyprctl dispatch dpms on";
|
||||
before_sleep_cmd = "loginctl lock-session";
|
||||
ignore_dbus_inhibit = false;
|
||||
lock_cmd = "pidof hyprlock || hyprlock";
|
||||
};
|
||||
|
||||
listener = [
|
||||
{
|
||||
timeout = lockSeconds - 300;
|
||||
on-timeout = ''notify-send "Auto-locking in 5 minutes"'';
|
||||
on-resume = ''notify-send "Auto-locking cancelled"'';
|
||||
}
|
||||
{
|
||||
timeout = lockSeconds - 180;
|
||||
on-timeout = ''notify-send "Auto-locking in 3 minutes"'';
|
||||
}
|
||||
{
|
||||
timeout = lockSeconds - 120;
|
||||
on-timeout = ''notify-send "Auto-locking in 2 minutes"'';
|
||||
}
|
||||
{
|
||||
timeout = lockSeconds - 60;
|
||||
on-timeout = ''notify-send "Auto-locking in 1 minute"'';
|
||||
}
|
||||
{
|
||||
timeout = lockSeconds - 30;
|
||||
on-timeout = ''notify-send "Auto-locking in 30 seconds"'';
|
||||
}
|
||||
{
|
||||
timeout = lockSeconds - 10;
|
||||
on-timeout = ''notify-send -u critical "Auto-locking in 10 seconds"'';
|
||||
}
|
||||
{
|
||||
timeout = lockSeconds;
|
||||
on-timeout = ''loginctl lock-session'';
|
||||
}
|
||||
{
|
||||
timeout = lockSeconds + 5;
|
||||
on-timeout = ''hyprctl dispatch dpms off'';
|
||||
on-resume = ''hyprctl dispatch dpms on'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
177
modules/home-manager/kitty.nix
Normal file
177
modules/home-manager/kitty.nix
Normal file
|
@ -0,0 +1,177 @@
|
|||
{
|
||||
colors,
|
||||
font,
|
||||
...
|
||||
}: {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
darwinLaunchOptions = ["--single-instance"];
|
||||
shellIntegration = {
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
settings = with colors.withHashPrefix; {
|
||||
font_family = font.name;
|
||||
bold_font = "${font.name} Heavy";
|
||||
italic_font = "${font.name} Italic";
|
||||
bold_italic_font = "${font.name} Heavy Italic";
|
||||
font_size = toString font.size;
|
||||
inactive_text_alpha = "0.5";
|
||||
copy_on_select = true;
|
||||
hide_window_decorations = "yes";
|
||||
|
||||
scrollback_lines = 500000;
|
||||
|
||||
symbol_map = "U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono";
|
||||
|
||||
# use `kitty + list-fonts --psnames` to get the font's PostScript name
|
||||
|
||||
allow_remote_control = true;
|
||||
listen_on = "unix:/tmp/kitty";
|
||||
repaint_delay = 3;
|
||||
input_delay = 3;
|
||||
sync_to_monitor = true;
|
||||
|
||||
adjust_line_height = 0;
|
||||
window_padding_width = "10.0";
|
||||
window_margin_width = "0.0";
|
||||
|
||||
confirm_os_window_close = 0;
|
||||
|
||||
enabled_layouts = "splits:split_axis=vertical,stack";
|
||||
|
||||
shell_integration = "disabled";
|
||||
|
||||
enable_audio_bell = true;
|
||||
visual_bell_duration = "0.25";
|
||||
visual_bell_color = bg3;
|
||||
|
||||
url_style = "single";
|
||||
|
||||
strip_trailing_spaces = "smart";
|
||||
|
||||
# open_url_modifiers ctrl
|
||||
|
||||
tab_bar_align = "left";
|
||||
tab_bar_style = "separator";
|
||||
tab_separator = ''""'';
|
||||
tab_bar_edge = "bottom";
|
||||
tab_title_template = ''"{fmt.fg.tab}{fmt.bg.tab} {activity_symbol}{title} "'';
|
||||
active_tab_font_style = "normal";
|
||||
|
||||
## name: Catppuccin Kitty Mocha
|
||||
## author: Catppuccin Org
|
||||
## license: MIT
|
||||
## upstream: https://github.com/catppuccin/kitty/blob/main/mocha.conf
|
||||
## blurb: Soothing pastel theme for the high-spirited!
|
||||
|
||||
# The basic colors
|
||||
foreground = text;
|
||||
background = bg;
|
||||
selection_foreground = bg;
|
||||
selection_background = text;
|
||||
|
||||
# Cursor colors
|
||||
cursor = text;
|
||||
cursor_text_color = bg;
|
||||
|
||||
# URL underline color when hovering with mouse
|
||||
url_color = primary;
|
||||
|
||||
# Kitty window border colors
|
||||
active_border_color = primary;
|
||||
inactive_border_color = bg3;
|
||||
bell_border_color = urgent;
|
||||
|
||||
# OS Window titlebar colors
|
||||
wayland_titlebar_color = "system";
|
||||
macos_titlebar_color = "system";
|
||||
|
||||
# Tab bar colors
|
||||
active_tab_foreground = bg;
|
||||
active_tab_background = primary;
|
||||
inactive_tab_foreground = fgdim;
|
||||
inactive_tab_background = bg2;
|
||||
tab_bar_background = bg;
|
||||
|
||||
# Colors for marks (marked text in the terminal)
|
||||
mark1_foreground = bg;
|
||||
mark1_background = blue;
|
||||
mark2_foreground = bg;
|
||||
mark2_background = purple;
|
||||
mark3_foreground = bg;
|
||||
mark3_background = blue;
|
||||
|
||||
# The 16 terminal colors
|
||||
|
||||
# black
|
||||
color0 = colors.withHashPrefix."0";
|
||||
color8 = colors.withHashPrefix."8";
|
||||
|
||||
# red
|
||||
color1 = colors.withHashPrefix."1";
|
||||
color9 = colors.withHashPrefix."9";
|
||||
|
||||
# green
|
||||
color2 = colors.withHashPrefix."2";
|
||||
color10 = colors.withHashPrefix."10";
|
||||
|
||||
# yellow
|
||||
color3 = colors.withHashPrefix."3";
|
||||
color11 = colors.withHashPrefix."11";
|
||||
|
||||
# blue
|
||||
color4 = colors.withHashPrefix."4";
|
||||
color12 = colors.withHashPrefix."12";
|
||||
|
||||
# magenta
|
||||
color5 = colors.withHashPrefix."5";
|
||||
color13 = colors.withHashPrefix."13";
|
||||
|
||||
# cyan
|
||||
color6 = colors.withHashPrefix."6";
|
||||
color14 = colors.withHashPrefix."14";
|
||||
|
||||
# white
|
||||
color7 = colors.withHashPrefix."7";
|
||||
color15 = colors.withHashPrefix."15";
|
||||
};
|
||||
keybindings = {
|
||||
"ctrl+shift+1" = "change_font_size all 12.5";
|
||||
"ctrl+shift+2" = "change_font_size all 18.5";
|
||||
"ctrl+shift+3" = "change_font_size all 26";
|
||||
"ctrl+shift+4" = "change_font_size all 32";
|
||||
"ctrl+shift+5" = "change_font_size all 48";
|
||||
"ctrl+shift+o" = "launch --type=tab --stdin-source=@screen_scrollback $EDITOR";
|
||||
|
||||
"ctrl+shift+equal" = "change_font_size all +0.5";
|
||||
"ctrl+shift+minus" = "change_font_size all -0.5";
|
||||
|
||||
"shift+insert" = "paste_from_clipboard";
|
||||
"ctrl+shift+v" = "paste_from_selection";
|
||||
"ctrl+shift+c" = "copy_to_clipboard";
|
||||
|
||||
# kill pane
|
||||
"ctrl+shift+q" = "close_window";
|
||||
|
||||
# kill tab
|
||||
"ctrl+alt+shift+q" = "close_tab";
|
||||
|
||||
"ctrl+shift+j" = "launch --location=hsplit --cwd=current";
|
||||
"ctrl+shift+l" = "launch --location=vsplit --cwd=current";
|
||||
|
||||
"ctrl+alt+shift+k" = "move_window up";
|
||||
"ctrl+alt+shift+h" = "move_window left";
|
||||
"ctrl+alt+shift+l" = "move_window right";
|
||||
"ctrl+alt+shift+j" = "move_window down";
|
||||
|
||||
"ctrl+h" = "neighboring_window left";
|
||||
"ctrl+l" = "neighboring_window right";
|
||||
"ctrl+k" = "neighboring_window up";
|
||||
"ctrl+j" = "neighboring_window down";
|
||||
"ctrl+shift+h" = "nth_window -1";
|
||||
"ctrl+shift+space>u" = "kitten hints --type=url --program @";
|
||||
|
||||
"ctrl+shift+z" = "toggle_layout stack";
|
||||
};
|
||||
};
|
||||
}
|
503
modules/home-manager/niri/config.kdl
Normal file
503
modules/home-manager/niri/config.kdl
Normal file
|
@ -0,0 +1,503 @@
|
|||
// This config is in the KDL format: https://kdl.dev
|
||||
// "/-" comments out the following node.
|
||||
// Check the wiki for a full description of the configuration:
|
||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Overview
|
||||
|
||||
// Input device configuration.
|
||||
// Find the full list of options on the wiki:
|
||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
|
||||
input {
|
||||
keyboard {
|
||||
// repeat-delay 180;
|
||||
// repeat-rate 120;
|
||||
|
||||
xkb {
|
||||
// You can set rules, model, layout, variant and options.
|
||||
// For more information, see xkeyboard-config(7).
|
||||
|
||||
// For example:
|
||||
// layout "us,ru"
|
||||
options "ctrl:nocaps"
|
||||
}
|
||||
}
|
||||
|
||||
// Next sections include libinput settings.
|
||||
// Omitting settings disables them, or leaves them at their default values.
|
||||
touchpad {
|
||||
// off
|
||||
tap
|
||||
// dwt
|
||||
// dwtp
|
||||
natural-scroll
|
||||
// accel-speed 0.2
|
||||
// accel-profile "flat"
|
||||
// scroll-method "two-finger"
|
||||
// disabled-on-external-mouse
|
||||
}
|
||||
|
||||
mouse {
|
||||
// off
|
||||
// natural-scroll
|
||||
// accel-speed 0.2
|
||||
// accel-profile "flat"
|
||||
// scroll-method "no-scroll"
|
||||
}
|
||||
|
||||
trackpoint {
|
||||
// off
|
||||
// natural-scroll
|
||||
// accel-speed 0.2
|
||||
// accel-profile "flat"
|
||||
// scroll-method "on-button-down"
|
||||
// scroll-button 273
|
||||
// middle-emulation
|
||||
}
|
||||
|
||||
// Uncomment this to make the mouse warp to the center of newly focused windows.
|
||||
// warp-mouse-to-focus
|
||||
|
||||
// Focus windows and outputs automatically when moving the mouse into them.
|
||||
// Setting max-scroll-amount="0%" makes it work only on windows already fully on screen.
|
||||
// focus-follows-mouse max-scroll-amount="0%"
|
||||
}
|
||||
|
||||
// You can configure outputs by their name, which you can find
|
||||
// by running `niri msg outputs` while inside a niri instance.
|
||||
// The built-in laptop monitor is usually called "eDP-1".
|
||||
// Find more information on the wiki:
|
||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs
|
||||
// Remember to uncomment the node by removing "/-"!
|
||||
/-output "eDP-1" {
|
||||
// Uncomment this line to disable this output.
|
||||
// off
|
||||
|
||||
// Resolution and, optionally, refresh rate of the output.
|
||||
// The format is "<width>x<height>" or "<width>x<height>@<refresh rate>".
|
||||
// If the refresh rate is omitted, niri will pick the highest refresh rate
|
||||
// for the resolution.
|
||||
// If the mode is omitted altogether or is invalid, niri will pick one automatically.
|
||||
// Run `niri msg outputs` while inside a niri instance to list all outputs and their modes.
|
||||
mode "1920x1080@120.030"
|
||||
|
||||
// You can use integer or fractional scale, for example use 1.5 for 150% scale.
|
||||
scale 2
|
||||
|
||||
// Transform allows to rotate the output counter-clockwise, valid values are:
|
||||
// normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270.
|
||||
transform "normal"
|
||||
|
||||
// Position of the output in the global coordinate space.
|
||||
// This affects directional monitor actions like "focus-monitor-left", and cursor movement.
|
||||
// The cursor can only move between directly adjacent outputs.
|
||||
// Output scale and rotation has to be taken into account for positioning:
|
||||
// outputs are sized in logical, or scaled, pixels.
|
||||
// For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080,
|
||||
// so to put another output directly adjacent to it on the right, set its x to 1920.
|
||||
// If the position is unset or results in an overlap, the output is instead placed
|
||||
// automatically.
|
||||
position x=1280 y=0
|
||||
}
|
||||
|
||||
// Settings that influence how windows are positioned and sized.
|
||||
// Find more information on the wiki:
|
||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Layout
|
||||
layout {
|
||||
// Set gaps around windows in logical pixels.
|
||||
gaps 5
|
||||
|
||||
// When to center a column when changing focus, options are:
|
||||
// - "never", default behavior, focusing an off-screen column will keep at the left
|
||||
// or right edge of the screen.
|
||||
// - "always", the focused column will always be centered.
|
||||
// - "on-overflow", focusing a column will center it if it doesn't fit
|
||||
// together with the previously focused column.
|
||||
center-focused-column "never"
|
||||
|
||||
// You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between.
|
||||
preset-column-widths {
|
||||
// Proportion sets the width as a fraction of the output width, taking gaps into account.
|
||||
// For example, you can perfectly fit four windows sized "proportion 0.25" on an output.
|
||||
// The default preset widths are 1/3, 1/2 and 2/3 of the output.
|
||||
// proportion 0.33333
|
||||
proportion 0.5
|
||||
// proportion 0.66667
|
||||
|
||||
// Fixed sets the width in logical pixels exactly.
|
||||
// fixed 1920
|
||||
}
|
||||
|
||||
// You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between.
|
||||
// preset-window-heights { }
|
||||
|
||||
// You can change the default width of the new windows.
|
||||
// default-column-width { proportion 0.5; }
|
||||
// If you leave the brackets empty, the windows themselves will decide their initial width.
|
||||
// default-column-width {}
|
||||
|
||||
// By default focus ring and border are rendered as a solid background rectangle
|
||||
// behind windows. That is, they will show up through semitransparent windows.
|
||||
// This is because windows using client-side decorations can have an arbitrary shape.
|
||||
//
|
||||
// If you don't like that, you should uncomment `prefer-no-csd` below.
|
||||
// Niri will draw focus ring and border *around* windows that agree to omit their
|
||||
// client-side decorations.
|
||||
//
|
||||
// Alternatively, you can override it with a window rule called
|
||||
// `draw-border-with-background`.
|
||||
|
||||
// You can change how the focus ring looks.
|
||||
focus-ring {
|
||||
// Uncomment this line to disable the focus ring.
|
||||
// off
|
||||
|
||||
// How many logical pixels the ring extends out from the windows.
|
||||
width 2
|
||||
|
||||
// Colors can be set in a variety of ways:
|
||||
// - CSS named colors: "red"
|
||||
// - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa"
|
||||
// - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others.
|
||||
|
||||
// Color of the ring on the active monitor.
|
||||
active-color "#7fc8ff"
|
||||
|
||||
// Color of the ring on inactive monitors.
|
||||
inactive-color "#505050"
|
||||
|
||||
// You can also use gradients. They take precedence over solid colors.
|
||||
// Gradients are rendered the same as CSS linear-gradient(angle, from, to).
|
||||
// The angle is the same as in linear-gradient, and is optional,
|
||||
// defaulting to 180 (top-to-bottom gradient).
|
||||
// You can use any CSS linear-gradient tool on the web to set these up.
|
||||
// Changing the color space is also supported, check the wiki for more info.
|
||||
//
|
||||
// active-gradient from="#80c8ff" to="#bbddff" angle=45
|
||||
|
||||
// You can also color the gradient relative to the entire view
|
||||
// of the workspace, rather than relative to just the window itself.
|
||||
// To do that, set relative-to="workspace-view".
|
||||
//
|
||||
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
|
||||
}
|
||||
|
||||
// You can also add a border. It's similar to the focus ring, but always visible.
|
||||
border {
|
||||
// The settings are the same as for the focus ring.
|
||||
// If you enable the border, you probably want to disable the focus ring.
|
||||
off
|
||||
|
||||
width 2
|
||||
active-color "#ffc87f"
|
||||
inactive-color "#505050"
|
||||
|
||||
// active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view"
|
||||
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
|
||||
}
|
||||
|
||||
// Struts shrink the area occupied by windows, similarly to layer-shell panels.
|
||||
// You can think of them as a kind of outer gaps. They are set in logical pixels.
|
||||
// Left and right struts will cause the next window to the side to always be visible.
|
||||
// Top and bottom struts will simply add outer gaps in addition to the area occupied by
|
||||
// layer-shell panels and regular gaps.
|
||||
struts {
|
||||
// left 64
|
||||
// right 64
|
||||
// top 64
|
||||
// bottom 64
|
||||
}
|
||||
}
|
||||
|
||||
// Add lines like this to spawn processes at startup.
|
||||
// Note that running niri as a session supports xdg-desktop-autostart,
|
||||
// which may be more convenient to use.
|
||||
// See the binds section below for more spawn examples.
|
||||
spawn-at-startup "wezterm"
|
||||
spawn-at-startup "firefox"
|
||||
spawn-at-startup "mako"
|
||||
spawn-at-startup "swayosd-server"
|
||||
|
||||
// Uncomment this line to ask the clients to omit their client-side decorations if possible.
|
||||
// If the client will specifically ask for CSD, the request will be honored.
|
||||
// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners.
|
||||
// This option will also fix border/focus ring drawing behind some semitransparent windows.
|
||||
// After enabling or disabling this, you need to restart the apps for this to take effect.
|
||||
// prefer-no-csd
|
||||
|
||||
// You can change the path where screenshots are saved.
|
||||
// A ~ at the front will be expanded to the home directory.
|
||||
// The path is formatted with strftime(3) to give you the screenshot date and time.
|
||||
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
|
||||
|
||||
// You can also set this to null to disable saving screenshots to disk.
|
||||
// screenshot-path null
|
||||
|
||||
// Animation settings.
|
||||
// The wiki explains how to configure individual animations:
|
||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Animations
|
||||
animations {
|
||||
// Uncomment to turn off all animations.
|
||||
// off
|
||||
|
||||
// Slow down all animations by this factor. Values below 1 speed them up instead.
|
||||
// slowdown 3.0
|
||||
}
|
||||
|
||||
// Window rules let you adjust behavior for individual windows.
|
||||
// Find more information on the wiki:
|
||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
|
||||
|
||||
// Work around WezTerm's initial configure bug
|
||||
// by setting an empty default-column-width.
|
||||
/-window-rule {
|
||||
// This regular expression is intentionally made as specific as possible,
|
||||
// since this is the default config, and we want no false positives.
|
||||
// You can get away with just app-id="wezterm" if you want.
|
||||
match app-id=r#"^org\.wezfurlong\.wezterm$"#
|
||||
default-column-width {}
|
||||
}
|
||||
|
||||
// Example: block out two password managers from screen capture.
|
||||
// (This example rule is commented out with a "/-" in front.)
|
||||
/-window-rule {
|
||||
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
|
||||
match app-id=r#"^org\.gnome\.World\.Secrets$"#
|
||||
|
||||
block-out-from "screen-capture"
|
||||
|
||||
// Use this instead if you want them visible on third-party screenshot tools.
|
||||
// block-out-from "screencast"
|
||||
}
|
||||
|
||||
// Example: enable rounded corners for all windows.
|
||||
// (This example rule is commented out with a "/-" in front.)
|
||||
window-rule {
|
||||
geometry-corner-radius 10
|
||||
clip-to-geometry true
|
||||
}
|
||||
|
||||
binds {
|
||||
// Keys consist of modifiers separated by + signs, followed by an XKB key name
|
||||
// in the end. To find an XKB name for a particular key, you may use a program
|
||||
// like wev.
|
||||
//
|
||||
// "Mod" is a special modifier equal to Super when running on a TTY, and to Alt
|
||||
// when running as a winit window.
|
||||
//
|
||||
// Most actions that you can bind here can also be invoked programmatically with
|
||||
// `niri msg action do-something`.
|
||||
|
||||
// Mod-Shift-/, which is usually the same as Mod-?,
|
||||
// shows a list of important hotkeys.
|
||||
Mod+Shift+Slash { show-hotkey-overlay; }
|
||||
|
||||
// Suggested binds for running programs: terminal, app launcher, screen locker.
|
||||
Mod+T { spawn "wezterm"; }
|
||||
Mod+Space { spawn "fuzzel"; }
|
||||
Mod+D { spawn "fuzzel --drun"; }
|
||||
Super+Alt+L { spawn "swaylock"; }
|
||||
|
||||
// You can also use a shell. Do this if you need pipes, multiple commands, etc.
|
||||
// Note: the entire command goes as a single argument in the end.
|
||||
// Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
|
||||
|
||||
// Example volume keys mappings for PipeWire & WirePlumber.
|
||||
// The allow-when-locked=true property makes them work even when the session is locked.
|
||||
XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; }
|
||||
XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; }
|
||||
XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
|
||||
XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
|
||||
|
||||
Mod+Q { close-window; }
|
||||
|
||||
Mod+Left { focus-column-left; }
|
||||
Mod+Down { focus-window-down; }
|
||||
Mod+Up { focus-window-up; }
|
||||
Mod+Right { focus-column-right; }
|
||||
Mod+h { focus-column-left; }
|
||||
Mod+j { focus-window-down; }
|
||||
Mod+k { focus-window-up; }
|
||||
Mod+l { focus-column-right; }
|
||||
|
||||
Mod+Ctrl+Left { move-column-left; }
|
||||
Mod+Ctrl+Down { move-window-down; }
|
||||
Mod+Ctrl+Up { move-window-up; }
|
||||
Mod+Ctrl+Right { move-column-right; }
|
||||
Mod+Ctrl+H { move-column-left; }
|
||||
Mod+Ctrl+J { move-window-down; }
|
||||
Mod+Ctrl+K { move-window-up; }
|
||||
Mod+Ctrl+L { move-column-right; }
|
||||
|
||||
// Alternative commands that move across workspaces when reaching
|
||||
// the first or last window in a column.
|
||||
// Mod+j { focus-window-or-workspace-down; }
|
||||
// Mod+K { focus-window-or-workspace-up; }
|
||||
// Mod+L { focus-window-or-workspace-right; }
|
||||
// Mod+h { focus-window-or-workspace-left; }
|
||||
// Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
|
||||
// Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
|
||||
|
||||
Mod+Home { focus-column-first; }
|
||||
Mod+End { focus-column-last; }
|
||||
Mod+Ctrl+Home { move-column-to-first; }
|
||||
Mod+Ctrl+End { move-column-to-last; }
|
||||
|
||||
Mod+Shift+Left { focus-monitor-left; }
|
||||
Mod+Shift+Down { focus-monitor-down; }
|
||||
Mod+Shift+Up { focus-monitor-up; }
|
||||
Mod+Shift+Right { focus-monitor-right; }
|
||||
Mod+Shift+H { focus-monitor-left; }
|
||||
Mod+Shift+J { focus-monitor-down; }
|
||||
Mod+Shift+K { focus-monitor-up; }
|
||||
Mod+Shift+L { focus-monitor-right; }
|
||||
|
||||
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
|
||||
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
|
||||
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
|
||||
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
|
||||
Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
|
||||
Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
|
||||
Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
|
||||
Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
|
||||
|
||||
// Alternatively, there are commands to move just a single window:
|
||||
// Mod+Shift+Ctrl+Left { move-window-to-monitor-left; }
|
||||
// ...
|
||||
|
||||
// And you can also move a whole workspace to another monitor:
|
||||
// Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; }
|
||||
// ...
|
||||
|
||||
Mod+Page_Down { focus-workspace-down; }
|
||||
Mod+Page_Up { focus-workspace-up; }
|
||||
Mod+U { focus-workspace-down; }
|
||||
Mod+I { focus-workspace-up; }
|
||||
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
|
||||
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
|
||||
Mod+Ctrl+U { move-column-to-workspace-down; }
|
||||
Mod+Ctrl+I { move-column-to-workspace-up; }
|
||||
|
||||
// Alternatively, there are commands to move just a single window:
|
||||
// Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
|
||||
// ...
|
||||
|
||||
Mod+Shift+Page_Down { move-workspace-down; }
|
||||
Mod+Shift+Page_Up { move-workspace-up; }
|
||||
Mod+Shift+U { move-workspace-down; }
|
||||
Mod+Shift+I { move-workspace-up; }
|
||||
|
||||
// You can bind mouse wheel scroll ticks using the following syntax.
|
||||
// These binds will change direction based on the natural-scroll setting.
|
||||
//
|
||||
// To avoid scrolling through workspaces really fast, you can use
|
||||
// the cooldown-ms property. The bind will be rate-limited to this value.
|
||||
// You can set a cooldown on any bind, but it's most useful for the wheel.
|
||||
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
|
||||
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
|
||||
Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
|
||||
Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
|
||||
|
||||
Mod+WheelScrollRight { focus-column-right; }
|
||||
Mod+WheelScrollLeft { focus-column-left; }
|
||||
Mod+Ctrl+WheelScrollRight { move-column-right; }
|
||||
Mod+Ctrl+WheelScrollLeft { move-column-left; }
|
||||
|
||||
// Usually scrolling up and down with Shift in applications results in
|
||||
// horizontal scrolling; these binds replicate that.
|
||||
Mod+Shift+WheelScrollDown { focus-column-right; }
|
||||
Mod+Shift+WheelScrollUp { focus-column-left; }
|
||||
Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
|
||||
Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
|
||||
|
||||
// Similarly, you can bind touchpad scroll "ticks".
|
||||
// Touchpad scrolling is continuous, so for these binds it is split into
|
||||
// discrete intervals.
|
||||
// These binds are also affected by touchpad's natural-scroll, so these
|
||||
// example binds are "inverted", since we have natural-scroll enabled for
|
||||
// touchpads by default.
|
||||
// Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; }
|
||||
// Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; }
|
||||
|
||||
// You can refer to workspaces by index. However, keep in mind that
|
||||
// niri is a dynamic workspace system, so these commands are kind of
|
||||
// "best effort". Trying to refer to a workspace index bigger than
|
||||
// the current workspace count will instead refer to the bottommost
|
||||
// (empty) workspace.
|
||||
//
|
||||
// For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on
|
||||
// will all refer to the 3rd workspace.
|
||||
Mod+1 { focus-workspace 1; }
|
||||
Mod+2 { focus-workspace 2; }
|
||||
Mod+3 { focus-workspace 3; }
|
||||
Mod+4 { focus-workspace 4; }
|
||||
Mod+5 { focus-workspace 5; }
|
||||
Mod+6 { focus-workspace 6; }
|
||||
Mod+7 { focus-workspace 7; }
|
||||
Mod+8 { focus-workspace 8; }
|
||||
Mod+9 { focus-workspace 9; }
|
||||
Mod+Ctrl+1 { move-column-to-workspace 1; }
|
||||
Mod+Ctrl+2 { move-column-to-workspace 2; }
|
||||
Mod+Ctrl+3 { move-column-to-workspace 3; }
|
||||
Mod+Ctrl+4 { move-column-to-workspace 4; }
|
||||
Mod+Ctrl+5 { move-column-to-workspace 5; }
|
||||
Mod+Ctrl+6 { move-column-to-workspace 6; }
|
||||
Mod+Ctrl+7 { move-column-to-workspace 7; }
|
||||
Mod+Ctrl+8 { move-column-to-workspace 8; }
|
||||
Mod+Ctrl+9 { move-column-to-workspace 9; }
|
||||
|
||||
// Alternatively, there are commands to move just a single window:
|
||||
// Mod+Ctrl+1 { move-window-to-workspace 1; }
|
||||
|
||||
// Switches focus between the current and the previous workspace.
|
||||
Mod+Tab { focus-workspace-previous; }
|
||||
|
||||
// Consume one window from the right into the focused column.
|
||||
Mod+Comma { consume-window-into-column; }
|
||||
// Expel one window from the focused column to the right.
|
||||
Mod+Period { expel-window-from-column; }
|
||||
|
||||
// There are also commands that consume or expel a single window to the side.
|
||||
Mod+BracketLeft { consume-or-expel-window-left; }
|
||||
Mod+BracketRight { consume-or-expel-window-right; }
|
||||
|
||||
Mod+R { switch-preset-column-width; }
|
||||
Mod+Shift+R { switch-preset-window-height; }
|
||||
Mod+Ctrl+R { reset-window-height; }
|
||||
Mod+F { maximize-column; }
|
||||
Mod+Shift+F { fullscreen-window; }
|
||||
Mod+C { center-column; }
|
||||
|
||||
// Finer width adjustments.
|
||||
// This command can also:
|
||||
// * set width in pixels: "1000"
|
||||
// * adjust width in pixels: "-5" or "+5"
|
||||
// * set width as a percentage of screen width: "25%"
|
||||
// * adjust width as a percentage of screen width: "-10%" or "+10%"
|
||||
// Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
|
||||
// set-column-width "100" will make the column occupy 200 physical screen pixels.
|
||||
Mod+Minus { set-column-width "-10%"; }
|
||||
Mod+Equal { set-column-width "+10%"; }
|
||||
|
||||
// Finer height adjustments when in column with other windows.
|
||||
Mod+Shift+Minus { set-window-height "-10%"; }
|
||||
Mod+Shift+Equal { set-window-height "+10%"; }
|
||||
|
||||
// Actions to switch layouts.
|
||||
// Note: if you uncomment these, make sure you do NOT have
|
||||
// a matching layout switch hotkey configured in xkb options above.
|
||||
// Having both at once on the same hotkey will break the switching,
|
||||
// since it will switch twice upon pressing the hotkey (once by xkb, once by niri).
|
||||
// Mod+Space { switch-layout "next"; }
|
||||
// Mod+Shift+Space { switch-layout "prev"; }
|
||||
|
||||
Print { screenshot; }
|
||||
Ctrl+Print { screenshot-screen; }
|
||||
Alt+Print { screenshot-window; }
|
||||
|
||||
// The quit action will show a confirmation dialog to avoid accidental exits.
|
||||
Mod+Shift+E { quit; }
|
||||
Ctrl+Alt+Delete { quit; }
|
||||
|
||||
// Powers off the monitors. To turn them back on, do any input like
|
||||
// moving the mouse or pressing any other key.
|
||||
Mod+Shift+P { power-off-monitors; }
|
||||
}
|
25
modules/home-manager/scripts/common/bin/at
Executable file
25
modules/home-manager/scripts/common/bin/at
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
usage() {
|
||||
echo "at - exit after the specified datetime"
|
||||
echo "Usage:"
|
||||
echo " at <DATETIME> && command..."
|
||||
echo
|
||||
echo "Examples:"
|
||||
echo " at 15:00:00 && echo \"it is 3 o'clock\""
|
||||
}
|
||||
|
||||
[[ -z "$1" ]] && { echo "error: no DATE argument provided" >&2; usage; exit 1; }
|
||||
|
||||
d="$(date -d "${@}" +%s)"
|
||||
_dt=$((d - $(date +%s)))
|
||||
days=$((_dt / 86400))
|
||||
printf 'Started at %s (with duration %sd %s)\n' "$(date)" "$days" "$(date -u --date @$((_dt)) +%H:%M:%S)"
|
||||
|
||||
while [[ "$d" -ge "$(date +%s)" ]]; do
|
||||
_dt=$((d - $(date +%s)))
|
||||
days=$((_dt / 86400))
|
||||
printf "\r%sd %s " "$days" "$(date -u --date @$((_dt)) +%H:%M:%S)";
|
||||
sleep 0.1
|
||||
done
|
||||
exit 0
|
41
modules/home-manager/scripts/common/bin/countdown
Executable file
41
modules/home-manager/scripts/common/bin/countdown
Executable file
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
function usage {
|
||||
echo "countdown - exit after a certain amount of time has passed"
|
||||
echo " Usage:"
|
||||
echo " countdown <TIME> && command..."
|
||||
echo
|
||||
echo " Examples:"
|
||||
echo ' countdown 120 && echo "Two minutes have elapsed!"'
|
||||
echo ' countdown 5m && echo "Five minutes have elapsed!"'
|
||||
echo ' countdown 10h && echo "Ten hours have elapsed!"'
|
||||
echo ' countdown 9d && echo "Nine days have elapsed!"'
|
||||
}
|
||||
|
||||
[[ $# -lt 1 ]] && { printf "error: no SECONDS argument provided\n" >&2; usage; exit 1; }
|
||||
|
||||
t="$1"
|
||||
seconds="$(echo "$t" | tr -d -c 0-9)"
|
||||
if [[ $t =~ ^.*m$ ]]; then
|
||||
seconds=$((seconds * 60))
|
||||
fi
|
||||
|
||||
if [[ $t =~ ^.*h$ ]]; then
|
||||
seconds=$((seconds * 60 * 60))
|
||||
fi
|
||||
|
||||
if [[ $t =~ ^.*d$ ]]; then
|
||||
seconds=$((seconds * 60 * 60 * 24))
|
||||
fi
|
||||
|
||||
d=$(($(date +%s) + seconds));
|
||||
printf 'Started at %s\n' "$(date)"
|
||||
|
||||
while [[ "$d" -ge "$(date +%s)" ]]; do
|
||||
_dt=$((d - $(date +%s)))
|
||||
days=$((_dt / 86400))
|
||||
printf "\r%sd %s " "$days" "$(date -u --date @$((_dt)) +%H:%M:%S)";
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
printf "\rCountdown finished %s\n" "$(date)"
|
4
modules/home-manager/scripts/common/bin/docker-compose
Executable file
4
modules/home-manager/scripts/common/bin/docker-compose
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env sh
|
||||
# a shim implemented this way so that other scripts looking for an executable
|
||||
# docker-compose file in my path think I have it installed 😈
|
||||
podman-compose "$@"
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
r="$(< "$HOME/.emoji.txt" sk --height 40%)"
|
||||
r="$(< "$HOME/.emoji.txt" fzf --height 40%)"
|
||||
echo "$r" | awk '$0=$1' | tr -d '\n' | clip
|
||||
echo "Copied $r emoji to your clipboard"
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env -S deno run --allow-read --allow-run --allow-net
|
||||
#!/usr/bin/env -S nix shell nixpkgs#deno --command deno run --allow-read --allow-run --allow-net
|
||||
|
||||
import * as path from "https://deno.land/std@0.181.0/path/mod.ts";
|
||||
|
3
modules/home-manager/scripts/common/bin/j
Executable file
3
modules/home-manager/scripts/common/bin/j
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
N journal
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
umask 0077
|
||||
SUBDIR="${2:-./}"
|
||||
mkdir -p "$NOTES_PATH/$SUBDIR"
|
||||
cd "$NOTES_PATH/$SUBDIR" || exit 1
|
127
modules/home-manager/scripts/common/bin/spark
Executable file
127
modules/home-manager/scripts/common/bin/spark
Executable file
|
@ -0,0 +1,127 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# spark
|
||||
# https://github.com/holman/spark
|
||||
#
|
||||
# Generates sparklines for a set of data.
|
||||
#
|
||||
# Here's a good web-based sparkline generator that was a bit of inspiration
|
||||
# for spark:
|
||||
#
|
||||
# https://datacollective.org/sparkblocks
|
||||
#
|
||||
# spark takes a comma-separated or space-separated list of data and then prints
|
||||
# a sparkline out of it.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# spark 1 5 22 13 53
|
||||
# # => ▁▁▃▂▇
|
||||
#
|
||||
# spark 0 30 55 80 33 150
|
||||
# # => ▁▂▃▅▂▇
|
||||
#
|
||||
# spark -h
|
||||
# # => Prints the spark help text.
|
||||
|
||||
# Generates sparklines.
|
||||
#
|
||||
# $1 - The data we'd like to graph.
|
||||
_echo()
|
||||
{
|
||||
if [ "X$1" = "X-n" ]; then
|
||||
shift
|
||||
printf "%s" "$*"
|
||||
else
|
||||
printf "%s\n" "$*"
|
||||
fi
|
||||
}
|
||||
|
||||
spark()
|
||||
{
|
||||
local n numbers=
|
||||
|
||||
# find min/max values
|
||||
local min=0xffffffff max=0
|
||||
|
||||
for n in ${@//,/ }
|
||||
do
|
||||
# on Linux (or with bash4) we could use `printf %.0f $n` here to
|
||||
# round the number but that doesn't work on OS X (bash3) nor does
|
||||
# `awk '{printf "%.0f",$1}' <<< $n` work, so just cut it off
|
||||
n=${n%.*}
|
||||
(( n < min )) && min=$n
|
||||
(( n > max )) && max=$n
|
||||
numbers=$numbers${numbers:+ }$n
|
||||
done
|
||||
|
||||
# print ticks
|
||||
local ticks=(▁ ▂ ▃ ▄ ▅ ▆ ▇ █)
|
||||
|
||||
# use a high tick if data is constant
|
||||
(( min == max )) && ticks=(▅ ▆)
|
||||
|
||||
local f=$(( (($max-$min)<<8)/(${#ticks[@]}-1) ))
|
||||
(( f < 1 )) && f=1
|
||||
|
||||
for n in $numbers
|
||||
do
|
||||
_echo -n ${ticks[$(( ((($n-$min)<<8)/$f) ))]}
|
||||
done
|
||||
_echo
|
||||
}
|
||||
|
||||
# If we're being sourced, don't worry about such things
|
||||
if [ "$BASH_SOURCE" == "$0" ]; then
|
||||
# Prints the help text for spark.
|
||||
help()
|
||||
{
|
||||
local spark=$(basename $0)
|
||||
cat <<EOF
|
||||
|
||||
USAGE:
|
||||
$spark [-h|--help] VALUE,...
|
||||
|
||||
EXAMPLES:
|
||||
$spark 1 5 22 13 53
|
||||
▁▁▃▂█
|
||||
$spark 0,30,55,80,33,150
|
||||
▁▂▃▄▂█
|
||||
echo 9 13 5 17 1 | $spark
|
||||
▄▆▂█▁
|
||||
EOF
|
||||
}
|
||||
|
||||
# show help for no arguments if stdin is a terminal
|
||||
if { [ -z "$1" ] && [ -t 0 ] ; } || [ "$1" == '-h' ] || [ "$1" == '--help' ]
|
||||
then
|
||||
help
|
||||
exit 0
|
||||
fi
|
||||
|
||||
spark ${@:-`cat`}
|
||||
fi
|
||||
|
||||
# source: https://github.com/holman/spark/commit/ab88ac6f8f33698f39ece2f109b1117ef39a68eb
|
||||
|
||||
# The MIT License
|
||||
#
|
||||
# Copyright (c) Zach Holman, https://zachholman.com
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
3
modules/home-manager/scripts/common/bin/t
Executable file
3
modules/home-manager/scripts/common/bin/t
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
N todo
|
2
modules/home-manager/scripts/common/bin/td
Executable file
2
modules/home-manager/scripts/common/bin/td
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
N todo
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue