Compare commits
835 Commits
wip-doofne
...
2024-08-12
Author | SHA1 | Date | |
---|---|---|---|
7a047702d5 | |||
467283989f | |||
db39dc209f | |||
7cf860a071 | |||
77a753b0d6 | |||
e2a4f4d63e | |||
31fc072bce | |||
144afd8171 | |||
7d97355d2a | |||
7827f6c584 | |||
e1899495a0 | |||
a56ad56a4f | |||
da551b8b97 | |||
ca412d08bd | |||
e7a1bb6ec0 | |||
74acfeadd5 | |||
e7d5a61014 | |||
6f47708624 | |||
fc826a3503 | |||
ccb2b7b8b6 | |||
78169d50f2 | |||
33a7d3536d | |||
7899c8d033 | |||
82b662a733 | |||
d4290588bf | |||
bd97fb9ec9 | |||
4dbff9c18f | |||
bfe278c17a | |||
295e07d535 | |||
d39459d8b5 | |||
4d5e60756b | |||
119afcf393 | |||
d3d970eb3e | |||
c0d5004926 | |||
d9a876e49a | |||
5a9dd89475 | |||
5e71e5a067 | |||
f0b0d15ad7 | |||
8aebc1fe87 | |||
764c2a3276 | |||
a2f34be9d6 | |||
bda172bc2d | |||
a91a2d8a7f | |||
875d919fa8 | |||
a323f321b5 | |||
f986936bbd | |||
3d773fe375 | |||
055ad222e3 | |||
3aafcb0aa8 | |||
c85f02ca68 | |||
eeafc34ccf | |||
039ffcdcd4 | |||
2a35cb5379 | |||
3db009bc98 | |||
1e840e72b3 | |||
ce1c3ec804 | |||
09dd69a855 | |||
cbe71868ef | |||
7b043d0c87 | |||
fd0188025d | |||
1c57ffa798 | |||
1d205a89bc | |||
5ff643aa2f | |||
bfdf63e641 | |||
c695f7a979 | |||
b3b38451b5 | |||
1ee81db537 | |||
b9947c05ca | |||
2de6491583 | |||
4525df58e0 | |||
9d1ffc7c43 | |||
a69af91b7b | |||
7b5d655c91 | |||
de6ffe6b75 | |||
f8aea34e96 | |||
49efb94a0a | |||
9b1e053ead | |||
235dc86155 | |||
6dad290cd5 | |||
cc6ed6c0ec | |||
cc3aba3cc2 | |||
41f08125bb | |||
27487fe870 | |||
d45ea622d1 | |||
247fd3f807 | |||
816e2a7065 | |||
be842d5c5e | |||
fa6ec981e0 | |||
52b4c1542a | |||
3ff59247da | |||
d9c0855c4e | |||
1a67a05238 | |||
1cdeedd9ec | |||
6830bb7097 | |||
316b0bee3a | |||
638655ff83 | |||
5e57e78411 | |||
3859619ae0 | |||
646c2dd85a | |||
0655b6906c | |||
3019f90f5d | |||
020e5f8c6e | |||
809c3af7fa | |||
93cb1bc546 | |||
53acab834c | |||
3a0610b029 | |||
9cee460d7e | |||
e657507a76 | |||
c706a19836 | |||
566e15286b | |||
d1b4e9c923 | |||
5eca45891b | |||
722fe8f368 | |||
e25dd98f6c | |||
54e9d4a0ae | |||
9f3a13eeb8 | |||
5605ffda4b | |||
9165925469 | |||
f65bf2b433 | |||
0f60a86ed4 | |||
b488b6748d | |||
ef6b7cf175 | |||
0906d76f83 | |||
90c495e74c | |||
74662df720 | |||
2b3278eb7f | |||
9b4e91fbd9 | |||
734627232a | |||
3adbbe5fa7 | |||
b4a244df7a | |||
97268e9b26 | |||
bebf6bdaeb | |||
04fc601c9c | |||
ee062d61d0 | |||
0dba9987c5 | |||
4761690b6d | |||
604782c3a6 | |||
365d33c357 | |||
a39ad8a508 | |||
c49e9a4c2b | |||
36491842cc | |||
81ea2210c9 | |||
f678508b33 | |||
6135be5f72 | |||
c8989ca1a8 | |||
1d665f8ecc | |||
7c284ad8da | |||
1c26674da7 | |||
dae8481176 | |||
42b27f0433 | |||
84be0cae5a | |||
fbfd0afca4 | |||
e586b7b449 | |||
222c37b056 | |||
53b17ec230 | |||
7697704aff | |||
c490b6e6ad | |||
89d678c729 | |||
c64163290c | |||
eaeb8380dc | |||
05a9e8e819 | |||
cf20230d96 | |||
9dbb2a6266 | |||
113b107d73 | |||
96dfe79a8c | |||
6e5bde17aa | |||
3eb66c098b | |||
515aab5370 | |||
f925dd9a20 | |||
cbe6bdf158 | |||
949a52dee1 | |||
2ee1fb17c4 | |||
48cc718700 | |||
6a7dd31755 | |||
2197951e12 | |||
883db3e9ba | |||
312b0a5554 | |||
07de46c616 | |||
efc16a9e80 | |||
161f272f41 | |||
6aa6c0020c | |||
acd46940e4 | |||
00a25f1533 | |||
bc0a1eb1b3 | |||
cd3f483df0 | |||
38a183cf3b | |||
5ed6e84cc7 | |||
7c1a0fc323 | |||
f16066549f | |||
659da66106 | |||
c07eaba873 | |||
bb420bd45d | |||
3902432864 | |||
33efbeda8a | |||
8206fb0519 | |||
2687286489 | |||
d5e52e21f7 | |||
367fc24aa8 | |||
bf45206d1a | |||
397b2ae2ea | |||
f0ebb305ec | |||
e629d2d999 | |||
9b2601e450 | |||
a20c13fffe | |||
20a2d8dc1c | |||
297bf7e090 | |||
ed024d081e | |||
4ddd4191bc | |||
32ef63028b | |||
70bd001171 | |||
b53f376d70 | |||
621c147483 | |||
841076fd9e | |||
80492e902b | |||
f058fe0be6 | |||
8fde3dea77 | |||
ac9238a7f0 | |||
45412e5042 | |||
d76d50f1c4 | |||
f1c76ada43 | |||
9dbd85ba08 | |||
2c707c3acd | |||
0fae963d90 | |||
90df178c35 | |||
dc053149d0 | |||
bce81d0487 | |||
a8eba4df4d | |||
1bb36b74c2 | |||
e21910a1f7 | |||
4b30036973 | |||
ea5919ab6b | |||
43232ff569 | |||
6a9fd04437 | |||
dc2d46b9c0 | |||
666744bda3 | |||
ba09fbeec9 | |||
916ecc30d1 | |||
1536a60a3d | |||
b7418afede | |||
82a0bf3212 | |||
cb79224c7a | |||
b850e25f5b | |||
8f0f7ef333 | |||
0bfaead177 | |||
1b93dbe12c | |||
72d286fbba | |||
033faf6f6b | |||
eb3651ce59 | |||
bf1f843306 | |||
6cc5669772 | |||
cb1fbdcaf0 | |||
c83dc4d601 | |||
36bbac539f | |||
9a1cd9341f | |||
3a6a5ffe01 | |||
971de060d5 | |||
3ea57f1d6a | |||
fa05e59863 | |||
de7ff360dc | |||
7f1f9a082d | |||
6553cdc068 | |||
e44771f67d | |||
cbe17c03e4 | |||
4c4d841038 | |||
060ae113a1 | |||
540124d2f7 | |||
9df947aa74 | |||
66333cbbe7 | |||
3353ed3b66 | |||
447923a231 | |||
3179a6834b | |||
70a470b81e | |||
fff7848cd6 | |||
1fb6cb483b | |||
33e72c8d34 | |||
8629e2600a | |||
2e644dc020 | |||
f4a6bc1991 | |||
19fd45211f | |||
ace03bb0e9 | |||
8819142128 | |||
d905af6cd1 | |||
0f084b19f1 | |||
91263b9dcf | |||
40e4d0f39c | |||
06a17e4425 | |||
cbca403158 | |||
3b8d6c8587 | |||
d59380b4dd | |||
f4df121e3d | |||
3d91fa2475 | |||
96f786de20 | |||
fcbbfc4a65 | |||
b93e9e75e6 | |||
4daf5452e8 | |||
af905a2f58 | |||
8ef5920d84 | |||
b554d32133 | |||
2203d6db59 | |||
07b55bb3ec | |||
874b7aecfa | |||
cf8e9f798d | |||
800945d951 | |||
4c3b0f820b | |||
0756349c86 | |||
490c587737 | |||
15df9edca1 | |||
2d73b85f92 | |||
70d4925483 | |||
dda2ea6fcb | |||
a165e568a8 | |||
a539e52abe | |||
e62df51258 | |||
17e7c7d48b | |||
6f1173e45a | |||
225c8de7a2 | |||
05f8dad425 | |||
8b6971a164 | |||
91359174f6 | |||
b012b93d89 | |||
34e770c5f5 | |||
0460a419c5 | |||
79834aedf3 | |||
2ca8bcda56 | |||
8ced778def | |||
d91ca22587 | |||
a47b9d580a | |||
fc8a54f39b | |||
3ae25fbe31 | |||
36acc87f30 | |||
5b7244d339 | |||
9efa5bb209 | |||
211486f60e | |||
b21002207a | |||
1fc0ae3066 | |||
712cff2867 | |||
a103cd819f | |||
553a2724a4 | |||
bf0583cbda | |||
5a5842d26c | |||
3f8f3f4e54 | |||
4ad6c84d31 | |||
8e215cba69 | |||
1e3b71def3 | |||
90b057af95 | |||
4e35c09a85 | |||
1e0034c66f | |||
ae91b825e6 | |||
3c8b3f2d04 | |||
79fbdc4e15 | |||
284ea45648 | |||
9c33cb44e2 | |||
77a9f47352 | |||
04a5d38f79 | |||
452950d80b | |||
a79d9b1823 | |||
6e3a790a46 | |||
7be997f597 | |||
ef1ee6c1c9 | |||
e196cea667 | |||
105416990a | |||
c0d1f7711a | |||
f123be98b2 | |||
15b0bba329 | |||
734a4c7c31 | |||
3ce2b44b7d | |||
5f0eaa9771 | |||
cd7b36b761 | |||
b72acef8ed | |||
74f2d4d174 | |||
bedc9d4b2c | |||
70b36fd79f | |||
7baed78b65 | |||
7cca126efc | |||
433e8b8736 | |||
c026b8c40d | |||
88df6b30ce | |||
d324a57f06 | |||
55bed1926c | |||
8c9dcdb90f | |||
0ebcbe0ad5 | |||
a9cbb2c092 | |||
c5227c52c4 | |||
0af5e43944 | |||
cd16f8c3b6 | |||
0f7ec33dac | |||
993c3df09e | |||
fccb48cc2d | |||
64ddf15620 | |||
68ef56b572 | |||
99c19ceac0 | |||
f95f9a35fc | |||
5f1ac2afac | |||
2ee53fd5be | |||
9fb2cf4d42 | |||
612fa0cae8 | |||
875e85c646 | |||
94ecca2967 | |||
1fea424052 | |||
4abd782b62 | |||
13b04d50b0 | |||
36b1178fc0 | |||
527e7029b9 | |||
18c07721d9 | |||
6ac700811a | |||
cd62aa2f38 | |||
72a78c5f3e | |||
db292850b0 | |||
8e6272bafd | |||
90e1f4a447 | |||
31c32b9636 | |||
d6aef04a77 | |||
0f08f14dc0 | |||
6d9806613c | |||
c0c2aa00f3 | |||
6d5cd7b604 | |||
98860ccf46 | |||
bc5805b341 | |||
3a4d27c3bf | |||
c88ef43310 | |||
326e71f7b1 | |||
532d3c13f6 | |||
9f26ad40f9 | |||
c8a99317bc | |||
2296e10f15 | |||
ca68434f18 | |||
a1de7a4afd | |||
b692c0b6ce | |||
8ba1e35b9d | |||
765ec610c9 | |||
43c33fef21 | |||
9bcc7cd30b | |||
0b7d8310df | |||
c6f07d4f55 | |||
94a0e77fcc | |||
91d5c20a56 | |||
9b898ce597 | |||
a49411c02d | |||
fcd13d4f6f | |||
ef1be364e7 | |||
8472320629 | |||
19acab1363 | |||
98e1ae53e2 | |||
eb2321aa79 | |||
8febe70665 | |||
ee4ab3b40c | |||
281643afb0 | |||
86f1e36035 | |||
929a8eadbc | |||
e355a4b2eb | |||
132798be23 | |||
c72e66a901 | |||
40d32ec1d5 | |||
1377f5c7bc | |||
bee714311b | |||
b368d4624e | |||
583f7217fc | |||
e8b0979de6 | |||
c4b4ac48fd | |||
8436ba3e02 | |||
8b1f91ca86 | |||
73f6907e9a | |||
d6bfef7657 | |||
0fafd81b79 | |||
2ac9c2cb68 | |||
e8547cc849 | |||
3495f04810 | |||
68a891f6de | |||
b8dbc0c1c0 | |||
6964cf8d46 | |||
c959c0a74a | |||
7b0a4c11ec | |||
a926cbee46 | |||
23d8990596 | |||
76ae404827 | |||
e868e28ed9 | |||
2283a5b167 | |||
8d0b7c5855 | |||
3fb7fe34c4 | |||
10687a80e4 | |||
a8bcfaed53 | |||
ab200f8988 | |||
b443fd46d8 | |||
0473822172 | |||
d0b5f586c4 | |||
f6895393d9 | |||
f78b49f075 | |||
aa3115d2ca | |||
924a6c812c | |||
fd50bf6422 | |||
7c0e7cbb71 | |||
26004da704 | |||
7013b09715 | |||
3969fd484b | |||
eeab1d9fda | |||
deb355d960 | |||
1d4df82bde | |||
f49e87cf99 | |||
e38c2f20e8 | |||
0e5f01f240 | |||
e04dd6cb7d | |||
f4b6bbfbd5 | |||
2e8c58a53d | |||
f6e326869f | |||
c16f2473e5 | |||
d85ffa8539 | |||
987cd93ce3 | |||
e82faa5961 | |||
514cfe7b0b | |||
dd2eb66875 | |||
6ccdbf50cd | |||
e2cca54e08 | |||
721f45f7d4 | |||
774ebd23f9 | |||
bfdacb1941 | |||
beeb5d34b0 | |||
3d3faba263 | |||
a56795ff79 | |||
00d644ef07 | |||
672de68e56 | |||
e47bc4c04d | |||
0b6a8eecce | |||
eaaea26603 | |||
e1c80c9abc | |||
50add19b14 | |||
56032bc040 | |||
6ee33240d7 | |||
4aaeb42cab | |||
2697d068ce | |||
3ae650bcae | |||
ddce650bc5 | |||
96bf9d594f | |||
c2185f44b1 | |||
549fa8e5cd | |||
afc31dfc2f | |||
2011065497 | |||
ca6bb7518a | |||
612274d0b2 | |||
b801ed07d6 | |||
53fd4ee42f | |||
0b610a6683 | |||
3696953ba0 | |||
da8b3fc188 | |||
91db9fef82 | |||
682e9c0c68 | |||
cd9f1cc95e | |||
607845d495 | |||
79c8521f38 | |||
fa284c3dec | |||
3fe5e57c3c | |||
05c212a227 | |||
ea2da626d1 | |||
f8d0c9ce3b | |||
46bf7c5ac9 | |||
d12120d53c | |||
22e3f58ab3 | |||
9f483541a4 | |||
8d8f19752f | |||
49c3bf0f34 | |||
065aba0996 | |||
c7425e792b | |||
74b7e90a34 | |||
9f642980fd | |||
c638218c07 | |||
1ad933ad9c | |||
3dc007448c | |||
3487303216 | |||
b74e797b13 | |||
bb3f148c32 | |||
e235e09cf1 | |||
64610a5806 | |||
15ca5fbfa4 | |||
997b841777 | |||
9ced7bd3b5 | |||
2710f2b2ca | |||
572a340c8a | |||
b844a9ef5d | |||
d41d067405 | |||
f8349a646b | |||
706667f403 | |||
99e0d5f03b | |||
3d82bc8c87 | |||
a3212f6955 | |||
0d3e89a431 | |||
b7c86d5867 | |||
5db8372b24 | |||
da09ab3617 | |||
133744fa4b | |||
bfd272b2c9 | |||
3edc8d87f4 | |||
6824080f6b | |||
0786475c63 | |||
ae082b1654 | |||
a77816e9de | |||
f50b10682f | |||
b062610866 | |||
bce8a0d91f | |||
3c53bca156 | |||
46806e36f0 | |||
4a8a5b309e | |||
8f46bd5497 | |||
2c3239da8b | |||
a08394edf1 | |||
5e5ecfe81e | |||
5048bd8d70 | |||
c7d8d9ee86 | |||
2e49946c65 | |||
a12aa02655 | |||
6d66a5dbf8 | |||
a31f67b793 | |||
5d80e298b5 | |||
56e488b130 | |||
5ebaaf46a2 | |||
bee3ec1fa0 | |||
46eab8f4e2 | |||
828d4fcc9c | |||
ca2ac89cec | |||
1ae1d94d53 | |||
c68f333bc9 | |||
9a09faa9e4 | |||
ae2eaa786c | |||
9c523b3ddd | |||
44c4e88b90 | |||
5ca0ca4f47 | |||
00ea7e17c5 | |||
823f8f2be3 | |||
13bec790cb | |||
e72f9be1bf | |||
0fd8dc2a01 | |||
24ed242bac | |||
f290b16f12 | |||
b4cb3decff | |||
7084bf95fa | |||
acd0926d1f | |||
2dba46da6b | |||
110c440697 | |||
f4047bfbea | |||
c573ac4e7e | |||
cc15be54d4 | |||
8b95a5fa37 | |||
b596f88ccc | |||
e82feb9f71 | |||
4839a40205 | |||
631c47c9bc | |||
b2f36e4ef6 | |||
9a210b4a63 | |||
181ebfc627 | |||
ddb904ae19 | |||
a234e57d89 | |||
a75a8f8425 | |||
9cbe74b20b | |||
6b06062cc9 | |||
b009b2c836 | |||
d46239f2ad | |||
47f474fecd | |||
828ef00b61 | |||
5d14a39d52 | |||
58f89aadf3 | |||
d9a03ee64a | |||
697543a675 | |||
ff235f5806 | |||
39fe0ce43a | |||
98fde86ff6 | |||
5c6a5b01c4 | |||
bb4f963c9c | |||
9eb0b3fc86 | |||
5b7f15b278 | |||
5176d6a3bc | |||
84ba7e3d68 | |||
6d16d83aab | |||
e9c51eddb3 | |||
75473c7123 | |||
10f7714cfd | |||
fe78f8bc45 | |||
6bbe3a8e23 | |||
98c4a5ec87 | |||
bf3a894d38 | |||
c973f2e03b | |||
9f76469b5c | |||
52231f2adc | |||
8c5d9d79d7 | |||
961c38e79b | |||
fc5068f4d4 | |||
e641f5c93a | |||
870e766966 | |||
a75a341b56 | |||
8b7ed2cdd4 | |||
b3a685aa31 | |||
9b8c461ce9 | |||
27de05a751 | |||
f54f1c57bc | |||
98d6439f2a | |||
fbcf2aed41 | |||
fb7701027e | |||
0bc228c07b | |||
943ebba7fb | |||
e41bf78db6 | |||
8588230f80 | |||
8ef1af7e22 | |||
989344f87e | |||
90f8d1e042 | |||
d8ca5f91c3 | |||
167bb4d8de | |||
6b117fa9bf | |||
4b9dcd50fb | |||
84e6d536d6 | |||
4c74e53052 | |||
5def8f30ad | |||
45dd144b24 | |||
66d4b380da | |||
8e7da2c956 | |||
0f11b9a7b7 | |||
d9437bf4aa | |||
5d1c52d0bc | |||
a0dfdb5125 | |||
cbc2ba02a4 | |||
ef0adb5689 | |||
b1bd4399f1 | |||
2b252e3ede | |||
9aaf89408a | |||
283ca45c5d | |||
7955d90f8d | |||
a06481fbef | |||
5db4d73ad6 | |||
304c8f8e3e | |||
5a09a2665b | |||
209545fc41 | |||
1e12566207 | |||
9a53cbc833 | |||
439bb5263f | |||
845dba3ca5 | |||
5e7fe850ec | |||
832338488d | |||
86ee95f607 | |||
5f5e55c98b | |||
7d59782005 | |||
62b541012b | |||
514197a17f | |||
143bdf672b | |||
a6c48eda71 | |||
a603c3e6bc | |||
1f48f41927 | |||
c0d9f05575 | |||
7f46b034f9 | |||
ba66378bc0 | |||
dcc8168aa0 | |||
f7d3c26d12 | |||
3d871e8d7c | |||
78f4cd9be2 | |||
f83bac3c2b | |||
58de5d661f | |||
599832d59c | |||
625cb0992b | |||
a02f221628 | |||
ad8bcfc09e | |||
815ce6287f | |||
0d1d56870f | |||
2445b882c2 | |||
12465e111e | |||
65a0914828 | |||
dab60e79c1 | |||
fe57f186cd | |||
78d66a8b09 | |||
b2955c9c9d | |||
b0e184b0f0 | |||
3cd97b522c | |||
c91681c77c | |||
d0d623da15 | |||
0db86d8c86 | |||
b74dfe7578 | |||
d1843b6b3d | |||
b482a1dfd6 | |||
5ba74a4055 | |||
b3b77e3e62 | |||
63bc58a56f | |||
efcf8639dc | |||
90b86dc7fc | |||
8bf8d31c5f | |||
2e44abc55d | |||
9e92069ba3 | |||
2a592a4a15 | |||
8ca357ea7f | |||
4f4c05a922 | |||
7c4be0f4e9 | |||
afea7fe5e7 | |||
294f0061bd | |||
4efe159933 | |||
b7f99c022b | |||
b3c5e53156 | |||
91c2b04ab4 | |||
27efb10a27 | |||
e4e32f46fe | |||
64b169069a | |||
c2c15e1ac3 | |||
0b3156c4c7 | |||
1c8551c842 | |||
2755d98b99 | |||
543108a5dd | |||
b32d02dc3f | |||
0bd92ef77e | |||
a7df4cc125 | |||
09a615ee62 | |||
8523b406ad | |||
6021da072c | |||
a49abbd123 | |||
f9091c0b0c | |||
bbf8fd5b20 | |||
be84747ffc | |||
478b443430 | |||
ded5f6560d | |||
c1b3629dcf | |||
5879499924 | |||
5a63f294c0 | |||
891a29feeb | |||
0863505877 | |||
0c922bd63a | |||
e04ec4c706 | |||
b0f9733ac8 | |||
e2babfc076 | |||
ef29b569e5 | |||
6f0a455d0b | |||
7d6a420c52 | |||
259143b87e | |||
fce426c318 | |||
9b794777b5 | |||
3ada668366 | |||
39a39e763d | |||
50353280d3 | |||
72b8211029 | |||
dbf719b59b | |||
57d7d3821f | |||
e86e9fc079 | |||
d708b78ebe | |||
075418eda1 | |||
9fc5b83b61 |
81
TODO.md
81
TODO.md
@@ -2,20 +2,22 @@
|
|||||||
- `rmDbusServices` may break sandboxing
|
- `rmDbusServices` may break sandboxing
|
||||||
- e.g. if the package ships a systemd unit which references $out, then make-sandboxed won't properly update that unit.
|
- e.g. if the package ships a systemd unit which references $out, then make-sandboxed won't properly update that unit.
|
||||||
- `rmDbusServicesInPlace` is not affected
|
- `rmDbusServicesInPlace` is not affected
|
||||||
- when moby wlan is explicitly set down (via ip link set wlan0 down), /var/lib/trust-dns/dhcp-configs doesn't get reset
|
- when moby wlan is explicitly set down (via ip link set wlan0 down), /var/lib/hickory-dns/dhcp-configs doesn't get reset
|
||||||
- `ip monitor` can detect those manual link state changes (NM-dispatcher it seems cannot)
|
- `ip monitor` can detect those manual link state changes (NM-dispatcher it seems cannot)
|
||||||
- or try dnsmasq?
|
- or try dnsmasq?
|
||||||
- trust-dns: can't recursively resolve api.mangadex.org
|
- hickory-dns can't resolve `abs.twimg.com`
|
||||||
- and *sometimes* apple.com fails
|
- hickory-dns can't resolve `social.kernel.org`
|
||||||
|
- hickory-dns can't resolve `pe.usps.com`
|
||||||
|
- hickory-dns can't resolve `social.seattle.wa.us`
|
||||||
|
- hickory-dns can't resolve `support.mozilla.org`
|
||||||
- sandbox: link cache means that if i update ~/.config/... files inline, sandboxed programs still see the old version
|
- sandbox: link cache means that if i update ~/.config/... files inline, sandboxed programs still see the old version
|
||||||
|
- mpv: continues to play past the end of some audio files
|
||||||
- mpv: audiocast has mpv sending its output to the builtin speakers unless manually changed
|
- mpv: audiocast has mpv sending its output to the builtin speakers unless manually changed
|
||||||
- mpv: no way to exit fullscreen video on moby
|
|
||||||
- uosc hides controls on FS, and touch doesn't support unhiding
|
|
||||||
- Signal restart loop drains battery
|
|
||||||
- decrease s6 restart time?
|
|
||||||
- `ssh` access doesn't grant same linux capabilities as login
|
- `ssh` access doesn't grant same linux capabilities as login
|
||||||
- ringer (i.e. dino incoming call) doesn't prevent moby from sleeping
|
- syshud (volume overlay): when casting with `blast`, syshud doesn't react to volume changes
|
||||||
- sysvol (volume overlay): when casting with `blast`, sysvol doesn't react to volume changes
|
- moby: after bringing the modem up, powering it down loses *complete* net connectivity (i.e. wlan is gone as well)
|
||||||
|
- dissent: if i launch it without net connectivity, it gets stuck at the login, and never tries again
|
||||||
|
- calls: seems that it starts before net access, and then is forever disconnected (until i manually restart it)
|
||||||
- moby: kaslr is effectively disabled
|
- moby: kaslr is effectively disabled
|
||||||
- `dmesg | grep "KASLR disabled due to lack of seed"`
|
- `dmesg | grep "KASLR disabled due to lack of seed"`
|
||||||
- fix by adding `kaslrseed` to uboot script before `booti`
|
- fix by adding `kaslrseed` to uboot script before `booti`
|
||||||
@@ -26,12 +28,21 @@
|
|||||||
- `dmesg | grep 'hid_bpf: error while preloading HID BPF dispatcher: -22'`
|
- `dmesg | grep 'hid_bpf: error while preloading HID BPF dispatcher: -22'`
|
||||||
- `s6` is not re-entrant
|
- `s6` is not re-entrant
|
||||||
- so if the desktop crashes, the login process from `unl0kr` fails to re-launch the GUI
|
- so if the desktop crashes, the login process from `unl0kr` fails to re-launch the GUI
|
||||||
|
- newflash on moby can't play videos
|
||||||
|
- "open in browser" works though -- in mpv
|
||||||
|
- gnome-maps can't use geoclue *and* openstreetmap at the same time
|
||||||
|
- get gnome-maps to speak xdg-desktop-portal, and this will be fixed
|
||||||
|
- epiphany can't save cookies
|
||||||
|
- see under "preferences", cookies are disabled
|
||||||
|
- prevents logging into websites (OpenStreetMap)
|
||||||
|
- works when sandbox is disabled
|
||||||
|
|
||||||
## REFACTORING:
|
## REFACTORING:
|
||||||
- add import checks to my Python nix-shell scripts
|
- add import checks to my Python nix-shell scripts
|
||||||
- consolidate ~/dev and ~/ref
|
- consolidate ~/dev and ~/ref
|
||||||
- ~/dev becomes a link to ~/ref/cat/mine
|
- ~/dev becomes a link to ~/ref/cat/mine
|
||||||
- fold hosts/common/home/ssh.nix -> hosts/common/users/colin.nix
|
- fold hosts/common/home/ssh.nix -> hosts/common/users/colin.nix
|
||||||
|
- don't hardcode IP addresses so much in servo
|
||||||
|
|
||||||
### sops/secrets
|
### sops/secrets
|
||||||
- rework secrets to leverage `sane.fs`
|
- rework secrets to leverage `sane.fs`
|
||||||
@@ -51,20 +62,26 @@
|
|||||||
|
|
||||||
|
|
||||||
## IMPROVEMENTS:
|
## IMPROVEMENTS:
|
||||||
- systemd/journalctl: use a less shit pager
|
|
||||||
- there's an env var for it: SYSTEMD_PAGER? and a flag for journalctl
|
|
||||||
- kernels: ship the same kernel on every machine
|
- kernels: ship the same kernel on every machine
|
||||||
- then i can tune the kernels for hardening, without duplicating that work 4 times
|
- then i can tune the kernels for hardening, without duplicating that work 4 times
|
||||||
- zfs: replace this with something which doesn't require a custom kernel build
|
- zfs: replace this with something which doesn't require a custom kernel build
|
||||||
- mpv: add media looping controls (e.g. loop song, loop playlist)
|
- mpv: add media looping controls (e.g. loop song, loop playlist)
|
||||||
|
- curlftpfs: replace with something better
|
||||||
|
- safer (rust? actively maintained? sandboxable?)
|
||||||
|
- handles spaces/symbols in filenames
|
||||||
|
- has better multi-stream perf (e.g. `sane-sync-music` should be able to copy N items in parallel)
|
||||||
|
- firefox: open *all* links (http, https, ...) with system handler
|
||||||
|
- removes the need for open-in-mpv, firefox-xdg-open, etc.
|
||||||
|
- matrix room links *just work*.
|
||||||
|
- `network.protocol-handler.external.https = true` in about:config *seems* to do this,
|
||||||
|
but breaks some webpages (e.g. Pleroma)
|
||||||
|
|
||||||
### security/resilience
|
### security/resilience
|
||||||
- validate duplicity backups!
|
- enable `snapper` btrfs snapshots (`services.snapper`)
|
||||||
- encrypt more ~ dirs (~/archives, ~/records, ..?)
|
|
||||||
- best to do this after i know for sure i have good backups
|
|
||||||
- /mnt/desko/home, etc, shouldn't include secrets (~/private)
|
- /mnt/desko/home, etc, shouldn't include secrets (~/private)
|
||||||
- 95% of its use is for remote media access and stuff which isn't in VCS (~/records)
|
- 95% of its use is for remote media access and stuff which isn't in VCS (~/records)
|
||||||
- port all sane.programs to be sandboxed
|
- port all sane.programs to be sandboxed
|
||||||
|
- sandbox `nix`
|
||||||
- enforce that all `environment.packages` has a sandbox profile (or explicitly opts out)
|
- enforce that all `environment.packages` has a sandbox profile (or explicitly opts out)
|
||||||
- revisit "non-sandboxable" apps and check that i'm not actually just missing mountpoints
|
- revisit "non-sandboxable" apps and check that i'm not actually just missing mountpoints
|
||||||
- LL_FS_RW=/ isn't enough -- need all mount points like `=/:/proc:/sys:...`.
|
- LL_FS_RW=/ isn't enough -- need all mount points like `=/:/proc:/sys:...`.
|
||||||
@@ -73,26 +90,17 @@
|
|||||||
- lock down dbus calls within the sandbox
|
- lock down dbus calls within the sandbox
|
||||||
- otherwise anyone can `systemd-run --user ...` to potentially escape a sandbox
|
- otherwise anyone can `systemd-run --user ...` to potentially escape a sandbox
|
||||||
- <https://github.com/flatpak/xdg-dbus-proxy>
|
- <https://github.com/flatpak/xdg-dbus-proxy>
|
||||||
- remove `.ssh` access from Firefox!
|
|
||||||
- limit access to `~/knowledge/secrets` through an agent that requires GUI approval, so a firefox exploit can't steal all my logins
|
|
||||||
- port sanebox to a compiled language (hare?)
|
- port sanebox to a compiled language (hare?)
|
||||||
- it adds like 50-70ms launch time _on my laptop_. i'd hate to know how much that is on the pinephone.
|
- it adds like 50-70ms launch time _on my laptop_. i'd hate to know how much that is on the pinephone.
|
||||||
- make dconf stuff less monolithic
|
- make dconf stuff less monolithic
|
||||||
- i.e. per-app dconf profiles for those which need it. possible static config.
|
- i.e. per-app dconf profiles for those which need it. possible static config.
|
||||||
- flatpak/spectrum has some stuff to proxy dconf per-app
|
- flatpak/spectrum has some stuff to proxy dconf per-app
|
||||||
- canaries for important services
|
|
||||||
- e.g. daily email checks; daily backup checks
|
|
||||||
- integrate `nix check` into Gitea actions?
|
|
||||||
|
|
||||||
### user experience
|
### user experience
|
||||||
- rofi: sort items case-insensitively
|
- rofi: sort items case-insensitively
|
||||||
- xdg-desktop-portal shouldn't kill children on exit
|
|
||||||
- *maybe* a job for `setsid -f`?
|
|
||||||
- replace starship prompt with something more efficient
|
- replace starship prompt with something more efficient
|
||||||
- watch `forkstat`: it does way too much
|
- watch `forkstat`: it does way too much
|
||||||
- cleanup waybar/nwg-panel so that it's not invoking playerctl every 2 seconds
|
- cleanup waybar/nwg-panel so that it's not invoking playerctl every 2 seconds
|
||||||
- nwg-panel: swaync icon is stuck as the refresh icon
|
|
||||||
- nwg-panel: doesn't appear on all desktops
|
|
||||||
- nwg-panel: doesn't know that virtual-desktop 10/TV exists
|
- nwg-panel: doesn't know that virtual-desktop 10/TV exists
|
||||||
- install apps:
|
- install apps:
|
||||||
- display QR codes for WiFi endpoints: <https://linuxphoneapps.org/apps/noappid.wisperwind.wifi2qr/>
|
- display QR codes for WiFi endpoints: <https://linuxphoneapps.org/apps/noappid.wisperwind.wifi2qr/>
|
||||||
@@ -101,7 +109,7 @@
|
|||||||
- offline docs viewer (gtk): <https://github.com/workbenchdev/Biblioteca>
|
- offline docs viewer (gtk): <https://github.com/workbenchdev/Biblioteca>
|
||||||
- some type of games manager/launcher
|
- some type of games manager/launcher
|
||||||
- Gnome Highscore (retro games)?: <https://gitlab.gnome.org/World/highscore>
|
- Gnome Highscore (retro games)?: <https://gitlab.gnome.org/World/highscore>
|
||||||
- better maps for mobile (Osmin (QtQuick)? Pure Maps (Qt/Kirigami)?
|
- better maps for mobile (Osmin (QtQuick)? Pure Maps (Qt/Kirigami)?)
|
||||||
- note-taking app: <https://linuxphoneapps.org/categories/note-taking/>
|
- note-taking app: <https://linuxphoneapps.org/categories/note-taking/>
|
||||||
- Folio is nice, uses standard markdown, though it only supports flat repos
|
- Folio is nice, uses standard markdown, though it only supports flat repos
|
||||||
- OSK overlay specifically for mobile gaming
|
- OSK overlay specifically for mobile gaming
|
||||||
@@ -119,20 +127,17 @@
|
|||||||
|
|
||||||
#### moby
|
#### moby
|
||||||
- fix cpuidle (gets better power consumption): <https://xnux.eu/log/077.html>
|
- fix cpuidle (gets better power consumption): <https://xnux.eu/log/077.html>
|
||||||
|
- fix cpupower for better power/perf
|
||||||
|
- `journalctl -u cpupower --boot` (problem is present on lappy, at least)
|
||||||
- moby: tune keyboard layout
|
- moby: tune keyboard layout
|
||||||
- SwayNC:
|
- SwayNC: add option to change audio output
|
||||||
- don't show MPRIS if no players detected
|
|
||||||
- this is a problem of playerctld, i guess
|
|
||||||
- add option to change audio output
|
|
||||||
- fix colors (red alert) to match overall theme
|
|
||||||
- moby: tune GPS
|
- moby: tune GPS
|
||||||
- run only geoclue, and not gpsd, to save power?
|
- fix iio-sensor-proxy magnetometer scaling
|
||||||
- tune QGPS setting in eg25-control, for less jitter?
|
- tune QGPS setting in eg25-control, for less jitter?
|
||||||
- direct mepo to prefer gpsd, with fallback to geoclue, for better accuracy?
|
|
||||||
- configure geoclue to do some smoothing?
|
- configure geoclue to do some smoothing?
|
||||||
- manually do smoothing, as some layer between mepo and geoclue/gpsd?
|
- manually do smoothing, as some layer between mepo and geoclue?
|
||||||
|
- email wigle.net people to unlock API access
|
||||||
- moby: port `freshen-agps` timer service to s6 (maybe i want some `s6-cron` or something)
|
- moby: port `freshen-agps` timer service to s6 (maybe i want some `s6-cron` or something)
|
||||||
- moby: show battery state on ssh login
|
|
||||||
- moby: improve gPodder launch time
|
- moby: improve gPodder launch time
|
||||||
- moby: theme GTK apps (i.e. non-adwaita styles)
|
- moby: theme GTK apps (i.e. non-adwaita styles)
|
||||||
- especially, make the menubar collapsible
|
- especially, make the menubar collapsible
|
||||||
@@ -141,6 +146,8 @@
|
|||||||
#### non-moby
|
#### non-moby
|
||||||
- RSS: integrate a paywall bypass
|
- RSS: integrate a paywall bypass
|
||||||
- e.g. self-hosted [ladder](https://github.com/everywall/ladder) (like 12ft.io)
|
- e.g. self-hosted [ladder](https://github.com/everywall/ladder) (like 12ft.io)
|
||||||
|
- RSS: have podcasts get downloaded straight into ~/Videos/...
|
||||||
|
- and strip the ads out using Whisper transcription + asking a LLM where the ad breaks are
|
||||||
- neovim: set up language server (lsp; rnix-lsp; nvim-lspconfig)
|
- neovim: set up language server (lsp; rnix-lsp; nvim-lspconfig)
|
||||||
- neovim: integrate LLMs
|
- neovim: integrate LLMs
|
||||||
- Helix: make copy-to-system clipboard be the default
|
- Helix: make copy-to-system clipboard be the default
|
||||||
@@ -153,17 +160,15 @@
|
|||||||
- have xdg-open parse `<repo:...> URIs (or adjust them so that it _can_ parse)
|
- have xdg-open parse `<repo:...> URIs (or adjust them so that it _can_ parse)
|
||||||
- sane-bt-search: show details like 5.1 vs stereo, h264 vs h265
|
- sane-bt-search: show details like 5.1 vs stereo, h264 vs h265
|
||||||
- maybe just color these "keywords" in all search results?
|
- maybe just color these "keywords" in all search results?
|
||||||
|
- transmission: apply `sane-tag-media` path fix in `torrent-done` script
|
||||||
|
- many .mkv files do appear to be tagged: i'd just need to add support in my own tooling
|
||||||
- uninsane.org: make URLs relative to allow local use (and as offline homepage)
|
- uninsane.org: make URLs relative to allow local use (and as offline homepage)
|
||||||
- email: fix so that local mail doesn't go to junk
|
- email: fix so that local mail doesn't go to junk
|
||||||
- git sendmail flow adds the DKIM signatures, but gets delivered locally w/o having the sig checked, so goes into Junk
|
- git sendmail flow adds the DKIM signatures, but gets delivered locally w/o having the sig checked, so goes into Junk
|
||||||
- could change junk filter from "no DKIM success" to explicit "DKIM failed"
|
- could change junk filter from "no DKIM success" to explicit "DKIM failed"
|
||||||
|
- add an auto-reply address (e.g. `reply-test@uninsane.org`) which reflects all incoming mail; use this (or a friend running this) for liveness checks
|
||||||
|
|
||||||
### perf
|
### perf
|
||||||
- debug nixos-rebuild times
|
|
||||||
- use `systemctl list-jobs` to show what's being waited on
|
|
||||||
- i think it's `systemd-networkd-wait-online.service` that's blocking this?
|
|
||||||
- i wonder what interface it's waiting for. i should use `--ignore=...` to ignore interfaces i don't care about.
|
|
||||||
- also `wireguard-wg-home.target` when net is offline
|
|
||||||
- add `pkgs.impure-cached.<foo>` package set to build things with ccache enabled
|
- add `pkgs.impure-cached.<foo>` package set to build things with ccache enabled
|
||||||
- every package here can be auto-generated, and marked with some env var so that it doesn't pollute the pure package set
|
- every package here can be auto-generated, and marked with some env var so that it doesn't pollute the pure package set
|
||||||
- would be super handy for package prototyping!
|
- would be super handy for package prototyping!
|
||||||
|
70
default.nix
70
default.nix
@@ -1,67 +1,5 @@
|
|||||||
# limited, non-flake interface to this repo.
|
{ ... }@args:
|
||||||
# this file exposes the same view into `pkgs` which the flake would see when evaluated.
|
|
||||||
#
|
|
||||||
# the primary purpose of this file is so i can run `updateScript`s which expect
|
|
||||||
# the root to be `default.nix`
|
|
||||||
{ }:
|
|
||||||
let
|
let
|
||||||
mkPkgs = args: (import ./pkgs/additional/nixpkgs args).extend
|
sane-nix-files = import ./pkgs/additional/sane-nix-files { };
|
||||||
(import ./overlays/all.nix);
|
in
|
||||||
inherit (mkPkgs {}) lib;
|
import "${sane-nix-files}/impure.nix" args
|
||||||
|
|
||||||
evalHost = { name, system, branch ? "master", variant ? null }:
|
|
||||||
let
|
|
||||||
pkgs = mkPkgs { inherit system; variant = branch; };
|
|
||||||
in pkgs.nixos (
|
|
||||||
[
|
|
||||||
(lib.optionalAttrs (variant == "light") {
|
|
||||||
sane.maxBuildCost = 2;
|
|
||||||
})
|
|
||||||
(lib.optionalAttrs (variant == "min") {
|
|
||||||
sane.maxBuildCost = 0;
|
|
||||||
})
|
|
||||||
(import ./hosts/instantiate.nix { hostName = name; })
|
|
||||||
(import ./modules)
|
|
||||||
pkgs.sops-nix.nixosModules.sops
|
|
||||||
]
|
|
||||||
);
|
|
||||||
mkFlavoredHost = args: let
|
|
||||||
host = evalHost args;
|
|
||||||
# expose the toplevel nixos system as the toplevel attribute itself,
|
|
||||||
# with nested aliases for other common build targets
|
|
||||||
in host.config.system.build.toplevel.overrideAttrs (base: {
|
|
||||||
passthru = (base.passthru or {}) // {
|
|
||||||
config = host.config;
|
|
||||||
fs = host.config.sane.fs;
|
|
||||||
img = host.config.system.build.img;
|
|
||||||
pkgs = host.config.system.build.pkgs;
|
|
||||||
programs = lib.mapAttrs (_: p: p.package) host.config.sane.programs;
|
|
||||||
toplevel = host.config.system.build.toplevel; #< self
|
|
||||||
};
|
|
||||||
});
|
|
||||||
mkHost = args: {
|
|
||||||
# TODO: swap order: $host-{next,staging}-{min,light}:
|
|
||||||
# then lexicographically-adjacent targets would also have the minimal difference in closure,
|
|
||||||
# and the order in which each target should be built is more evident
|
|
||||||
"${args.name}" = mkFlavoredHost args;
|
|
||||||
"${args.name}-next" = mkFlavoredHost args // { branch = "staging-next"; };
|
|
||||||
"${args.name}-staging" = mkFlavoredHost args // { branch = "staging"; };
|
|
||||||
"${args.name}-light" = mkFlavoredHost args // { variant = "light"; };
|
|
||||||
"${args.name}-light-next" = mkFlavoredHost args // { variant = "light"; branch = "staging-next"; };
|
|
||||||
"${args.name}-light-staging" = mkFlavoredHost args // { variant = "light"; branch = "staging"; };
|
|
||||||
"${args.name}-min" = mkFlavoredHost args // { variant = "min"; };
|
|
||||||
"${args.name}-min-next" = mkFlavoredHost args // { variant = "min"; branch = "staging-next"; };
|
|
||||||
"${args.name}-min-staging" = mkFlavoredHost args // { variant = "min"; branch = "staging-staging"; };
|
|
||||||
};
|
|
||||||
|
|
||||||
hosts = lib.foldl' (acc: host: acc // (mkHost host)) {} [
|
|
||||||
{ name = "crappy"; system = "armv7l-linux"; }
|
|
||||||
{ name = "desko"; system = "x86_64-linux"; }
|
|
||||||
{ name = "lappy"; system = "x86_64-linux"; }
|
|
||||||
{ name = "moby"; system = "aarch64-linux"; }
|
|
||||||
{ name = "rescue"; system = "x86_64-linux"; }
|
|
||||||
{ name = "servo"; system = "x86_64-linux"; }
|
|
||||||
];
|
|
||||||
in {
|
|
||||||
inherit hosts;
|
|
||||||
} // (mkPkgs {})
|
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
sane.programs.calls.enableFor.user.colin = false;
|
sane.programs.calls.enableFor.user.colin = false;
|
||||||
sane.programs.consoleMediaUtils.enableFor.user.colin = true;
|
sane.programs.consoleMediaUtils.enableFor.user.colin = true;
|
||||||
sane.programs.epiphany.enableFor.user.colin = true;
|
sane.programs.epiphany.enableFor.user.colin = true;
|
||||||
sane.programs."gnome.geary".enableFor.user.colin = false;
|
sane.programs.geary.enableFor.user.colin = false;
|
||||||
# sane.programs.firefox.enableFor.user.colin = true;
|
# sane.programs.firefox.enableFor.user.colin = true;
|
||||||
sane.programs.portfolio-filemanager.enableFor.user.colin = true;
|
sane.programs.portfolio-filemanager.enableFor.user.colin = true;
|
||||||
sane.programs.signal-desktop.enableFor.user.colin = false;
|
sane.programs.signal-desktop.enableFor.user.colin = false;
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
sane.programs.dino.config.autostart = false;
|
sane.programs.dino.config.autostart = false;
|
||||||
sane.programs.dissent.config.autostart = false;
|
sane.programs.dissent.config.autostart = false;
|
||||||
sane.programs.fractal.config.autostart = false;
|
sane.programs.fractal.config.autostart = false;
|
||||||
|
sane.programs.sway.config.mod = "Mod1"; #< alt key instead of Super
|
||||||
|
|
||||||
# sane.programs.guiApps.enableFor.user.colin = false;
|
# sane.programs.guiApps.enableFor.user.colin = false;
|
||||||
|
|
||||||
|
@@ -4,15 +4,19 @@
|
|||||||
./fs.nix
|
./fs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
sane.services.trust-dns.asSystemResolver = false; # TEMPORARY: TODO: re-enable trust-dns
|
sane.services.hickory-dns.asSystemResolver = false; # TEMPORARY: TODO: re-enable hickory-dns
|
||||||
# sane.programs.devPkgs.enableFor.user.colin = true;
|
# sane.programs.devPkgs.enableFor.user.colin = true;
|
||||||
# sane.guest.enable = true;
|
# sane.guest.enable = true;
|
||||||
|
|
||||||
# don't enable wifi by default: it messes with connectivity.
|
# don't enable wifi by default: it messes with connectivity.
|
||||||
# systemd.services.iwd.enable = false;
|
# systemd.services.iwd.enable = false;
|
||||||
|
# networking.wireless.enable = false;
|
||||||
# systemd.services.wpa_supplicant.enable = false;
|
# systemd.services.wpa_supplicant.enable = false;
|
||||||
sane.programs.wpa_supplicant.enableFor.user.colin = lib.mkForce false;
|
# sane.programs.wpa_supplicant.enableFor.user.colin = lib.mkForce false;
|
||||||
sane.programs.wpa_supplicant.enableFor.system = lib.mkForce false;
|
# sane.programs.wpa_supplicant.enableFor.system = lib.mkForce false;
|
||||||
|
# don't auto-connect to wifi networks
|
||||||
|
# see: <https://networkmanager.dev/docs/api/latest/NetworkManager.conf.html#device-spec>
|
||||||
|
networking.networkmanager.unmanaged = [ "type:wifi" ];
|
||||||
|
|
||||||
sops.secrets.colin-passwd.neededForUsers = true;
|
sops.secrets.colin-passwd.neededForUsers = true;
|
||||||
|
|
||||||
@@ -24,15 +28,18 @@
|
|||||||
sane.services.wg-home.ip = config.sane.hosts.by-name."desko".wg-home.ip;
|
sane.services.wg-home.ip = config.sane.hosts.by-name."desko".wg-home.ip;
|
||||||
sane.ovpn.addrV4 = "172.26.55.21";
|
sane.ovpn.addrV4 = "172.26.55.21";
|
||||||
# sane.ovpn.addrV6 = "fd00:0000:1337:cafe:1111:1111:20c1:a73c";
|
# sane.ovpn.addrV6 = "fd00:0000:1337:cafe:1111:1111:20c1:a73c";
|
||||||
sane.services.duplicity.enable = true;
|
sane.services.rsync-net.enable = true;
|
||||||
|
|
||||||
sane.nixcache.remote-builders.desko = false;
|
sane.nixcache.remote-builders.desko = false;
|
||||||
|
|
||||||
|
sane.programs.sane-private-unlock-remote.enableFor.user.colin = true;
|
||||||
|
sane.programs.sane-private-unlock-remote.config.hosts = [ "servo" ];
|
||||||
|
|
||||||
sane.programs.sway.enableFor.user.colin = true;
|
sane.programs.sway.enableFor.user.colin = true;
|
||||||
sane.programs.iphoneUtils.enableFor.user.colin = true;
|
sane.programs.iphoneUtils.enableFor.user.colin = true;
|
||||||
sane.programs.steam.enableFor.user.colin = true;
|
sane.programs.steam.enableFor.user.colin = true;
|
||||||
|
|
||||||
sane.programs."gnome.geary".config.autostart = true;
|
sane.programs.geary.config.autostart = true;
|
||||||
sane.programs.signal-desktop.config.autostart = true;
|
sane.programs.signal-desktop.config.autostart = true;
|
||||||
|
|
||||||
sane.programs.nwg-panel.config = {
|
sane.programs.nwg-panel.config = {
|
||||||
@@ -45,15 +52,18 @@
|
|||||||
# needed to use libimobiledevice/ifuse, for iphone sync
|
# needed to use libimobiledevice/ifuse, for iphone sync
|
||||||
services.usbmuxd.enable = true;
|
services.usbmuxd.enable = true;
|
||||||
|
|
||||||
|
# TODO: enable snapper (need to make `/nix` or `/nix/persist` a subvolume, somehow).
|
||||||
# default config: https://man.archlinux.org/man/snapper-configs.5
|
# default config: https://man.archlinux.org/man/snapper-configs.5
|
||||||
# defaults to something like:
|
# defaults to something like:
|
||||||
# - hourly snapshots
|
# - hourly snapshots
|
||||||
# - auto cleanup; keep the last 10 hourlies, last 10 daylies, last 10 monthlys.
|
# - auto cleanup; keep the last 10 hourlies, last 10 daylies, last 10 monthlys.
|
||||||
services.snapper.configs.nix = {
|
# to list snapshots: `sudo snapper --config nix list`
|
||||||
# TODO: for the impermanent setup, we'd prefer to just do /nix/persist,
|
# to take a snapshot: `sudo snapper --config nix create`
|
||||||
# but that also requires setting up the persist dir as a subvol
|
# services.snapper.configs.nix = {
|
||||||
SUBVOLUME = "/nix";
|
# # TODO: for the impermanent setup, we'd prefer to just do /nix/persist,
|
||||||
# TODO: ALLOW_USERS doesn't seem to work. still need `sudo snapper -c nix list`
|
# # but that also requires setting up the persist dir as a subvol
|
||||||
ALLOW_USERS = [ "colin" ];
|
# SUBVOLUME = "/nix";
|
||||||
};
|
# # TODO: ALLOW_USERS doesn't seem to work. still need `sudo snapper -c nix list`
|
||||||
|
# ALLOW_USERS = [ "colin" ];
|
||||||
|
# };
|
||||||
}
|
}
|
||||||
|
@@ -15,22 +15,31 @@
|
|||||||
# sane.guest.enable = true;
|
# sane.guest.enable = true;
|
||||||
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
|
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
|
||||||
|
|
||||||
|
sane.programs.sane-private-unlock-remote.enableFor.user.colin = true;
|
||||||
|
sane.programs.sane-private-unlock-remote.config.hosts = [ "servo" ];
|
||||||
|
|
||||||
sane.programs.stepmania.enableFor.user.colin = true;
|
sane.programs.stepmania.enableFor.user.colin = true;
|
||||||
sane.programs.sway.enableFor.user.colin = true;
|
sane.programs.sway.enableFor.user.colin = true;
|
||||||
|
|
||||||
sane.programs."gnome.geary".config.autostart = true;
|
sane.programs.geary.config.autostart = true;
|
||||||
sane.programs.signal-desktop.config.autostart = true;
|
sane.programs.signal-desktop.config.autostart = true;
|
||||||
|
|
||||||
sops.secrets.colin-passwd.neededForUsers = true;
|
sops.secrets.colin-passwd.neededForUsers = true;
|
||||||
|
|
||||||
|
sane.services.rsync-net.enable = true;
|
||||||
|
|
||||||
|
# TODO: enable snapper (need to make `/nix` or `/nix/persist` a subvolume, somehow).
|
||||||
# default config: https://man.archlinux.org/man/snapper-configs.5
|
# default config: https://man.archlinux.org/man/snapper-configs.5
|
||||||
# defaults to something like:
|
# defaults to something like:
|
||||||
# - hourly snapshots
|
# - hourly snapshots
|
||||||
# - auto cleanup; keep the last 10 hourlies, last 10 daylies, last 10 monthlys.
|
# - auto cleanup; keep the last 10 hourlies, last 10 daylies, last 10 monthlys.
|
||||||
services.snapper.configs.nix = {
|
# to list snapshots: `sudo snapper --config nix list`
|
||||||
# TODO: for the impermanent setup, we'd prefer to just do /nix/persist,
|
# to take a snapshot: `sudo snapper --config nix create`
|
||||||
# but that also requires setting up the persist dir as a subvol
|
# services.snapper.configs.nix = {
|
||||||
SUBVOLUME = "/nix";
|
# # TODO: for the impermanent setup, we'd prefer to just do /nix/persist,
|
||||||
ALLOW_USERS = [ "colin" ];
|
# # but that also requires setting up the persist dir as a subvol
|
||||||
};
|
# SUBVOLUME = "/nix";
|
||||||
|
# # TODO: ALLOW_USERS doesn't seem to work. still need `sudo snapper -c nix list`
|
||||||
|
# ALLOW_USERS = [ "colin" ];
|
||||||
|
# };
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,6 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./fs.nix
|
./fs.nix
|
||||||
./gps.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
sane.hal.pine64.enable = true;
|
sane.hal.pine64.enable = true;
|
||||||
@@ -24,11 +23,13 @@
|
|||||||
# XXX colin: phosh doesn't work well with passwordless login,
|
# XXX colin: phosh doesn't work well with passwordless login,
|
||||||
# so set this more reliable default password should anything go wrong
|
# so set this more reliable default password should anything go wrong
|
||||||
users.users.colin.initialPassword = "147147";
|
users.users.colin.initialPassword = "147147";
|
||||||
# services.getty.autologinUser = "root"; # allows for emergency maintenance?
|
|
||||||
|
|
||||||
sops.secrets.colin-passwd.neededForUsers = true;
|
sops.secrets.colin-passwd.neededForUsers = true;
|
||||||
|
|
||||||
|
sane.services.rsync-net.enable = true;
|
||||||
|
|
||||||
sane.programs.sway.enableFor.user.colin = true;
|
sane.programs.sway.enableFor.user.colin = true;
|
||||||
|
sane.programs.sway.config.mod = "Mod1"; #< alt key instead of Super
|
||||||
sane.programs.blueberry.enableFor.user.colin = false; # bluetooth manager: doesn't cross compile!
|
sane.programs.blueberry.enableFor.user.colin = false; # bluetooth manager: doesn't cross compile!
|
||||||
sane.programs.fcitx5.enableFor.user.colin = false; # does not cross compile
|
sane.programs.fcitx5.enableFor.user.colin = false; # does not cross compile
|
||||||
sane.programs.mercurial.enableFor.user.colin = false; # does not cross compile
|
sane.programs.mercurial.enableFor.user.colin = false; # does not cross compile
|
||||||
@@ -36,12 +37,12 @@
|
|||||||
|
|
||||||
# enabled for easier debugging
|
# enabled for easier debugging
|
||||||
sane.programs.eg25-control.enableFor.user.colin = true;
|
sane.programs.eg25-control.enableFor.user.colin = true;
|
||||||
sane.programs.rtl8723cs-wowlan.enableFor.user.colin = true;
|
# sane.programs.rtl8723cs-wowlan.enableFor.user.colin = true;
|
||||||
|
|
||||||
# sane.programs.ntfy-sh.config.autostart = true;
|
# sane.programs.ntfy-sh.config.autostart = true;
|
||||||
sane.programs.dino.config.autostart = true;
|
sane.programs.dino.config.autostart = true;
|
||||||
# sane.programs.signal-desktop.config.autostart = true; # TODO: enable once electron stops derping.
|
sane.programs.signal-desktop.config.autostart = true;
|
||||||
# sane.programs."gnome.geary".config.autostart = true;
|
# sane.programs.geary.config.autostart = true;
|
||||||
# sane.programs.calls.config.autostart = true;
|
# sane.programs.calls.config.autostart = true;
|
||||||
|
|
||||||
sane.programs.pipewire.config = {
|
sane.programs.pipewire.config = {
|
||||||
|
@@ -1,68 +0,0 @@
|
|||||||
# pinephone GPS happens in EG25 modem
|
|
||||||
# serial control interface to modem is /dev/ttyUSB2
|
|
||||||
# after enabling GPS, readout is /dev/ttyUSB1
|
|
||||||
#
|
|
||||||
# minimal process to enable modem and GPS:
|
|
||||||
# - `echo 1 > /sys/class/modem-power/modem-power/device/powered`
|
|
||||||
# - `screen /dev/ttyUSB2 115200`
|
|
||||||
# - `AT+QGPSCFG="nmeasrc",1`
|
|
||||||
# - `AT+QGPS=1`
|
|
||||||
# this process is automated by my `eg25-control` program and services (`eg25-control-powered`, `eg25-control-gps`)
|
|
||||||
# - see the `modules/` directory further up this repository.
|
|
||||||
#
|
|
||||||
# now, something like `gpsd` can directly read from /dev/ttyUSB1,
|
|
||||||
# or geoclue can query the GPS directly through modem-manager
|
|
||||||
#
|
|
||||||
# initial GPS fix can take 15+ minutes.
|
|
||||||
# meanwhile, services like eg25-manager or eg25-control-freshen-agps can speed this up by uploading assisted GPS data to the modem.
|
|
||||||
#
|
|
||||||
# support/help:
|
|
||||||
# - geoclue, gnome-maps
|
|
||||||
# - irc: #gnome-maps on irc.gimp.org
|
|
||||||
# - Matrix: #gnome-maps:gnome.org (unclear if bridged to IRC)
|
|
||||||
#
|
|
||||||
# programs to pair this with:
|
|
||||||
# - `satellite-gtk`: <https://codeberg.org/tpikonen/satellite>
|
|
||||||
# - shows/tracks which satellites the GPS is connected to; useful to understand fix characteristics
|
|
||||||
# - `gnome-maps`: uses geoclue, has route planning
|
|
||||||
# - `mepo`: uses gpsd, minimalist, flaky, and buttons are kinda hard to activate on mobile
|
|
||||||
# - puremaps?
|
|
||||||
# - osmin?
|
|
||||||
#
|
|
||||||
# known/outstanding bugs:
|
|
||||||
# - `systemctl start eg25-control-gps` can the hang the whole system (2023/10/06)
|
|
||||||
# - i think it's actually `eg25-control-powered` which does this (started by the gps)
|
|
||||||
# - best guess is modem draws so much power at launch that other parts of the system see undervoltage
|
|
||||||
# - workaround is to hard power-cycle the system. the modem may not bring up after reboot: leave unpowered for 60s and boot again.
|
|
||||||
#
|
|
||||||
# future work:
|
|
||||||
# - integrate with [wigle](https://www.wigle.net/) for offline equivalent to Mozilla Location Services
|
|
||||||
|
|
||||||
{ config, lib, ... }:
|
|
||||||
{
|
|
||||||
# test gpsd with `gpspipe -w -n 10 2> /dev/null | grep -m 1 TPV | jq '.lat, .lon' | tr '\n' ' '`
|
|
||||||
# ^ should return <lat> <long>
|
|
||||||
services.gpsd.enable = true;
|
|
||||||
services.gpsd.devices = [ "/dev/ttyUSB1" ];
|
|
||||||
|
|
||||||
# test geoclue2 by building `geoclue2-with-demo-agent`
|
|
||||||
# and running "${geoclue2-with-demo-agent}/libexec/geoclue-2.0/demos/where-am-i"
|
|
||||||
# note that geoclue is dbus-activated, and auto-stops after 60s with no caller
|
|
||||||
services.geoclue2.enable = true;
|
|
||||||
services.geoclue2.appConfig.where-am-i = {
|
|
||||||
# this is the default "agent", shipped by geoclue package: allow it to use location
|
|
||||||
isAllowed = true;
|
|
||||||
isSystem = false;
|
|
||||||
# XXX: setting users != [] might be causing `where-am-i` to time out
|
|
||||||
users = [
|
|
||||||
# restrict to only one set of users. empty array (default) means "allow any user to access geolocation".
|
|
||||||
(builtins.toString config.users.users.colin.uid)
|
|
||||||
];
|
|
||||||
};
|
|
||||||
systemd.services.geoclue.after = lib.mkForce []; #< defaults to network-online, but not all my sources require network
|
|
||||||
users.users.geoclue.extraGroups = [
|
|
||||||
"dialout" # TODO: figure out if dialout is required. that's for /dev/ttyUSB1, but geoclue probably doesn't read that?
|
|
||||||
];
|
|
||||||
|
|
||||||
sane.programs.where-am-i.enableFor.user.colin = true;
|
|
||||||
}
|
|
@@ -7,22 +7,21 @@
|
|||||||
./services
|
./services
|
||||||
];
|
];
|
||||||
|
|
||||||
sane.programs = {
|
# for administering services
|
||||||
# for administering services
|
sane.programs.clightning-sane.enableFor.user.colin = true;
|
||||||
freshrss.enableFor.user.colin = true;
|
# sane.programs.freshrss.enableFor.user.colin = true;
|
||||||
matrix-synapse.enableFor.user.colin = true;
|
# sane.programs.signaldctl.enableFor.user.colin = true;
|
||||||
signaldctl.enableFor.user.colin = true;
|
# sane.programs.matrix-synapse.enableFor.user.colin = true;
|
||||||
};
|
|
||||||
|
|
||||||
sane.roles.build-machine.enable = true;
|
sane.roles.build-machine.enable = true;
|
||||||
sane.programs.zsh.config.showDeadlines = false; # ~/knowledge doesn't always exist
|
sane.programs.sane-deadlines.config.showOnLogin = false; # ~/knowledge doesn't always exist
|
||||||
sane.programs.consoleUtils.suggestedPrograms = [
|
sane.programs.consoleUtils.suggestedPrograms = [
|
||||||
"consoleMediaUtils" # notably, for go2tv / casting
|
"consoleMediaUtils" # notably, for go2tv / casting
|
||||||
"pcConsoleUtils"
|
"pcConsoleUtils"
|
||||||
"sane-scripts.stop-all-servo"
|
"sane-scripts.stop-all-servo"
|
||||||
];
|
];
|
||||||
sane.services.dyn-dns.enable = true;
|
sane.services.dyn-dns.enable = true;
|
||||||
sane.services.trust-dns.asSystemResolver = false; # TODO: enable once it's all working well
|
sane.services.hickory-dns.asSystemResolver = false; # TODO: enable once it's all working well
|
||||||
sane.services.wg-home.enable = true;
|
sane.services.wg-home.enable = true;
|
||||||
sane.services.wg-home.visibleToWan = true;
|
sane.services.wg-home.visibleToWan = true;
|
||||||
sane.services.wg-home.forwardToWan = true;
|
sane.services.wg-home.forwardToWan = true;
|
||||||
@@ -32,11 +31,12 @@
|
|||||||
# sane.ovpn.addrV6 = "fd00:0000:1337:cafe:1111:1111:8df3:14b0";
|
# sane.ovpn.addrV6 = "fd00:0000:1337:cafe:1111:1111:8df3:14b0";
|
||||||
sane.nixcache.remote-builders.desko = false;
|
sane.nixcache.remote-builders.desko = false;
|
||||||
sane.nixcache.remote-builders.servo = false;
|
sane.nixcache.remote-builders.servo = false;
|
||||||
# sane.services.duplicity.enable = true; # TODO: re-enable after HW upgrade
|
sane.services.rsync-net.enable = true;
|
||||||
|
|
||||||
# automatically log in at the virtual consoles.
|
# automatically log in at the virtual consoles.
|
||||||
# using root here makes sure we always have an escape hatch
|
# using root here makes sure we always have an escape hatch.
|
||||||
services.getty.autologinUser = "root";
|
# XXX(2024-07-27): this is incompatible with my s6-rc stuff, which needs to auto-login as `colin` to start its user services.
|
||||||
|
# services.getty.autologinUser = "root";
|
||||||
|
|
||||||
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
|
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
|
||||||
|
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
# show zfs datasets: `zfs list` (will be empty if haven't imported)
|
# show zfs datasets: `zfs list` (will be empty if haven't imported)
|
||||||
# show zfs properties (e.g. compression): `zfs get all pool`
|
# show zfs properties (e.g. compression): `zfs get all pool`
|
||||||
# set zfs properties: `zfs set compression=on pool`
|
# set zfs properties: `zfs set compression=on pool`
|
||||||
{ ... }:
|
{ lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
# hostId: not used for anything except zfs guardrail?
|
# hostId: not used for anything except zfs guardrail?
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
options = [ "acl" ]; #< not sure if this `acl` flag is actually necessary. it mounts without it.
|
options = [ "acl" ]; #< not sure if this `acl` flag is actually necessary. it mounts without it.
|
||||||
};
|
};
|
||||||
# services.zfs.zed = ... # TODO: zfs can send me emails when disks fail
|
# services.zfs.zed = ... # TODO: zfs can send me emails when disks fail
|
||||||
sane.programs.sysadminUtils.suggestedPrograms = [ "zfs" ];
|
sane.programs.sysadminUtils.suggestedPrograms = [ "zfs-tools" ];
|
||||||
|
|
||||||
sane.persist.stores."ext" = {
|
sane.persist.stores."ext" = {
|
||||||
origin = "/mnt/pool/persist";
|
origin = "/mnt/pool/persist";
|
||||||
@@ -131,6 +131,20 @@
|
|||||||
the contents should be a subset of what's in ../media/datasets.
|
the contents should be a subset of what's in ../media/datasets.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
systemd.services.dedupe-media = {
|
||||||
|
description = "transparently de-duplicate /var/media entries by using block-level hardlinks";
|
||||||
|
script = ''
|
||||||
|
${lib.getExe' pkgs.util-linux "hardlink"} /var/media --reflink=always --ignore-time --verbose
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
systemd.timers.dedupe-media = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
timerConfig = {
|
||||||
|
OnStartupSec = "23min";
|
||||||
|
OnUnitActiveSec = "720min";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# btrfs doesn't easily support swapfiles
|
# btrfs doesn't easily support swapfiles
|
||||||
# swapDevices = [
|
# swapDevices = [
|
||||||
# { device = "/nix/persist/swapfile"; size = 4096; }
|
# { device = "/nix/persist/swapfile"; size = 4096; }
|
||||||
|
@@ -30,6 +30,14 @@ in
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
networking.domain = "uninsane.org";
|
networking.domain = "uninsane.org";
|
||||||
|
systemd.network.networks."50-eth0" = {
|
||||||
|
matchConfig.Name = "eth0";
|
||||||
|
networkConfig.Address = [
|
||||||
|
"205.201.63.12/32"
|
||||||
|
"10.78.79.51/22"
|
||||||
|
];
|
||||||
|
networkConfig.DNS = [ "10.78.79.1" ];
|
||||||
|
};
|
||||||
|
|
||||||
sane.ports.openFirewall = true;
|
sane.ports.openFirewall = true;
|
||||||
sane.ports.openUpnp = true;
|
sane.ports.openUpnp = true;
|
||||||
|
@@ -1,34 +0,0 @@
|
|||||||
{ config, lib, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
cweb-cfg = config.services.calibre-web;
|
|
||||||
inherit (cweb-cfg) user group;
|
|
||||||
inherit (cweb-cfg.listen) ip port;
|
|
||||||
svc-dir = "/var/lib/${cweb-cfg.dataDir}";
|
|
||||||
in
|
|
||||||
# XXX: disabled because of runtime errors like:
|
|
||||||
# > File "/nix/store/c7jqvx980nlg9xhxi065cba61r2ain9y-calibre-web-0.6.19/lib/python3.10/site-packages/calibreweb/cps/db.py", line 926, in speaking_language
|
|
||||||
# > languages = self.session.query(Languages) \
|
|
||||||
# > AttributeError: 'NoneType' object has no attribute 'query'
|
|
||||||
lib.mkIf false
|
|
||||||
{
|
|
||||||
sane.persist.sys.byStore.plaintext = [
|
|
||||||
{ inherit user group; mode = "0700"; path = svc-dir; method = "bind"; }
|
|
||||||
];
|
|
||||||
|
|
||||||
services.calibre-web.enable = true;
|
|
||||||
services.calibre-web.listen.ip = "127.0.0.1";
|
|
||||||
# XXX: externally populate `${svc-dir}/metadata.db` (once) from
|
|
||||||
# <https://github.com/janeczku/calibre-web/blob/master/library/metadata.db>
|
|
||||||
# i don't know why you have to do this??
|
|
||||||
# services.calibre-web.options.calibreLibrary = svc-dir;
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."calibre.uninsane.org" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://${ip}:${builtins.toString port}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
sane.dns.zones."uninsane.org".inet.CNAME."calibre" = "native";
|
|
||||||
}
|
|
@@ -36,7 +36,8 @@
|
|||||||
# - rb = received bytes
|
# - rb = received bytes
|
||||||
# - sp = sent packets
|
# - sp = sent packets
|
||||||
# - sb = sent bytes
|
# - sb = sent bytes
|
||||||
{ lib, ... }:
|
|
||||||
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
# TURN port range (inclusive).
|
# TURN port range (inclusive).
|
||||||
# default coturn behavior is to use the upper quarter of all ports. i.e. 49152 - 65535.
|
# default coturn behavior is to use the upper quarter of all ports. i.e. 49152 - 65535.
|
||||||
@@ -130,11 +131,11 @@ in
|
|||||||
"verbose"
|
"verbose"
|
||||||
# "Verbose" #< even MORE verbosity than "verbose" (it's TOO MUCH verbosity really)
|
# "Verbose" #< even MORE verbosity than "verbose" (it's TOO MUCH verbosity really)
|
||||||
"no-multicast-peers" # disables sending to IPv4 broadcast addresses (e.g. 224.0.0.0/3)
|
"no-multicast-peers" # disables sending to IPv4 broadcast addresses (e.g. 224.0.0.0/3)
|
||||||
# "listening-ip=10.0.1.5" "external-ip=185.157.162.178" #< 2024/04/25: works, if running in root namespace
|
# "listening-ip=${config.sane.netns.ovpns.hostVethIpv4}" "external-ip=${config.sane.netns.ovpns.netnsPubIpv4}" #< 2024/04/25: works, if running in root namespace
|
||||||
"listening-ip=185.157.162.178" "external-ip=185.157.162.178"
|
"listening-ip=${config.sane.netns.ovpns.netnsPubIpv4}" "external-ip=${config.sane.netns.ovpns.netnsPubIpv4}"
|
||||||
|
|
||||||
# old attempts:
|
# old attempts:
|
||||||
# "external-ip=185.157.162.178/10.0.1.5"
|
# "external-ip=${config.sane.netns.ovpns.netnsPubIpv4}/${config.sane.netns.ovpns.hostVethIpv4}"
|
||||||
# "listening-ip=10.78.79.51" # can be specified multiple times; omit for *
|
# "listening-ip=10.78.79.51" # can be specified multiple times; omit for *
|
||||||
# "external-ip=97.113.128.229/10.78.79.51"
|
# "external-ip=97.113.128.229/10.78.79.51"
|
||||||
# "external-ip=97.113.128.229"
|
# "external-ip=97.113.128.229"
|
||||||
|
@@ -16,14 +16,17 @@
|
|||||||
# - validate with `bitcoin-cli -netinfo`
|
# - validate with `bitcoin-cli -netinfo`
|
||||||
{ config, lib, pkgs, sane-lib, ... }:
|
{ config, lib, pkgs, sane-lib, ... }:
|
||||||
let
|
let
|
||||||
|
# bitcoind = config.sane.programs.bitcoind.packageUnwrapped;
|
||||||
|
bitcoind = pkgs.bitcoind;
|
||||||
# wrapper to run bitcoind with the tor onion address as externalip (computed at runtime)
|
# wrapper to run bitcoind with the tor onion address as externalip (computed at runtime)
|
||||||
_bitcoindWithExternalIp = with pkgs; writeShellScriptBin "bitcoind" ''
|
_bitcoindWithExternalIp = pkgs.writeShellScriptBin "bitcoind" ''
|
||||||
|
set -xeu
|
||||||
externalip="$(cat /var/lib/tor/onion/bitcoind/hostname)"
|
externalip="$(cat /var/lib/tor/onion/bitcoind/hostname)"
|
||||||
exec ${bitcoind}/bin/bitcoind "-externalip=$externalip" "$@"
|
exec ${bitcoind}/bin/bitcoind "-externalip=$externalip" "$@"
|
||||||
'';
|
'';
|
||||||
# the package i provide to services.bitcoind ends up on system PATH, and used by other tools like clightning.
|
# the package i provide to services.bitcoind ends up on system PATH, and used by other tools like clightning.
|
||||||
# therefore, even though services.bitcoind only needs `bitcoind` binary, provide all the other bitcoin-related binaries (notably `bitcoin-cli`) as well:
|
# therefore, even though services.bitcoind only needs `bitcoind` binary, provide all the other bitcoin-related binaries (notably `bitcoin-cli`) as well:
|
||||||
bitcoindWithExternalIp = with pkgs; symlinkJoin {
|
bitcoindWithExternalIp = pkgs.symlinkJoin {
|
||||||
name = "bitcoind-with-external-ip";
|
name = "bitcoind-with-external-ip";
|
||||||
paths = [ _bitcoindWithExternalIp bitcoind ];
|
paths = [ _bitcoindWithExternalIp bitcoind ];
|
||||||
};
|
};
|
||||||
@@ -61,23 +64,62 @@ in
|
|||||||
passwordHMAC = "30002c05d82daa210550e17a182db3f3$6071444151281e1aa8a2729f75e3e2d224e9d7cac3974810dab60e7c28ffaae4";
|
passwordHMAC = "30002c05d82daa210550e17a182db3f3$6071444151281e1aa8a2729f75e3e2d224e9d7cac3974810dab60e7c28ffaae4";
|
||||||
};
|
};
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
# checkblocks: default 6: how many blocks to verify on start
|
||||||
|
checkblocks=3
|
||||||
# don't load the wallet, and disable wallet RPC calls
|
# don't load the wallet, and disable wallet RPC calls
|
||||||
disablewallet=1
|
disablewallet=1
|
||||||
# proxy all outbound traffic through Tor
|
# proxy all outbound traffic through Tor
|
||||||
proxy=127.0.0.1:9050
|
proxy=127.0.0.1:9050
|
||||||
'';
|
'';
|
||||||
|
extraCmdlineOptions = [
|
||||||
|
# "-debug"
|
||||||
|
# "-debug=estimatefee"
|
||||||
|
# "-debug=http"
|
||||||
|
# "-debug=net"
|
||||||
|
"-debug=proxy"
|
||||||
|
"-debug=rpc"
|
||||||
|
# "-debug=validation"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.bitcoind-mainnet.extraGroups = [ "tor" ];
|
users.users.bitcoind-mainnet.extraGroups = [ "tor" ];
|
||||||
|
|
||||||
systemd.services.bitcoind-mainnet.serviceConfig.RestartSec = "30s"; #< default is 0
|
systemd.services.bitcoind-mainnet = {
|
||||||
|
after = [ "tor.service" ];
|
||||||
|
requires = [ "tor.service" ];
|
||||||
|
serviceConfig.RestartSec = "30s"; #< default is 0
|
||||||
|
|
||||||
|
# hardening (systemd-analyze security bitcoind-mainnet)
|
||||||
|
serviceConfig.StateDirectory = "bitcoind-mainnet";
|
||||||
|
serviceConfig.LockPersonality = true;
|
||||||
|
serviceConfig.MemoryDenyWriteExecute = "true";
|
||||||
|
serviceConfig.NoNewPrivileges = "true";
|
||||||
|
serviceConfig.PrivateDevices = "true";
|
||||||
|
serviceConfig.PrivateMounts = true;
|
||||||
|
serviceConfig.PrivateTmp = "true";
|
||||||
|
serviceConfig.PrivateUsers = true;
|
||||||
|
serviceConfig.ProcSubset = "pid";
|
||||||
|
serviceConfig.ProtectControlGroups = true;
|
||||||
|
serviceConfig.ProtectHome = true;
|
||||||
|
serviceConfig.ProtectHostname = true;
|
||||||
|
serviceConfig.ProtectKernelLogs = true;
|
||||||
|
serviceConfig.ProtectKernelModules = true;
|
||||||
|
serviceConfig.ProtectKernelTunables = true;
|
||||||
|
serviceConfig.ProtectProc = "invisible";
|
||||||
|
serviceConfig.ProtectSystem = lib.mkForce "strict";
|
||||||
|
serviceConfig.RemoveIPC = true;
|
||||||
|
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
|
||||||
|
serviceConfig.RestrictNamespaces = true;
|
||||||
|
serviceConfig.RestrictSUIDSGID = true;
|
||||||
|
serviceConfig.SystemCallArchitectures = "native";
|
||||||
|
serviceConfig.SystemCallFilter = [ "@system-service" ];
|
||||||
|
};
|
||||||
|
|
||||||
sane.users.colin.fs.".bitcoin/bitcoin.conf" = sane-lib.fs.wantedSymlinkTo config.sops.secrets."bitcoin.conf".path;
|
|
||||||
sops.secrets."bitcoin.conf" = {
|
sops.secrets."bitcoin.conf" = {
|
||||||
mode = "0600";
|
mode = "0600";
|
||||||
owner = "colin";
|
owner = "colin";
|
||||||
group = "users";
|
group = "users";
|
||||||
};
|
};
|
||||||
|
|
||||||
sane.programs.bitcoind.enableFor.user.colin = true; # for debugging/administration: `bitcoin-cli`
|
sane.programs.bitcoin-cli.enableFor.user.colin = true; # for debugging/administration: `bitcoin-cli`
|
||||||
}
|
}
|
||||||
|
@@ -72,13 +72,11 @@
|
|||||||
|
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
sane.persist.sys.byStore.ext = [
|
sane.persist.sys.byStore.private = [
|
||||||
|
# clightning takes up only a few MB. but then several hundred MB of crash logs that i should probably GC.
|
||||||
{ user = "clightning"; group = "clightning"; mode = "0710"; path = "/var/lib/clightning"; method = "bind"; }
|
{ user = "clightning"; group = "clightning"; mode = "0710"; path = "/var/lib/clightning"; method = "bind"; }
|
||||||
];
|
];
|
||||||
|
|
||||||
# `lightning-cli` finds its RPC file via `~/.lightning/bitcoin/lightning-rpc`, to message the daemon
|
|
||||||
sane.user.fs.".lightning".symlink.target = "/var/lib/clightning";
|
|
||||||
|
|
||||||
# see bitcoin.nix for how to generate this
|
# see bitcoin.nix for how to generate this
|
||||||
services.bitcoind.mainnet.rpc.users.clightning.passwordHMAC =
|
services.bitcoind.mainnet.rpc.users.clightning.passwordHMAC =
|
||||||
"befcb82d9821049164db5217beb85439$2c31ac7db3124612e43893ae13b9527dbe464ab2d992e814602e7cb07dc28985";
|
"befcb82d9821049164db5217beb85439$2c31ac7db3124612e43893ae13b9527dbe464ab2d992e814602e7cb07dc28985";
|
||||||
@@ -105,6 +103,7 @@
|
|||||||
users.users.clightning.extraGroups = [ "tor" ];
|
users.users.clightning.extraGroups = [ "tor" ];
|
||||||
|
|
||||||
systemd.services.clightning.after = [ "tor.service" ];
|
systemd.services.clightning.after = [ "tor.service" ];
|
||||||
|
systemd.services.clightning.requires = [ "tor.service" ];
|
||||||
|
|
||||||
# lightning-config contains fields from here:
|
# lightning-config contains fields from here:
|
||||||
# - <https://docs.corelightning.org/docs/configuration>
|
# - <https://docs.corelightning.org/docs/configuration>
|
||||||
@@ -116,11 +115,16 @@
|
|||||||
# - fee-per-satoshi=<ppm>
|
# - fee-per-satoshi=<ppm>
|
||||||
# - feature configs (i.e. experimental-xyz options)
|
# - feature configs (i.e. experimental-xyz options)
|
||||||
sane.services.clightning.extraConfig = ''
|
sane.services.clightning.extraConfig = ''
|
||||||
log-level=debug:lightningd
|
# log levels: "io", "debug", "info", "unusual", "broken"
|
||||||
|
log-level=info
|
||||||
|
# log-level=info:lightningd
|
||||||
|
# log-level=debug:lightningd
|
||||||
|
# log-level=debug
|
||||||
|
|
||||||
# peerswap:
|
# peerswap:
|
||||||
# - config example: <https://github.com/fort-nix/nix-bitcoin/pull/462/files#diff-b357d832705b8ce8df1f41934d613f79adb77c4cd5cd9e9eb12a163fca3e16c6>
|
# - config example: <https://github.com/fort-nix/nix-bitcoin/pull/462/files#diff-b357d832705b8ce8df1f41934d613f79adb77c4cd5cd9e9eb12a163fca3e16c6>
|
||||||
# XXX: peerswap crashes clightning on launch. stacktrace is useless.
|
# XXX: peerswap crashes clightning on launch. stacktrace is useless.
|
||||||
# plugin=${pkgs.peerswap}/bin/peerswap
|
# plugin={pkgs.peerswap}/bin/peerswap
|
||||||
# peerswap-db-path=/var/lib/clightning/peerswap/swaps
|
# peerswap-db-path=/var/lib/clightning/peerswap/swaps
|
||||||
# peerswap-policy-path=...
|
# peerswap-policy-path=...
|
||||||
'';
|
'';
|
||||||
@@ -131,5 +135,5 @@
|
|||||||
group = "clightning";
|
group = "clightning";
|
||||||
};
|
};
|
||||||
|
|
||||||
sane.programs.clightning.enableFor.user.colin = true; # for debugging/admin: `lightning-cli`
|
sane.programs.lightning-cli.enableFor.user.colin = true; # for debugging/admin:
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
{ ... }:
|
{ lib, ... }:
|
||||||
|
lib.mkIf false #< 2024/07/27: i don't use it, too much surface-area for me to run it pro-bono (`systemd-analyze security monero`)
|
||||||
{
|
{
|
||||||
services.i2p.enable = true;
|
services.i2p.enable = true;
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
# as of 2023/11/26: complete downloaded blockchain should be 200GiB on disk, give or take.
|
# as of 2023/11/26: complete downloaded blockchain should be 200GiB on disk, give or take.
|
||||||
{ ... }:
|
{ lib, ... }:
|
||||||
|
lib.mkIf false #< 2024/07/27: i don't use it, too much surface-area for me to run it pro-bono (`systemd-analyze security monero`)
|
||||||
{
|
{
|
||||||
sane.persist.sys.byStore.ext = [
|
sane.persist.sys.byStore.ext = [
|
||||||
# /var/lib/monero/lmdb is what consumes most of the space
|
# /var/lib/monero/lmdb is what consumes most of the space
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
# tor settings: <https://2019.www.torproject.org/docs/tor-manual.html.en>
|
# tor settings: <https://2019.www.torproject.org/docs/tor-manual.html.en>
|
||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
# tor hidden service hostnames aren't deterministic, so persist.
|
sane.persist.sys.byStore.ephemeral = [
|
||||||
# might be able to get away with just persisting /var/lib/tor/onion, not sure.
|
# N.B.: tor hidden service hostnames aren't deterministic, so if you need them
|
||||||
sane.persist.sys.byStore.plaintext = [
|
# to be preserved across reboots then persist /var/lib/tor/onion in "private" store.
|
||||||
{ user = "tor"; group = "tor"; mode = "0710"; path = "/var/lib/tor"; method = "bind"; }
|
{ user = "tor"; group = "tor"; mode = "0710"; path = "/var/lib/tor"; method = "bind"; }
|
||||||
];
|
];
|
||||||
|
|
||||||
# tor: `tor.enable` doesn't start a relay, exit node, proxy, etc. it's minimal.
|
# tor: `tor.enable` doesn't start a relay, exit node, proxy, etc. it's minimal.
|
||||||
|
@@ -1,17 +1,17 @@
|
|||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./calibre.nix
|
|
||||||
./coturn.nix
|
./coturn.nix
|
||||||
./cryptocurrencies
|
./cryptocurrencies
|
||||||
./email
|
./email
|
||||||
./ejabberd.nix
|
./ejabberd.nix
|
||||||
./freshrss.nix
|
./freshrss.nix
|
||||||
./export
|
./export
|
||||||
|
./hickory-dns.nix
|
||||||
./gitea.nix
|
./gitea.nix
|
||||||
./goaccess.nix
|
./goaccess.nix
|
||||||
./ipfs.nix
|
./ipfs.nix
|
||||||
./jackett.nix
|
./jackett
|
||||||
./jellyfin.nix
|
./jellyfin.nix
|
||||||
./kiwix-serve.nix
|
./kiwix-serve.nix
|
||||||
./komga.nix
|
./komga.nix
|
||||||
@@ -21,13 +21,13 @@
|
|||||||
./nginx.nix
|
./nginx.nix
|
||||||
./nixos-prebuild.nix
|
./nixos-prebuild.nix
|
||||||
./ntfy
|
./ntfy
|
||||||
|
./ollama.nix
|
||||||
./pict-rs.nix
|
./pict-rs.nix
|
||||||
./pleroma.nix
|
./pleroma.nix
|
||||||
./postgres.nix
|
./postgres.nix
|
||||||
./prosody
|
./prosody
|
||||||
./slskd.nix
|
./slskd.nix
|
||||||
./transmission.nix
|
./transmission
|
||||||
./trust-dns.nix
|
|
||||||
./wikipedia.nix
|
./wikipedia.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -44,61 +44,61 @@ in
|
|||||||
# everything configured below was fine: used ejabberd for several months.
|
# everything configured below was fine: used ejabberd for several months.
|
||||||
lib.mkIf false
|
lib.mkIf false
|
||||||
{
|
{
|
||||||
sane.persist.sys.byStore.plaintext = [
|
sane.persist.sys.byStore.private = [
|
||||||
{ user = "ejabberd"; group = "ejabberd"; path = "/var/lib/ejabberd"; method = "bind"; }
|
{ user = "ejabberd"; group = "ejabberd"; path = "/var/lib/ejabberd"; method = "bind"; }
|
||||||
];
|
];
|
||||||
sane.ports.ports = lib.mkMerge ([
|
sane.ports.ports = lib.mkMerge ([
|
||||||
{
|
{
|
||||||
"3478" = {
|
"3478" = {
|
||||||
protocol = [ "tcp" "udp" ];
|
protocol = [ "tcp" "udp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-xmpp-stun-turn";
|
description = "colin-xmpp-stun-turn";
|
||||||
};
|
};
|
||||||
"5222" = {
|
"5222" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-xmpp-client-to-server";
|
description = "colin-xmpp-client-to-server";
|
||||||
};
|
};
|
||||||
"5223" = {
|
"5223" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-xmpps-client-to-server"; # XMPP over TLS
|
description = "colin-xmpps-client-to-server"; # XMPP over TLS
|
||||||
};
|
};
|
||||||
"5269" = {
|
"5269" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
visibleTo.wan = true;
|
visibleTo.doof = true;
|
||||||
description = "colin-xmpp-server-to-server";
|
description = "colin-xmpp-server-to-server";
|
||||||
};
|
};
|
||||||
"5270" = {
|
"5270" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
visibleTo.wan = true;
|
visibleTo.doof = true;
|
||||||
description = "colin-xmpps-server-to-server"; # XMPP over TLS
|
description = "colin-xmpps-server-to-server"; # XMPP over TLS
|
||||||
};
|
};
|
||||||
"5280" = {
|
"5280" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-xmpp-bosh";
|
description = "colin-xmpp-bosh";
|
||||||
};
|
};
|
||||||
"5281" = {
|
"5281" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-xmpp-bosh-https";
|
description = "colin-xmpp-bosh-https";
|
||||||
};
|
};
|
||||||
"5349" = {
|
"5349" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-xmpp-stun-turn-over-tls";
|
description = "colin-xmpp-stun-turn-over-tls";
|
||||||
};
|
};
|
||||||
"5443" = {
|
"5443" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-xmpp-web-services"; # file uploads, websockets, admin
|
description = "colin-xmpp-web-services"; # file uploads, websockets, admin
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -109,8 +109,8 @@ lib.mkIf false
|
|||||||
numPorts = turnPortHigh - turnPortLow + 1;
|
numPorts = turnPortHigh - turnPortLow + 1;
|
||||||
in {
|
in {
|
||||||
protocol = [ "tcp" "udp" ];
|
protocol = [ "tcp" "udp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-xmpp-turn-${builtins.toString count}-of-${builtins.toString numPorts}";
|
description = "colin-xmpp-turn-${builtins.toString count}-of-${builtins.toString numPorts}";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
@@ -8,14 +8,14 @@
|
|||||||
{
|
{
|
||||||
sane.ports.ports."143" = {
|
sane.ports.ports."143" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-imap-imap.uninsane.org";
|
description = "colin-imap-imap.uninsane.org";
|
||||||
};
|
};
|
||||||
sane.ports.ports."993" = {
|
sane.ports.ports."993" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-imaps-imap.uninsane.org";
|
description = "colin-imaps-imap.uninsane.org";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -83,8 +83,8 @@
|
|||||||
# sieve_plugins = sieve_imapsieve
|
# sieve_plugins = sieve_imapsieve
|
||||||
# }
|
# }
|
||||||
|
|
||||||
mail_debug = yes
|
# mail_debug = yes
|
||||||
auth_debug = yes
|
# auth_debug = yes
|
||||||
# verbose_ssl = yes
|
# verbose_ssl = yes
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@@ -1,6 +1,13 @@
|
|||||||
# postfix config options: <https://www.postfix.org/postconf.5.html>
|
# postfix config options: <https://www.postfix.org/postconf.5.html>
|
||||||
|
# config files:
|
||||||
|
# - /etc/postfix/main.cf
|
||||||
|
# - /etc/postfix/master.cf
|
||||||
|
#
|
||||||
|
# logs:
|
||||||
|
# - postfix logs directly to *syslog*,
|
||||||
|
# so check e.g. ~/.local/share/rsyslog
|
||||||
|
|
||||||
{ lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
submissionOptions = {
|
submissionOptions = {
|
||||||
@@ -18,14 +25,14 @@ let
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
sane.persist.sys.byStore.plaintext = [
|
sane.persist.sys.byStore.private = [
|
||||||
# TODO: mode? could be more granular
|
# TODO: mode? could be more granular
|
||||||
{ user = "opendkim"; group = "opendkim"; path = "/var/lib/opendkim"; method = "bind"; }
|
{ user = "opendkim"; group = "opendkim"; path = "/var/lib/opendkim"; method = "bind"; } #< TODO: migrate to secrets
|
||||||
{ user = "root"; group = "root"; path = "/var/lib/postfix"; method = "bind"; }
|
|
||||||
{ user = "root"; group = "root"; path = "/var/spool/mail"; method = "bind"; }
|
{ user = "root"; group = "root"; path = "/var/spool/mail"; method = "bind"; }
|
||||||
# *probably* don't need these dirs:
|
# *probably* don't need these dirs:
|
||||||
# "/var/lib/dhparams" # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/security/dhparams.nix
|
# "/var/lib/dhparams" # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/security/dhparams.nix
|
||||||
# "/var/lib/dovecot"
|
# "/var/lib/dovecot"
|
||||||
|
# "/var/lib/postfix"
|
||||||
];
|
];
|
||||||
|
|
||||||
# XXX(2023/10/20): opening these ports in the firewall has the OPPOSITE effect as intended.
|
# XXX(2023/10/20): opening these ports in the firewall has the OPPOSITE effect as intended.
|
||||||
@@ -56,8 +63,7 @@ in
|
|||||||
|
|
||||||
sane.dns.zones."uninsane.org".inet = {
|
sane.dns.zones."uninsane.org".inet = {
|
||||||
MX."@" = "10 mx.uninsane.org.";
|
MX."@" = "10 mx.uninsane.org.";
|
||||||
# XXX: RFC's specify that the MX record CANNOT BE A CNAME
|
A."mx" = "%AOVPNS%"; #< XXX: RFC's specify that the MX record CANNOT BE A CNAME. TODO: use "%AOVPNS%?
|
||||||
A."mx" = "185.157.162.178";
|
|
||||||
|
|
||||||
# Sender Policy Framework:
|
# Sender Policy Framework:
|
||||||
# +mx => mail passes if it originated from the MX
|
# +mx => mail passes if it originated from the MX
|
||||||
@@ -96,6 +102,7 @@ in
|
|||||||
services.postfix.sslCert = "/var/lib/acme/mx.uninsane.org/fullchain.pem";
|
services.postfix.sslCert = "/var/lib/acme/mx.uninsane.org/fullchain.pem";
|
||||||
services.postfix.sslKey = "/var/lib/acme/mx.uninsane.org/key.pem";
|
services.postfix.sslKey = "/var/lib/acme/mx.uninsane.org/key.pem";
|
||||||
|
|
||||||
|
# see: `man 5 virtual`
|
||||||
services.postfix.virtual = ''
|
services.postfix.virtual = ''
|
||||||
notify.matrix@uninsane.org matrix-synapse
|
notify.matrix@uninsane.org matrix-synapse
|
||||||
@uninsane.org colin
|
@uninsane.org colin
|
||||||
@@ -136,6 +143,20 @@ in
|
|||||||
# smtpd_sender_restrictions = reject_unknown_sender_domain
|
# smtpd_sender_restrictions = reject_unknown_sender_domain
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# debugging options:
|
||||||
|
# services.postfix.masterConfig = {
|
||||||
|
# "proxymap".args = [ "-v" ];
|
||||||
|
# "proxywrite".args = [ "-v" ];
|
||||||
|
# "relay".args = [ "-v" ];
|
||||||
|
# "smtp".args = [ "-v" ];
|
||||||
|
# "smtp_inet".args = [ "-v" ];
|
||||||
|
# "submission".args = [ "-v" ];
|
||||||
|
# "submissions".args = [ "-v" ];
|
||||||
|
# "submissions".chroot = false;
|
||||||
|
# "submissions".private = false;
|
||||||
|
# "submissions".privileged = true;
|
||||||
|
# };
|
||||||
|
|
||||||
services.postfix.enableSubmission = true;
|
services.postfix.enableSubmission = true;
|
||||||
services.postfix.submissionOptions = submissionOptions;
|
services.postfix.submissionOptions = submissionOptions;
|
||||||
services.postfix.enableSubmissions = true;
|
services.postfix.enableSubmissions = true;
|
||||||
@@ -143,6 +164,10 @@ in
|
|||||||
|
|
||||||
systemd.services.postfix.after = [ "wireguard-wg-ovpns.service" ];
|
systemd.services.postfix.after = [ "wireguard-wg-ovpns.service" ];
|
||||||
systemd.services.postfix.partOf = [ "wireguard-wg-ovpns.service" ];
|
systemd.services.postfix.partOf = [ "wireguard-wg-ovpns.service" ];
|
||||||
|
systemd.services.postfix.unitConfig.RequiresMountsFor = [
|
||||||
|
"/var/spool/mail" # spooky errors when postfix is run w/o this: `warning: connect #1 to subsystem private/proxymap: Connection refused`
|
||||||
|
"/var/lib/opendkim"
|
||||||
|
];
|
||||||
systemd.services.postfix.serviceConfig = {
|
systemd.services.postfix.serviceConfig = {
|
||||||
# run this behind the OVPN static VPN
|
# run this behind the OVPN static VPN
|
||||||
NetworkNamespacePath = "/run/netns/ovpns";
|
NetworkNamespacePath = "/run/netns/ovpns";
|
||||||
@@ -176,23 +201,30 @@ in
|
|||||||
|
|
||||||
|
|
||||||
#### OUTGOING MESSAGE REWRITING:
|
#### OUTGOING MESSAGE REWRITING:
|
||||||
services.postfix.enableHeaderChecks = true;
|
# - `man 5 header_checks`
|
||||||
services.postfix.headerChecks = [
|
# - <https://www.postfix.org/header_checks.5.html>
|
||||||
# intercept gitea registration confirmations and manually screen them
|
# - populates `/var/lib/postfix/conf/header_checks`
|
||||||
{
|
# XXX(2024-08-06): registration gating via email matches is AWFUL:
|
||||||
# headerChecks are somehow ignorant of alias rules: have to redirect to a real user
|
# 1. bypassed if the service offers localization.
|
||||||
action = "REDIRECT colin@uninsane.org";
|
# 2. if i try to forward the registration request, it may match the filter again and get sent back to my inbox.
|
||||||
pattern = "/^Subject: Please activate your account/";
|
# 3. header checks are possibly under-used in the ecosystem, and may break postfix config.
|
||||||
}
|
# services.postfix.enableHeaderChecks = true;
|
||||||
# intercept Matrix registration confirmations
|
# services.postfix.headerChecks = [
|
||||||
{
|
# # intercept gitea registration confirmations and manually screen them
|
||||||
action = "REDIRECT colin@uninsane.org";
|
# {
|
||||||
pattern = "/^Subject:.*Validate your email/";
|
# # headerChecks are somehow ignorant of alias rules: have to redirect to a real user
|
||||||
}
|
# action = "REDIRECT colin@uninsane.org";
|
||||||
# XXX postfix only supports performing ONE action per header.
|
# pattern = "/^Subject: Please activate your account/";
|
||||||
# {
|
# }
|
||||||
# action = "REPLACE Subject: git application: Please activate your account";
|
# # intercept Matrix registration confirmations
|
||||||
# pattern = "/^Subject:.*activate your account/";
|
# {
|
||||||
# }
|
# action = "REDIRECT colin@uninsane.org";
|
||||||
];
|
# pattern = "/^Subject:.*Validate your email/";
|
||||||
|
# }
|
||||||
|
# # XXX postfix only supports performing ONE action per header.
|
||||||
|
# # {
|
||||||
|
# # action = "REPLACE Subject: git application: Please activate your account";
|
||||||
|
# # pattern = "/^Subject:.*activate your account/";
|
||||||
|
# # }
|
||||||
|
# ];
|
||||||
}
|
}
|
||||||
|
@@ -37,7 +37,8 @@
|
|||||||
wantedBy = [ "nfs.service" "sftpgo.service" ];
|
wantedBy = [ "nfs.service" "sftpgo.service" ];
|
||||||
file.text = ''
|
file.text = ''
|
||||||
- media/ read-only: Videos, Music, Books, etc
|
- media/ read-only: Videos, Music, Books, etc
|
||||||
- playground/ read-write: use it to share files with other users of this server
|
- playground/ read-write: use it to share files with other users of this server, inaccessible from the www
|
||||||
|
- pub/ read-only: content made to be shared with the www
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -50,4 +51,11 @@
|
|||||||
- be a friendly troll
|
- be a friendly troll
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sane.fs."/var/export/.public_for_test/test" = {
|
||||||
|
wantedBy = [ "nfs.service" "sftpgo.service" ];
|
||||||
|
file.text = ''
|
||||||
|
automated tests read this file to probe connectivity
|
||||||
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
{ config, lib, pkgs, sane-lib, ... }:
|
{ config, lib, pkgs, sane-lib, ... }:
|
||||||
let
|
let
|
||||||
external_auth_hook = pkgs.static-nix-shell.mkPython3Bin {
|
external_auth_hook = pkgs.static-nix-shell.mkPython3 {
|
||||||
pname = "external_auth_hook";
|
pname = "external_auth_hook";
|
||||||
srcRoot = ./.;
|
srcRoot = ./.;
|
||||||
pyPkgs = [ "passlib" ];
|
pkgs = [ "python3.pkgs.passlib" ];
|
||||||
};
|
};
|
||||||
# Client initiates a FTP "control connection" on port 21.
|
# Client initiates a FTP "control connection" on port 21.
|
||||||
# - this handles the client -> server commands, and the server -> client status, but not the actual data
|
# - this handles the client -> server commands, and the server -> client status, but not the actual data
|
||||||
@@ -27,13 +27,12 @@ in
|
|||||||
"21" = {
|
"21" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
# visibleTo.wan = true;
|
|
||||||
description = "colin-FTP server";
|
description = "colin-FTP server";
|
||||||
};
|
};
|
||||||
"990" = {
|
"990" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-FTPS server";
|
description = "colin-FTPS server";
|
||||||
};
|
};
|
||||||
} // (sane-lib.mapToAttrs
|
} // (sane-lib.mapToAttrs
|
||||||
@@ -41,8 +40,8 @@ in
|
|||||||
name = builtins.toString port;
|
name = builtins.toString port;
|
||||||
value = {
|
value = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-FTP server data port range";
|
description = "colin-FTP server data port range";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
@@ -81,12 +80,6 @@ in
|
|||||||
port = 21;
|
port = 21;
|
||||||
debug = true;
|
debug = true;
|
||||||
}
|
}
|
||||||
{
|
|
||||||
# binding this means any LAN client can connect (also WAN traffic forwarded from the gateway)
|
|
||||||
address = "10.78.79.51";
|
|
||||||
port = 21;
|
|
||||||
debug = true;
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
# binding this means any wireguard client can connect
|
# binding this means any wireguard client can connect
|
||||||
address = "10.0.10.5";
|
address = "10.0.10.5";
|
||||||
@@ -97,6 +90,26 @@ in
|
|||||||
{
|
{
|
||||||
# binding this means any LAN client can connect (also WAN traffic forwarded from the gateway)
|
# binding this means any LAN client can connect (also WAN traffic forwarded from the gateway)
|
||||||
address = "10.78.79.51";
|
address = "10.78.79.51";
|
||||||
|
port = 21;
|
||||||
|
debug = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# binding this means any LAN client can connect (also WAN traffic forwarded from the gateway)
|
||||||
|
address = "10.78.79.51";
|
||||||
|
port = 990;
|
||||||
|
debug = true;
|
||||||
|
tls_mode = 2; # 2 = "implicit FTPS": client negotiates TLS before any FTP command.
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# binding this means any doof client can connect (TLS only)
|
||||||
|
address = config.sane.netns.doof.hostVethIpv4;
|
||||||
|
port = 990;
|
||||||
|
debug = true;
|
||||||
|
tls_mode = 2; # 2 = "implicit FTPS": client negotiates TLS before any FTP command.
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# binding this means any LAN client can connect via `ftp.uninsane.org` (TLS only)
|
||||||
|
address = config.sane.netns.doof.netnsPubIpv4;
|
||||||
port = 990;
|
port = 990;
|
||||||
debug = true;
|
debug = true;
|
||||||
tls_mode = 2; # 2 = "implicit FTPS": client negotiates TLS before any FTP command.
|
tls_mode = 2; # 2 = "implicit FTPS": client negotiates TLS before any FTP command.
|
||||||
@@ -117,7 +130,7 @@ in
|
|||||||
banner = ''
|
banner = ''
|
||||||
Welcome, friends, to Colin's FTP server! Also available via NFS on the same host, but LAN-only.
|
Welcome, friends, to Colin's FTP server! Also available via NFS on the same host, but LAN-only.
|
||||||
|
|
||||||
Read-only access (LAN-restricted):
|
Read-only access (LAN clients see everything; WAN clients can only see /pub):
|
||||||
Username: "anonymous"
|
Username: "anonymous"
|
||||||
Password: "anonymous"
|
Password: "anonymous"
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ps.passlib ])"
|
#!nix-shell -i python3 -p python3 -p python3.pkgs.passlib
|
||||||
# vim: set filetype=python :
|
# vim: set filetype=python :
|
||||||
#
|
#
|
||||||
# available environment variables:
|
# available environment variables:
|
||||||
@@ -45,6 +45,8 @@ from hmac import compare_digest
|
|||||||
|
|
||||||
authFail = dict(username="")
|
authFail = dict(username="")
|
||||||
|
|
||||||
|
PERM_DENY = []
|
||||||
|
PERM_LIST = [ "list" ]
|
||||||
PERM_RO = [ "list", "download" ]
|
PERM_RO = [ "list", "download" ]
|
||||||
PERM_RW = [
|
PERM_RW = [
|
||||||
# read-only:
|
# read-only:
|
||||||
@@ -127,12 +129,14 @@ def getAuthResponse(ip: str, username: str, password: str) -> dict:
|
|||||||
return mkAuthOk(username, permissions = {
|
return mkAuthOk(username, permissions = {
|
||||||
"/": PERM_RW,
|
"/": PERM_RW,
|
||||||
"/playground": PERM_RW,
|
"/playground": PERM_RW,
|
||||||
|
"/.public_for_test": PERM_RO,
|
||||||
})
|
})
|
||||||
if isWireguard(ip):
|
if isWireguard(ip):
|
||||||
# allow any user from wireguard
|
# allow any user from wireguard
|
||||||
return mkAuthOk(username, permissions = {
|
return mkAuthOk(username, permissions = {
|
||||||
"/": PERM_RW,
|
"/": PERM_RW,
|
||||||
"/playground": PERM_RW,
|
"/playground": PERM_RW,
|
||||||
|
"/.public_for_test": PERM_RO,
|
||||||
})
|
})
|
||||||
if isLan(ip):
|
if isLan(ip):
|
||||||
if username == "anonymous":
|
if username == "anonymous":
|
||||||
@@ -140,7 +144,19 @@ def getAuthResponse(ip: str, username: str, password: str) -> dict:
|
|||||||
return mkAuthOk("anonymous", permissions = {
|
return mkAuthOk("anonymous", permissions = {
|
||||||
"/": PERM_RO,
|
"/": PERM_RO,
|
||||||
"/playground": PERM_RW,
|
"/playground": PERM_RW,
|
||||||
|
"/.public_for_test": PERM_RO,
|
||||||
})
|
})
|
||||||
|
if username == "anonymous":
|
||||||
|
# anonymous users from the www can have even more limited access.
|
||||||
|
# mostly because i need an easy way to test WAN connectivity :-)
|
||||||
|
return mkAuthOk("anonymous", permissions = {
|
||||||
|
# "/": PERM_DENY,
|
||||||
|
"/": PERM_LIST, #< REQUIRED, even for lftp to list a subdir
|
||||||
|
"/media": PERM_DENY,
|
||||||
|
"/playground": PERM_DENY,
|
||||||
|
"/.public_for_test": PERM_RO,
|
||||||
|
# "/README.md": PERM_RO, #< does not work
|
||||||
|
})
|
||||||
|
|
||||||
return authFail
|
return authFail
|
||||||
|
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
# ```
|
# ```
|
||||||
|
|
||||||
{ config, lib, pkgs, sane-lib, ... }:
|
{ config, lib, pkgs, sane-lib, ... }:
|
||||||
|
lib.mkIf false #< 2024/07/04: i haven't actively used this for months
|
||||||
{
|
{
|
||||||
sops.secrets."freshrss_passwd" = {
|
sops.secrets."freshrss_passwd" = {
|
||||||
owner = config.users.users.freshrss.name;
|
owner = config.users.users.freshrss.name;
|
||||||
|
@@ -1,11 +1,14 @@
|
|||||||
# config options: <https://docs.gitea.io/en-us/administration/config-cheat-sheet/>
|
# config options: <https://docs.gitea.io/en-us/administration/config-cheat-sheet/>
|
||||||
|
# TODO: service shouldn't run as `git` user, but as `gitea`
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
sane.persist.sys.byStore.plaintext = [
|
sane.persist.sys.byStore.private = [
|
||||||
# TODO: mode? could be more granular
|
{ user = "git"; group = "gitea"; mode = "0750"; path = "/var/lib/gitea"; method = "bind"; }
|
||||||
{ user = "git"; group = "gitea"; path = "/var/lib/gitea"; method = "bind"; }
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
sane.programs.gitea.enableFor.user.colin = true; # for admin, and monitoring
|
||||||
|
|
||||||
services.gitea.enable = true;
|
services.gitea.enable = true;
|
||||||
services.gitea.user = "git"; # default is 'gitea'
|
services.gitea.user = "git"; # default is 'gitea'
|
||||||
services.gitea.database.type = "postgres";
|
services.gitea.database.type = "postgres";
|
||||||
@@ -38,17 +41,24 @@
|
|||||||
ROOT_URL = "https://git.uninsane.org/";
|
ROOT_URL = "https://git.uninsane.org/";
|
||||||
};
|
};
|
||||||
service = {
|
service = {
|
||||||
# timeout for email approval. 5760 = 4 days
|
# timeout for email approval. 5760 = 4 days. 10080 = 7 days
|
||||||
ACTIVE_CODE_LIVE_MINUTES = 5760;
|
ACTIVE_CODE_LIVE_MINUTES = 10080;
|
||||||
# REGISTER_EMAIL_CONFIRM = false;
|
# REGISTER_EMAIL_CONFIRM = false;
|
||||||
# REGISTER_MANUAL_CONFIRM = true;
|
# REGISTER_EMAIL_CONFIRM = true; #< override REGISTER_MANUAL_CONFIRM
|
||||||
REGISTER_EMAIL_CONFIRM = true;
|
REGISTER_MANUAL_CONFIRM = true;
|
||||||
# not sure what this notified on?
|
# not sure what this notifies *on*...
|
||||||
ENABLE_NOTIFY_MAIL = true;
|
ENABLE_NOTIFY_MAIL = true;
|
||||||
# defaults to image-based captcha.
|
# defaults to image-based captcha.
|
||||||
# also supports recaptcha (with custom URLs) or hCaptcha.
|
# also supports recaptcha (with custom URLs) or hCaptcha.
|
||||||
ENABLE_CAPTCHA = true;
|
ENABLE_CAPTCHA = true;
|
||||||
NOREPLY_ADDRESS = "noreply.anonymous.git@uninsane.org";
|
NOREPLY_ADDRESS = "noreply.anonymous.git@uninsane.org";
|
||||||
|
EMAIL_DOMAIN_BLOCKLIST = lib.concatStringsSep ", " [
|
||||||
|
"*.claychoen.top"
|
||||||
|
"*.gemmasmith.co.uk"
|
||||||
|
"*.jenniferlawrence.uk"
|
||||||
|
"*.sarahconnor.co.uk"
|
||||||
|
"*.marymarshall.co.uk"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
session = {
|
session = {
|
||||||
COOKIE_SECURE = true;
|
COOKIE_SECURE = true;
|
||||||
@@ -64,8 +74,8 @@
|
|||||||
SHOW_FOOTER_TEMPLATE_LOAD_TIME = false;
|
SHOW_FOOTER_TEMPLATE_LOAD_TIME = false;
|
||||||
};
|
};
|
||||||
ui = {
|
ui = {
|
||||||
# options: "auto", "gitea", "arc-green"
|
# options: "gitea-auto" (adapt to system theme), "gitea-dark", "gitea-light"
|
||||||
DEFAULT_THEME = "arc-green";
|
# DEFAULT_THEME = "gitea-auto";
|
||||||
# cache frontend assets if true
|
# cache frontend assets if true
|
||||||
# USE_SERVICE_WORKER = true;
|
# USE_SERVICE_WORKER = true;
|
||||||
};
|
};
|
||||||
@@ -74,9 +84,10 @@
|
|||||||
# alternative is to use nixos-level config:
|
# alternative is to use nixos-level config:
|
||||||
# services.gitea.mailerPasswordFile = ...
|
# services.gitea.mailerPasswordFile = ...
|
||||||
ENABLED = true;
|
ENABLED = true;
|
||||||
MAILER_TYPE = "sendmail";
|
|
||||||
FROM = "notify.git@uninsane.org";
|
FROM = "notify.git@uninsane.org";
|
||||||
|
PROTOCOL = "sendmail";
|
||||||
SENDMAIL_PATH = "${pkgs.postfix}/bin/sendmail";
|
SENDMAIL_PATH = "${pkgs.postfix}/bin/sendmail";
|
||||||
|
SENDMAIL_ARGS = "--"; # most "sendmail" programs take options, "--" will prevent an email address being interpreted as an option.
|
||||||
};
|
};
|
||||||
time = {
|
time = {
|
||||||
# options: ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z, RFC3339, RFC3339Nano, Kitchen, Stamp, StampMilli, StampMicro, StampNano
|
# options: ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z, RFC3339, RFC3339Nano, Kitchen, Stamp, StampMilli, StampMicro, StampNano
|
||||||
@@ -108,6 +119,10 @@
|
|||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://127.0.0.1:3000";
|
proxyPass = "http://127.0.0.1:3000";
|
||||||
};
|
};
|
||||||
|
# fuck you @anthropic
|
||||||
|
locations."= /robots.txt".extraConfig = ''
|
||||||
|
return 200 "User-agent: *\nDisallow: /\n";
|
||||||
|
'';
|
||||||
# gitea serves all `raw` files as content-type: plain, but i'd like to serve them as their actual content type.
|
# gitea serves all `raw` files as content-type: plain, but i'd like to serve them as their actual content type.
|
||||||
# or at least, enough to make specific pages viewable (serving unoriginal content as arbitrary content type is dangerous).
|
# or at least, enough to make specific pages viewable (serving unoriginal content as arbitrary content type is dangerous).
|
||||||
locations."~ ^/colin/phone-case-cq/raw/.*.html" = {
|
locations."~ ^/colin/phone-case-cq/raw/.*.html" = {
|
||||||
@@ -133,7 +148,7 @@
|
|||||||
sane.ports.ports."22" = {
|
sane.ports.ports."22" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
visibleTo.doof = true;
|
||||||
description = "colin-git@git.uninsane.org";
|
description = "colin-git@git.uninsane.org";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
145
hosts/by-name/servo/services/hickory-dns.nix
Normal file
145
hosts/by-name/servo/services/hickory-dns.nix
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
# TODO: split this file apart into smaller files to make it easier to understand
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
dyn-dns = config.sane.services.dyn-dns;
|
||||||
|
nativeAddrs = lib.mapAttrs (_name: builtins.head) config.sane.dns.zones."uninsane.org".inet.A;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
sane.ports.ports."53" = {
|
||||||
|
protocol = [ "udp" "tcp" ];
|
||||||
|
visibleTo.lan = true;
|
||||||
|
# visibleTo.wan = true;
|
||||||
|
visibleTo.ovpns = true;
|
||||||
|
visibleTo.doof = true;
|
||||||
|
description = "colin-dns-hosting";
|
||||||
|
};
|
||||||
|
|
||||||
|
sane.dns.zones."uninsane.org".TTL = 900;
|
||||||
|
|
||||||
|
# SOA record structure: <https://en.wikipedia.org/wiki/SOA_record#Structure>
|
||||||
|
# SOA MNAME RNAME (... rest)
|
||||||
|
# MNAME = Master name server for this zone. this is where update requests should be sent.
|
||||||
|
# RNAME = admin contact (encoded email address)
|
||||||
|
# Serial = YYYYMMDDNN, where N is incremented every time this file changes, to trigger secondary NS to re-fetch it.
|
||||||
|
# Refresh = how frequently secondary NS should query master
|
||||||
|
# Retry = how long secondary NS should wait until re-querying master after a failure (must be < Refresh)
|
||||||
|
# Expire = how long secondary NS should continue to reply to queries after master fails (> Refresh + Retry)
|
||||||
|
sane.dns.zones."uninsane.org".inet = {
|
||||||
|
SOA."@" = ''
|
||||||
|
ns1.uninsane.org. admin-dns.uninsane.org. (
|
||||||
|
2023092101 ; Serial
|
||||||
|
4h ; Refresh
|
||||||
|
30m ; Retry
|
||||||
|
7d ; Expire
|
||||||
|
5m) ; Negative response TTL
|
||||||
|
'';
|
||||||
|
TXT."rev" = "2023092101";
|
||||||
|
|
||||||
|
CNAME."native" = "%CNAMENATIVE%";
|
||||||
|
A."@" = "%ANATIVE%";
|
||||||
|
A."servo.wan" = "%AWAN%";
|
||||||
|
A."servo.doof" = "%ADOOF%";
|
||||||
|
A."servo.lan" = config.sane.hosts.by-name."servo".lan-ip;
|
||||||
|
A."servo.hn" = config.sane.hosts.by-name."servo".wg-home.ip;
|
||||||
|
|
||||||
|
# XXX NS records must also not be CNAME
|
||||||
|
# it's best that we keep this identical, or a superset of, what org. lists as our NS.
|
||||||
|
# so, org. can specify ns2/ns3 as being to the VPN, with no mention of ns1. we provide ns1 here.
|
||||||
|
A."ns1" = "%ANATIVE%";
|
||||||
|
A."ns2" = "%ADOOF%";
|
||||||
|
A."ovpns" = "%AOVPNS%";
|
||||||
|
NS."@" = [
|
||||||
|
"ns1.uninsane.org."
|
||||||
|
"ns2.uninsane.org."
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.hickory-dns.settings.zones = [ "uninsane.org" ];
|
||||||
|
|
||||||
|
|
||||||
|
networking.nat.enable = true; #< TODO: try removing this?
|
||||||
|
# networking.nat.extraCommands = ''
|
||||||
|
# # redirect incoming DNS requests from LAN addresses
|
||||||
|
# # to the LAN-specialized DNS service
|
||||||
|
# # N.B.: use the `nixos-*` chains instead of e.g. PREROUTING
|
||||||
|
# # because they get cleanly reset across activations or `systemctl restart firewall`
|
||||||
|
# # instead of accumulating cruft
|
||||||
|
# iptables -t nat -A nixos-nat-pre -p udp --dport 53 \
|
||||||
|
# -m iprange --src-range 10.78.76.0-10.78.79.255 \
|
||||||
|
# -j DNAT --to-destination :1053
|
||||||
|
# iptables -t nat -A nixos-nat-pre -p tcp --dport 53 \
|
||||||
|
# -m iprange --src-range 10.78.76.0-10.78.79.255 \
|
||||||
|
# -j DNAT --to-destination :1053
|
||||||
|
# '';
|
||||||
|
# sane.ports.ports."1053" = {
|
||||||
|
# # because the NAT above redirects in nixos-nat-pre, LAN requests behave as though they arrived on the external interface at the redirected port.
|
||||||
|
# # TODO: try nixos-nat-post instead?
|
||||||
|
# # TODO: or, don't NAT from port 53 -> port 1053, but rather nat from LAN addr to a loopback addr.
|
||||||
|
# # - this is complicated in that loopback is a different interface than eth0, so rewriting the destination address would cause the packets to just be dropped by the interface
|
||||||
|
# protocol = [ "udp" "tcp" ];
|
||||||
|
# visibleTo.lan = true;
|
||||||
|
# description = "colin-redirected-dns-for-lan-namespace";
|
||||||
|
# };
|
||||||
|
|
||||||
|
|
||||||
|
sane.services.hickory-dns.enable = true;
|
||||||
|
sane.services.hickory-dns.instances = let
|
||||||
|
mkSubstitutions = flavor: {
|
||||||
|
"%ADOOF%" = config.sane.netns.doof.netnsPubIpv4;
|
||||||
|
"%ANATIVE%" = nativeAddrs."servo.${flavor}";
|
||||||
|
"%AOVPNS%" = config.sane.netns.ovpns.netnsPubIpv4;
|
||||||
|
"%AWAN%" = "$(cat '${dyn-dns.ipPath}')";
|
||||||
|
"%CNAMENATIVE%" = "servo.${flavor}";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
doof = {
|
||||||
|
substitutions = mkSubstitutions "doof";
|
||||||
|
listenAddrsIpv4 = [
|
||||||
|
config.sane.netns.doof.hostVethIpv4
|
||||||
|
config.sane.netns.doof.netnsPubIpv4
|
||||||
|
nativeAddrs."servo.lan"
|
||||||
|
# config.sane.netns.ovpns.hostVethIpv4
|
||||||
|
];
|
||||||
|
};
|
||||||
|
hn = {
|
||||||
|
substitutions = mkSubstitutions "hn";
|
||||||
|
listenAddrsIpv4 = [ nativeAddrs."servo.hn" ];
|
||||||
|
enableRecursiveResolver = true; #< allow wireguard clients to use this as their DNS resolver
|
||||||
|
# extraConfig = {
|
||||||
|
# zones = [
|
||||||
|
# {
|
||||||
|
# # forward the root zone to the local DNS resolver
|
||||||
|
# # to allow wireguard clients to use this as their DNS resolver
|
||||||
|
# zone = ".";
|
||||||
|
# zone_type = "Forward";
|
||||||
|
# stores = {
|
||||||
|
# type = "forward";
|
||||||
|
# name_servers = [
|
||||||
|
# {
|
||||||
|
# socket_addr = "127.0.0.53:53";
|
||||||
|
# protocol = "udp";
|
||||||
|
# trust_nx_responses = true;
|
||||||
|
# }
|
||||||
|
# ];
|
||||||
|
# };
|
||||||
|
# }
|
||||||
|
# ];
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
# lan = {
|
||||||
|
# substitutions = mkSubstitutions "lan";
|
||||||
|
# listenAddrsIpv4 = [ nativeAddrs."servo.lan" ];
|
||||||
|
# # port = 1053;
|
||||||
|
# };
|
||||||
|
# wan = {
|
||||||
|
# substitutions = mkSubstitutions "wan";
|
||||||
|
# listenAddrsIpv4 = [
|
||||||
|
# nativeAddrs."servo.lan"
|
||||||
|
# ];
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
|
||||||
|
sane.services.dyn-dns.restartOnChange = lib.map (c: "${c.service}.service") (builtins.attrValues config.sane.services.hickory-dns.instances);
|
||||||
|
}
|
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
lib.mkIf false # i don't actively use ipfs anymore
|
lib.mkIf false # i don't actively use ipfs anymore
|
||||||
{
|
{
|
||||||
sane.persist.sys.byStore.plaintext = [
|
sane.persist.sys.byStore.private = [
|
||||||
# TODO: mode? could be more granular
|
# TODO: mode? could be more granular
|
||||||
{ user = "261"; group = "261"; path = "/var/lib/ipfs"; method = "bind"; }
|
{ user = "261"; group = "261"; path = "/var/lib/ipfs"; method = "bind"; }
|
||||||
];
|
];
|
||||||
|
@@ -1,36 +0,0 @@
|
|||||||
{ lib, pkgs, ... }:
|
|
||||||
|
|
||||||
lib.mkIf false #< TODO: re-enable once confident of sandboxing
|
|
||||||
{
|
|
||||||
sane.persist.sys.byStore.plaintext = [
|
|
||||||
# TODO: mode? we only need this to save Indexer creds ==> migrate to config?
|
|
||||||
{ user = "root"; group = "root"; path = "/var/lib/jackett"; method = "bind"; }
|
|
||||||
];
|
|
||||||
services.jackett.enable = true;
|
|
||||||
|
|
||||||
systemd.services.jackett.after = [ "wireguard-wg-ovpns.service" ];
|
|
||||||
systemd.services.jackett.partOf = [ "wireguard-wg-ovpns.service" ];
|
|
||||||
systemd.services.jackett.serviceConfig = {
|
|
||||||
# run this behind the OVPN static VPN
|
|
||||||
NetworkNamespacePath = "/run/netns/ovpns";
|
|
||||||
ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect 185.157.162.178" ]; # abort if public IP is not as expected
|
|
||||||
|
|
||||||
# patch jackett to listen on the public interfaces
|
|
||||||
# ExecStart = lib.mkForce "${pkgs.jackett}/bin/Jackett --NoUpdates --DataFolder /var/lib/jackett/.config/Jackett --ListenPublic";
|
|
||||||
};
|
|
||||||
|
|
||||||
# jackett torrent search
|
|
||||||
services.nginx.virtualHosts."jackett.uninsane.org" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
# inherit kTLS;
|
|
||||||
locations."/" = {
|
|
||||||
# proxyPass = "http://ovpns.uninsane.org:9117";
|
|
||||||
proxyPass = "http://10.0.1.6:9117";
|
|
||||||
recommendedProxySettings = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
sane.dns.zones."uninsane.org".inet.CNAME."jackett" = "native";
|
|
||||||
}
|
|
||||||
|
|
68
hosts/by-name/servo/services/jackett/default.nix
Normal file
68
hosts/by-name/servo/services/jackett/default.nix
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.jackett;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
sane.persist.sys.byStore.private = [
|
||||||
|
# TODO: mode? we only need this to save Indexer creds ==> migrate to config?
|
||||||
|
{ user = "jackett"; group = "jackett"; path = "/var/lib/jackett"; method = "bind"; }
|
||||||
|
];
|
||||||
|
services.jackett.enable = true;
|
||||||
|
|
||||||
|
systemd.services.jackett.after = [ "wireguard-wg-ovpns.service" ];
|
||||||
|
systemd.services.jackett.partOf = [ "wireguard-wg-ovpns.service" ];
|
||||||
|
systemd.services.jackett = {
|
||||||
|
# run this behind the OVPN static VPN
|
||||||
|
serviceConfig.NetworkNamespacePath = "/run/netns/ovpns";
|
||||||
|
serviceConfig.ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect ${config.sane.netns.ovpns.netnsPubIpv4}" ]; # abort if public IP is not as expected
|
||||||
|
# patch in `--ListenPublic` so that it's reachable from the netns veth.
|
||||||
|
# this also makes it reachable from the VPN pub address. oh well.
|
||||||
|
serviceConfig.ExecStart = lib.mkForce "${cfg.package}/bin/Jackett --ListenPublic --NoUpdates --DataFolder '${cfg.dataDir}'";
|
||||||
|
serviceConfig.RestartSec = "30s";
|
||||||
|
|
||||||
|
# hardening (systemd-analyze security jackett)
|
||||||
|
# TODO: upstream into nixpkgs
|
||||||
|
serviceConfig.StateDirectory = "jackett";
|
||||||
|
serviceConfig.LockPersonality = true;
|
||||||
|
serviceConfig.NoNewPrivileges = true;
|
||||||
|
# serviceConfig.MemoryDenyWriteExecute = true; #< Failed to create CoreCLR, HRESULT: 0x80004005
|
||||||
|
serviceConfig.PrivateDevices = true;
|
||||||
|
serviceConfig.PrivateMounts = true;
|
||||||
|
serviceConfig.PrivateTmp = true;
|
||||||
|
serviceConfig.PrivateUsers = true;
|
||||||
|
serviceConfig.ProcSubset = "pid";
|
||||||
|
serviceConfig.ProtectClock = true;
|
||||||
|
serviceConfig.ProtectControlGroups = true;
|
||||||
|
serviceConfig.ProtectHome = true;
|
||||||
|
serviceConfig.ProtectHostname = true;
|
||||||
|
serviceConfig.ProtectKernelLogs = true;
|
||||||
|
serviceConfig.ProtectKernelModules = true;
|
||||||
|
serviceConfig.ProtectKernelTunables = true;
|
||||||
|
serviceConfig.ProtectProc = "invisible";
|
||||||
|
serviceConfig.ProtectSystem = "strict";
|
||||||
|
serviceConfig.RemoveIPC = true;
|
||||||
|
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
|
||||||
|
serviceConfig.RestrictNamespaces = true;
|
||||||
|
serviceConfig.RestrictSUIDSGID = true;
|
||||||
|
serviceConfig.SystemCallArchitectures = "native";
|
||||||
|
serviceConfig.SystemCallFilter = [ "@system-service" "~@privileged" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# jackett torrent search
|
||||||
|
services.nginx.virtualHosts."jackett.uninsane.org" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
# inherit kTLS;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://${config.sane.netns.ovpns.netnsVethIpv4}:9117";
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
};
|
||||||
|
locations."= /robots.txt".extraConfig = ''
|
||||||
|
return 200 "User-agent: *\nDisallow: /\n";
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
sane.dns.zones."uninsane.org".inet.CNAME."jackett" = "native";
|
||||||
|
}
|
||||||
|
|
@@ -21,6 +21,9 @@
|
|||||||
enableACME = true;
|
enableACME = true;
|
||||||
# inherit kTLS;
|
# inherit kTLS;
|
||||||
locations."/".proxyPass = "http://127.0.0.1:8013";
|
locations."/".proxyPass = "http://127.0.0.1:8013";
|
||||||
|
locations."= /robots.txt".extraConfig = ''
|
||||||
|
return 200 "User-agent: *\nDisallow: /\n";
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
sane.dns.zones."uninsane.org".inet.CNAME."w" = "native";
|
sane.dns.zones."uninsane.org".inet.CNAME."w" = "native";
|
||||||
|
@@ -17,6 +17,9 @@ in
|
|||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://127.0.0.1:${builtins.toString port}";
|
proxyPass = "http://127.0.0.1:${builtins.toString port}";
|
||||||
};
|
};
|
||||||
|
locations."= /robots.txt".extraConfig = ''
|
||||||
|
return 200 "User-agent: *\nDisallow: /\n";
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
sane.dns.zones."uninsane.org".inet.CNAME."komga" = "native";
|
sane.dns.zones."uninsane.org".inet.CNAME."komga" = "native";
|
||||||
}
|
}
|
||||||
|
@@ -38,14 +38,10 @@ in {
|
|||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.lemmy.serviceConfig = {
|
|
||||||
# fix to use a normal user so we can configure perms correctly
|
|
||||||
DynamicUser = mkForce false;
|
|
||||||
User = "lemmy";
|
|
||||||
Group = "lemmy";
|
|
||||||
};
|
|
||||||
systemd.services.lemmy.environment = {
|
systemd.services.lemmy.environment = {
|
||||||
RUST_BACKTRACE = "full";
|
RUST_BACKTRACE = "full";
|
||||||
|
RUST_LOG = "error";
|
||||||
|
# RUST_LOG = "warn";
|
||||||
# RUST_LOG = "debug";
|
# RUST_LOG = "debug";
|
||||||
# RUST_LOG = "trace";
|
# RUST_LOG = "trace";
|
||||||
# upstream defaults LEMMY_DATABASE_URL = "postgres:///lemmy?host=/run/postgresql";
|
# upstream defaults LEMMY_DATABASE_URL = "postgres:///lemmy?host=/run/postgresql";
|
||||||
@@ -72,6 +68,73 @@ in {
|
|||||||
|
|
||||||
sane.dns.zones."uninsane.org".inet.CNAME."lemmy" = "native";
|
sane.dns.zones."uninsane.org".inet.CNAME."lemmy" = "native";
|
||||||
|
|
||||||
|
systemd.services.lemmy = {
|
||||||
|
# fix to use a normal user so we can configure perms correctly
|
||||||
|
# XXX(2024-07-28): this hasn't been rigorously tested:
|
||||||
|
# possible that i've set something too strict and won't notice right away
|
||||||
|
serviceConfig.DynamicUser = mkForce false;
|
||||||
|
serviceConfig.User = "lemmy";
|
||||||
|
serviceConfig.Group = "lemmy";
|
||||||
|
|
||||||
|
# hardening (systemd-analyze security lemmy)
|
||||||
|
# a handful of these are specified in upstream nixpkgs, but mostly not
|
||||||
|
serviceConfig.LockPersonality = true;
|
||||||
|
serviceConfig.NoNewPrivileges = true;
|
||||||
|
serviceConfig.MemoryDenyWriteExecute = true;
|
||||||
|
serviceConfig.PrivateDevices = true;
|
||||||
|
serviceConfig.PrivateMounts = true;
|
||||||
|
serviceConfig.PrivateTmp = true;
|
||||||
|
serviceConfig.PrivateUsers = true;
|
||||||
|
serviceConfig.ProcSubset = "pid";
|
||||||
|
|
||||||
|
serviceConfig.ProtectClock = true;
|
||||||
|
serviceConfig.ProtectControlGroups = true;
|
||||||
|
serviceConfig.ProtectHome = true;
|
||||||
|
serviceConfig.ProtectHostname = true;
|
||||||
|
serviceConfig.ProtectKernelLogs = true;
|
||||||
|
serviceConfig.ProtectKernelModules = true;
|
||||||
|
serviceConfig.ProtectKernelTunables = true;
|
||||||
|
serviceConfig.ProtectProc = "invisible";
|
||||||
|
serviceConfig.ProtectSystem = "strict";
|
||||||
|
serviceConfig.RemoveIPC = true;
|
||||||
|
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
|
||||||
|
|
||||||
|
serviceConfig.RestrictNamespaces = true;
|
||||||
|
serviceConfig.RestrictSUIDSGID = true;
|
||||||
|
serviceConfig.SystemCallArchitectures = "native";
|
||||||
|
serviceConfig.SystemCallFilter = [ "@system-service" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.lemmy-ui = {
|
||||||
|
# hardening (systemd-analyze security lemmy-ui)
|
||||||
|
# TODO: upstream into nixpkgs
|
||||||
|
serviceConfig.LockPersonality = true;
|
||||||
|
serviceConfig.NoNewPrivileges = true;
|
||||||
|
# serviceConfig.MemoryDenyWriteExecute = true; #< it uses v8, JIT
|
||||||
|
serviceConfig.PrivateDevices = true;
|
||||||
|
serviceConfig.PrivateMounts = true;
|
||||||
|
serviceConfig.PrivateTmp = true;
|
||||||
|
serviceConfig.PrivateUsers = true;
|
||||||
|
serviceConfig.ProcSubset = "pid";
|
||||||
|
|
||||||
|
serviceConfig.ProtectClock = true;
|
||||||
|
serviceConfig.ProtectControlGroups = true;
|
||||||
|
serviceConfig.ProtectHome = true;
|
||||||
|
serviceConfig.ProtectHostname = true;
|
||||||
|
serviceConfig.ProtectKernelLogs = true;
|
||||||
|
serviceConfig.ProtectKernelModules = true;
|
||||||
|
serviceConfig.ProtectKernelTunables = true;
|
||||||
|
serviceConfig.ProtectProc = "invisible";
|
||||||
|
serviceConfig.ProtectSystem = "strict";
|
||||||
|
serviceConfig.RemoveIPC = true;
|
||||||
|
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
|
||||||
|
|
||||||
|
serviceConfig.RestrictNamespaces = true;
|
||||||
|
serviceConfig.RestrictSUIDSGID = true;
|
||||||
|
serviceConfig.SystemCallArchitectures = "native";
|
||||||
|
serviceConfig.SystemCallFilter = [ "@system-service" "@pkey" "@sandbox" ];
|
||||||
|
};
|
||||||
|
|
||||||
#v DO NOT REMOVE: defaults to 0.3, instead of latest, so always need to explicitly set this.
|
#v DO NOT REMOVE: defaults to 0.3, instead of latest, so always need to explicitly set this.
|
||||||
services.pict-rs.package = pict-rs;
|
services.pict-rs.package = pict-rs;
|
||||||
|
|
||||||
@@ -81,10 +144,38 @@ in {
|
|||||||
# - via CLI flags (overrides everything above)
|
# - via CLI flags (overrides everything above)
|
||||||
# some of the CLI flags have defaults, making it the only actual way to configure certain things even when docs claim otherwise.
|
# some of the CLI flags have defaults, making it the only actual way to configure certain things even when docs claim otherwise.
|
||||||
# CLI args: <https://git.asonix.dog/asonix/pict-rs#user-content-running>
|
# CLI args: <https://git.asonix.dog/asonix/pict-rs#user-content-running>
|
||||||
systemd.services.pict-rs.serviceConfig.ExecStart = lib.mkForce (lib.concatStringsSep " " [
|
systemd.services.pict-rs = {
|
||||||
"${lib.getBin pict-rs}/bin/pict-rs run"
|
serviceConfig.ExecStart = lib.mkForce (lib.concatStringsSep " " [
|
||||||
"--media-video-max-frame-count" (builtins.toString (30*60*60))
|
"${lib.getBin pict-rs}/bin/pict-rs run"
|
||||||
"--media-process-timeout 120"
|
"--media-video-max-frame-count" (builtins.toString (30*60*60))
|
||||||
"--media-video-allow-audio" # allow audio
|
"--media-process-timeout 120"
|
||||||
]);
|
"--media-video-allow-audio" # allow audio
|
||||||
|
]);
|
||||||
|
|
||||||
|
# hardening (systemd-analyze security pict-rs)
|
||||||
|
# TODO: upstream into nixpkgs
|
||||||
|
serviceConfig.LockPersonality = true;
|
||||||
|
serviceConfig.NoNewPrivileges = true;
|
||||||
|
serviceConfig.MemoryDenyWriteExecute = true;
|
||||||
|
serviceConfig.PrivateDevices = true;
|
||||||
|
serviceConfig.PrivateMounts = true;
|
||||||
|
serviceConfig.PrivateTmp = true;
|
||||||
|
serviceConfig.PrivateUsers = true;
|
||||||
|
serviceConfig.ProcSubset = "pid";
|
||||||
|
serviceConfig.ProtectClock = true;
|
||||||
|
serviceConfig.ProtectControlGroups = true;
|
||||||
|
serviceConfig.ProtectHome = true;
|
||||||
|
serviceConfig.ProtectHostname = true;
|
||||||
|
serviceConfig.ProtectKernelLogs = true;
|
||||||
|
serviceConfig.ProtectKernelModules = true;
|
||||||
|
serviceConfig.ProtectKernelTunables = true;
|
||||||
|
serviceConfig.ProtectProc = "invisible";
|
||||||
|
serviceConfig.ProtectSystem = "strict";
|
||||||
|
serviceConfig.RemoveIPC = true;
|
||||||
|
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
|
||||||
|
serviceConfig.RestrictNamespaces = true;
|
||||||
|
serviceConfig.RestrictSUIDSGID = true;
|
||||||
|
serviceConfig.SystemCallArchitectures = "native";
|
||||||
|
serviceConfig.SystemCallFilter = [ "@system-service" ];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
# docs: <https://nixos.wiki/wiki/Matrix>
|
# docs: <https://nixos.wiki/wiki/Matrix>
|
||||||
# docs: <https://nixos.org/manual/nixos/stable/index.html#module-services-matrix-synapse>
|
# docs: <https://nixos.org/manual/nixos/stable/index.html#module-services-matrix-synapse>
|
||||||
# example config: <https://github.com/matrix-org/synapse/blob/develop/docs/sample_config.yaml>
|
# example config: <https://github.com/element-hq/synapse/blob/develop/docs/sample_config.yaml>
|
||||||
#
|
#
|
||||||
# ENABLING PUSH NOTIFICATIONS (with UnifiedPush/ntfy):
|
# ENABLING PUSH NOTIFICATIONS (with UnifiedPush/ntfy):
|
||||||
# - Matrix "pushers" API spec: <https://spec.matrix.org/latest/client-server-api/#post_matrixclientv3pushersset>
|
# - Matrix "pushers" API spec: <https://spec.matrix.org/latest/client-server-api/#post_matrixclientv3pushersset>
|
||||||
@@ -20,19 +20,17 @@
|
|||||||
./signal.nix
|
./signal.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
sane.persist.sys.byStore.plaintext = [
|
sane.persist.sys.byStore.private = [
|
||||||
{ user = "matrix-synapse"; group = "matrix-synapse"; path = "/var/lib/matrix-synapse"; method = "bind"; }
|
{ user = "matrix-synapse"; group = "matrix-synapse"; path = "/var/lib/matrix-synapse"; method = "bind"; }
|
||||||
];
|
];
|
||||||
services.matrix-synapse.enable = true;
|
services.matrix-synapse.enable = true;
|
||||||
|
services.matrix-synapse.log.root.level = "ERROR"; # accepts "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL" (?)
|
||||||
services.matrix-synapse.settings = {
|
services.matrix-synapse.settings = {
|
||||||
# this changes the default log level from INFO to WARN.
|
|
||||||
# maybe there's an easier way?
|
|
||||||
log_config = ./synapse-log_level.yaml;
|
|
||||||
server_name = "uninsane.org";
|
server_name = "uninsane.org";
|
||||||
|
|
||||||
# services.matrix-synapse.enable_registration_captcha = true;
|
# services.matrix-synapse.enable_registration_captcha = true;
|
||||||
# services.matrix-synapse.enable_registration_without_verification = true;
|
# services.matrix-synapse.enable_registration_without_verification = true;
|
||||||
enable_registration = true;
|
# enable_registration = true;
|
||||||
# services.matrix-synapse.registration_shared_secret = "<shared key goes here>";
|
# services.matrix-synapse.registration_shared_secret = "<shared key goes here>";
|
||||||
|
|
||||||
# default for listeners is port = 8448, tls = true, x_forwarded = false.
|
# default for listeners is port = 8448, tls = true, x_forwarded = false.
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
# - recommended to use mautrix-discord: <https://github.com/NixOS/nixpkgs/pull/200462>
|
# - recommended to use mautrix-discord: <https://github.com/NixOS/nixpkgs/pull/200462>
|
||||||
lib.mkIf false
|
lib.mkIf false
|
||||||
{
|
{
|
||||||
sane.persist.sys.byStore.plaintext = [
|
sane.persist.sys.byStore.private = [
|
||||||
{ user = "matrix-synapse"; group = "matrix-synapse"; path = "/var/lib/mx-puppet-discord"; method = "bind"; }
|
{ user = "matrix-synapse"; group = "matrix-synapse"; path = "/var/lib/mx-puppet-discord"; method = "bind"; }
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@@ -1,15 +1,13 @@
|
|||||||
# config docs:
|
# config docs:
|
||||||
# - <https://github.com/matrix-org/matrix-appservice-irc/blob/develop/config.sample.yaml>
|
# - <https://github.com/matrix-org/matrix-appservice-irc/blob/develop/config.sample.yaml>
|
||||||
# probably want to remove that.
|
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
ircServer = { name, additionalAddresses ? [], sasl ? true, port ? 6697 }: let
|
ircServer = { name, additionalAddresses ? [], ssl ? true, sasl ? true, port ? if ssl then 6697 else 6667 }: let
|
||||||
lowerName = lib.toLower name;
|
lowerName = lib.toLower name;
|
||||||
in {
|
in {
|
||||||
# XXX sasl: appservice doesn't support NickServ identification (only SASL, or PASS if sasl = false)
|
# XXX sasl: appservice doesn't support NickServ identification (only SASL, or PASS if sasl = false)
|
||||||
inherit name additionalAddresses sasl port;
|
inherit additionalAddresses name port sasl ssl;
|
||||||
ssl = true;
|
|
||||||
botConfig = {
|
botConfig = {
|
||||||
# bot has no presence in IRC channel; only real Matrix users
|
# bot has no presence in IRC channel; only real Matrix users
|
||||||
enabled = false;
|
enabled = false;
|
||||||
@@ -101,7 +99,7 @@ in
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
sane.persist.sys.byStore.plaintext = [
|
sane.persist.sys.byStore.private = [
|
||||||
# TODO: mode?
|
# TODO: mode?
|
||||||
{ user = "matrix-appservice-irc"; group = "matrix-appservice-irc"; path = "/var/lib/matrix-appservice-irc"; method = "bind"; }
|
{ user = "matrix-appservice-irc"; group = "matrix-appservice-irc"; path = "/var/lib/matrix-appservice-irc"; method = "bind"; }
|
||||||
];
|
];
|
||||||
@@ -129,6 +127,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
ircService = {
|
ircService = {
|
||||||
|
logging.level = "warn"; # "error", "warn", "info", "debug"
|
||||||
servers = {
|
servers = {
|
||||||
"irc.esper.net" = ircServer {
|
"irc.esper.net" = ircServer {
|
||||||
name = "esper";
|
name = "esper";
|
||||||
@@ -156,6 +155,10 @@ in
|
|||||||
# - #sxmo-offtopic
|
# - #sxmo-offtopic
|
||||||
};
|
};
|
||||||
"irc.rizon.net" = ircServer { name = "Rizon"; };
|
"irc.rizon.net" = ircServer { name = "Rizon"; };
|
||||||
|
"wigle.net" = ircServer {
|
||||||
|
name = "WiGLE";
|
||||||
|
ssl = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
lib.mkIf false # disabled 2024/01/11: i don't use it, and pkgs.mautrix-signal had some API changes
|
lib.mkIf false # disabled 2024/01/11: i don't use it, and pkgs.mautrix-signal had some API changes
|
||||||
{
|
{
|
||||||
sane.persist.sys.byStore.plaintext = [
|
sane.persist.sys.byStore.private = [
|
||||||
{ user = "mautrix-signal"; group = "mautrix-signal"; path = "/var/lib/mautrix-signal"; method = "bind"; }
|
{ user = "mautrix-signal"; group = "mautrix-signal"; path = "/var/lib/mautrix-signal"; method = "bind"; }
|
||||||
{ user = "signald"; group = "signald"; path = "/var/lib/signald"; method = "bind"; }
|
{ user = "signald"; group = "signald"; path = "/var/lib/signald"; method = "bind"; }
|
||||||
];
|
];
|
||||||
|
@@ -1,27 +0,0 @@
|
|||||||
version: 1
|
|
||||||
|
|
||||||
# In systemd's journal, loglevel is implicitly stored, so let's omit it
|
|
||||||
# from the message text.
|
|
||||||
formatters:
|
|
||||||
journal_fmt:
|
|
||||||
format: '%(name)s: [%(request)s] %(message)s'
|
|
||||||
|
|
||||||
filters:
|
|
||||||
context:
|
|
||||||
(): synapse.util.logcontext.LoggingContextFilter
|
|
||||||
request: ""
|
|
||||||
|
|
||||||
handlers:
|
|
||||||
journal:
|
|
||||||
class: systemd.journal.JournalHandler
|
|
||||||
formatter: journal_fmt
|
|
||||||
filters: [context]
|
|
||||||
SYSLOG_IDENTIFIER: synapse
|
|
||||||
|
|
||||||
# default log level: INFO
|
|
||||||
root:
|
|
||||||
level: WARN
|
|
||||||
handlers: [journal]
|
|
||||||
|
|
||||||
disable_existing_loggers: False
|
|
||||||
|
|
@@ -17,7 +17,6 @@ in
|
|||||||
sane.ports.ports."80" = {
|
sane.ports.ports."80" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
visibleTo.ovpns = true; # so that letsencrypt can procure a cert for the mx record
|
visibleTo.ovpns = true; # so that letsencrypt can procure a cert for the mx record
|
||||||
visibleTo.doof = true;
|
visibleTo.doof = true;
|
||||||
description = "colin-http-uninsane.org";
|
description = "colin-http-uninsane.org";
|
||||||
@@ -25,12 +24,17 @@ in
|
|||||||
sane.ports.ports."443" = {
|
sane.ports.ports."443" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
visibleTo.doof = true;
|
visibleTo.doof = true;
|
||||||
description = "colin-https-uninsane.org";
|
description = "colin-https-uninsane.org";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.enable = true;
|
services.nginx.enable = true;
|
||||||
|
# nginxStable is one release behind nginxMainline.
|
||||||
|
# nginx itself recommends running mainline; nixos defaults to stable.
|
||||||
|
# services.nginx.package = pkgs.nginxMainline;
|
||||||
|
# XXX(2024-07-31): nixos defaults to zlib-ng -- supposedly more performant, but spams log with
|
||||||
|
# "gzip filter failed to use preallocated memory: ..."
|
||||||
|
services.nginx.package = pkgs.nginxMainline.override { zlib = pkgs.zlib; };
|
||||||
services.nginx.appendConfig = ''
|
services.nginx.appendConfig = ''
|
||||||
# use 1 process per core.
|
# use 1 process per core.
|
||||||
# may want to increase worker_connections too, but `ulimit -n` must be increased first.
|
# may want to increase worker_connections too, but `ulimit -n` must be increased first.
|
||||||
@@ -46,8 +50,10 @@ in
|
|||||||
log_format vcombined '$host:$server_port $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referrer" "$http_user_agent"';
|
log_format vcombined '$host:$server_port $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referrer" "$http_user_agent"';
|
||||||
access_log /var/log/nginx/private.log vcombined;
|
access_log /var/log/nginx/private.log vcombined;
|
||||||
'';
|
'';
|
||||||
# sets gzip_comp_level = 5
|
# enables gzip and sets gzip_comp_level = 5
|
||||||
services.nginx.recommendedGzipSettings = true;
|
services.nginx.recommendedGzipSettings = true;
|
||||||
|
# enables zstd and sets zstd_comp_level = 9
|
||||||
|
services.nginx.recommendedZstdSettings = true;
|
||||||
# enables OCSP stapling (so clients don't need contact the OCSP server -- i do instead)
|
# enables OCSP stapling (so clients don't need contact the OCSP server -- i do instead)
|
||||||
# - doesn't seem to, actually: <https://www.ssllabs.com/ssltest/analyze.html?d=uninsane.org>
|
# - doesn't seem to, actually: <https://www.ssllabs.com/ssltest/analyze.html?d=uninsane.org>
|
||||||
# caches TLS sessions for 10m
|
# caches TLS sessions for 10m
|
||||||
@@ -101,6 +107,16 @@ in
|
|||||||
disable_symlinks on;
|
disable_symlinks on;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
locations."/share/Ubunchu/" = {
|
||||||
|
alias = "/var/media/Books/Visual/HiroshiSeo/Ubunchu/";
|
||||||
|
extraConfig = ''
|
||||||
|
# autoindex => render directory listings
|
||||||
|
autoindex on;
|
||||||
|
# don't follow any symlinks when serving files
|
||||||
|
# otherwise it allows a directory escape
|
||||||
|
disable_symlinks on;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
# allow matrix users to discover that @user:uninsane.org is reachable via matrix.uninsane.org
|
# allow matrix users to discover that @user:uninsane.org is reachable via matrix.uninsane.org
|
||||||
locations."= /.well-known/matrix/server".extraConfig =
|
locations."= /.well-known/matrix/server".extraConfig =
|
||||||
@@ -182,8 +198,15 @@ in
|
|||||||
|
|
||||||
sane.persist.sys.byStore.plaintext = [
|
sane.persist.sys.byStore.plaintext = [
|
||||||
{ user = "acme"; group = "acme"; path = "/var/lib/acme"; method = "bind"; }
|
{ user = "acme"; group = "acme"; path = "/var/lib/acme"; method = "bind"; }
|
||||||
|
];
|
||||||
|
sane.persist.sys.byStore.private = [
|
||||||
{ user = "colin"; group = "users"; path = "/var/www/sites"; method = "bind"; }
|
{ user = "colin"; group = "users"; path = "/var/www/sites"; method = "bind"; }
|
||||||
];
|
];
|
||||||
|
sane.persist.sys.byStore.ephemeral = [
|
||||||
|
# logs *could* be persisted to private storage, but then there's the issue of
|
||||||
|
# "what if servo boots, isn't unlocked, and the whole / tmpfs is consumed by logs"
|
||||||
|
{ user = "nginx"; group = "nginx"; path = "/var/log/nginx"; method = "bind"; }
|
||||||
|
];
|
||||||
|
|
||||||
# let's encrypt default chain looks like:
|
# let's encrypt default chain looks like:
|
||||||
# - End-entity certificate ← R3 ← ISRG Root X1 ← DST Root CA X3
|
# - End-entity certificate ← R3 ← ISRG Root X1 ← DST Root CA X3
|
||||||
|
@@ -30,7 +30,7 @@ let
|
|||||||
altPort = 2587;
|
altPort = 2587;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
sane.persist.sys.byStore.plaintext = [
|
sane.persist.sys.byStore.private = [
|
||||||
# not 100% necessary to persist this, but ntfy does keep a 12hr (by default) cache
|
# not 100% necessary to persist this, but ntfy does keep a 12hr (by default) cache
|
||||||
# for pushing notifications to users who become offline.
|
# for pushing notifications to users who become offline.
|
||||||
# ACLs also live here.
|
# ACLs also live here.
|
||||||
@@ -46,7 +46,7 @@ in
|
|||||||
# defaults to 45s.
|
# defaults to 45s.
|
||||||
# note that the client may still do its own TCP-level keepalives, typically every 30s
|
# note that the client may still do its own TCP-level keepalives, typically every 30s
|
||||||
keepalive-interval = "15m";
|
keepalive-interval = "15m";
|
||||||
log-level = "trace"; # trace, debug, info (default), warn, error
|
log-level = "info"; # trace, debug, info (default), warn, error
|
||||||
auth-default-access = "deny-all";
|
auth-default-access = "deny-all";
|
||||||
};
|
};
|
||||||
systemd.services.ntfy-sh.serviceConfig.DynamicUser = lib.mkForce false;
|
systemd.services.ntfy-sh.serviceConfig.DynamicUser = lib.mkForce false;
|
||||||
@@ -86,7 +86,7 @@ in
|
|||||||
sane.ports.ports."${builtins.toString altPort}" = {
|
sane.ports.ports."${builtins.toString altPort}" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
visibleTo.doof = true;
|
||||||
description = "colin-ntfy.uninsane.org";
|
description = "colin-ntfy.uninsane.org";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ])" -p ntfy-sh
|
#!nix-shell -i python3 -p ntfy-sh -p python3
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
|
@@ -47,7 +47,7 @@ in
|
|||||||
};
|
};
|
||||||
sane.ntfy-waiter.package = mkOption {
|
sane.ntfy-waiter.package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = pkgs.static-nix-shell.mkPython3Bin {
|
default = pkgs.static-nix-shell.mkPython3 {
|
||||||
pname = "ntfy-waiter";
|
pname = "ntfy-waiter";
|
||||||
srcRoot = ./.;
|
srcRoot = ./.;
|
||||||
pkgs = [ "ntfy-sh" ];
|
pkgs = [ "ntfy-sh" ];
|
||||||
@@ -62,8 +62,8 @@ in
|
|||||||
sane.ports.ports = lib.mkMerge (lib.forEach portRange (port: {
|
sane.ports.ports = lib.mkMerge (lib.forEach portRange (port: {
|
||||||
"${builtins.toString port}" = {
|
"${builtins.toString port}" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-notification-waiter-${builtins.toString (port - portLow + 1)}-of-${builtins.toString numPorts}";
|
description = "colin-notification-waiter-${builtins.toString (port - portLow + 1)}-of-${builtins.toString numPorts}";
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
23
hosts/by-name/servo/services/ollama.nix
Normal file
23
hosts/by-name/servo/services/ollama.nix
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# ollama: <https://github.com/ollama/ollama>
|
||||||
|
# use: `ollama run llama3.1`
|
||||||
|
# or: `ollama run llama3.1:70b`
|
||||||
|
# or use a remote session: <https://github.com/ggozad/oterm>
|
||||||
|
{ lib, ... }:
|
||||||
|
lib.mkIf false #< WIP
|
||||||
|
{
|
||||||
|
sane.persist.sys.byStore.plaintext = [
|
||||||
|
{ user = "ollama"; group = "ollama"; path = "/var/lib/ollama"; method = "bind"; }
|
||||||
|
];
|
||||||
|
services.ollama.enable = true;
|
||||||
|
services.ollama.user = "ollama";
|
||||||
|
services.ollama.group = "ollama";
|
||||||
|
|
||||||
|
users.groups.ollama = {};
|
||||||
|
|
||||||
|
users.users.ollama = {
|
||||||
|
group = "ollama";
|
||||||
|
isSystemUser = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.ollama.serviceConfig.DynamicUser = lib.mkForce false;
|
||||||
|
}
|
@@ -7,14 +7,15 @@
|
|||||||
# to run it in a oci-container: <https://github.com/barrucadu/nixfiles/blob/master/services/pleroma.nix>
|
# to run it in a oci-container: <https://github.com/barrucadu/nixfiles/blob/master/services/pleroma.nix>
|
||||||
#
|
#
|
||||||
# admin frontend: <https://fed.uninsane.org/pleroma/admin>
|
# admin frontend: <https://fed.uninsane.org/pleroma/admin>
|
||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
logLevel = "warn";
|
logLevel = "warn";
|
||||||
# logLevel = "debug";
|
# logLevel = "debug";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
sane.persist.sys.byStore.plaintext = [
|
sane.persist.sys.byStore.private = [
|
||||||
|
# contains media i've uploaded to the server
|
||||||
{ user = "pleroma"; group = "pleroma"; path = "/var/lib/pleroma"; method = "bind"; }
|
{ user = "pleroma"; group = "pleroma"; path = "/var/lib/pleroma"; method = "bind"; }
|
||||||
];
|
];
|
||||||
services.pleroma.enable = true;
|
services.pleroma.enable = true;
|
||||||
@@ -135,25 +136,52 @@ in
|
|||||||
# something inside pleroma invokes `sh` w/o specifying it by path, so this is needed to allow pleroma to start
|
# something inside pleroma invokes `sh` w/o specifying it by path, so this is needed to allow pleroma to start
|
||||||
pkgs.bash
|
pkgs.bash
|
||||||
# used by Pleroma to strip geo tags from uploads
|
# used by Pleroma to strip geo tags from uploads
|
||||||
pkgs.exiftool
|
config.sane.programs.exiftool.package
|
||||||
# i saw some errors when pleroma was shutting down about it not being able to find `awk`. probably not critical
|
# i saw some errors when pleroma was shutting down about it not being able to find `awk`. probably not critical
|
||||||
pkgs.gawk
|
config.sane.programs.gawk.package
|
||||||
# needed for email operations like password reset
|
# needed for email operations like password reset
|
||||||
pkgs.postfix
|
pkgs.postfix
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.services.pleroma.serviceConfig = {
|
systemd.services.pleroma = {
|
||||||
# postgres can be slow to service early requests, preventing pleroma from starting on the first try
|
# postgres can be slow to service early requests, preventing pleroma from starting on the first try
|
||||||
Restart = "on-failure";
|
serviceConfig.Restart = "on-failure";
|
||||||
RestartSec = "10s";
|
serviceConfig.RestartSec = "10s";
|
||||||
};
|
|
||||||
|
|
||||||
# systemd.services.pleroma.serviceConfig = {
|
# hardening (systemd-analyze security pleroma)
|
||||||
# # required for sendmail. see https://git.pleroma.social/pleroma/pleroma/-/issues/2259
|
# XXX(2024-07-28): this hasn't been rigorously tested:
|
||||||
# NoNewPrivileges = lib.mkForce false;
|
# possible that i've set something too strict and won't notice right away
|
||||||
# PrivateTmp = lib.mkForce false;
|
# make sure to test:
|
||||||
# CapabilityBoundingSet = lib.mkForce "~";
|
# - image/media uploading
|
||||||
# };
|
serviceConfig.CapabilityBoundingSet = "~CAP_SYS_ADMIN"; #< TODO: reduce this. try: CAP_SYS_NICE CAP_DAC_READ_SEARCH CAP_SYS_CHROOT CAP_SETGID CAP_SETUID
|
||||||
|
serviceConfig.LockPersonality = true;
|
||||||
|
serviceConfig.NoNewPrivileges = true;
|
||||||
|
serviceConfig.MemoryDenyWriteExecute = true;
|
||||||
|
serviceConfig.PrivateDevices = lib.mkForce true; #< dunno why nixpkgs has this set false; it seems to work as true
|
||||||
|
serviceConfig.PrivateMounts = true;
|
||||||
|
serviceConfig.PrivateTmp = true;
|
||||||
|
serviceConfig.PrivateUsers = true;
|
||||||
|
|
||||||
|
serviceConfig.ProtectProc = "invisible";
|
||||||
|
serviceConfig.ProcSubset = "all"; #< needs /proc/sys/kernel/overflowuid for bwrap
|
||||||
|
|
||||||
|
serviceConfig.ProtectClock = true;
|
||||||
|
serviceConfig.ProtectControlGroups = true;
|
||||||
|
serviceConfig.ProtectHome = true;
|
||||||
|
serviceConfig.ProtectKernelModules = true;
|
||||||
|
serviceConfig.ProtectSystem = lib.mkForce "strict";
|
||||||
|
serviceConfig.RemoveIPC = true;
|
||||||
|
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6 AF_NETLINK";
|
||||||
|
|
||||||
|
serviceConfig.RestrictSUIDSGID = true;
|
||||||
|
serviceConfig.SystemCallArchitectures = "native";
|
||||||
|
serviceConfig.SystemCallFilter = [ "@system-service" "@mount" "@sandbox" ]; #< "sandbox" might not actually be necessary
|
||||||
|
|
||||||
|
serviceConfig.ProtectHostname = false; #< else brap can't mount /proc
|
||||||
|
serviceConfig.ProtectKernelLogs = false; #< else breaks exiftool ("bwrap: Can't mount proc on /newroot/proc: Operation not permitted")
|
||||||
|
serviceConfig.ProtectKernelTunables = false; #< else breaks exiftool
|
||||||
|
serviceConfig.RestrictNamespaces = false; # media uploads require bwrap
|
||||||
|
};
|
||||||
|
|
||||||
# this is required to allow pleroma to send email.
|
# this is required to allow pleroma to send email.
|
||||||
# raw `sendmail` works, but i think pleroma's passing it some funny flags or something, idk.
|
# raw `sendmail` works, but i think pleroma's passing it some funny flags or something, idk.
|
||||||
|
@@ -6,9 +6,9 @@ let
|
|||||||
KiB = n: 1024*n;
|
KiB = n: 1024*n;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
sane.persist.sys.byStore.plaintext = [
|
sane.persist.sys.byStore.private = [
|
||||||
# TODO: mode?
|
{ user = "postgres"; group = "postgres"; mode = "0750"; path = "/var/lib/postgresql"; method = "bind"; }
|
||||||
{ user = "postgres"; group = "postgres"; path = "/var/lib/postgresql"; method = "bind"; }
|
{ user = "postgres"; group = "postgres"; mode = "0750"; path = "/var/backup/postgresql"; method = "bind"; }
|
||||||
];
|
];
|
||||||
services.postgresql.enable = true;
|
services.postgresql.enable = true;
|
||||||
|
|
||||||
|
@@ -56,47 +56,48 @@ let
|
|||||||
enableDebug = false;
|
enableDebug = false;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
sane.persist.sys.byStore.plaintext = [
|
sane.persist.sys.byStore.private = [
|
||||||
|
# TODO: mode?
|
||||||
{ user = "prosody"; group = "prosody"; path = "/var/lib/prosody"; method = "bind"; }
|
{ user = "prosody"; group = "prosody"; path = "/var/lib/prosody"; method = "bind"; }
|
||||||
];
|
];
|
||||||
sane.ports.ports."5000" = {
|
sane.ports.ports."5000" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-xmpp-prosody-fileshare-proxy65";
|
description = "colin-xmpp-prosody-fileshare-proxy65";
|
||||||
};
|
};
|
||||||
sane.ports.ports."5222" = {
|
sane.ports.ports."5222" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-xmpp-client-to-server";
|
description = "colin-xmpp-client-to-server";
|
||||||
};
|
};
|
||||||
sane.ports.ports."5223" = {
|
sane.ports.ports."5223" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-xmpps-client-to-server"; # XMPP over TLS
|
description = "colin-xmpps-client-to-server"; # XMPP over TLS
|
||||||
};
|
};
|
||||||
sane.ports.ports."5269" = {
|
sane.ports.ports."5269" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
visibleTo.wan = true;
|
visibleTo.doof = true;
|
||||||
description = "colin-xmpp-server-to-server";
|
description = "colin-xmpp-server-to-server";
|
||||||
};
|
};
|
||||||
sane.ports.ports."5270" = {
|
sane.ports.ports."5270" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
visibleTo.wan = true;
|
visibleTo.doof = true;
|
||||||
description = "colin-xmpps-server-to-server"; # XMPP over TLS
|
description = "colin-xmpps-server-to-server"; # XMPP over TLS
|
||||||
};
|
};
|
||||||
sane.ports.ports."5280" = {
|
sane.ports.ports."5280" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-xmpp-bosh";
|
description = "colin-xmpp-bosh";
|
||||||
};
|
};
|
||||||
sane.ports.ports."5281" = {
|
sane.ports.ports."5281" = {
|
||||||
protocol = [ "tcp" ];
|
protocol = [ "tcp" ];
|
||||||
|
visibleTo.doof = true;
|
||||||
visibleTo.lan = true;
|
visibleTo.lan = true;
|
||||||
visibleTo.wan = true;
|
|
||||||
description = "colin-xmpp-prosody-https"; # necessary?
|
description = "colin-xmpp-prosody-https"; # necessary?
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -10,7 +10,9 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
sane.persist.sys.byStore.plaintext = [
|
sane.persist.sys.byStore.ephemeral = [
|
||||||
|
# {data,downloads,incomplete,logs}: contains logs, search history, and downloads
|
||||||
|
# so, move the downloaded data to persistent storage regularly, or configure the downloads/incomplete dirs to point to persisted storage (in nixpkgs slskd config)
|
||||||
{ user = "slskd"; group = "media"; path = "/var/lib/slskd"; method = "bind"; }
|
{ user = "slskd"; group = "media"; path = "/var/lib/slskd"; method = "bind"; }
|
||||||
];
|
];
|
||||||
sops.secrets."slskd_env" = {
|
sops.secrets."slskd_env" = {
|
||||||
@@ -32,7 +34,7 @@
|
|||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://10.0.1.6:5030";
|
proxyPass = "http://${config.sane.netns.ovpns.netnsVethIpv4}:5030";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -68,12 +70,20 @@
|
|||||||
# flags.volatile = true; # store searches and active transfers in RAM (completed transfers still go to disk). rec for btrfs/zfs
|
# flags.volatile = true; # store searches and active transfers in RAM (completed transfers still go to disk). rec for btrfs/zfs
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.slskd.serviceConfig = {
|
systemd.services.slskd = {
|
||||||
# run this behind the OVPN static VPN
|
# run this behind the OVPN static VPN
|
||||||
NetworkNamespacePath = "/run/netns/ovpns";
|
serviceConfig.NetworkNamespacePath = "/run/netns/ovpns";
|
||||||
ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect 185.157.162.178" ]; # abort if public IP is not as expected
|
serviceConfig.ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect ${config.sane.netns.ovpns.netnsPubIpv4}" ]; # abort if public IP is not as expected
|
||||||
|
|
||||||
Restart = lib.mkForce "always"; # exits "success" when it fails to connect to soulseek server
|
serviceConfig.Restart = lib.mkForce "always"; # exits "success" when it fails to connect to soulseek server
|
||||||
RestartSec = "60s";
|
serviceConfig.RestartSec = "60s";
|
||||||
|
|
||||||
|
# hardening (systemd-analyze security slskd)
|
||||||
|
# upstream nixpkgs specifies moderate defaults; these are supplementary
|
||||||
|
# serviceConfig.MemoryDenyWriteExecute = true;
|
||||||
|
# serviceConfig.ProcSubset = "pid";
|
||||||
|
# serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
|
||||||
|
# serviceConfig.SystemCallArchitectures = "native";
|
||||||
|
# serviceConfig.SystemCallFilter = [ "@system-service" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -22,71 +22,23 @@ let
|
|||||||
--replace-fail 'set(TR_USER_AGENT_PREFIX "''${TR_SEMVER}")' 'set(TR_USER_AGENT_PREFIX "3.00")'
|
--replace-fail 'set(TR_USER_AGENT_PREFIX "''${TR_SEMVER}")' 'set(TR_USER_AGENT_PREFIX "3.00")'
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
download-dir = "/var/media/torrents";
|
download-dir = "/var/media/torrents"; #< keep in sync with consts embedded in `torrent-done`
|
||||||
torrent-done = pkgs.writeShellApplication {
|
torrent-done = pkgs.static-nix-shell.mkBash {
|
||||||
name = "torrent-done";
|
pname = "torrent-done";
|
||||||
runtimeInputs = with pkgs; [
|
srcRoot = ./.;
|
||||||
acl
|
pkgs = [
|
||||||
coreutils
|
"acl"
|
||||||
findutils
|
"coreutils"
|
||||||
rsync
|
"findutils"
|
||||||
util-linux
|
"rsync"
|
||||||
];
|
];
|
||||||
text = ''
|
|
||||||
destructive() {
|
|
||||||
if [ -n "''${TR_DRY_RUN-}" ]; then
|
|
||||||
echo "$*"
|
|
||||||
else
|
|
||||||
"$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
if [[ "$TR_TORRENT_DIR" =~ ^.*freeleech.*$ ]]; then
|
|
||||||
# freeleech torrents have no place in my permanent library
|
|
||||||
echo "freeleech: nothing to do"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
if ! [[ "$TR_TORRENT_DIR" =~ ^${download-dir}/.*$ ]]; then
|
|
||||||
echo "unexpected torrent dir, aborting: $TR_TORRENT_DIR"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
REL_DIR="''${TR_TORRENT_DIR#${download-dir}/}"
|
|
||||||
MEDIA_DIR="/var/media/$REL_DIR"
|
|
||||||
|
|
||||||
destructive mkdir -p "$(dirname "$MEDIA_DIR")"
|
|
||||||
destructive rsync -arv "$TR_TORRENT_DIR/" "$MEDIA_DIR/"
|
|
||||||
# make the media rwx by anyone in the group
|
|
||||||
destructive find "$MEDIA_DIR" -type d -exec setfacl --recursive --modify d:g::rwx,o::rx {} \;
|
|
||||||
destructive find "$MEDIA_DIR" -type d -exec chmod g+rw,a+rx {} \;
|
|
||||||
|
|
||||||
# if there's a single directory inside the media dir, then inline that
|
|
||||||
subdirs=("$MEDIA_DIR"/*)
|
|
||||||
if [ ''${#subdirs} -eq 1 ]; then
|
|
||||||
dirname="''${subdirs[0]}"
|
|
||||||
if [ -d "$dirname" ]; then
|
|
||||||
mv "$dirname"/* "$MEDIA_DIR/" && rmdir "$dirname"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# remove noisy files:
|
|
||||||
find "$MEDIA_DIR/" -type f \(\
|
|
||||||
-iname 'www.YTS.*.jpg' \
|
|
||||||
-o -iname 'WWW.YIFY*.COM.jpg' \
|
|
||||||
-o -iname 'YIFY*.com.txt' \
|
|
||||||
-o -iname 'YTS*.com.txt' \
|
|
||||||
\) -exec rm {} \;
|
|
||||||
|
|
||||||
# dedupe the whole media library.
|
|
||||||
# yeah, a bit excessive: move this to a cron job if that's problematic.
|
|
||||||
destructive hardlink /var/media --reflink=always --ignore-time --verbose
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
lib.mkIf false #< TODO: re-enable once confident of sandboxing
|
|
||||||
{
|
{
|
||||||
sane.persist.sys.byStore.plaintext = [
|
sane.persist.sys.byStore.private = [
|
||||||
# TODO: mode? we need this specifically for the stats tracking in .config/
|
# TODO: mode? we need this specifically for the stats tracking in .config/
|
||||||
{ user = "transmission"; group = config.users.users.transmission.group; path = "/var/lib/transmission"; method = "bind"; }
|
{ user = "transmission"; group = config.users.users.transmission.group; path = "/var/lib/transmission"; method = "bind"; }
|
||||||
|
{ user = "transmission"; group = config.users.users.transmission.group; path = "/var/backup/torrents"; method = "bind"; }
|
||||||
];
|
];
|
||||||
users.users.transmission.extraGroups = [ "media" ];
|
users.users.transmission.extraGroups = [ "media" ];
|
||||||
|
|
||||||
@@ -106,8 +58,8 @@ lib.mkIf false #< TODO: re-enable once confident of sandboxing
|
|||||||
# DOCUMENTATION/options list: <https://github.com/transmission/transmission/blob/main/docs/Editing-Configuration-Files.md#options>
|
# DOCUMENTATION/options list: <https://github.com/transmission/transmission/blob/main/docs/Editing-Configuration-Files.md#options>
|
||||||
|
|
||||||
# message-level = 3; #< enable for debug logging. 0-3, default is 2.
|
# message-level = 3; #< enable for debug logging. 0-3, default is 2.
|
||||||
# 10.0.1.6 => allow rpc only from the root servo ns. it'll tunnel things to the net, if need be.
|
# ovpns.netnsVethIpv4 => allow rpc only from the root servo ns. it'll tunnel things to the net, if need be.
|
||||||
rpc-bind-address = "10.0.1.6";
|
rpc-bind-address = config.sane.netns.ovpns.netnsVethIpv4;
|
||||||
#rpc-host-whitelist = "bt.uninsane.org";
|
#rpc-host-whitelist = "bt.uninsane.org";
|
||||||
#rpc-whitelist = "*.*.*.*";
|
#rpc-whitelist = "*.*.*.*";
|
||||||
rpc-authentication-required = true;
|
rpc-authentication-required = true;
|
||||||
@@ -118,7 +70,7 @@ lib.mkIf false #< TODO: re-enable once confident of sandboxing
|
|||||||
rpc-whitelist-enabled = false;
|
rpc-whitelist-enabled = false;
|
||||||
|
|
||||||
# force behind ovpns in case the NetworkNamespace fails somehow
|
# force behind ovpns in case the NetworkNamespace fails somehow
|
||||||
bind-address-ipv4 = "185.157.162.178";
|
bind-address-ipv4 = config.sane.netns.ovpns.netnsPubIpv4;
|
||||||
port-forwarding-enabled = false;
|
port-forwarding-enabled = false;
|
||||||
|
|
||||||
# hopefully, make the downloads world-readable
|
# hopefully, make the downloads world-readable
|
||||||
@@ -155,16 +107,31 @@ lib.mkIf false #< TODO: re-enable once confident of sandboxing
|
|||||||
script-torrent-done-filename = "${torrent-done}/bin/torrent-done";
|
script-torrent-done-filename = "${torrent-done}/bin/torrent-done";
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.transmission.after = [ "wireguard-wg-ovpns.service" ];
|
systemd.services.transmission = {
|
||||||
systemd.services.transmission.partOf = [ "wireguard-wg-ovpns.service" ];
|
after = [ "wireguard-wg-ovpns.service" ];
|
||||||
systemd.services.transmission.serviceConfig = {
|
partOf = [ "wireguard-wg-ovpns.service" ];
|
||||||
|
environment.TR_DEBUG = "1";
|
||||||
# run this behind the OVPN static VPN
|
# run this behind the OVPN static VPN
|
||||||
NetworkNamespacePath = "/run/netns/ovpns";
|
serviceConfig.NetworkNamespacePath = "/run/netns/ovpns";
|
||||||
ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect 185.157.162.178" ]; # abort if public IP is not as expected
|
serviceConfig.ExecStartPre = [ "${lib.getExe pkgs.sane-scripts.ip-check} --no-upnp --expect ${config.sane.netns.ovpns.netnsPubIpv4}" ]; # abort if public IP is not as expected
|
||||||
|
|
||||||
Restart = "on-failure";
|
serviceConfig.Restart = "on-failure";
|
||||||
RestartSec = "30s";
|
serviceConfig.RestartSec = "30s";
|
||||||
BindPaths = [ "/var/media" ]; #< so it can move completed torrents into the media library
|
serviceConfig.BindPaths = [ "/var/media" ]; #< so it can move completed torrents into the media library
|
||||||
|
serviceConfig.SystemCallFilter = lib.mkForce [
|
||||||
|
# the torrent-done script does stuff which fails the nixos default syscall filter.
|
||||||
|
# allow a bunch of stuff, speculatively, to hopefully fix that:
|
||||||
|
"@aio"
|
||||||
|
"@basic-io"
|
||||||
|
"@chown"
|
||||||
|
"@file-system"
|
||||||
|
"@io-event"
|
||||||
|
"@process"
|
||||||
|
"@sandbox"
|
||||||
|
"@sync"
|
||||||
|
"@system-service"
|
||||||
|
"quotactl"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# service to automatically backup torrents i add to transmission
|
# service to automatically backup torrents i add to transmission
|
||||||
@@ -190,7 +157,7 @@ lib.mkIf false #< TODO: re-enable once confident of sandboxing
|
|||||||
# inherit kTLS;
|
# inherit kTLS;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
# proxyPass = "http://ovpns.uninsane.org:9091";
|
# proxyPass = "http://ovpns.uninsane.org:9091";
|
||||||
proxyPass = "http://10.0.1.6:9091";
|
proxyPass = "http://${config.sane.netns.ovpns.netnsVethIpv4}:9091";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
70
hosts/by-name/servo/services/transmission/torrent-done
Executable file
70
hosts/by-name/servo/services/transmission/torrent-done
Executable file
@@ -0,0 +1,70 @@
|
|||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#!nix-shell -i bash -p acl -p bash -p coreutils -p findutils -p rsync
|
||||||
|
|
||||||
|
# transmission invokes this with no args, and the following env vars:
|
||||||
|
# - TR_TORRENT_DIR: full path to the folder i told transmission to download it to.
|
||||||
|
# e.g. /var/media/torrents/Videos/Film/Jason.Bourne-2016
|
||||||
|
# optionally:
|
||||||
|
# - TR_DRY_RUN=1
|
||||||
|
# - TR_DEBUG=1
|
||||||
|
|
||||||
|
DOWNLOAD_DIR=/var/media/torrents
|
||||||
|
|
||||||
|
destructive() {
|
||||||
|
if [ -n "${TR_DRY_RUN-}" ]; then
|
||||||
|
echo "[dry-run] $*"
|
||||||
|
else
|
||||||
|
debug "$@"
|
||||||
|
"$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
debug() {
|
||||||
|
if [ -n "${TR_DEBUG-}" ]; then
|
||||||
|
echo "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "TR_TORRENT_DIR=$TR_TORRENT_DIR torrent-done $*"
|
||||||
|
|
||||||
|
if [[ "$TR_TORRENT_DIR" =~ ^.*freeleech.*$ ]]; then
|
||||||
|
# freeleech torrents have no place in my permanent library
|
||||||
|
echo "freeleech: nothing to do"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if ! [[ "$TR_TORRENT_DIR" =~ ^$DOWNLOAD_DIR/.*$ ]]; then
|
||||||
|
echo "unexpected torrent dir, aborting: $TR_TORRENT_DIR"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
REL_DIR="${TR_TORRENT_DIR#$DOWNLOAD_DIR/}"
|
||||||
|
MEDIA_DIR="/var/media/$REL_DIR"
|
||||||
|
|
||||||
|
destructive mkdir -p "$(dirname "$MEDIA_DIR")"
|
||||||
|
destructive rsync -rlv "$TR_TORRENT_DIR/" "$MEDIA_DIR/"
|
||||||
|
# make the media rwx by anyone in the group
|
||||||
|
destructive find "$MEDIA_DIR" -type d -exec setfacl --recursive --modify d:g::rwx,o::rx {} \;
|
||||||
|
destructive find "$MEDIA_DIR" -type d -exec chmod g+rw,a+rx {} \;
|
||||||
|
destructive find "$MEDIA_DIR" -type f -exec chmod g+rw,a+r {} \;
|
||||||
|
|
||||||
|
# if there's a single directory inside the media dir, then inline that
|
||||||
|
subdirs=("$MEDIA_DIR"/*)
|
||||||
|
debug "top-level items in torrent dir:" "${subdirs[@]}"
|
||||||
|
if [ ${#subdirs[@]} -eq 1 ]; then
|
||||||
|
dirname="${subdirs[0]}"
|
||||||
|
debug "exactly one top-level item, checking if directory: $dirname"
|
||||||
|
if [ -d "$dirname" ]; then
|
||||||
|
destructive mv "$dirname"/* "$MEDIA_DIR/" && destructive rmdir "$dirname"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# remove noisy files:
|
||||||
|
# -iname means "insensitive", but the syntax is NOT regex -- more similar to shell matching
|
||||||
|
destructive find "$MEDIA_DIR/" -type f \(\
|
||||||
|
-iname '*downloaded?from*' \
|
||||||
|
-o -iname 'source.txt' \
|
||||||
|
-o -iname '*upcoming?releases*' \
|
||||||
|
-o -iname 'www.YTS*.jpg' \
|
||||||
|
-o -iname 'WWW.YIFY*.COM.jpg' \
|
||||||
|
-o -iname 'YIFY*.com.txt' \
|
||||||
|
-o -iname 'YTS*.com.txt' \
|
||||||
|
\) -exec rm {} \;
|
@@ -1,162 +0,0 @@
|
|||||||
# TODO: split this file apart into smaller files to make it easier to understand
|
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
dyn-dns = config.sane.services.dyn-dns;
|
|
||||||
nativeAddrs = lib.mapAttrs (_name: builtins.head) config.sane.dns.zones."uninsane.org".inet.A;
|
|
||||||
bindOvpn = "10.0.1.5";
|
|
||||||
bindDoof = "10.0.2.5";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
sane.ports.ports."53" = {
|
|
||||||
protocol = [ "udp" "tcp" ];
|
|
||||||
visibleTo.lan = true;
|
|
||||||
visibleTo.wan = true;
|
|
||||||
visibleTo.ovpns = true;
|
|
||||||
visibleTo.doof = true;
|
|
||||||
description = "colin-dns-hosting";
|
|
||||||
};
|
|
||||||
|
|
||||||
sane.dns.zones."uninsane.org".TTL = 900;
|
|
||||||
|
|
||||||
# SOA record structure: <https://en.wikipedia.org/wiki/SOA_record#Structure>
|
|
||||||
# SOA MNAME RNAME (... rest)
|
|
||||||
# MNAME = Master name server for this zone. this is where update requests should be sent.
|
|
||||||
# RNAME = admin contact (encoded email address)
|
|
||||||
# Serial = YYYYMMDDNN, where N is incremented every time this file changes, to trigger secondary NS to re-fetch it.
|
|
||||||
# Refresh = how frequently secondary NS should query master
|
|
||||||
# Retry = how long secondary NS should wait until re-querying master after a failure (must be < Refresh)
|
|
||||||
# Expire = how long secondary NS should continue to reply to queries after master fails (> Refresh + Retry)
|
|
||||||
sane.dns.zones."uninsane.org".inet = {
|
|
||||||
SOA."@" = ''
|
|
||||||
ns1.uninsane.org. admin-dns.uninsane.org. (
|
|
||||||
2023092101 ; Serial
|
|
||||||
4h ; Refresh
|
|
||||||
30m ; Retry
|
|
||||||
7d ; Expire
|
|
||||||
5m) ; Negative response TTL
|
|
||||||
'';
|
|
||||||
TXT."rev" = "2023092101";
|
|
||||||
|
|
||||||
CNAME."native" = "%CNAMENATIVE%";
|
|
||||||
A."@" = "%ANATIVE%";
|
|
||||||
A."servo.wan" = "%AWAN%";
|
|
||||||
A."servo.lan" = config.sane.hosts.by-name."servo".lan-ip;
|
|
||||||
A."servo.hn" = config.sane.hosts.by-name."servo".wg-home.ip;
|
|
||||||
|
|
||||||
# XXX NS records must also not be CNAME
|
|
||||||
# it's best that we keep this identical, or a superset of, what org. lists as our NS.
|
|
||||||
# so, org. can specify ns2/ns3 as being to the VPN, with no mention of ns1. we provide ns1 here.
|
|
||||||
A."ns1" = "%ANATIVE%";
|
|
||||||
A."ns2" = "185.157.162.178";
|
|
||||||
A."ns3" = "185.157.162.178";
|
|
||||||
A."ovpns" = "185.157.162.178";
|
|
||||||
NS."@" = [
|
|
||||||
"ns1.uninsane.org."
|
|
||||||
"ns2.uninsane.org."
|
|
||||||
"ns3.uninsane.org."
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.trust-dns.settings.zones = [ "uninsane.org" ];
|
|
||||||
|
|
||||||
|
|
||||||
networking.nat.enable = true;
|
|
||||||
networking.nat.extraCommands = ''
|
|
||||||
# redirect incoming DNS requests from LAN addresses
|
|
||||||
# to the LAN-specialized DNS service
|
|
||||||
# N.B.: use the `nixos-*` chains instead of e.g. PREROUTING
|
|
||||||
# because they get cleanly reset across activations or `systemctl restart firewall`
|
|
||||||
# instead of accumulating cruft
|
|
||||||
iptables -t nat -A nixos-nat-pre -p udp --dport 53 \
|
|
||||||
-m iprange --src-range 10.78.76.0-10.78.79.255 \
|
|
||||||
-j DNAT --to-destination :1053
|
|
||||||
iptables -t nat -A nixos-nat-pre -p tcp --dport 53 \
|
|
||||||
-m iprange --src-range 10.78.76.0-10.78.79.255 \
|
|
||||||
-j DNAT --to-destination :1053
|
|
||||||
'';
|
|
||||||
sane.ports.ports."1053" = {
|
|
||||||
# because the NAT above redirects in nixos-nat-pre, LAN requests behave as though they arrived on the external interface at the redirected port.
|
|
||||||
# TODO: try nixos-nat-post instead?
|
|
||||||
# TODO: or, don't NAT from port 53 -> port 1053, but rather nat from LAN addr to a loopback addr.
|
|
||||||
# - this is complicated in that loopback is a different interface than eth0, so rewriting the destination address would cause the packets to just be dropped by the interface
|
|
||||||
protocol = [ "udp" "tcp" ];
|
|
||||||
visibleTo.lan = true;
|
|
||||||
description = "colin-redirected-dns-for-lan-namespace";
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
sane.services.trust-dns.enable = true;
|
|
||||||
sane.services.trust-dns.instances = let
|
|
||||||
mkSubstitutions = flavor: {
|
|
||||||
"%AWAN%" = "$(cat '${dyn-dns.ipPath}')";
|
|
||||||
"%CNAMENATIVE%" = "servo.${flavor}";
|
|
||||||
"%ANATIVE%" = nativeAddrs."servo.${flavor}";
|
|
||||||
"%AOVPNS%" = "185.157.162.178";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
wan = {
|
|
||||||
substitutions = mkSubstitutions "wan";
|
|
||||||
listenAddrsIpv4 = [
|
|
||||||
nativeAddrs."servo.lan"
|
|
||||||
bindOvpn
|
|
||||||
bindDoof
|
|
||||||
];
|
|
||||||
};
|
|
||||||
lan = {
|
|
||||||
substitutions = mkSubstitutions "lan";
|
|
||||||
listenAddrsIpv4 = [ nativeAddrs."servo.lan" ];
|
|
||||||
port = 1053;
|
|
||||||
};
|
|
||||||
hn = {
|
|
||||||
substitutions = mkSubstitutions "hn";
|
|
||||||
listenAddrsIpv4 = [ nativeAddrs."servo.hn" ];
|
|
||||||
port = 1053;
|
|
||||||
};
|
|
||||||
# hn-resolver = {
|
|
||||||
# # don't need %AWAN% here because we forward to the hn instance.
|
|
||||||
# listenAddrsIpv4 = [ nativeAddrs."servo.hn" ];
|
|
||||||
# extraConfig = {
|
|
||||||
# zones = [
|
|
||||||
# {
|
|
||||||
# zone = "uninsane.org";
|
|
||||||
# zone_type = "Forward";
|
|
||||||
# stores = {
|
|
||||||
# type = "forward";
|
|
||||||
# name_servers = [
|
|
||||||
# {
|
|
||||||
# socket_addr = "${nativeAddrs."servo.hn"}:1053";
|
|
||||||
# protocol = "udp";
|
|
||||||
# trust_nx_responses = true;
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# # forward the root zone to the local DNS resolver
|
|
||||||
# zone = ".";
|
|
||||||
# zone_type = "Forward";
|
|
||||||
# stores = {
|
|
||||||
# type = "forward";
|
|
||||||
# name_servers = [
|
|
||||||
# {
|
|
||||||
# socket_addr = "127.0.0.53:53";
|
|
||||||
# protocol = "udp";
|
|
||||||
# trust_nx_responses = true;
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
};
|
|
||||||
|
|
||||||
sane.services.dyn-dns.restartOnChange = [
|
|
||||||
"trust-dns-wan.service"
|
|
||||||
"trust-dns-lan.service"
|
|
||||||
"trust-dns-hn.service"
|
|
||||||
# "trust-dns-hn-resolver.service" # doesn't need restart because it doesn't know about WAN IP
|
|
||||||
];
|
|
||||||
}
|
|
@@ -46,5 +46,6 @@
|
|||||||
# manifests as spurious "No space left on device" when trying to install watches,
|
# manifests as spurious "No space left on device" when trying to install watches,
|
||||||
# e.g. in dyn-dns by `systemctl start dyn-dns-watcher.path`.
|
# e.g. in dyn-dns by `systemctl start dyn-dns-watcher.path`.
|
||||||
# see: <https://askubuntu.com/questions/828779/failed-to-add-run-systemd-ask-password-to-directory-watch-no-space-left-on-dev>
|
# see: <https://askubuntu.com/questions/828779/failed-to-add-run-systemd-ask-password-to-directory-watch-no-space-left-on-dev>
|
||||||
boot.kernel.sysctl."fs.inotify.max_user_watches" = 1048576;
|
boot.kernel.sysctl."fs.inotify.max_user_watches" = 4194304;
|
||||||
|
boot.kernel.sysctl."fs.inotify.max_user_instances" = 4194304;
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,6 @@
|
|||||||
./machine-id.nix
|
./machine-id.nix
|
||||||
./net
|
./net
|
||||||
./nix.nix
|
./nix.nix
|
||||||
./persist.nix
|
|
||||||
./polyunfill.nix
|
./polyunfill.nix
|
||||||
./programs
|
./programs
|
||||||
./quirks.nix
|
./quirks.nix
|
||||||
|
@@ -1,14 +1,11 @@
|
|||||||
# where to find good stuff?
|
# where to find good stuff?
|
||||||
# - universal search/directory: <https://podcastindex.org>
|
# - universal search/directory: <https://podcastindex.org>
|
||||||
|
# - list of lists: <https://en.wikipedia.org/wiki/Category:Lists_of_podcasts>
|
||||||
# - podcasts w/ a community: <https://lemmyverse.net/communities?query=podcast>
|
# - podcasts w/ a community: <https://lemmyverse.net/communities?query=podcast>
|
||||||
# - podcast rec thread: <https://lemmy.ml/post/1565858>
|
# - podcast recs:
|
||||||
|
# - active lemmy: <https://slrpnk.net/c/podcasts>
|
||||||
|
# - old thread: <https://lemmy.ml/post/1565858>
|
||||||
#
|
#
|
||||||
# candidates:
|
|
||||||
# - The Nonlinear Library (podcast): <https://forum.effectivealtruism.org/posts/JTZTBienqWEAjGDRv/listen-to-more-ea-content-with-the-nonlinear-library>
|
|
||||||
# - has ~10 posts per day, text-to-speech; i would need better tagging before adding this
|
|
||||||
# - <https://www.metaculus.com/questions/11102/introducing-the-metaculus-journal-podcast/>
|
|
||||||
# - dead since 2022/10 - 2023/03
|
|
||||||
|
|
||||||
{ lib, sane-data, ... }:
|
{ lib, sane-data, ... }:
|
||||||
let
|
let
|
||||||
hourly = { freq = "hourly"; };
|
hourly = { freq = "hourly"; };
|
||||||
@@ -62,6 +59,7 @@ let
|
|||||||
podcasts = [
|
podcasts = [
|
||||||
(fromDb "acquiredlpbonussecretsecret.libsyn.com" // tech) # ACQ2 - more "Acquired" episodes
|
(fromDb "acquiredlpbonussecretsecret.libsyn.com" // tech) # ACQ2 - more "Acquired" episodes
|
||||||
(fromDb "allinchamathjason.libsyn.com" // pol)
|
(fromDb "allinchamathjason.libsyn.com" // pol)
|
||||||
|
(fromDb "api.oyez.org/podcasts/oral-arguments/2015" // pol) # Supreme Court Oral Arguments ("2015" in URL means nothing -- it's still updated)
|
||||||
(fromDb "anchor.fm/s/34c7232c/podcast/rss" // tech) # Civboot -- https://anchor.fm/civboot
|
(fromDb "anchor.fm/s/34c7232c/podcast/rss" // tech) # Civboot -- https://anchor.fm/civboot
|
||||||
(fromDb "anchor.fm/s/2da69154/podcast/rss" // tech) # POD OF JAKE -- https://podofjake.com/
|
(fromDb "anchor.fm/s/2da69154/podcast/rss" // tech) # POD OF JAKE -- https://podofjake.com/
|
||||||
(fromDb "cast.postmarketos.org" // tech)
|
(fromDb "cast.postmarketos.org" // tech)
|
||||||
@@ -75,15 +73,17 @@ let
|
|||||||
(fromDb "feeds.feedburner.com/radiolab" // pol) # Radiolab -- also available here, but ONLY OVER HTTP: <http://feeds.wnyc.org/radiolab>
|
(fromDb "feeds.feedburner.com/radiolab" // pol) # Radiolab -- also available here, but ONLY OVER HTTP: <http://feeds.wnyc.org/radiolab>
|
||||||
(fromDb "feeds.megaphone.fm/behindthebastards" // pol) # also Maggie Killjoy
|
(fromDb "feeds.megaphone.fm/behindthebastards" // pol) # also Maggie Killjoy
|
||||||
(fromDb "feeds.megaphone.fm/recodedecode" // tech) # The Verge - Decoder
|
(fromDb "feeds.megaphone.fm/recodedecode" // tech) # The Verge - Decoder
|
||||||
(fromDb "feeds.simplecast.com/54nAGcIl" // pol) # The Daily
|
|
||||||
(fromDb "feeds.simplecast.com/82FI35Px" // pol) # Ezra Klein Show
|
(fromDb "feeds.simplecast.com/82FI35Px" // pol) # Ezra Klein Show
|
||||||
(fromDb "feeds.simplecast.com/wgl4xEgL" // rat) # Econ Talk
|
(fromDb "feeds.simplecast.com/wgl4xEgL" // rat) # Econ Talk
|
||||||
(fromDb "feeds.simplecast.com/xKJ93w_w" // uncat) # Atlas Obscura
|
(fromDb "feeds.simplecast.com/xKJ93w_w" // uncat) # Atlas Obscura
|
||||||
(fromDb "feeds.transistor.fm/acquired" // tech)
|
(fromDb "feeds.transistor.fm/acquired" // tech)
|
||||||
|
(fromDb "feeds.transistor.fm/complex-systems-with-patrick-mckenzie-patio11" // tech) # Patrick Mackenzie (from Bits About Money)
|
||||||
|
(fromDb "feeds.twit.tv/floss.xml" // tech)
|
||||||
(fromDb "fulltimenix.com" // tech)
|
(fromDb "fulltimenix.com" // tech)
|
||||||
(fromDb "futureofcoding.org/episodes" // tech)
|
(fromDb "futureofcoding.org/episodes" // tech)
|
||||||
(fromDb "hackerpublicradio.org" // tech)
|
(fromDb "hackerpublicradio.org" // tech)
|
||||||
(fromDb "lexfridman.com/podcast" // rat)
|
(fromDb "lexfridman.com/podcast" // rat)
|
||||||
|
(fromDb "linktr.ee/betteroffline" // pol)
|
||||||
(fromDb "mapspodcast.libsyn.com" // uncat) # Multidisciplinary Association for Psychedelic Studies
|
(fromDb "mapspodcast.libsyn.com" // uncat) # Multidisciplinary Association for Psychedelic Studies
|
||||||
(fromDb "microarch.club" // tech)
|
(fromDb "microarch.club" // tech)
|
||||||
(fromDb "mintcast.org" // tech)
|
(fromDb "mintcast.org" // tech)
|
||||||
@@ -91,8 +91,8 @@ let
|
|||||||
(fromDb "omny.fm/shows/cool-people-who-did-cool-stuff" // pol) # Maggie Killjoy -- referenced by Cory Doctorow
|
(fromDb "omny.fm/shows/cool-people-who-did-cool-stuff" // pol) # Maggie Killjoy -- referenced by Cory Doctorow
|
||||||
(fromDb "omny.fm/shows/money-stuff-the-podcast") # Matt Levine
|
(fromDb "omny.fm/shows/money-stuff-the-podcast") # Matt Levine
|
||||||
(fromDb "omny.fm/shows/the-dollop-with-dave-anthony-and-gareth-reynolds") # The Dollop history/comedy
|
(fromDb "omny.fm/shows/the-dollop-with-dave-anthony-and-gareth-reynolds") # The Dollop history/comedy
|
||||||
|
(fromDb "omny.fm/shows/weird-little-guys") # Cool Zone Media
|
||||||
(fromDb "originstories.libsyn.com" // uncat)
|
(fromDb "originstories.libsyn.com" // uncat)
|
||||||
(fromDb "podcast.posttv.com/itunes/post-reports.xml" // pol)
|
|
||||||
(fromDb "politicalorphanage.libsyn.com" // pol)
|
(fromDb "politicalorphanage.libsyn.com" // pol)
|
||||||
(fromDb "reverseengineering.libsyn.com/rss" // tech) # UnNamed Reverse Engineering Podcast
|
(fromDb "reverseengineering.libsyn.com/rss" // tech) # UnNamed Reverse Engineering Podcast
|
||||||
(fromDb "rss.acast.com/deconstructed") # The Intercept - Deconstructed
|
(fromDb "rss.acast.com/deconstructed") # The Intercept - Deconstructed
|
||||||
@@ -103,6 +103,7 @@ let
|
|||||||
(fromDb "seattlenice.buzzsprout.com" // pol)
|
(fromDb "seattlenice.buzzsprout.com" // pol)
|
||||||
(fromDb "srslywrong.com" // pol)
|
(fromDb "srslywrong.com" // pol)
|
||||||
(fromDb "sharkbytes.transistor.fm" // tech) # Wireshark Podcast o_0
|
(fromDb "sharkbytes.transistor.fm" // tech) # Wireshark Podcast o_0
|
||||||
|
(fromDb "sharptech.fm/feed/podcast" // tech)
|
||||||
(fromDb "sscpodcast.libsyn.com" // rat) # Astral Codex Ten
|
(fromDb "sscpodcast.libsyn.com" // rat) # Astral Codex Ten
|
||||||
(fromDb "talesfromthebridge.buzzsprout.com" // tech) # Sci-Fi? has Peter Watts; author of No Moods, Ads or Cutesy Fucking Icons (rifters.com)
|
(fromDb "talesfromthebridge.buzzsprout.com" // tech) # Sci-Fi? has Peter Watts; author of No Moods, Ads or Cutesy Fucking Icons (rifters.com)
|
||||||
(fromDb "theamphour.com" // tech)
|
(fromDb "theamphour.com" // tech)
|
||||||
@@ -114,7 +115,9 @@ let
|
|||||||
|
|
||||||
# (fromDb "feeds.libsyn.com/421877" // rat) # Less Wrong Curated
|
# (fromDb "feeds.libsyn.com/421877" // rat) # Less Wrong Curated
|
||||||
# (fromDb "feeds.megaphone.fm/hubermanlab" // uncat) # Daniel Huberman on sleep
|
# (fromDb "feeds.megaphone.fm/hubermanlab" // uncat) # Daniel Huberman on sleep
|
||||||
|
# (fromDb "feeds.simplecast.com/54nAGcIl" // pol) # The Daily
|
||||||
# (fromDb "feeds.simplecast.com/l2i9YnTd" // tech // pol) # Hard Fork (NYtimes tech)
|
# (fromDb "feeds.simplecast.com/l2i9YnTd" // tech // pol) # Hard Fork (NYtimes tech)
|
||||||
|
# (fromDb "podcast.posttv.com/itunes/post-reports.xml" // pol)
|
||||||
# (fromDb "podcast.thelinuxexp.com" // tech) # low-brow linux/foss PR announcements
|
# (fromDb "podcast.thelinuxexp.com" // tech) # low-brow linux/foss PR announcements
|
||||||
# (fromDb "rss.art19.com/your-welcome" // pol) # Michael Malice - Your Welcome -- also available here: <https://origin.podcastone.com/podcast?categoryID2=2232>
|
# (fromDb "rss.art19.com/your-welcome" // pol) # Michael Malice - Your Welcome -- also available here: <https://origin.podcastone.com/podcast?categoryID2=2232>
|
||||||
# (fromDb "rss.prod.firstlook.media/deconstructed/podcast.rss" // pol) #< possible URL rot
|
# (fromDb "rss.prod.firstlook.media/deconstructed/podcast.rss" // pol) #< possible URL rot
|
||||||
@@ -135,6 +138,7 @@ let
|
|||||||
(fromDb "artemis.sh" // tech)
|
(fromDb "artemis.sh" // tech)
|
||||||
(fromDb "ascii.textfiles.com" // tech) # Jason Scott
|
(fromDb "ascii.textfiles.com" // tech) # Jason Scott
|
||||||
(fromDb "austinvernon.site" // tech)
|
(fromDb "austinvernon.site" // tech)
|
||||||
|
(fromDb "buttondown.email" // tech)
|
||||||
(fromDb "ben-evans.com/benedictevans" // pol)
|
(fromDb "ben-evans.com/benedictevans" // pol)
|
||||||
(fromDb "bitbashing.io" // tech)
|
(fromDb "bitbashing.io" // tech)
|
||||||
(fromDb "bitsaboutmoney.com" // uncat)
|
(fromDb "bitsaboutmoney.com" // uncat)
|
||||||
@@ -196,6 +200,7 @@ let
|
|||||||
(fromDb "willow.phantoma.online") # wizard@xyzzy.link
|
(fromDb "willow.phantoma.online") # wizard@xyzzy.link
|
||||||
(fromDb "xn--gckvb8fzb.com" // tech)
|
(fromDb "xn--gckvb8fzb.com" // tech)
|
||||||
(fromDb "xorvoid.com" // tech)
|
(fromDb "xorvoid.com" // tech)
|
||||||
|
(fromDb "www.thebignewsletter.com" // pol)
|
||||||
(mkSubstack "astralcodexten" // rat // daily) # Scott Alexander
|
(mkSubstack "astralcodexten" // rat // daily) # Scott Alexander
|
||||||
(mkSubstack "eliqian" // rat // weekly)
|
(mkSubstack "eliqian" // rat // weekly)
|
||||||
(mkSubstack "oversharing" // pol // daily)
|
(mkSubstack "oversharing" // pol // daily)
|
||||||
@@ -238,9 +243,9 @@ let
|
|||||||
(fromDb "youtube.com/@TheB1M")
|
(fromDb "youtube.com/@TheB1M")
|
||||||
(fromDb "youtube.com/@TomScottGo")
|
(fromDb "youtube.com/@TomScottGo")
|
||||||
(fromDb "youtube.com/@Vihart")
|
(fromDb "youtube.com/@Vihart")
|
||||||
(fromDb "youtube.com/@Vox")
|
|
||||||
# (fromDb "youtube.com/@Vsauce") # they're all like 1-minute long videos now? what happened @Vsauce?
|
|
||||||
|
|
||||||
|
# (fromDb "youtube.com/@Vox")
|
||||||
|
# (fromDb "youtube.com/@Vsauce") # they're all like 1-minute long videos now? what happened @Vsauce?
|
||||||
# (fromDb "youtube.com/@rossmanngroup" // pol // tech) # Louis Rossmann
|
# (fromDb "youtube.com/@rossmanngroup" // pol // tech) # Louis Rossmann
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@@ -26,10 +26,6 @@ let
|
|||||||
# lazyMount: defer mounting until first access from userspace.
|
# lazyMount: defer mounting until first access from userspace.
|
||||||
# see: `man systemd.automount`, `man automount`, `man autofs`
|
# see: `man systemd.automount`, `man automount`, `man autofs`
|
||||||
lazyMount = noauto ++ automount;
|
lazyMount = noauto ++ automount;
|
||||||
wg = [
|
|
||||||
"x-systemd.requires=wireguard-wg-home.service"
|
|
||||||
"x-systemd.after=wireguard-wg-home.service"
|
|
||||||
];
|
|
||||||
|
|
||||||
fuse = [
|
fuse = [
|
||||||
"allow_other" # allow users other than the one who mounts it to access it. needed, if systemd is the one mounting this fs (as root)
|
"allow_other" # allow users other than the one who mounts it to access it. needed, if systemd is the one mounting this fs (as root)
|
||||||
@@ -49,7 +45,7 @@ let
|
|||||||
"gid=100"
|
"gid=100"
|
||||||
];
|
];
|
||||||
|
|
||||||
ssh = common ++ fuse ++ [
|
ssh = common ++ fuseColin ++ [
|
||||||
"identityfile=/home/colin/.ssh/id_ed25519"
|
"identityfile=/home/colin/.ssh/id_ed25519"
|
||||||
# i *think* idmap=user means that `colin` on `localhost` and `colin` on the remote are actually treated as the same user, even if their uid/gid differs?
|
# i *think* idmap=user means that `colin` on `localhost` and `colin` on the remote are actually treated as the same user, even if their uid/gid differs?
|
||||||
# i.e., local colin's id is translated to/from remote colin's id on every operation?
|
# i.e., local colin's id is translated to/from remote colin's id on every operation?
|
||||||
@@ -111,66 +107,207 @@ let
|
|||||||
"connect_timeout=20"
|
"connect_timeout=20"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ifSshAuthorized = lib.mkIf config.sane.hosts.by-name."${config.networking.hostName}".ssh.authorized;
|
||||||
|
|
||||||
remoteHome = host: {
|
remoteHome = host: {
|
||||||
sane.programs.sshfs-fuse.enableFor.system = true;
|
sane.programs.sshfs-fuse.enableFor.system = true;
|
||||||
|
system.fsPackages = [
|
||||||
|
config.sane.programs.sshfs-fuse.package
|
||||||
|
];
|
||||||
fileSystems."/mnt/${host}/home" = {
|
fileSystems."/mnt/${host}/home" = {
|
||||||
device = "colin@${host}:/home/colin";
|
device = "sshfs#colin@${host}:/home/colin";
|
||||||
fsType = "fuse.sshfs";
|
fsType = "fuse3";
|
||||||
options = fsOpts.sshColin ++ fsOpts.lazyMount;
|
options = fsOpts.sshColin ++ fsOpts.lazyMount ++ [
|
||||||
|
# drop_privileges: after `mount.fuse3` opens /dev/fuse, it will drop all capabilities before invoking sshfs
|
||||||
|
"drop_privileges"
|
||||||
|
"auto_unmount" #< ensures that when the fs exits, it releases its mountpoint. then systemd can recognize it as failed.
|
||||||
|
];
|
||||||
noCheck = true;
|
noCheck = true;
|
||||||
};
|
};
|
||||||
sane.fs."/mnt/${host}/home" = sane-lib.fs.wanted {
|
sane.fs."/mnt/${host}/home" = {
|
||||||
dir.acl.user = "colin";
|
dir.acl.user = "colin";
|
||||||
dir.acl.group = "users";
|
dir.acl.group = "users";
|
||||||
dir.acl.mode = "0700";
|
dir.acl.mode = "0700";
|
||||||
|
wantedBy = [ "default.target" ];
|
||||||
|
mount.depends = [ "network-online.target" ];
|
||||||
|
mount.mountConfig.ExecSearchPath = [ "/run/current-system/sw/bin" ];
|
||||||
|
mount.mountConfig.User = "colin";
|
||||||
|
mount.mountConfig.AmbientCapabilities = "CAP_SETPCAP CAP_SYS_ADMIN";
|
||||||
|
# hardening (systemd-analyze security mnt-desko-home.mount):
|
||||||
|
# TODO: i can't use ProtectSystem=full here, because i can't create a new mount space; but...
|
||||||
|
# with drop_privileges, i *could* sandbox the actual `sshfs` program using e.g. bwrap
|
||||||
|
mount.mountConfig.CapabilityBoundingSet = "CAP_SETPCAP CAP_SYS_ADMIN";
|
||||||
|
mount.mountConfig.LockPersonality = true;
|
||||||
|
mount.mountConfig.MemoryDenyWriteExecute = true;
|
||||||
|
mount.mountConfig.NoNewPrivileges = true;
|
||||||
|
mount.mountConfig.ProtectClock = true;
|
||||||
|
mount.mountConfig.ProtectHostname = true;
|
||||||
|
mount.mountConfig.RemoveIPC = true;
|
||||||
|
mount.mountConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
|
||||||
|
#VVV this includes anything it reads from, e.g. /bin/sh; /nix/store/...
|
||||||
|
# see `systemd-analyze filesystems` for a full list
|
||||||
|
mount.mountConfig.RestrictFileSystems = "@common-block @basic-api fuse";
|
||||||
|
mount.mountConfig.RestrictRealtime = true;
|
||||||
|
mount.mountConfig.RestrictSUIDSGID = true;
|
||||||
|
mount.mountConfig.SystemCallArchitectures = "native";
|
||||||
|
mount.mountConfig.SystemCallFilter = [
|
||||||
|
"@system-service"
|
||||||
|
"@mount"
|
||||||
|
"~@chown"
|
||||||
|
"~@cpu-emulation"
|
||||||
|
"~@keyring"
|
||||||
|
# could remove almost all io calls, however one has to keep `open`, and `write`, to communicate with the fuse device.
|
||||||
|
# so that's pretty useless as a way to prevent write access
|
||||||
|
];
|
||||||
|
mount.mountConfig.IPAddressDeny = "any";
|
||||||
|
mount.mountConfig.IPAddressAllow = "10.0.0.0/8";
|
||||||
|
mount.mountConfig.DevicePolicy = "closed"; # only allow /dev/{null,zero,full,random,urandom}
|
||||||
|
mount.mountConfig.DeviceAllow = "/dev/fuse";
|
||||||
|
# mount.mountConfig.RestrictNamespaces = true; #< my sshfs sandboxing uses bwrap
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
remoteServo = subdir: {
|
remoteServo = subdir: let
|
||||||
|
localPath = "/mnt/servo/${subdir}";
|
||||||
|
systemdName = utils.escapeSystemdPath localPath;
|
||||||
|
in {
|
||||||
sane.programs.curlftpfs.enableFor.system = true;
|
sane.programs.curlftpfs.enableFor.system = true;
|
||||||
sane.fs."/mnt/servo/${subdir}" = sane-lib.fs.wanted {
|
system.fsPackages = [
|
||||||
|
config.sane.programs.curlftpfs.package
|
||||||
|
];
|
||||||
|
fileSystems."${localPath}" = {
|
||||||
|
device = "curlftpfs#ftp://servo-hn:/${subdir}";
|
||||||
|
noCheck = true;
|
||||||
|
fsType = "fuse3";
|
||||||
|
options = fsOpts.ftp ++ fsOpts.noauto ++ [
|
||||||
|
# drop_privileges: after `mount.fuse3` opens /dev/fuse, it will drop all capabilities before invoking sshfs
|
||||||
|
"drop_privileges"
|
||||||
|
"auto_unmount" #< ensures that when the fs exits, it releases its mountpoint. then systemd can recognize it as failed.
|
||||||
|
];
|
||||||
|
# fsType = "nfs";
|
||||||
|
# options = fsOpts.nfs ++ fsOpts.lazyMount;
|
||||||
|
};
|
||||||
|
sane.fs."${localPath}" = {
|
||||||
dir.acl.user = "colin";
|
dir.acl.user = "colin";
|
||||||
dir.acl.group = "users";
|
dir.acl.group = "users";
|
||||||
dir.acl.mode = "0750";
|
dir.acl.mode = "0750";
|
||||||
};
|
|
||||||
fileSystems."/mnt/servo/${subdir}" = {
|
|
||||||
device = "ftp://servo-hn:/${subdir}";
|
|
||||||
noCheck = true;
|
|
||||||
fsType = "fuse.curlftpfs";
|
|
||||||
options = fsOpts.ftp ++ fsOpts.noauto ++ fsOpts.wg;
|
|
||||||
# fsType = "nfs";
|
|
||||||
# options = fsOpts.nfs ++ fsOpts.lazyMount ++ fsOpts.wg;
|
|
||||||
};
|
|
||||||
systemd.services."automount-servo-${utils.escapeSystemdPath subdir}" = let
|
|
||||||
fs = config.fileSystems."/mnt/servo/${subdir}";
|
|
||||||
in {
|
|
||||||
# this is a *flaky* network mount, especially on moby.
|
|
||||||
# if done as a normal autofs mount, access will eternally block when network is dropped.
|
|
||||||
# notably, this would block *any* sandboxed app which allows media access, whether they actually try to use that media or not.
|
|
||||||
# a practical solution is this: mount as a service -- instead of autofs -- and unmount on timeout error, in a restart loop.
|
|
||||||
# until the ftp handshake succeeds, nothing is actually mounted to the vfs, so this doesn't slow down any I/O when network is down.
|
|
||||||
description = "automount /mnt/servo/${subdir} in a fault-tolerant and non-blocking manner";
|
|
||||||
after = [ "network-online.target" ];
|
|
||||||
requires = [ "network-online.target" ];
|
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
|
mount.depends = [ "network-online.target" "${systemdName}-reachable.service" ];
|
||||||
|
#VVV patch so that when the mount fails, we start a timer to remount it.
|
||||||
|
# and for a disconnection after a good mount (onSuccess), restart the timer to be more aggressive
|
||||||
|
mount.unitConfig.OnFailure = [ "${systemdName}.timer" ];
|
||||||
|
mount.unitConfig.OnSuccess = [ "${systemdName}-restart-timer.target" ];
|
||||||
|
|
||||||
serviceConfig.Type = "simple";
|
mount.mountConfig.TimeoutSec = "10s";
|
||||||
serviceConfig.ExecStart = lib.escapeShellArgs [
|
mount.mountConfig.ExecSearchPath = [ "/run/current-system/sw/bin" ];
|
||||||
"/usr/bin/env"
|
mount.mountConfig.User = "colin";
|
||||||
"PATH=/run/current-system/sw/bin"
|
mount.mountConfig.AmbientCapabilities = "CAP_SETPCAP CAP_SYS_ADMIN";
|
||||||
"mount.${fs.fsType}"
|
# hardening (systemd-analyze security mnt-servo-playground.mount)
|
||||||
"-f" # foreground (i.e. don't daemonize)
|
mount.mountConfig.CapabilityBoundingSet = "CAP_SETPCAP CAP_SYS_ADMIN";
|
||||||
"-s" # single-threaded (TODO: it's probably ok to disable this?)
|
mount.mountConfig.LockPersonality = true;
|
||||||
"-o"
|
mount.mountConfig.MemoryDenyWriteExecute = true;
|
||||||
(lib.concatStringsSep "," (lib.filter (o: !lib.hasPrefix "x-systemd." o) fs.options))
|
mount.mountConfig.NoNewPrivileges = true;
|
||||||
fs.device
|
mount.mountConfig.ProtectClock = true;
|
||||||
"/mnt/servo/${subdir}"
|
mount.mountConfig.ProtectHostname = true;
|
||||||
|
mount.mountConfig.RemoveIPC = true;
|
||||||
|
mount.mountConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
|
||||||
|
#VVV this includes anything it reads from, e.g. /bin/sh; /nix/store/...
|
||||||
|
# see `systemd-analyze filesystems` for a full list
|
||||||
|
mount.mountConfig.RestrictFileSystems = "@common-block @basic-api fuse";
|
||||||
|
mount.mountConfig.RestrictRealtime = true;
|
||||||
|
mount.mountConfig.RestrictSUIDSGID = true;
|
||||||
|
mount.mountConfig.SystemCallArchitectures = "native";
|
||||||
|
mount.mountConfig.SystemCallFilter = [
|
||||||
|
"@system-service"
|
||||||
|
"@mount"
|
||||||
|
"~@chown"
|
||||||
|
"~@cpu-emulation"
|
||||||
|
"~@keyring"
|
||||||
|
# could remove almost all io calls, however one has to keep `open`, and `write`, to communicate with the fuse device.
|
||||||
|
# so that's pretty useless as a way to prevent write access
|
||||||
];
|
];
|
||||||
# not sure if this configures a linear, or exponential backoff.
|
mount.mountConfig.IPAddressDeny = "any";
|
||||||
# but the first restart will be after `RestartSec`, and the n'th restart (n = RestartSteps) will be RestartMaxDelaySec after the n-1'th exit.
|
mount.mountConfig.IPAddressAllow = "10.0.10.5";
|
||||||
serviceConfig.Restart = "always";
|
mount.mountConfig.DevicePolicy = "closed"; # only allow /dev/{null,zero,full,random,urandom}
|
||||||
serviceConfig.RestartSec = "10s";
|
mount.mountConfig.DeviceAllow = "/dev/fuse";
|
||||||
serviceConfig.RestartMaxDelaySec = "120s";
|
# mount.mountConfig.RestrictNamespaces = true;
|
||||||
serviceConfig.RestartSteps = "5";
|
};
|
||||||
|
|
||||||
|
systemd.services."${systemdName}-reachable" = {
|
||||||
|
serviceConfig.ExecSearchPath = [ "/run/current-system/sw/bin" ];
|
||||||
|
serviceConfig.ExecStart = lib.escapeShellArgs [
|
||||||
|
"curlftpfs"
|
||||||
|
"ftp://servo-hn:/${subdir}"
|
||||||
|
"/dev/null"
|
||||||
|
"-o"
|
||||||
|
(lib.concatStringsSep "," ([ "exit_after_connect" ] ++ config.fileSystems."${localPath}".options))
|
||||||
|
];
|
||||||
|
serviceConfig.RemainAfterExit = true;
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
|
unitConfig.BindsTo = [ "${systemdName}.mount" ];
|
||||||
|
# hardening (systemd-analyze security mnt-servo-playground-reachable.service)
|
||||||
|
serviceConfig.AmbientCapabilities = "";
|
||||||
|
serviceConfig.CapabilityBoundingSet = "";
|
||||||
|
serviceConfig.DynamicUser = true;
|
||||||
|
serviceConfig.LockPersonality = true;
|
||||||
|
serviceConfig.MemoryDenyWriteExecute = true;
|
||||||
|
serviceConfig.NoNewPrivileges = true;
|
||||||
|
serviceConfig.PrivateDevices = true;
|
||||||
|
serviceConfig.PrivateMounts = true;
|
||||||
|
serviceConfig.PrivateTmp = true;
|
||||||
|
serviceConfig.PrivateUsers = true;
|
||||||
|
serviceConfig.ProcSubset = "all";
|
||||||
|
serviceConfig.ProtectClock = true;
|
||||||
|
serviceConfig.ProtectControlGroups = true;
|
||||||
|
serviceConfig.ProtectHome = true;
|
||||||
|
serviceConfig.ProtectKernelModules = true;
|
||||||
|
serviceConfig.ProtectProc = "invisible";
|
||||||
|
serviceConfig.ProtectSystem = "strict";
|
||||||
|
serviceConfig.RemoveIPC = true;
|
||||||
|
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
|
||||||
|
# serviceConfig.RestrictFileSystems = "@common-block @basic-api"; #< NOPE
|
||||||
|
serviceConfig.RestrictRealtime = true;
|
||||||
|
serviceConfig.RestrictSUIDSGID = true;
|
||||||
|
serviceConfig.SystemCallArchitectures = "native";
|
||||||
|
serviceConfig.SystemCallFilter = [
|
||||||
|
"@system-service"
|
||||||
|
"@mount"
|
||||||
|
"~@chown"
|
||||||
|
"~@cpu-emulation"
|
||||||
|
"~@keyring"
|
||||||
|
# "~@privileged" #< NOPE
|
||||||
|
"~@resources"
|
||||||
|
# could remove some more probably
|
||||||
|
];
|
||||||
|
serviceConfig.IPAddressDeny = "any";
|
||||||
|
serviceConfig.IPAddressAllow = "10.0.10.5";
|
||||||
|
serviceConfig.DevicePolicy = "closed";
|
||||||
|
# exceptions
|
||||||
|
serviceConfig.ProtectHostname = false;
|
||||||
|
serviceConfig.ProtectKernelLogs = false;
|
||||||
|
serviceConfig.ProtectKernelTunables = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.targets."${systemdName}-restart-timer" = {
|
||||||
|
# hack unit which, when started, stops the timer (if running), and then starts it again.
|
||||||
|
after = [ "${systemdName}.timer" ];
|
||||||
|
conflicts = [ "${systemdName}.timer" ];
|
||||||
|
upholds = [ "${systemdName}.timer" ];
|
||||||
|
unitConfig.StopWhenUnneeded = true;
|
||||||
|
};
|
||||||
|
systemd.timers."${systemdName}" = {
|
||||||
|
timerConfig.Unit = "${systemdName}.mount";
|
||||||
|
timerConfig.AccuracySec = "2s";
|
||||||
|
timerConfig.OnActiveSec = [
|
||||||
|
# try to remount at these timestamps, backing off gradually
|
||||||
|
# there seems to be an implicit mount attempt at t=0.
|
||||||
|
"10s"
|
||||||
|
"30s"
|
||||||
|
"60s"
|
||||||
|
"120s"
|
||||||
|
];
|
||||||
|
# cap the backoff to a fixed interval.
|
||||||
|
timerConfig.OnUnitActiveSec = [ "120s" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
@@ -216,10 +353,11 @@ lib.mkMerge [
|
|||||||
programs.fuse.userAllowOther = true; #< necessary for `allow_other` or `allow_root` options.
|
programs.fuse.userAllowOther = true; #< necessary for `allow_other` or `allow_root` options.
|
||||||
}
|
}
|
||||||
|
|
||||||
(remoteHome "crappy")
|
(ifSshAuthorized (remoteHome "crappy"))
|
||||||
(remoteHome "desko")
|
(ifSshAuthorized (remoteHome "desko"))
|
||||||
(remoteHome "lappy")
|
(ifSshAuthorized (remoteHome "lappy"))
|
||||||
(remoteHome "moby")
|
(ifSshAuthorized (remoteHome "moby"))
|
||||||
|
(ifSshAuthorized (remoteHome "servo"))
|
||||||
# this granularity of servo media mounts is necessary to support sandboxing:
|
# this granularity of servo media mounts is necessary to support sandboxing:
|
||||||
# for flaky mounts, we can only bind the mountpoint itself into the sandbox,
|
# for flaky mounts, we can only bind the mountpoint itself into the sandbox,
|
||||||
# so it's either this or unconditionally bind all of media/.
|
# so it's either this or unconditionally bind all of media/.
|
||||||
|
@@ -1,31 +1,30 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
{
|
{
|
||||||
sane.user.persist.byStore.plaintext = [
|
sane.user.persist.byStore.plaintext = [
|
||||||
"archive"
|
# TODO: some of ~/dev should be private too, but maybe not all 800+ GB of it
|
||||||
|
# perhaps i ought to rethink how it's organized
|
||||||
"dev"
|
"dev"
|
||||||
# TODO: records should be private
|
|
||||||
"records"
|
|
||||||
"ref"
|
"ref"
|
||||||
"tmp"
|
|
||||||
"use"
|
"use"
|
||||||
"Books/local"
|
"Books/local"
|
||||||
"Music"
|
"Music"
|
||||||
|
|
||||||
|
# this is persisted simply to save on RAM. mesa_shader_cache is < 10 MB.
|
||||||
|
# TODO: integrate with sane.programs.sandbox?
|
||||||
|
".cache/mesa_shader_cache"
|
||||||
|
];
|
||||||
|
sane.user.persist.byStore.private = [
|
||||||
|
"archive"
|
||||||
"Pictures/albums"
|
"Pictures/albums"
|
||||||
"Pictures/cat"
|
"Pictures/cat"
|
||||||
"Pictures/from"
|
"Pictures/from"
|
||||||
"Pictures/Screenshots" #< XXX: something is case-sensitive about this?
|
"Pictures/Screenshots" #< XXX: something is case-sensitive about this?
|
||||||
"Pictures/Photos"
|
"Pictures/Photos"
|
||||||
"Videos/local"
|
"records"
|
||||||
|
"tmp"
|
||||||
|
|
||||||
# these are persisted simply to save on RAM.
|
|
||||||
# ~/.cache/nix can become several GB.
|
|
||||||
# mesa_shader_cache is < 10 MB.
|
|
||||||
# TODO: integrate with sane.programs.sandbox?
|
|
||||||
".cache/mesa_shader_cache"
|
|
||||||
".cache/nix"
|
|
||||||
];
|
|
||||||
sane.user.persist.byStore.private = [
|
|
||||||
"knowledge"
|
"knowledge"
|
||||||
|
"Videos/local"
|
||||||
];
|
];
|
||||||
|
|
||||||
# convenience
|
# convenience
|
||||||
@@ -34,7 +33,7 @@
|
|||||||
in {
|
in {
|
||||||
".persist/private" = lib.mkIf persistEnabled { symlink.target = config.sane.persist.stores.private.origin; };
|
".persist/private" = lib.mkIf persistEnabled { symlink.target = config.sane.persist.stores.private.origin; };
|
||||||
".persist/plaintext" = lib.mkIf persistEnabled { symlink.target = config.sane.persist.stores.plaintext.origin; };
|
".persist/plaintext" = lib.mkIf persistEnabled { symlink.target = config.sane.persist.stores.plaintext.origin; };
|
||||||
".persist/ephemeral" = lib.mkIf persistEnabled { symlink.target = config.sane.persist.stores.cryptClearOnBoot.origin; };
|
".persist/ephemeral" = lib.mkIf persistEnabled { symlink.target = config.sane.persist.stores.ephemeral.origin; };
|
||||||
|
|
||||||
"nixos".symlink.target = "dev/nixos";
|
"nixos".symlink.target = "dev/nixos";
|
||||||
|
|
||||||
|
@@ -45,8 +45,8 @@
|
|||||||
sane.ids.pict-rs.gid = 2409;
|
sane.ids.pict-rs.gid = 2409;
|
||||||
sane.ids.sftpgo.uid = 2410;
|
sane.ids.sftpgo.uid = 2410;
|
||||||
sane.ids.sftpgo.gid = 2410;
|
sane.ids.sftpgo.gid = 2410;
|
||||||
sane.ids.trust-dns.uid = 2411;
|
sane.ids.hickory-dns.uid = 2411; #< previously "trust-dns"
|
||||||
sane.ids.trust-dns.gid = 2411;
|
sane.ids.hickory-dns.gid = 2411; #< previously "trust-dns"
|
||||||
sane.ids.export.gid = 2412;
|
sane.ids.export.gid = 2412;
|
||||||
sane.ids.nfsuser.uid = 2413;
|
sane.ids.nfsuser.uid = 2413;
|
||||||
sane.ids.media.gid = 2414;
|
sane.ids.media.gid = 2414;
|
||||||
@@ -62,6 +62,9 @@
|
|||||||
sane.ids.clightning.gid = 2419;
|
sane.ids.clightning.gid = 2419;
|
||||||
sane.ids.nix-serve.uid = 2420;
|
sane.ids.nix-serve.uid = 2420;
|
||||||
sane.ids.nix-serve.gid = 2420;
|
sane.ids.nix-serve.gid = 2420;
|
||||||
|
sane.ids.plugdev.gid = 2421;
|
||||||
|
sane.ids.ollama.uid = 2422;
|
||||||
|
sane.ids.ollama.gid = 2422;
|
||||||
|
|
||||||
sane.ids.colin.uid = 1000;
|
sane.ids.colin.uid = 1000;
|
||||||
sane.ids.guest.uid = 1100;
|
sane.ids.guest.uid = 1100;
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
systemd.network.enable = true;
|
systemd.network.enable = true;
|
||||||
networking.useNetworkd = true;
|
networking.useNetworkd = true;
|
||||||
|
networking.usePredictableInterfaceNames = false; #< set false to get `eth0`, `wlan0`, etc instead of `enp3s0`/etc
|
||||||
|
|
||||||
# view refused/dropped packets with: `sudo journalctl -k`
|
# view refused/dropped packets with: `sudo journalctl -k`
|
||||||
# networking.firewall.logRefusedPackets = true;
|
# networking.firewall.logRefusedPackets = true;
|
||||||
|
@@ -20,19 +20,19 @@
|
|||||||
# - each namespace may use a different /etc/resolv.conf to specify different DNS servers
|
# - each namespace may use a different /etc/resolv.conf to specify different DNS servers
|
||||||
# - nscd breaks namespacing: the host nscd is unaware of the guest's /etc/resolv.conf, and so directs the guest's DNS requests to the host's servers.
|
# - nscd breaks namespacing: the host nscd is unaware of the guest's /etc/resolv.conf, and so directs the guest's DNS requests to the host's servers.
|
||||||
# - this is fixed by either removing `/var/run/nscd/socket` from the namespace, or disabling nscd altogether.
|
# - this is fixed by either removing `/var/run/nscd/socket` from the namespace, or disabling nscd altogether.
|
||||||
{ config, lib, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
lib.mkMerge [
|
lib.mkMerge [
|
||||||
{
|
{
|
||||||
sane.services.trust-dns.enable = lib.mkDefault config.sane.services.trust-dns.asSystemResolver;
|
sane.services.hickory-dns.enable = lib.mkDefault config.sane.services.hickory-dns.asSystemResolver;
|
||||||
sane.services.trust-dns.asSystemResolver = lib.mkDefault true;
|
sane.services.hickory-dns.asSystemResolver = lib.mkDefault true;
|
||||||
}
|
}
|
||||||
(lib.mkIf (!config.sane.services.trust-dns.asSystemResolver) {
|
(lib.mkIf (!config.sane.services.hickory-dns.asSystemResolver) {
|
||||||
# use systemd's stub resolver.
|
# use systemd's stub resolver.
|
||||||
# /etc/resolv.conf isn't sophisticated enough to use different servers per net namespace (or link).
|
# /etc/resolv.conf isn't sophisticated enough to use different servers per net namespace (or link).
|
||||||
# instead, running the stub resolver on a known address in the root ns lets us rewrite packets
|
# instead, running the stub resolver on a known address in the root ns lets us rewrite packets
|
||||||
# in servo's ovnps namespace to use the provider's DNS resolvers.
|
# in servo's ovnps namespace to use the provider's DNS resolvers.
|
||||||
# a weakness is we can only query 1 NS at a time (unless we were to clone the packets?)
|
# a weakness is we can only query 1 NS at a time (unless we were to clone the packets?)
|
||||||
# TODO: improve trust-dns recursive resolver and then remove this
|
# TODO: improve hickory-dns recursive resolver and then remove this
|
||||||
services.resolved.enable = true; #< to disable, set ` = lib.mkForce false`, as other systemd features default to enabling `resolved`.
|
services.resolved.enable = true; #< to disable, set ` = lib.mkForce false`, as other systemd features default to enabling `resolved`.
|
||||||
# without DNSSEC:
|
# without DNSSEC:
|
||||||
# - dig matrix.org => works
|
# - dig matrix.org => works
|
||||||
@@ -40,7 +40,7 @@ lib.mkMerge [
|
|||||||
# with default DNSSEC:
|
# with default DNSSEC:
|
||||||
# - dig matrix.org => works
|
# - dig matrix.org => works
|
||||||
# - curl https://matrix.org => fails
|
# - curl https://matrix.org => fails
|
||||||
# i don't know why. this might somehow be interfering with the DNS run on this device (trust-dns)
|
# i don't know why. this might somehow be interfering with the DNS run on this device (hickory-dns)
|
||||||
services.resolved.dnssec = "false";
|
services.resolved.dnssec = "false";
|
||||||
networking.nameservers = [
|
networking.nameservers = [
|
||||||
# use systemd-resolved resolver
|
# use systemd-resolved resolver
|
||||||
@@ -59,15 +59,35 @@ lib.mkMerge [
|
|||||||
# in the netns and we query upstream DNS more often than needed. hm.
|
# in the netns and we query upstream DNS more often than needed. hm.
|
||||||
# services.nscd.enableNsncd = true;
|
# services.nscd.enableNsncd = true;
|
||||||
|
|
||||||
# disabling nscd LOSES US SOME FUNCTIONALITY. in particular, only the glibc-builtin modules are accessible via /etc/resolv.conf.
|
# disabling nscd LOSES US SOME FUNCTIONALITY. in particular, only the glibc-builtin modules are accessible via /etc/resolv.conf (er, did i mean /etc/nsswitch.conf?).
|
||||||
# - dns: glibc-bultin
|
# - dns: glibc-bultin
|
||||||
# - files: glibc-builtin
|
# - files: glibc-builtin
|
||||||
# - myhostname: systemd
|
# - myhostname: systemd
|
||||||
# - mymachines: systemd
|
# - mymachines: systemd
|
||||||
# - resolve: systemd
|
# - resolve: systemd
|
||||||
# in practice, i see no difference with nscd disabled.
|
# in practice, i see no difference with nscd disabled.
|
||||||
|
# - the exception is when the system dns resolver doesn't do everything.
|
||||||
|
# for example, systemd-resolved does mDNS. hickory-dns does not. a hickory-dns system won't be mDNS-capable.
|
||||||
# disabling nscd VASTLY simplifies netns and process isolation. see explainer at top of file.
|
# disabling nscd VASTLY simplifies netns and process isolation. see explainer at top of file.
|
||||||
services.nscd.enable = false;
|
services.nscd.enable = false;
|
||||||
system.nssModules = lib.mkForce [];
|
# system.nssModules = lib.mkForce [];
|
||||||
|
sane.silencedAssertions = [''.*Loading NSS modules from system.nssModules.*requires services.nscd.enable being set to true.*''];
|
||||||
|
# add NSS modules into their own subdirectory.
|
||||||
|
# then i can add just the NSS modules library path to the global LD_LIBRARY_PATH, rather than ALL of /run/current-system/sw/lib.
|
||||||
|
# TODO: i'm doing this so as to achieve mdns DNS resolution (avahi). it would be better to just have hickory-dns delegate .local to avahi
|
||||||
|
# (except avahi doesn't act as a local resolver over DNS protocol -- only dbus).
|
||||||
|
environment.systemPackages = [(pkgs.symlinkJoin {
|
||||||
|
name = "nss-modules";
|
||||||
|
paths = config.system.nssModules.list;
|
||||||
|
postBuild = ''
|
||||||
|
mkdir nss
|
||||||
|
mv $out/lib/libnss_* nss
|
||||||
|
rm -rf $out
|
||||||
|
mkdir -p $out/lib
|
||||||
|
mv nss $out/lib
|
||||||
|
'';
|
||||||
|
})];
|
||||||
|
environment.variables.LD_LIBRARY_PATH = [ "/run/current-system/sw/lib/nss" ];
|
||||||
|
systemd.globalEnvironment.LD_LIBRARY_PATH = "/run/current-system/sw/lib/nss"; #< specifically for `geoclue.service`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@@ -14,7 +14,6 @@
|
|||||||
# after = [ "polkit.service" ];
|
# after = [ "polkit.service" ];
|
||||||
# requires = [ "polkit.service" ];
|
# requires = [ "polkit.service" ];
|
||||||
wantedBy = [ "network.target" ]; #< default is `multi-user.target`, somehow it doesn't auto-start with that...
|
wantedBy = [ "network.target" ]; #< default is `multi-user.target`, somehow it doesn't auto-start with that...
|
||||||
# path = [ "/run/current-system/sw" ]; #< so it can find `sanebox`
|
|
||||||
|
|
||||||
# serviceConfig.Type = "dbus";
|
# serviceConfig.Type = "dbus";
|
||||||
# serviceConfig.BusName = "org.freedesktop.ModemManager1";
|
# serviceConfig.BusName = "org.freedesktop.ModemManager1";
|
||||||
@@ -38,7 +37,11 @@
|
|||||||
# serviceConfig.RestrictAddressFamilies = "AF_NETLINK AF_UNIX AF_QIPCRTR";
|
# serviceConfig.RestrictAddressFamilies = "AF_NETLINK AF_UNIX AF_QIPCRTR";
|
||||||
# serviceConfig.NoNewPrivileges = true;
|
# serviceConfig.NoNewPrivileges = true;
|
||||||
|
|
||||||
serviceConfig.CapabilityBoundingSet = [ "CAP_NET_ADMIN" ]; #< TODO: make sure this is *really* taking effect, and isn't supplemental to upstream's `CAP_SYS_ADMIN` setting
|
serviceConfig.CapabilityBoundingSet = [
|
||||||
|
"" #< reset upstream capabilities
|
||||||
|
"CAP_NET_ADMIN"
|
||||||
|
"CAP_SYS_ADMIN" #< TODO: remove CAP_SYS_ADMIN!
|
||||||
|
];
|
||||||
serviceConfig.LockPersonality = true;
|
serviceConfig.LockPersonality = true;
|
||||||
# serviceConfig.PrivateUsers = true; #< untried, not likely to work since it needs capabilities
|
# serviceConfig.PrivateUsers = true; #< untried, not likely to work since it needs capabilities
|
||||||
serviceConfig.PrivateTmp = true;
|
serviceConfig.PrivateTmp = true;
|
||||||
|
@@ -2,21 +2,28 @@
|
|||||||
let
|
let
|
||||||
# networkmanager = pkgs.networkmanager;
|
# networkmanager = pkgs.networkmanager;
|
||||||
networkmanager = pkgs.networkmanager.overrideAttrs (upstream: {
|
networkmanager = pkgs.networkmanager.overrideAttrs (upstream: {
|
||||||
src = pkgs.fetchFromGitea {
|
# src = pkgs.fetchFromGitea {
|
||||||
domain = "git.uninsane.org";
|
# domain = "git.uninsane.org";
|
||||||
owner = "colin";
|
# owner = "colin";
|
||||||
repo = "NetworkManager";
|
# repo = "NetworkManager";
|
||||||
# patched to fix polkit permissions (with `nmcli`) when NetworkManager runs as user networkmanager
|
# # patched to fix polkit permissions (with `nmcli`) when NetworkManager runs as user networkmanager
|
||||||
rev = "dev-sane-1.48.0";
|
# rev = "dev-sane-1.48.0";
|
||||||
hash = "sha256-vGmOKtwVItxjYioZJlb1og3K6u9s4rcmDnjAPLBC3ao=";
|
# hash = "sha256-vGmOKtwVItxjYioZJlb1og3K6u9s4rcmDnjAPLBC3ao=";
|
||||||
};
|
# };
|
||||||
# patches = [];
|
patches = (upstream.patches or []) ++ [
|
||||||
|
(pkgs.fetchpatch {
|
||||||
|
name = "polkit: add owner annotations to all actions";
|
||||||
|
url = "https://git.uninsane.org/colin/NetworkManager/commit/a01293861fa24201ffaeb84c07f1c71136c49759.patch";
|
||||||
|
hash = "sha256-th1/M2slo7rjkVBwETZII53Lmhyw8OMS0aT9QYI5Uvk=";
|
||||||
|
})
|
||||||
|
];
|
||||||
});
|
});
|
||||||
# split the package into `daemon` and `nmcli` outputs, because the networkmanager *service*
|
# split the package into `daemon` and `nmcli` outputs, because the networkmanager *service*
|
||||||
# doesn't need `nmcli`/`nmtui` tooling
|
# doesn't need `nmcli`/`nmtui` tooling
|
||||||
networkmanager-split = pkgs.networkmanager-split.override { inherit networkmanager; };
|
networkmanager-split = pkgs.networkmanager-split.override { inherit networkmanager; };
|
||||||
in {
|
in {
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
|
systemd.network.wait-online.enable = false; # systemd-networkd-wait-online.service reliably fails on lappy. docs don't match behavior. shit software.
|
||||||
# plugins mostly add support for establishing different VPN connections.
|
# plugins mostly add support for establishing different VPN connections.
|
||||||
# the default plugin set includes mostly proprietary VPNs:
|
# the default plugin set includes mostly proprietary VPNs:
|
||||||
# - fortisslvpn (Fortinet)
|
# - fortisslvpn (Fortinet)
|
||||||
@@ -59,6 +66,11 @@ in {
|
|||||||
serviceConfig.User = "networkmanager";
|
serviceConfig.User = "networkmanager";
|
||||||
serviceConfig.Group = "networkmanager";
|
serviceConfig.Group = "networkmanager";
|
||||||
serviceConfig.AmbientCapabilities = [
|
serviceConfig.AmbientCapabilities = [
|
||||||
|
"CAP_NET_ADMIN"
|
||||||
|
"CAP_NET_RAW"
|
||||||
|
"CAP_NET_BIND_SERVICE"
|
||||||
|
];
|
||||||
|
serviceConfig.CapabilityBoundingSet = [
|
||||||
# "CAP_DAC_OVERRIDE"
|
# "CAP_DAC_OVERRIDE"
|
||||||
"CAP_NET_ADMIN"
|
"CAP_NET_ADMIN"
|
||||||
"CAP_NET_RAW" #< required, else `libndp: ndp_sock_open: Failed to create ICMP6 socket.`
|
"CAP_NET_RAW" #< required, else `libndp: ndp_sock_open: Failed to create ICMP6 socket.`
|
||||||
@@ -69,6 +81,7 @@ in {
|
|||||||
];
|
];
|
||||||
serviceConfig.LockPersonality = true;
|
serviceConfig.LockPersonality = true;
|
||||||
serviceConfig.NoNewPrivileges = true;
|
serviceConfig.NoNewPrivileges = true;
|
||||||
|
serviceConfig.MemoryDenyWriteExecute = true;
|
||||||
serviceConfig.PrivateDevices = true; # remount /dev with just the basics, syscall filter to block @raw-io
|
serviceConfig.PrivateDevices = true; # remount /dev with just the basics, syscall filter to block @raw-io
|
||||||
serviceConfig.PrivateIPC = true;
|
serviceConfig.PrivateIPC = true;
|
||||||
serviceConfig.PrivateTmp = true;
|
serviceConfig.PrivateTmp = true;
|
||||||
@@ -80,7 +93,10 @@ in {
|
|||||||
serviceConfig.ProtectKernelLogs = true; # disable /proc/kmsg, /dev/kmsg
|
serviceConfig.ProtectKernelLogs = true; # disable /proc/kmsg, /dev/kmsg
|
||||||
serviceConfig.ProtectKernelModules = true; # syscall filter to prevent module calls (probably not upstreamable: NM will want to load modules like `ppp`)
|
serviceConfig.ProtectKernelModules = true; # syscall filter to prevent module calls (probably not upstreamable: NM will want to load modules like `ppp`)
|
||||||
serviceConfig.ProtectKernelTunables = true; # but NM might need to write /proc/sys/net/...
|
serviceConfig.ProtectKernelTunables = true; # but NM might need to write /proc/sys/net/...
|
||||||
|
serviceConfig.ProtectProc = "invisible";
|
||||||
|
serviceConfig.ProcSubset = "pid";
|
||||||
serviceConfig.ProtectSystem = "strict"; # makes read-only: all but /dev, /proc, /sys.
|
serviceConfig.ProtectSystem = "strict"; # makes read-only: all but /dev, /proc, /sys.
|
||||||
|
serviceConfig.RemoveIPC = true;
|
||||||
serviceConfig.RestrictAddressFamilies = [
|
serviceConfig.RestrictAddressFamilies = [
|
||||||
"AF_INET"
|
"AF_INET"
|
||||||
"AF_INET6"
|
"AF_INET6"
|
||||||
@@ -91,19 +107,25 @@ in {
|
|||||||
# AF_BLUETOOTH ?
|
# AF_BLUETOOTH ?
|
||||||
# AF_BRIDGE ?
|
# AF_BRIDGE ?
|
||||||
];
|
];
|
||||||
|
serviceConfig.RestrictNamespaces = true;
|
||||||
serviceConfig.RestrictSUIDSGID = true;
|
serviceConfig.RestrictSUIDSGID = true;
|
||||||
serviceConfig.SystemCallArchitectures = "native"; # prevents e.g. aarch64 syscalls in the event that the kernel is multi-architecture.
|
serviceConfig.SystemCallArchitectures = "native"; # prevents e.g. aarch64 syscalls in the event that the kernel is multi-architecture.
|
||||||
|
serviceConfig.SystemCallFilter = [
|
||||||
|
"@system-service"
|
||||||
|
# TODO: restrict SystemCallFilter more aggressively
|
||||||
|
];
|
||||||
|
# TODO: restrict `DeviceAllow`
|
||||||
# from earlier `landlock` sandboxing, i know it needs these directories:
|
# from earlier `landlock` sandboxing, i know it needs these directories:
|
||||||
# - "/proc/net"
|
# - "/proc/net"
|
||||||
# - "/proc/sys/net"
|
# - "/proc/sys/net"
|
||||||
# - "/run/NetworkManager"
|
# - "/run/NetworkManager"
|
||||||
# - "/run/systemd" # for trust-dns-nmhook
|
# - "/run/systemd" # for hickory-dns-nmhook
|
||||||
# - "/run/udev"
|
# - "/run/udev"
|
||||||
# - # "/run/wg-home.priv"
|
# - # "/run/wg-home.priv"
|
||||||
# - "/sys/class"
|
# - "/sys/class"
|
||||||
# - "/sys/devices"
|
# - "/sys/devices"
|
||||||
# - "/var/lib/NetworkManager"
|
# - "/var/lib/NetworkManager"
|
||||||
# - "/var/lib/trust-dns" #< for trust-dns-nmhook
|
# - "/var/lib/hickory-dns" #< for hickory-dns-nmhook
|
||||||
# - "/run/systemd"
|
# - "/run/systemd"
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -115,7 +137,12 @@ in {
|
|||||||
# fix NetworkManager-dispatcher to actually run as a daemon,
|
# fix NetworkManager-dispatcher to actually run as a daemon,
|
||||||
# and sandbox it a bit
|
# and sandbox it a bit
|
||||||
systemd.services.NetworkManager-dispatcher = {
|
systemd.services.NetworkManager-dispatcher = {
|
||||||
after = [ "trust-dns-localhost.service" ]; #< so that /var/lib/trust-dns will exist
|
#VVV so that /var/lib/hickory-dns will exist (the hook needs to write here).
|
||||||
|
# but this creates a cycle: hickory-dns-localhost > network.target > NetworkManager-dispatcher > hickory-dns-localhost.
|
||||||
|
# (seemingly) impossible to remove the network.target dep on NetworkManager-dispatcher.
|
||||||
|
# beffore would be to have the dispatcher not write hickory-dns files
|
||||||
|
# but rather just its own, and create a .path unit which restarts hickory-dns appropriately.
|
||||||
|
# after = [ "hickory-dns-localhost.service" ];
|
||||||
# serviceConfig.ExecStart = [
|
# serviceConfig.ExecStart = [
|
||||||
# "" # first blank line is to clear the upstream `ExecStart` field.
|
# "" # first blank line is to clear the upstream `ExecStart` field.
|
||||||
# "${cfg.package}/libexec/nm-dispatcher --persist" # --persist is needed for it to actually run as a daemon
|
# "${cfg.package}/libexec/nm-dispatcher --persist" # --persist is needed for it to actually run as a daemon
|
||||||
@@ -123,7 +150,7 @@ in {
|
|||||||
# serviceConfig.Restart = "always";
|
# serviceConfig.Restart = "always";
|
||||||
# serviceConfig.RestartSec = "1s";
|
# serviceConfig.RestartSec = "1s";
|
||||||
|
|
||||||
# serviceConfig.DynamicUser = true; #< not possible, else we lose group perms (so can't write to `trust-dns`'s files in the nm hook)
|
# serviceConfig.DynamicUser = true; #< not possible, else we lose group perms (so can't write to `hickory-dns`'s files in the nm hook)
|
||||||
serviceConfig.User = "networkmanager"; # TODO: should arguably use `DynamicUser`
|
serviceConfig.User = "networkmanager"; # TODO: should arguably use `DynamicUser`
|
||||||
serviceConfig.Group = "networkmanager";
|
serviceConfig.Group = "networkmanager";
|
||||||
serviceConfig.LockPersonality = true;
|
serviceConfig.LockPersonality = true;
|
||||||
@@ -139,7 +166,7 @@ in {
|
|||||||
serviceConfig.ProtectKernelLogs = true; # disable /proc/kmsg, /dev/kmsg
|
serviceConfig.ProtectKernelLogs = true; # disable /proc/kmsg, /dev/kmsg
|
||||||
serviceConfig.ProtectKernelModules = true; # syscall filter to prevent module calls
|
serviceConfig.ProtectKernelModules = true; # syscall filter to prevent module calls
|
||||||
serviceConfig.ProtectKernelTunables = true;
|
serviceConfig.ProtectKernelTunables = true;
|
||||||
serviceConfig.ProtectSystem = "full"; # makes read-only: /boot, /etc/, /usr. `strict` isn't possible due to trust-dns hook
|
serviceConfig.ProtectSystem = "full"; # makes read-only: /boot, /etc/, /usr. `strict` isn't possible due to hickory-dns hook
|
||||||
serviceConfig.RestrictAddressFamilies = [
|
serviceConfig.RestrictAddressFamilies = [
|
||||||
"AF_UNIX" # required, probably for dbus or systemd connectivity
|
"AF_UNIX" # required, probably for dbus or systemd connectivity
|
||||||
];
|
];
|
||||||
@@ -199,9 +226,15 @@ in {
|
|||||||
logging.level = "INFO";
|
logging.level = "INFO";
|
||||||
|
|
||||||
# main.dhcp = "internal"; #< default
|
# main.dhcp = "internal"; #< default
|
||||||
|
# main.dns controls what to do when NM gets a DNS server via DHCP
|
||||||
|
# - "none" (populate /run/NetworkManager/resolv.conf with DHCP settings)
|
||||||
|
# - "internal" (?)
|
||||||
|
# - "systemd-resolved" (tell systemd-resolved about it, and point /run/NetworkManager/resolv.conf -> systemd)
|
||||||
|
# without this, systemd-resolved won't be able to resolve anything (because it has no upstream servers)
|
||||||
|
# note that NM's resolv.conf isn't (necessarily) /etc/resolv.conf -- that is managed by nixos (via symlinking)
|
||||||
main.dns = if config.services.resolved.enable then
|
main.dns = if config.services.resolved.enable then
|
||||||
"systemd-resolved"
|
"systemd-resolved"
|
||||||
else if config.sane.services.trust-dns.enable && config.sane.services.trust-dns.asSystemResolver then
|
else if config.sane.services.hickory-dns.enable && config.sane.services.hickory-dns.asSystemResolver then
|
||||||
"none"
|
"none"
|
||||||
else
|
else
|
||||||
"internal"
|
"internal"
|
||||||
@@ -243,7 +276,7 @@ in {
|
|||||||
users.users.networkmanager = {
|
users.users.networkmanager = {
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
group = "networkmanager";
|
group = "networkmanager";
|
||||||
extraGroups = [ "trust-dns" ];
|
extraGroups = [ "hickory-dns" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# there is, unfortunately, no proper interface by which to plumb wpa_supplicant into the NixOS service, except by overlay.
|
# there is, unfortunately, no proper interface by which to plumb wpa_supplicant into the NixOS service, except by overlay.
|
||||||
|
@@ -1,17 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# store /home/colin/a/b in /mnt/persist/private/a/b instead of /mnt/persist/private/home/colin/a/b
|
|
||||||
sane.persist.stores.private.prefix = "/home/colin";
|
|
||||||
|
|
||||||
sane.persist.sys.byStore.initrd = [
|
|
||||||
"/var/log"
|
|
||||||
];
|
|
||||||
sane.persist.sys.byStore.plaintext = [
|
|
||||||
# TODO: these should be private.. somehow
|
|
||||||
"/var/backup" # for e.g. postgres dumps
|
|
||||||
];
|
|
||||||
sane.persist.sys.byStore.cryptClearOnBoot = [
|
|
||||||
"/var/lib/systemd/coredump"
|
|
||||||
];
|
|
||||||
}
|
|
@@ -1,12 +1,11 @@
|
|||||||
# strictly *decrease* the scope of the default nixos installation/config
|
# strictly *decrease* the scope of the default nixos installation/config
|
||||||
|
|
||||||
{ lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
suidlessPam = pkgs.pam.overrideAttrs (upstream: {
|
suidlessPam = pkgs.pam.overrideAttrs (upstream: {
|
||||||
# nixpkgs' pam hardcodes unix_chkpwd path to the /run/wrappers one,
|
# nixpkgs' pam hardcodes unix_chkpwd path to the /run/wrappers one,
|
||||||
# but i don't want the wrapper, so undo that.
|
# but i don't want the wrapper, so undo that.
|
||||||
# ideally i would patch this via an overlay, but pam is in the bootstrap so that forces a full rebuild.
|
# ideally i would patch this via an overlay, but pam is in the bootstrap so that forces a full rebuild.
|
||||||
# TODO: add a `package` option to the nixos' pam module and substitute it that way.
|
|
||||||
postPatch = (if upstream.postPatch != null then upstream.postPatch else "") + ''
|
postPatch = (if upstream.postPatch != null then upstream.postPatch else "") + ''
|
||||||
substituteInPlace modules/pam_unix/Makefile.am --replace-fail \
|
substituteInPlace modules/pam_unix/Makefile.am --replace-fail \
|
||||||
"/run/wrappers/bin/unix_chkpwd" "$out/bin/unix_chkpwd"
|
"/run/wrappers/bin/unix_chkpwd" "$out/bin/unix_chkpwd"
|
||||||
@@ -39,36 +38,29 @@ in
|
|||||||
]));
|
]));
|
||||||
};
|
};
|
||||||
options.security.pam.services = lib.mkOption {
|
options.security.pam.services = lib.mkOption {
|
||||||
apply = services: let
|
apply = lib.filterAttrs (name: _: !(builtins.elem name [
|
||||||
filtered = lib.filterAttrs (name: _: !(builtins.elem name [
|
# from <repo:nixos/nixpkgs:nixos/modules/security/pam.nix>
|
||||||
# from <repo:nixos/nixpkgs:nixos/modules/security/pam.nix>
|
"i3lock"
|
||||||
"i3lock"
|
"i3lock-color"
|
||||||
"i3lock-color"
|
"vlock"
|
||||||
"vlock"
|
"xlock"
|
||||||
"xlock"
|
"xscreensaver"
|
||||||
"xscreensaver"
|
"runuser"
|
||||||
"runuser"
|
"runuser-l"
|
||||||
"runuser-l"
|
# from ??
|
||||||
# from ??
|
"chfn"
|
||||||
"chfn"
|
"chpasswd"
|
||||||
"chpasswd"
|
"chsh"
|
||||||
"chsh"
|
"groupadd"
|
||||||
"groupadd"
|
"groupdel"
|
||||||
"groupdel"
|
"groupmems"
|
||||||
"groupmems"
|
"groupmod"
|
||||||
"groupmod"
|
"useradd"
|
||||||
"useradd"
|
"userdel"
|
||||||
"userdel"
|
"usermod"
|
||||||
"usermod"
|
# from <repo:nixos/nixpkgs:nixos/modules/system/boot/systemd/user.nix>
|
||||||
# from <repo:nixos/nixpkgs:nixos/modules/system/boot/systemd/user.nix>
|
"systemd-user" #< N.B.: this causes the `systemd --user` service manager to not be started!
|
||||||
"systemd-user" #< N.B.: this causes the `systemd --user` service manager to not be started!
|
]));
|
||||||
])) services;
|
|
||||||
in lib.mapAttrs (_serviceName: service: service // {
|
|
||||||
# replace references with the old pam_unix, which calls into /run/wrappers/bin/unix_chkpwd,
|
|
||||||
# with a pam_unix that calls into unix_chkpwd via the nix store.
|
|
||||||
# TODO: use `security.pam.package` instead once <https://github.com/NixOS/nixpkgs/pull/314791> lands.
|
|
||||||
text = lib.replaceStrings [" pam_unix.so" ] [ " ${suidlessPam}/lib/security/pam_unix.so" ] service.text;
|
|
||||||
}) filtered;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
options.environment.systemPackages = lib.mkOption {
|
options.environment.systemPackages = lib.mkOption {
|
||||||
@@ -111,7 +103,11 @@ in
|
|||||||
# pkgs.which
|
# pkgs.which
|
||||||
# pkgs.zstd
|
# pkgs.zstd
|
||||||
];
|
];
|
||||||
in lib.filter (p: ! builtins.elem p requiredPackages);
|
conveniencePackages = [
|
||||||
|
config.boot.kernelPackages.cpupower # <repo:nixos/nixpkgs:nixos/modules/tasks/cpu-freq.nix> places it on PATH for convenience if powerManagement.cpuFreqGovernor is set
|
||||||
|
pkgs.kbd # <repo:nixos/nixpkgs:nixos/modules/config/console.nix> places it on PATH as part of console/virtual TTYs, but probably not needed unless you want to set console fonts
|
||||||
|
];
|
||||||
|
in lib.filter (p: ! builtins.elem p (requiredPackages ++ conveniencePackages));
|
||||||
};
|
};
|
||||||
|
|
||||||
options.system.fsPackages = lib.mkOption {
|
options.system.fsPackages = lib.mkOption {
|
||||||
@@ -212,5 +208,16 @@ in
|
|||||||
|
|
||||||
# see: <repo:nixos/nixpkgs:nixos/modules/virtualisation/nixos-containers.nix>
|
# see: <repo:nixos/nixpkgs:nixos/modules/virtualisation/nixos-containers.nix>
|
||||||
boot.enableContainers = lib.mkDefault false;
|
boot.enableContainers = lib.mkDefault false;
|
||||||
|
|
||||||
|
# see: <repo:nixos/nixpkgs:nixos/modules/tasks/lvm.nix>
|
||||||
|
# lvm places `pkgs.lvm2` onto PATH, which has like 100 binaries.
|
||||||
|
# it is, actually, needed for some userspace tools (cryptsetup). probably just the udev rules. try to reduce this set?
|
||||||
|
services.lvm.enable = lib.mkDefault false;
|
||||||
|
services.udev.packages = [ pkgs.lvm2.out ]; #< N.B. `lvm2.out` != `lvm2`
|
||||||
|
# systemd.packages = [ pkgs.lvm2 ];
|
||||||
|
# systemd.tmpfiles.packages = [ pkgs.lvm2.out ];
|
||||||
|
# environment.systemPackages = [ pkgs.lvm2 ];
|
||||||
|
|
||||||
|
security.pam.package = suidlessPam;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -38,7 +38,9 @@ in
|
|||||||
"bridge-utils" # for brctl; debug linux "bridge" inet devices
|
"bridge-utils" # for brctl; debug linux "bridge" inet devices
|
||||||
"btrfs-progs"
|
"btrfs-progs"
|
||||||
"cacert.unbundled" # some services require unbundled /etc/ssl/certs
|
"cacert.unbundled" # some services require unbundled /etc/ssl/certs
|
||||||
|
"captree"
|
||||||
"cryptsetup"
|
"cryptsetup"
|
||||||
|
"curl"
|
||||||
"ddrescue"
|
"ddrescue"
|
||||||
"dig"
|
"dig"
|
||||||
"dtc" # device tree [de]compiler
|
"dtc" # device tree [de]compiler
|
||||||
@@ -46,6 +48,7 @@ in
|
|||||||
"efibootmgr"
|
"efibootmgr"
|
||||||
"errno"
|
"errno"
|
||||||
"ethtool"
|
"ethtool"
|
||||||
|
"evtest"
|
||||||
"fatresize"
|
"fatresize"
|
||||||
"fd"
|
"fd"
|
||||||
"file"
|
"file"
|
||||||
@@ -57,6 +60,7 @@ in
|
|||||||
"git"
|
"git"
|
||||||
"gptfdisk" # gdisk
|
"gptfdisk" # gdisk
|
||||||
"hdparm"
|
"hdparm"
|
||||||
|
"hping"
|
||||||
"htop"
|
"htop"
|
||||||
"iftop"
|
"iftop"
|
||||||
"inetutils" # for telnet
|
"inetutils" # for telnet
|
||||||
@@ -67,7 +71,7 @@ in
|
|||||||
"killall"
|
"killall"
|
||||||
"less"
|
"less"
|
||||||
"lftp"
|
"lftp"
|
||||||
# "libcap_ng" # for `netcap`
|
"libcap_ng" # for `netcap`, `pscap`, `captest`
|
||||||
"lsof"
|
"lsof"
|
||||||
"man-pages"
|
"man-pages"
|
||||||
"man-pages-posix"
|
"man-pages-posix"
|
||||||
@@ -78,6 +82,7 @@ in
|
|||||||
"neovim"
|
"neovim"
|
||||||
"netcat"
|
"netcat"
|
||||||
"nethogs"
|
"nethogs"
|
||||||
|
"nix"
|
||||||
"nmap"
|
"nmap"
|
||||||
"nmcli"
|
"nmcli"
|
||||||
"nvme-cli" # nvme
|
"nvme-cli" # nvme
|
||||||
@@ -106,9 +111,6 @@ in
|
|||||||
# "zfs" # doesn't cross-compile (requires samba)
|
# "zfs" # doesn't cross-compile (requires samba)
|
||||||
];
|
];
|
||||||
sysadminExtraUtils = declPackageSet [
|
sysadminExtraUtils = declPackageSet [
|
||||||
"backblaze-b2"
|
|
||||||
"duplicity"
|
|
||||||
"sane-scripts.backup"
|
|
||||||
"sqlite" # to debug sqlite3 databases
|
"sqlite" # to debug sqlite3 databases
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -124,6 +126,7 @@ in
|
|||||||
# "dmidecode"
|
# "dmidecode"
|
||||||
"dtrx" # `unar` alternative, "Do The Right eXtraction"
|
"dtrx" # `unar` alternative, "Do The Right eXtraction"
|
||||||
# "efivar"
|
# "efivar"
|
||||||
|
"exiftool"
|
||||||
"eza" # a better 'ls'
|
"eza" # a better 'ls'
|
||||||
# "flashrom"
|
# "flashrom"
|
||||||
"git" # needed as a user package, for config.
|
"git" # needed as a user package, for config.
|
||||||
@@ -151,11 +154,16 @@ in
|
|||||||
# "ponymix"
|
# "ponymix"
|
||||||
"pulsemixer"
|
"pulsemixer"
|
||||||
"python3-repl"
|
"python3-repl"
|
||||||
# "python3Packages.eyeD3" # music tagging
|
# "python3.pkgs.eyeD3" # music tagging
|
||||||
"ripgrep" # needed as a user package so that its user-level config file can be installed
|
"ripgrep" # needed as a user package so that its user-level config file can be installed
|
||||||
"rsync"
|
"rsync"
|
||||||
|
# "rsyslog" # KEEP THIS HERE if you want persistent logging (TODO: port to systemd, store in /var/log/...)
|
||||||
|
"sane-deadlines"
|
||||||
"sane-scripts.bittorrent"
|
"sane-scripts.bittorrent"
|
||||||
"sane-scripts.cli"
|
"sane-scripts.cli"
|
||||||
|
"sane-secrets-unlock"
|
||||||
|
"sane-sysload"
|
||||||
|
"sc-im"
|
||||||
# "snapper"
|
# "snapper"
|
||||||
"sops" # for manually viewing secrets; outside `sane-secrets` (TODO: improve sane-secrets!)
|
"sops" # for manually viewing secrets; outside `sane-secrets` (TODO: improve sane-secrets!)
|
||||||
"speedtest-cli"
|
"speedtest-cli"
|
||||||
@@ -175,8 +183,12 @@ in
|
|||||||
# "gh" # MS GitHub cli
|
# "gh" # MS GitHub cli
|
||||||
"nix-index"
|
"nix-index"
|
||||||
"nixpkgs-review"
|
"nixpkgs-review"
|
||||||
|
"qmk-udev-rules"
|
||||||
"sane-scripts.dev"
|
"sane-scripts.dev"
|
||||||
"sequoia"
|
"sequoia"
|
||||||
|
# "via"
|
||||||
|
"wally-cli"
|
||||||
|
# "zsa-udev-rules"
|
||||||
];
|
];
|
||||||
|
|
||||||
consoleMediaUtils = declPackageSet [
|
consoleMediaUtils = declPackageSet [
|
||||||
@@ -270,45 +282,44 @@ in
|
|||||||
# "emote"
|
# "emote"
|
||||||
# "evince" # PDF viewer
|
# "evince" # PDF viewer
|
||||||
# "flare-signal" # gtk4 signal client
|
# "flare-signal" # gtk4 signal client
|
||||||
# "foliate" # e-book reader
|
|
||||||
"fractal" # matrix client
|
"fractal" # matrix client
|
||||||
"g4music" # local music player
|
"g4music" # local music player
|
||||||
# "gnome.cheese"
|
# "gnome.cheese"
|
||||||
# "gnome-feeds" # RSS reader (with claimed mobile support)
|
# "gnome-feeds" # RSS reader (with claimed mobile support)
|
||||||
# "gnome.file-roller"
|
# "gnome.file-roller"
|
||||||
"gnome.geary" # adaptive e-mail client; uses webkitgtk 4.1
|
"geary" # adaptive e-mail client; uses webkitgtk 4.1
|
||||||
"gnome.gnome-calculator"
|
"gnome-calculator"
|
||||||
"gnome.gnome-calendar"
|
"gnome-calendar"
|
||||||
"gnome.gnome-clocks"
|
"gnome.gnome-clocks"
|
||||||
"gnome.gnome-maps"
|
"gnome.gnome-maps"
|
||||||
# "gnome-podcasts"
|
# "gnome-podcasts"
|
||||||
# "gnome.gnome-system-monitor"
|
# "gnome.gnome-system-monitor"
|
||||||
# "gnome.gnome-terminal" # works on phosh
|
# "gnome.gnome-terminal" # works on phosh
|
||||||
"gnome.gnome-weather"
|
"gnome.gnome-weather"
|
||||||
# "gnome.seahorse" # keyring/secret manager
|
# "seahorse" # keyring/secret manager
|
||||||
"gnome-frog" # OCR/QR decoder
|
"gnome-frog" # OCR/QR decoder
|
||||||
"gpodder"
|
"gpodder"
|
||||||
"gst-device-monitor" # for debugging audio/video
|
# "gst-device-monitor" # for debugging audio/video
|
||||||
# "gthumb"
|
# "gthumb"
|
||||||
# "lemoa" # lemmy app
|
# "lemoa" # lemmy app
|
||||||
"libcamera" # for `cam` binary (useful for debugging cameras)
|
# "libcamera" # for `cam` binary (useful for debugging cameras)
|
||||||
"libnotify" # for notify-send; debugging
|
"libnotify" # for notify-send; debugging
|
||||||
# "lollypop"
|
# "lollypop"
|
||||||
"loupe" # image viewer
|
"loupe" # image viewer
|
||||||
"mate.engrampa" # archive manager
|
"mate.engrampa" # archive manager
|
||||||
"mepo" # maps viewer
|
"mepo" # maps viewer
|
||||||
"mesa-demos" # for eglinfo, glxinfo & other testing tools
|
# "mesa-demos" # for eglinfo, glxinfo & other testing tools
|
||||||
"mpv"
|
"mpv"
|
||||||
"networkmanagerapplet" # for nm-connection-editor: it's better than not having any gui!
|
"networkmanagerapplet" # for nm-connection-editor: it's better than not having any gui!
|
||||||
"ntfy-sh" # notification service
|
"ntfy-sh" # notification service
|
||||||
# "newsflash" # RSS viewer
|
"newsflash" # RSS viewer
|
||||||
"pavucontrol"
|
"pavucontrol"
|
||||||
"pwvucontrol" # pipewire version of pavu
|
"pwvucontrol" # pipewire version of pavu
|
||||||
# "picard" # music tagging
|
# "picard" # music tagging
|
||||||
# "libsForQt5.plasmatube" # Youtube player
|
# "libsForQt5.plasmatube" # Youtube player
|
||||||
"signal-desktop"
|
"signal-desktop"
|
||||||
"snapshot" # camera app
|
# "snapshot" # camera app
|
||||||
"spot" # Gnome Spotify client
|
# "spot" # Gnome Spotify client
|
||||||
# "sublime-music"
|
# "sublime-music"
|
||||||
# "tdesktop" # broken on phosh
|
# "tdesktop" # broken on phosh
|
||||||
# "tokodon"
|
# "tokodon"
|
||||||
@@ -316,17 +327,20 @@ in
|
|||||||
"vulkan-tools" # vulkaninfo
|
"vulkan-tools" # vulkaninfo
|
||||||
# "whalebird" # pleroma client (Electron). input is broken on phosh.
|
# "whalebird" # pleroma client (Electron). input is broken on phosh.
|
||||||
"xdg-terminal-exec"
|
"xdg-terminal-exec"
|
||||||
|
"youtube-tui"
|
||||||
"zathura" # PDF/CBZ/ePUB viewer
|
"zathura" # PDF/CBZ/ePUB viewer
|
||||||
];
|
];
|
||||||
|
|
||||||
handheldGuiApps = declPackageSet [
|
handheldGuiApps = declPackageSet [
|
||||||
# "celluloid" # mpv frontend
|
# "celluloid" # mpv frontend
|
||||||
# "chatty" # matrix/xmpp/irc client (2023/12/29: disabled because broken cross build)
|
# "chatty" # matrix/xmpp/irc client (2023/12/29: disabled because broken cross build)
|
||||||
"cozy" # audiobook player
|
# "cozy" # audiobook player
|
||||||
"epiphany" # gnome's web browser
|
"epiphany" # gnome's web browser
|
||||||
|
"foliate" # e-book reader
|
||||||
# "iotas" # note taking app
|
# "iotas" # note taking app
|
||||||
"komikku"
|
"komikku"
|
||||||
"koreader"
|
"koreader"
|
||||||
|
"lgtrombetta-compass"
|
||||||
"megapixels" # camera app
|
"megapixels" # camera app
|
||||||
"notejot" # note taking, e.g. shopping list
|
"notejot" # note taking, e.g. shopping list
|
||||||
"planify" # todo-tracker/planner
|
"planify" # todo-tracker/planner
|
||||||
@@ -348,7 +362,7 @@ in
|
|||||||
# "chromium" # chromium takes hours to build. brave is chromium-based, distributed in binary form, so prefer it.
|
# "chromium" # chromium takes hours to build. brave is chromium-based, distributed in binary form, so prefer it.
|
||||||
# "cups"
|
# "cups"
|
||||||
"discord" # x86-only
|
"discord" # x86-only
|
||||||
"electrum"
|
# "electrum"
|
||||||
"element-desktop"
|
"element-desktop"
|
||||||
"firefox"
|
"firefox"
|
||||||
"font-manager"
|
"font-manager"
|
||||||
@@ -356,13 +370,14 @@ in
|
|||||||
"gimp" # broken on phosh
|
"gimp" # broken on phosh
|
||||||
# "gnome.dconf-editor"
|
# "gnome.dconf-editor"
|
||||||
# "gnome.file-roller"
|
# "gnome.file-roller"
|
||||||
"gnome.gnome-disk-utility"
|
"gnome-disk-utility"
|
||||||
"gnome.nautilus" # file browser
|
"nautilus" # file browser
|
||||||
# "gnome.totem" # video player, supposedly supports UPnP
|
# "gnome.totem" # video player, supposedly supports UPnP
|
||||||
# "handbrake" #< TODO: fix build
|
# "handbrake" #< TODO: fix build
|
||||||
"inkscape"
|
"inkscape"
|
||||||
# "jellyfin-media-player"
|
# "jellyfin-media-player"
|
||||||
"kdenlive"
|
"kdenlive"
|
||||||
|
# "keymapp"
|
||||||
# "kid3" # audio tagging
|
# "kid3" # audio tagging
|
||||||
"krita"
|
"krita"
|
||||||
"libreoffice" # TODO: replace with an office suite that uses saner packaging?
|
"libreoffice" # TODO: replace with an office suite that uses saner packaging?
|
||||||
@@ -371,13 +386,13 @@ in
|
|||||||
# "monero-gui" # x86-only
|
# "monero-gui" # x86-only
|
||||||
# "mumble"
|
# "mumble"
|
||||||
# "nheko" # Matrix chat client
|
# "nheko" # Matrix chat client
|
||||||
# "nicotine-plus" # soulseek client. before re-enabling this make sure it's properly sandboxed!
|
"nicotine-plus" # soulseek client
|
||||||
# "obsidian"
|
# "obsidian"
|
||||||
# "openscad" # 3d modeling
|
# "openscad" # 3d modeling
|
||||||
# "rhythmbox" # local music player
|
# "rhythmbox" # local music player
|
||||||
# "slic3r"
|
# "slic3r"
|
||||||
"soundconverter"
|
"soundconverter"
|
||||||
"spotify" # x86-only
|
# "spotify" # x86-only
|
||||||
"tor-browser" # x86-only
|
"tor-browser" # x86-only
|
||||||
# "vlc"
|
# "vlc"
|
||||||
"wireshark" # could maybe ship the cli as sysadmin pkg
|
"wireshark" # could maybe ship the cli as sysadmin pkg
|
||||||
@@ -416,12 +431,17 @@ in
|
|||||||
btrfs-progs.sandbox.method = "bwrap"; #< bwrap, landlock: both work
|
btrfs-progs.sandbox.method = "bwrap"; #< bwrap, landlock: both work
|
||||||
btrfs-progs.sandbox.autodetectCliPaths = "existing"; # e.g. `btrfs filesystem df /my/fs`
|
btrfs-progs.sandbox.autodetectCliPaths = "existing"; # e.g. `btrfs filesystem df /my/fs`
|
||||||
|
|
||||||
"cacert.unbundled".sandbox.enable = false;
|
"cacert.unbundled".sandbox.enable = false; #< data only
|
||||||
|
|
||||||
cargo.persist.byStore.plaintext = [ ".cargo" ];
|
cargo.persist.byStore.plaintext = [ ".cargo" ];
|
||||||
|
|
||||||
clang = {};
|
clang = {};
|
||||||
|
|
||||||
|
clightning-sane.sandbox.method = "bwrap";
|
||||||
|
clightning-sane.sandbox.extraPaths = [
|
||||||
|
"/var/lib/clightning/bitcoin/lightning-rpc"
|
||||||
|
];
|
||||||
|
|
||||||
# cryptsetup: typical use is `cryptsetup open /dev/loopxyz mappedName`, and creates `/dev/mapper/mappedName`
|
# cryptsetup: typical use is `cryptsetup open /dev/loopxyz mappedName`, and creates `/dev/mapper/mappedName`
|
||||||
cryptsetup.sandbox.method = "landlock";
|
cryptsetup.sandbox.method = "landlock";
|
||||||
cryptsetup.sandbox.extraPaths = [
|
cryptsetup.sandbox.extraPaths = [
|
||||||
@@ -491,7 +511,7 @@ in
|
|||||||
electrum.sandbox.method = "bwrap"; # TODO:sandbox: untested
|
electrum.sandbox.method = "bwrap"; # TODO:sandbox: untested
|
||||||
electrum.sandbox.net = "all"; # TODO: probably want to make this run behind a VPN, always
|
electrum.sandbox.net = "all"; # TODO: probably want to make this run behind a VPN, always
|
||||||
electrum.sandbox.whitelistWayland = true;
|
electrum.sandbox.whitelistWayland = true;
|
||||||
electrum.persist.byStore.cryptClearOnBoot = [ ".electrum" ]; #< TODO: use XDG dirs!
|
electrum.persist.byStore.ephemeral = [ ".electrum" ]; #< TODO: use XDG dirs!
|
||||||
|
|
||||||
endless-sky.buildCost = 1;
|
endless-sky.buildCost = 1;
|
||||||
endless-sky.persist.byStore.plaintext = [ ".local/share/endless-sky" ];
|
endless-sky.persist.byStore.plaintext = [ ".local/share/endless-sky" ];
|
||||||
@@ -508,9 +528,17 @@ in
|
|||||||
ethtool.sandbox.method = "landlock";
|
ethtool.sandbox.method = "landlock";
|
||||||
ethtool.sandbox.capabilities = [ "net_admin" ];
|
ethtool.sandbox.capabilities = [ "net_admin" ];
|
||||||
|
|
||||||
|
evtest.sandbox.method = "bwrap";
|
||||||
|
evtest.sandbox.autodetectCliPaths = "existingFile"; # `evtest /dev/foo` to monitor events for a specific device
|
||||||
|
evtest.sandbox.extraPaths = [
|
||||||
|
"/dev/input"
|
||||||
|
];
|
||||||
|
|
||||||
# eza `ls` replacement
|
# eza `ls` replacement
|
||||||
# eza.sandbox.method = "landlock";
|
# bwrap causes `/proc` files to be listed differently (e.g. `eza /proc/sys/net/ipv6/conf/`)
|
||||||
eza.sandbox.method = "bwrap"; #< note that bwrap causes `/proc` files to be listed differently (e.g. `eza /proc/sys/net/ipv6/conf/`)
|
# bwrap loses group info (so files owned by other users appear as owner "nobody")
|
||||||
|
eza.sandbox.method = "landlock";
|
||||||
|
# eza.sandbox.method = "bwrap";
|
||||||
eza.sandbox.autodetectCliPaths = "existing";
|
eza.sandbox.autodetectCliPaths = "existing";
|
||||||
eza.sandbox.whitelistPwd = true;
|
eza.sandbox.whitelistPwd = true;
|
||||||
eza.sandbox.extraHomePaths = [
|
eza.sandbox.extraHomePaths = [
|
||||||
@@ -574,10 +602,6 @@ in
|
|||||||
gawk.sandbox.wrapperType = "inplace"; # /share/gawk libraries refer to /libexec
|
gawk.sandbox.wrapperType = "inplace"; # /share/gawk libraries refer to /libexec
|
||||||
gawk.sandbox.autodetectCliPaths = "existingFile";
|
gawk.sandbox.autodetectCliPaths = "existingFile";
|
||||||
|
|
||||||
gdb.sandbox.enable = false; # gdb doesn't sandbox well. i don't know how you could.
|
|
||||||
# gdb.sandbox.method = "landlock"; # permission denied when trying to attach, even as root
|
|
||||||
gdb.sandbox.autodetectCliPaths = true;
|
|
||||||
|
|
||||||
geoclue2-with-demo-agent = {};
|
geoclue2-with-demo-agent = {};
|
||||||
|
|
||||||
# MS GitHub stores auth token in .config
|
# MS GitHub stores auth token in .config
|
||||||
@@ -604,32 +628,39 @@ in
|
|||||||
"/tmp" # "Cannot open display:" if it can't mount /tmp 👀
|
"/tmp" # "Cannot open display:" if it can't mount /tmp 👀
|
||||||
];
|
];
|
||||||
|
|
||||||
"gnome.gnome-calculator".buildCost = 1;
|
gitea = {};
|
||||||
"gnome.gnome-calculator".sandbox.method = "bwrap";
|
|
||||||
"gnome.gnome-calculator".sandbox.whitelistWayland = true;
|
|
||||||
|
|
||||||
"gnome.gnome-calendar".buildCost = 1;
|
gnome-calculator.buildCost = 1;
|
||||||
|
gnome-calculator.sandbox.method = "bwrap";
|
||||||
|
gnome-calculator.sandbox.whitelistWayland = true;
|
||||||
|
|
||||||
|
gnome-calendar.buildCost = 1;
|
||||||
# gnome-calendar surely has data to persist, but i use it strictly to do date math, not track events.
|
# gnome-calendar surely has data to persist, but i use it strictly to do date math, not track events.
|
||||||
"gnome.gnome-calendar".sandbox.method = "bwrap";
|
gnome-calendar.sandbox.method = "bwrap";
|
||||||
"gnome.gnome-calendar".sandbox.whitelistWayland = true;
|
gnome-calendar.sandbox.whitelistWayland = true;
|
||||||
|
|
||||||
# gnome-disks
|
# gnome-disks
|
||||||
"gnome.gnome-disk-utility".buildCost = 1;
|
gnome-disk-utility.buildCost = 1;
|
||||||
"gnome.gnome-disk-utility".sandbox.method = "bwrap";
|
gnome-disk-utility.sandbox.method = "bwrap";
|
||||||
"gnome.gnome-disk-utility".sandbox.whitelistDbus = [ "system" ];
|
gnome-disk-utility.sandbox.whitelistDbus = [ "system" ];
|
||||||
"gnome.gnome-disk-utility".sandbox.whitelistWayland = true;
|
gnome-disk-utility.sandbox.whitelistWayland = true;
|
||||||
"gnome.gnome-disk-utility".sandbox.extraHomePaths = [
|
gnome-disk-utility.sandbox.extraHomePaths = [
|
||||||
"tmp"
|
"tmp"
|
||||||
"use/iso"
|
"use/iso"
|
||||||
# TODO: probably need /dev and such
|
# TODO: probably need /dev and such
|
||||||
];
|
];
|
||||||
|
|
||||||
|
hping.sandbox.method = "landlock";
|
||||||
|
hping.sandbox.net = "all";
|
||||||
|
hping.sandbox.capabilities = [ "net_raw" ];
|
||||||
|
hping.sandbox.autodetectCliPaths = "existingFile"; # for sending packet data from file
|
||||||
|
|
||||||
# seahorse: dump gnome-keyring secrets.
|
# seahorse: dump gnome-keyring secrets.
|
||||||
"gnome.seahorse".buildCost = 1;
|
seahorse.buildCost = 1;
|
||||||
# N.B.: it can also manage ~/.ssh keys, but i explicitly don't add those to the sandbox for now.
|
# N.B. it can lso manage ~/.ssh keys, but i explicitly don't add those to the sandbox for now.
|
||||||
"gnome.seahorse".sandbox.method = "bwrap";
|
seahorse.sandbox.method = "bwrap";
|
||||||
"gnome.seahorse".sandbox.whitelistDbus = [ "user" ];
|
seahorse.sandbox.whitelistDbus = [ "user" ];
|
||||||
"gnome.seahorse".sandbox.whitelistWayland = true;
|
seahorse.sandbox.whitelistWayland = true;
|
||||||
|
|
||||||
gnome-2048.buildCost = 1;
|
gnome-2048.buildCost = 1;
|
||||||
gnome-2048.sandbox.method = "bwrap";
|
gnome-2048.sandbox.method = "bwrap";
|
||||||
@@ -654,7 +685,7 @@ in
|
|||||||
"Pictures/Screenshots"
|
"Pictures/Screenshots"
|
||||||
"Pictures/servo-macros"
|
"Pictures/servo-macros"
|
||||||
];
|
];
|
||||||
gnome-frog.persist.byStore.cryptClearOnBoot = [
|
gnome-frog.persist.byStore.ephemeral = [
|
||||||
".local/share/tessdata" # 15M; dunno what all it is.
|
".local/share/tessdata" # 15M; dunno what all it is.
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -736,7 +767,7 @@ in
|
|||||||
iotop.sandbox.capabilities = [ "net_admin" ];
|
iotop.sandbox.capabilities = [ "net_admin" ];
|
||||||
|
|
||||||
# provides `ip`, `routel`, `bridge`, others.
|
# provides `ip`, `routel`, `bridge`, others.
|
||||||
# landlock works fine for most of these, but `ip netns exec` wants to attach to an existing namespace
|
# landlock works fine for most of these, but `ip netns exec` wants to attach to an existing namespace (which requires sudo)
|
||||||
# and that means we can't use ANY sandboxer for it.
|
# and that means we can't use ANY sandboxer for it.
|
||||||
iproute2.sandbox.enable = false;
|
iproute2.sandbox.enable = false;
|
||||||
# iproute2.sandbox.net = "all";
|
# iproute2.sandbox.net = "all";
|
||||||
@@ -784,14 +815,23 @@ in
|
|||||||
"tmp"
|
"tmp"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
landlock-sandboxer.sandbox.enable = false; #< sandbox helper
|
||||||
|
|
||||||
libcamera = {};
|
libcamera = {};
|
||||||
|
|
||||||
libcap.sandbox.enable = false; #< for `capsh`, which i use as a sandboxer
|
libcap_ng.sandbox.enable = false; # TODO: `pscap` can sandbox with bwrap, `captest` and `netcap` with landlock
|
||||||
libcap_ng.sandbox.enable = false; # there's something about /proc/$pid/fd which breaks `readlink`/stat with every sandbox technique (except capsh-only)
|
|
||||||
|
|
||||||
libnotify.sandbox.method = "bwrap";
|
libnotify.sandbox.method = "bwrap";
|
||||||
libnotify.sandbox.whitelistDbus = [ "user" ]; # notify-send
|
libnotify.sandbox.whitelistDbus = [ "user" ]; # notify-send
|
||||||
|
|
||||||
|
lightning-cli.packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.clightning "lightning-cli";
|
||||||
|
lightning-cli.sandbox.method = "bwrap";
|
||||||
|
lightning-cli.sandbox.extraHomePaths = [
|
||||||
|
".lightning/bitcoin/lightning-rpc"
|
||||||
|
];
|
||||||
|
# `lightning-cli` finds its RPC file via `~/.lightning/bitcoin/lightning-rpc`, to message the daemon
|
||||||
|
lightning-cli.fs.".lightning".symlink.target = "/var/lib/clightning";
|
||||||
|
|
||||||
losslesscut-bin.buildCost = 1;
|
losslesscut-bin.buildCost = 1;
|
||||||
losslesscut-bin.sandbox.method = "bwrap";
|
losslesscut-bin.sandbox.method = "bwrap";
|
||||||
losslesscut-bin.sandbox.extraHomePaths = [
|
losslesscut-bin.sandbox.extraHomePaths = [
|
||||||
@@ -812,14 +852,17 @@ in
|
|||||||
|
|
||||||
lua = {};
|
lua = {};
|
||||||
|
|
||||||
man-pages.sandbox.enable = false;
|
man-pages.sandbox.enable = false; #< data only
|
||||||
man-pages-posix.sandbox.enable = false;
|
man-pages-posix.sandbox.enable = false; #< data only
|
||||||
|
|
||||||
mercurial.sandbox.method = "bwrap"; # TODO:sandbox: untested
|
mercurial.sandbox.method = "bwrap"; # TODO:sandbox: untested
|
||||||
mercurial.sandbox.net = "clearnet";
|
mercurial.sandbox.net = "clearnet";
|
||||||
mercurial.sandbox.whitelistPwd = true;
|
mercurial.sandbox.whitelistPwd = true;
|
||||||
|
|
||||||
mesa-demos = {};
|
mesa-demos.sandbox.method = "bwrap";
|
||||||
|
mesa-demos.sandbox.whitelistDri = true;
|
||||||
|
mesa-demos.sandbox.whitelistWayland = true;
|
||||||
|
mesa-demos.sandbox.whitelistX = true;
|
||||||
|
|
||||||
# actual monero blockchain (not wallet/etc; safe to delete, just slow to regenerate)
|
# actual monero blockchain (not wallet/etc; safe to delete, just slow to regenerate)
|
||||||
monero-gui.buildCost = 1;
|
monero-gui.buildCost = 1;
|
||||||
@@ -865,7 +908,7 @@ in
|
|||||||
nixpkgs-review.sandbox.extraPaths = [
|
nixpkgs-review.sandbox.extraPaths = [
|
||||||
"/nix"
|
"/nix"
|
||||||
];
|
];
|
||||||
nixpkgs-review.persist.byStore.cryptClearOnBoot = [
|
nixpkgs-review.persist.byStore.ephemeral = [
|
||||||
".cache/nixpkgs-review" #< help it not exhaust / tmpfs
|
".cache/nixpkgs-review" #< help it not exhaust / tmpfs
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -916,7 +959,7 @@ in
|
|||||||
"/sys/devices"
|
"/sys/devices"
|
||||||
];
|
];
|
||||||
|
|
||||||
"perlPackages.FileMimeInfo".sandbox.enable = false; #< TODO: sandbox `mimetype` but not `mimeopen`.
|
"perlPackages.FileMimeInfo" = {};
|
||||||
|
|
||||||
powertop.sandbox.method = "landlock";
|
powertop.sandbox.method = "landlock";
|
||||||
powertop.sandbox.capabilities = [ "ipc_lock" "sys_admin" ];
|
powertop.sandbox.capabilities = [ "ipc_lock" "sys_admin" ];
|
||||||
@@ -949,7 +992,9 @@ in
|
|||||||
|
|
||||||
python3-repl.packageUnwrapped = pkgs.python3.withPackages (ps: with ps; [
|
python3-repl.packageUnwrapped = pkgs.python3.withPackages (ps: with ps; [
|
||||||
psutil
|
psutil
|
||||||
|
pykakasi
|
||||||
requests
|
requests
|
||||||
|
unidecode
|
||||||
]);
|
]);
|
||||||
python3-repl.sandbox.method = "bwrap";
|
python3-repl.sandbox.method = "bwrap";
|
||||||
python3-repl.sandbox.net = "clearnet";
|
python3-repl.sandbox.net = "clearnet";
|
||||||
@@ -977,9 +1022,17 @@ in
|
|||||||
sane-weather.sandbox.method = "bwrap";
|
sane-weather.sandbox.method = "bwrap";
|
||||||
sane-weather.sandbox.net = "clearnet";
|
sane-weather.sandbox.net = "clearnet";
|
||||||
|
|
||||||
|
sc-im.sandbox.method = "bwrap";
|
||||||
|
sc-im.sandbox.autodetectCliPaths = "existingFile";
|
||||||
|
|
||||||
screen.sandbox.enable = false; #< tty; needs to run anything
|
screen.sandbox.enable = false; #< tty; needs to run anything
|
||||||
|
|
||||||
sequoia.sandbox.method = "bwrap"; # TODO:sandbox: untested
|
sequoia.packageUnwrapped = pkgs.sequoia.overrideAttrs (_: {
|
||||||
|
# XXX(2024-07-30): sq_autocrypt_import test failure: "Warning: 9B7DD433F254904A is expired."
|
||||||
|
doCheck = false;
|
||||||
|
});
|
||||||
|
sequoia.buildCost = 1;
|
||||||
|
sequoia.sandbox.method = "bwrap";
|
||||||
sequoia.sandbox.whitelistPwd = true;
|
sequoia.sandbox.whitelistPwd = true;
|
||||||
sequoia.sandbox.autodetectCliPaths = "existingFileOrParent"; # supports `-o <file-to-create>`
|
sequoia.sandbox.autodetectCliPaths = "existingFileOrParent"; # supports `-o <file-to-create>`
|
||||||
|
|
||||||
@@ -1007,7 +1060,7 @@ in
|
|||||||
# TODO: enable dma heaps for more efficient buffer sharing: <https://gitlab.com/postmarketOS/pmaports/-/issues/2789>
|
# TODO: enable dma heaps for more efficient buffer sharing: <https://gitlab.com/postmarketOS/pmaports/-/issues/2789>
|
||||||
snapshot = {};
|
snapshot = {};
|
||||||
|
|
||||||
sops.sandbox.method = "bwrap"; # TODO:sandbox: untested
|
sops.sandbox.method = "bwrap";
|
||||||
sops.sandbox.extraHomePaths = [
|
sops.sandbox.extraHomePaths = [
|
||||||
".config/sops"
|
".config/sops"
|
||||||
"nixos"
|
"nixos"
|
||||||
@@ -1023,7 +1076,9 @@ in
|
|||||||
"Music"
|
"Music"
|
||||||
"tmp"
|
"tmp"
|
||||||
"use"
|
"use"
|
||||||
|
".config/dconf"
|
||||||
];
|
];
|
||||||
|
soundconverter.sandbox.whitelistDbus = [ "user" ]; # for dconf
|
||||||
soundconverter.sandbox.extraPaths = [
|
soundconverter.sandbox.extraPaths = [
|
||||||
"/mnt/servo/media/Music"
|
"/mnt/servo/media/Music"
|
||||||
"/mnt/servo/media/games"
|
"/mnt/servo/media/games"
|
||||||
@@ -1046,7 +1101,16 @@ in
|
|||||||
|
|
||||||
sqlite = {};
|
sqlite = {};
|
||||||
|
|
||||||
sshfs-fuse = {}; # used by fs.nix
|
sshfs-fuse.sandbox.method = "bwrap"; #< N.B. if you call this from the CLI -- without `mount.fuse` -- set this to `none`
|
||||||
|
sshfs-fuse.sandbox.net = "all";
|
||||||
|
sshfs-fuse.sandbox.autodetectCliPaths = "parent";
|
||||||
|
# sshfs-fuse.sandbox.extraPaths = [
|
||||||
|
# "/dev/fd" # fuse.mount3 -o drop_privileges passes us data over /dev/fd/3
|
||||||
|
# "/mnt" # XXX: not sure why i need all this, instead of just /mnt/desko, or /mnt/desko/home, etc
|
||||||
|
# ];
|
||||||
|
sshfs-fuse.sandbox.extraHomePaths = [
|
||||||
|
".ssh/id_ed25519" #< TODO: add -o foo,bar=path/to/thing style arguments to autodetection
|
||||||
|
];
|
||||||
|
|
||||||
strace.sandbox.enable = false; #< needs to `exec` its args, and therefore support *anything*
|
strace.sandbox.enable = false; #< needs to `exec` its args, and therefore support *anything*
|
||||||
|
|
||||||
@@ -1088,7 +1152,7 @@ in
|
|||||||
tumiki-fighters.sandbox.whitelistWayland = true;
|
tumiki-fighters.sandbox.whitelistWayland = true;
|
||||||
tumiki-fighters.sandbox.whitelistX = true;
|
tumiki-fighters.sandbox.whitelistX = true;
|
||||||
|
|
||||||
util-linux.sandbox.enable = false; #< TODO: possible to sandbox if i specific a different profile for each of its ~50 binaries
|
util-linux.sandbox.enable = false; #< TODO: possible to sandbox if i specify a different profile for each of its ~50 binaries
|
||||||
|
|
||||||
unzip.sandbox.method = "bwrap";
|
unzip.sandbox.method = "bwrap";
|
||||||
unzip.sandbox.autodetectCliPaths = "existingOrParent";
|
unzip.sandbox.autodetectCliPaths = "existingOrParent";
|
||||||
@@ -1103,9 +1167,6 @@ in
|
|||||||
valgrind.buildCost = 1;
|
valgrind.buildCost = 1;
|
||||||
valgrind.sandbox.enable = false; #< it's a launcher: can't sandbox
|
valgrind.sandbox.enable = false; #< it's a launcher: can't sandbox
|
||||||
|
|
||||||
visidata.sandbox.method = "bwrap"; # TODO:sandbox: untested
|
|
||||||
visidata.sandbox.autodetectCliPaths = true;
|
|
||||||
|
|
||||||
# `vulkaninfo`, `vkcube`
|
# `vulkaninfo`, `vkcube`
|
||||||
vulkan-tools.sandbox.method = "landlock";
|
vulkan-tools.sandbox.method = "landlock";
|
||||||
|
|
||||||
@@ -1137,10 +1198,12 @@ in
|
|||||||
|
|
||||||
# `wg`, `wg-quick`
|
# `wg`, `wg-quick`
|
||||||
wireguard-tools.sandbox.method = "landlock";
|
wireguard-tools.sandbox.method = "landlock";
|
||||||
|
wireguard-tools.sandbox.net = "all";
|
||||||
wireguard-tools.sandbox.capabilities = [ "net_admin" ];
|
wireguard-tools.sandbox.capabilities = [ "net_admin" ];
|
||||||
|
|
||||||
# provides `iwconfig`, `iwlist`, `iwpriv`, ...
|
# provides `iwconfig`, `iwlist`, `iwpriv`, ...
|
||||||
wirelesstools.sandbox.method = "landlock";
|
wirelesstools.sandbox.method = "landlock";
|
||||||
|
wirelesstools.sandbox.net = "all";
|
||||||
wirelesstools.sandbox.capabilities = [ "net_admin" ];
|
wirelesstools.sandbox.capabilities = [ "net_admin" ];
|
||||||
|
|
||||||
wl-clipboard.sandbox.method = "bwrap";
|
wl-clipboard.sandbox.method = "bwrap";
|
||||||
@@ -1160,11 +1223,9 @@ in
|
|||||||
|
|
||||||
yarn.persist.byStore.plaintext = [ ".cache/yarn" ];
|
yarn.persist.byStore.plaintext = [ ".cache/yarn" ];
|
||||||
|
|
||||||
yt-dlp.sandbox.method = "bwrap"; # TODO:sandbox: untested
|
yt-dlp.sandbox.method = "bwrap";
|
||||||
yt-dlp.sandbox.net = "all";
|
yt-dlp.sandbox.net = "all";
|
||||||
yt-dlp.sandbox.whitelistPwd = true; # saves to pwd by default
|
yt-dlp.sandbox.whitelistPwd = true; # saves to pwd by default
|
||||||
|
|
||||||
zfs = {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sane.persist.sys.byStore.plaintext = lib.mkIf config.sane.programs.guiApps.enabled [
|
sane.persist.sys.byStore.plaintext = lib.mkIf config.sane.programs.guiApps.enabled [
|
||||||
@@ -1181,13 +1242,12 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.opengl = lib.mkIf config.sane.programs.guiApps.enabled ({
|
hardware.graphics = lib.mkIf config.sane.programs.guiApps.enabled ({
|
||||||
enable = true;
|
enable = true;
|
||||||
driSupport = lib.mkDefault true;
|
|
||||||
} // (lib.optionalAttrs pkgs.stdenv.isx86_64 {
|
} // (lib.optionalAttrs pkgs.stdenv.isx86_64 {
|
||||||
# for 32 bit applications
|
# for 32 bit applications
|
||||||
# upstream nixpkgs forbids setting driSupport32Bit unless specifically x86_64 (so aarch64 isn't allowed)
|
# upstream nixpkgs forbids setting enable32Bit unless specifically x86_64 (so aarch64 isn't allowed)
|
||||||
driSupport32Bit = lib.mkDefault true;
|
enable32Bit = lib.mkDefault true;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
system.activationScripts.notifyActive = lib.mkIf config.sane.programs.guiApps.enabled {
|
system.activationScripts.notifyActive = lib.mkIf config.sane.programs.guiApps.enabled {
|
||||||
@@ -1195,7 +1255,7 @@ in
|
|||||||
''
|
''
|
||||||
tryNotifyUser() {
|
tryNotifyUser() {
|
||||||
local user="$1"
|
local user="$1"
|
||||||
local new_path="$PATH:${pkgs.sudo}/bin:${pkgs.libnotify}/bin"
|
local new_path="$PATH:/etc/profiles/per-user/$user/bin:${pkgs.sudo}/bin:${pkgs.libnotify}/bin"
|
||||||
local version="$(cat $systemConfig/nixos-version)"
|
local version="$(cat $systemConfig/nixos-version)"
|
||||||
PATH="$new_path" sudo -u "$user" \
|
PATH="$new_path" sudo -u "$user" \
|
||||||
env PATH="$new_path" NIXOS_VERSION="$version" /bin/sh -c \
|
env PATH="$new_path" NIXOS_VERSION="$version" /bin/sh -c \
|
||||||
@@ -1203,7 +1263,7 @@ in
|
|||||||
}
|
}
|
||||||
''
|
''
|
||||||
] ++ lib.mapAttrsToList
|
] ++ lib.mapAttrsToList
|
||||||
(user: en: lib.optionalString en "tryNotifyUser ${user}")
|
(user: en: lib.optionalString en "tryNotifyUser ${user} > /dev/null")
|
||||||
config.sane.programs.guiApps.enableFor.user
|
config.sane.programs.guiApps.enableFor.user
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
sane.programs.ausyscall = {
|
sane.programs.ausyscall = {
|
||||||
packageUnwrapped = pkgs.linkIntoOwnPackage pkgs.audit "bin/ausyscall";
|
packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.audit "ausyscall";
|
||||||
|
|
||||||
sandbox.method = "landlock";
|
sandbox.method = "landlock";
|
||||||
};
|
};
|
||||||
|
91
hosts/common/programs/avahi.nix
Normal file
91
hosts/common/programs/avahi.nix
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
# Avahi zeroconf (mDNS) implementation.
|
||||||
|
# runs as systemd `avahi-daemon.service`
|
||||||
|
#
|
||||||
|
# - <https://avahi.org/>
|
||||||
|
# - code: <https://github.com/avahi/avahi>
|
||||||
|
# - IRC: #avahi on irc.libera.chat
|
||||||
|
#
|
||||||
|
# - `avahi-browse --help` for usage
|
||||||
|
# - `man avahi-daemon.conf`
|
||||||
|
# - `LD_LIBRARY_PATH=/nix/store/ngwj3jqmxh8k4qji2z0lj7y1f8vzqrn2-nss-mdns-0.15.1/lib getent hosts desko.local`
|
||||||
|
# nss-mdns goes through avahi-daemon, so there IS caching here
|
||||||
|
#
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
sane.programs.avahi = {
|
||||||
|
packageUnwrapped = pkgs.avahi.overrideAttrs (upstream: {
|
||||||
|
# avahi wants to do its own sandboxing opaque to systemd & maybe in conflict with my bwrap.
|
||||||
|
# --no-drop-root disables that, so that i can e.g. run it as User=avahi, etc.
|
||||||
|
# do this here, because the service isn't so easily patched.
|
||||||
|
postInstall = (upstream.postInstall or "") + ''
|
||||||
|
wrapProgram "$out/sbin/avahi-daemon" \
|
||||||
|
--add-flags --no-drop-root
|
||||||
|
'';
|
||||||
|
nativeBuildInputs = upstream.nativeBuildInputs ++ [
|
||||||
|
pkgs.makeBinaryWrapper
|
||||||
|
];
|
||||||
|
});
|
||||||
|
sandbox.method = "bwrap";
|
||||||
|
sandbox.whitelistDbus = [ "system" ];
|
||||||
|
sandbox.net = "all"; #< otherwise it will show 'null' in place of each interface name.
|
||||||
|
sandbox.extraPaths = [
|
||||||
|
"/" #< TODO: decrease this, but be weary that the daemon might exit immediately
|
||||||
|
];
|
||||||
|
};
|
||||||
|
services.avahi = lib.mkIf config.sane.programs.avahi.enabled {
|
||||||
|
enable = true;
|
||||||
|
package = config.sane.programs.avahi.package;
|
||||||
|
publish.enable = true;
|
||||||
|
publish.userServices = true;
|
||||||
|
nssmdns4 = true;
|
||||||
|
nssmdns6 = true;
|
||||||
|
# reflector = true;
|
||||||
|
allowInterfaces = [
|
||||||
|
# particularly, the default config disallows loopback, which is kinda fucking retarded, right?
|
||||||
|
"ens1" #< servo
|
||||||
|
"enp5s0" #< desko
|
||||||
|
"eth0"
|
||||||
|
"lo"
|
||||||
|
"wg-home"
|
||||||
|
"wlan0" #< moby
|
||||||
|
"wlp3s0" #< lappy
|
||||||
|
"wlp4s0" #< desko
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.avahi-daemon = lib.mkIf config.sane.programs.avahi.enabled {
|
||||||
|
# hardening: see `systemd-analyze security avahi-daemon`
|
||||||
|
serviceConfig.User = "avahi";
|
||||||
|
serviceConfig.Group = "avahi";
|
||||||
|
serviceConfig.AmbientCapabilities = "";
|
||||||
|
serviceConfig.CapabilityBoundingSet = "";
|
||||||
|
serviceConfig.LockPersonality = true;
|
||||||
|
serviceConfig.MemoryDenyWriteExecute = true;
|
||||||
|
serviceConfig.NoNewPrivileges = true;
|
||||||
|
serviceConfig.PrivateDevices = true;
|
||||||
|
serviceConfig.PrivateMounts = true;
|
||||||
|
serviceConfig.PrivateTmp = true;
|
||||||
|
serviceConfig.PrivateUsers = true;
|
||||||
|
serviceConfig.ProcSubset = "all";
|
||||||
|
serviceConfig.ProtectClock = true;
|
||||||
|
serviceConfig.ProtectControlGroups = true;
|
||||||
|
serviceConfig.ProtectHome = true;
|
||||||
|
serviceConfig.ProtectHostname = true;
|
||||||
|
serviceConfig.ProtectKernelLogs = true;
|
||||||
|
serviceConfig.ProtectKernelModules = true;
|
||||||
|
serviceConfig.ProtectKernelTunables = true;
|
||||||
|
serviceConfig.ProtectProc = "noaccess";
|
||||||
|
serviceConfig.ProtectSystem = "strict";
|
||||||
|
serviceConfig.RemoveIPC = true; #< this *might* slow down the initial connection?
|
||||||
|
serviceConfig.RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6 AF_NETLINK";
|
||||||
|
serviceConfig.RestrictRealtime = true;
|
||||||
|
serviceConfig.RestrictSUIDSGID = true;
|
||||||
|
serviceConfig.SystemCallArchitectures = "native";
|
||||||
|
serviceConfig.SystemCallFilter = [
|
||||||
|
"@system-service"
|
||||||
|
"@mount"
|
||||||
|
"~@resources"
|
||||||
|
# "~@privileged"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
@@ -95,7 +95,7 @@ in
|
|||||||
|
|
||||||
packageUnwrapped = pkgs.bemenu.overrideAttrs (upstream: {
|
packageUnwrapped = pkgs.bemenu.overrideAttrs (upstream: {
|
||||||
nativeBuildInputs = (upstream.nativeBuildInputs or []) ++ [
|
nativeBuildInputs = (upstream.nativeBuildInputs or []) ++ [
|
||||||
pkgs.makeWrapper
|
pkgs.makeBinaryWrapper
|
||||||
];
|
];
|
||||||
# can alternatively be specified as CLI flags
|
# can alternatively be specified as CLI flags
|
||||||
postInstall = (upstream.postInstall or "") + ''
|
postInstall = (upstream.postInstall or "") + ''
|
||||||
|
13
hosts/common/programs/bitcoin-cli.nix
Normal file
13
hosts/common/programs/bitcoin-cli.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
sane.programs.bitcoin-cli = {
|
||||||
|
packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.bitcoind "bitcoin-cli";
|
||||||
|
sandbox.method = "bwrap";
|
||||||
|
sandbox.autodetectCliPaths = "existing"; #< for `bitcoin-cli -datadir=/var/lib/...`
|
||||||
|
sandbox.extraHomePaths = [
|
||||||
|
".bitcoin/bitcoin.conf"
|
||||||
|
];
|
||||||
|
sandbox.net = "all"; # actually needs only localhost
|
||||||
|
secrets.".bitcoin/bitcoin.conf" = ../../../secrets/servo/bitcoin.conf.bin;
|
||||||
|
};
|
||||||
|
}
|
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ])" -p blast-ugjka
|
#!nix-shell -i python3 -p blast-ugjka -p python3
|
||||||
# vim: set filetype=python :
|
# vim: set filetype=python :
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
@@ -31,7 +31,7 @@ in
|
|||||||
|
|
||||||
sane.programs.blast-to-default = {
|
sane.programs.blast-to-default = {
|
||||||
# helper to deal with blast's interactive CLI
|
# helper to deal with blast's interactive CLI
|
||||||
packageUnwrapped = pkgs.static-nix-shell.mkPython3Bin {
|
packageUnwrapped = pkgs.static-nix-shell.mkPython3 {
|
||||||
pname = "blast-to-default";
|
pname = "blast-to-default";
|
||||||
pkgs = [ "blast-ugjka" ];
|
pkgs = [ "blast-ugjka" ];
|
||||||
srcRoot = ./.;
|
srcRoot = ./.;
|
||||||
|
@@ -111,7 +111,7 @@ in
|
|||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|
||||||
fs.".config/bonsai/bonsai_tree.json".symlink.text = builtins.toJSON cfg.config.transitions;
|
fs.".config/bonsai/bonsai_tree.json".symlink.target = pkgs.writers.writeJSON "bonsai_tree.json" cfg.config.transitions;
|
||||||
|
|
||||||
sandbox.method = "bwrap";
|
sandbox.method = "bwrap";
|
||||||
sandbox.extraRuntimePaths = [
|
sandbox.extraRuntimePaths = [
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
sandbox.whitelistDri = true;
|
sandbox.whitelistDri = true;
|
||||||
sandbox.whitelistWayland = true;
|
sandbox.whitelistWayland = true;
|
||||||
|
|
||||||
persist.byStore.cryptClearOnBoot = [
|
persist.byStore.ephemeral = [
|
||||||
".cache/BraveSoftware"
|
".cache/BraveSoftware"
|
||||||
".config/BraveSoftware"
|
".config/BraveSoftware"
|
||||||
];
|
];
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
sane.programs.callaudiod = {
|
sane.programs.callaudiod = {
|
||||||
packageUnwrapped = pkgs.rmDbusServices pkgs.callaudiod;
|
packageUnwrapped = pkgs.rmDbusServices pkgs.callaudiod;
|
||||||
|
|
||||||
# probably more needed once i enable proper sandboxing, but for now this ensures the service isn't started too early!
|
sandbox.method = "bwrap";
|
||||||
sandbox.whitelistAudio = true;
|
sandbox.whitelistAudio = true;
|
||||||
sandbox.whitelistDbus = [ "user" ];
|
sandbox.whitelistDbus = [ "user" ];
|
||||||
|
|
||||||
|
@@ -24,7 +24,23 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
packageUnwrapped = pkgs.calls.overrideAttrs (upstream: {
|
packageUnwrapped = pkgs.rmDbusServicesInPlace ((pkgs.calls.override {
|
||||||
|
gtk3 = pkgs.gtk4;
|
||||||
|
libpeas = pkgs.libpeas2;
|
||||||
|
wrapGAppsHook3 = pkgs.wrapGAppsHook4;
|
||||||
|
}).overrideAttrs (upstream: {
|
||||||
|
# XXX(2024-08-08): v46.3 has a bug where if it has no network connection on launch, it forever stays disconnected & never retries
|
||||||
|
version = "47_beta.0-unstable-2024-08-08";
|
||||||
|
src = lib.warnIf (lib.versionOlder "47.0" upstream.version) "gnome-calls outdated; remove src override? (keep UI patches though!)" pkgs.fetchFromGitLab {
|
||||||
|
domain = "gitlab.gnome.org";
|
||||||
|
owner = "GNOME";
|
||||||
|
repo = "calls";
|
||||||
|
fetchSubmodules = true;
|
||||||
|
# rev = "main";
|
||||||
|
rev = "ff213579a52222e7c95e585843d97b5b817b2a8b";
|
||||||
|
hash = "sha256-0QYC8FJpfg/X2lIjBDooba2idUfpJNQhcpv8Z5I/B4k=";
|
||||||
|
};
|
||||||
|
|
||||||
patches = (upstream.patches or []) ++ [
|
patches = (upstream.patches or []) ++ [
|
||||||
(pkgs.fetchpatch {
|
(pkgs.fetchpatch {
|
||||||
# usability improvement... if the UI is visible, then i can receive calls. otherwise, i can't!
|
# usability improvement... if the UI is visible, then i can receive calls. otherwise, i can't!
|
||||||
@@ -33,10 +49,18 @@ in
|
|||||||
hash = "sha256-NoVQV2TlkCcsBt0uwSyK82hBKySUW4pADrJVfLFvWgU=";
|
hash = "sha256-NoVQV2TlkCcsBt0uwSyK82hBKySUW4pADrJVfLFvWgU=";
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
});
|
|
||||||
|
nativeBuildInputs = upstream.nativeBuildInputs ++ [
|
||||||
|
pkgs.dbus #< for dbus-run-session (should be test only, but it's not)
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = upstream.buildInputs ++ [
|
||||||
|
pkgs.libadwaita
|
||||||
|
];
|
||||||
|
}));
|
||||||
|
|
||||||
sandbox.method = "bwrap";
|
sandbox.method = "bwrap";
|
||||||
sandbox.net = "clearnet";
|
sandbox.net = "vpn.wg-home"; #< XXX(2024/07/05): my cell carrier seems to block RTP, so tunnel it.
|
||||||
sandbox.whitelistAudio = true;
|
sandbox.whitelistAudio = true;
|
||||||
sandbox.whitelistDbus = [ "user" ]; # necessary for secrets, at the minimum
|
sandbox.whitelistDbus = [ "user" ]; # necessary for secrets, at the minimum
|
||||||
sandbox.whitelistWayland = true;
|
sandbox.whitelistWayland = true;
|
||||||
|
7
hosts/common/programs/capsh.nix
Normal file
7
hosts/common/programs/capsh.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
sane.programs.capsh = {
|
||||||
|
packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.libcap "capsh";
|
||||||
|
sandbox.enable = false; #< i use `capsh` as a sandboxer.
|
||||||
|
};
|
||||||
|
}
|
8
hosts/common/programs/captree.nix
Normal file
8
hosts/common/programs/captree.nix
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
sane.programs.captree = {
|
||||||
|
packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.libcap-with-captree "captree";
|
||||||
|
sandbox.method = "bwrap";
|
||||||
|
sandbox.isolatePids = false;
|
||||||
|
};
|
||||||
|
}
|
@@ -66,6 +66,7 @@ end
|
|||||||
if vars.percent ~= nil then
|
if vars.percent ~= nil then
|
||||||
bat_args = bat_args .. " --percent-suffix '" .. vars.percent .. "'"
|
bat_args = bat_args .. " --percent-suffix '" .. vars.percent .. "'"
|
||||||
end
|
end
|
||||||
|
bat_args = bat_args .. " {bat}"
|
||||||
|
|
||||||
-- N.B.: `[[ <text> ]]` is Lua's multiline string literal
|
-- N.B.: `[[ <text> ]]` is Lua's multiline string literal
|
||||||
conky.text = [[
|
conky.text = [[
|
||||||
@@ -73,8 +74,8 @@ ${color1}${shadecolor 707070}${font sans-serif:size=50:style=Bold}${alignc}${exe
|
|||||||
${color2}${shadecolor a4d7d0}${font sans-serif:size=20}${alignc}${exec date +"%a %d %b"}${font}
|
${color2}${shadecolor a4d7d0}${font sans-serif:size=20}${alignc}${exec date +"%a %d %b"}${font}
|
||||||
|
|
||||||
|
|
||||||
${color1}${shadecolor}${font sans-serif:size=22:style=Bold}${alignc}${execp @bat@ ]] .. bat_args .. [[ }${font}
|
${color1}${shadecolor}${font sans-serif:size=22:style=Bold}${alignc}${execp sane-sysload ]] .. bat_args .. [[ }${font}
|
||||||
${color1}${shadecolor}${font sans-serif:size=20:style=Bold}${alignc}${texeci 600 @weather@ }${font}
|
${color1}${shadecolor}${font sans-serif:size=20:style=Bold}${alignc}${texeci 600 timeout 20 sane-weather }${font}
|
||||||
|
|
||||||
|
|
||||||
${color2}${shadecolor a4d7d0}${font sans-serif:size=16}${alignc}⇅ ${downspeedf wlan0}]] .. vars.kBps .. [[${font}
|
${color2}${shadecolor a4d7d0}${font sans-serif:size=16}${alignc}⇅ ${downspeedf wlan0}]] .. vars.kBps .. [[${font}
|
||||||
|
@@ -5,22 +5,18 @@
|
|||||||
sandbox.net = "clearnet"; #< for the scripts it calls (weather)
|
sandbox.net = "clearnet"; #< for the scripts it calls (weather)
|
||||||
sandbox.extraPaths = [
|
sandbox.extraPaths = [
|
||||||
"/sys/class/power_supply"
|
"/sys/class/power_supply"
|
||||||
"/sys/devices" # needed by sane-sysinfo
|
"/sys/devices" # needed by sane-sysload
|
||||||
# "/sys/devices/cpu"
|
# "/sys/devices/cpu"
|
||||||
# "/sys/devices/system"
|
# "/sys/devices/system"
|
||||||
];
|
];
|
||||||
sandbox.whitelistWayland = true;
|
sandbox.whitelistWayland = true;
|
||||||
|
|
||||||
suggestedPrograms = [
|
suggestedPrograms = [
|
||||||
"sane-sysinfo"
|
"sane-sysload"
|
||||||
"sane-weather"
|
"sane-weather"
|
||||||
];
|
];
|
||||||
|
|
||||||
fs.".config/conky/conky.conf".symlink.target = pkgs.substituteAll {
|
fs.".config/conky/conky.conf".symlink.target = ./conky.conf;
|
||||||
src = ./conky.conf;
|
|
||||||
bat = "sane-sysinfo";
|
|
||||||
weather = "timeout 20 sane-weather";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.conky = {
|
services.conky = {
|
||||||
description = "conky dynamic desktop background";
|
description = "conky dynamic desktop background";
|
||||||
|
8
hosts/common/programs/curl.nix
Normal file
8
hosts/common/programs/curl.nix
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
sane.programs.curl = {
|
||||||
|
sandbox.method = "bwrap";
|
||||||
|
sandbox.net = "all";
|
||||||
|
sandbox.autodetectCliPaths = "parent"; #< for `-o` option
|
||||||
|
};
|
||||||
|
}
|
@@ -1,35 +1,8 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
sane.programs.curlftpfs = {
|
sane.programs.curlftpfs = {
|
||||||
packageUnwrapped = pkgs.curlftpfs.overrideAttrs (upstream: {
|
packageUnwrapped = pkgs.curlftpfs-sane;
|
||||||
# my fork includes:
|
sandbox.method = "bwrap";
|
||||||
# - per-operation timeouts (CURLOPT_TIMEOUT; would use CURLOPT_LOW_SPEED_TIME/CURLOPT_LOW_SPEED_LIMIT but they don't apply)
|
sandbox.net = "all";
|
||||||
# - exit on timeout (so that one knows to abort the mount, instead of waiting indefinitely)
|
|
||||||
# - support for "meta" keys found in /etc/fstab
|
|
||||||
src = pkgs.fetchFromGitea {
|
|
||||||
domain = "git.uninsane.org";
|
|
||||||
owner = "colin";
|
|
||||||
repo = "curlftpfs";
|
|
||||||
rev = "0890d32e709b5a01153f00d29ed4c00299744f5d";
|
|
||||||
hash = "sha256-M28PzHqEAkezQdtPeL16z56prwl3BfMZqry0dlpXJls=";
|
|
||||||
};
|
|
||||||
# `mount` clears PATH before calling the mount helper (see util-linux/lib/env.c),
|
|
||||||
# so the traditional /etc/fstab approach of fstype=fuse and device = curlftpfs#URI doesn't work.
|
|
||||||
# instead, install a `mount.curlftpfs` mount helper. this is what programs like `gocryptfs` do.
|
|
||||||
postInstall = (upstream.postInstall or "") + ''
|
|
||||||
ln -s curlftpfs $out/bin/mount.fuse.curlftpfs
|
|
||||||
ln -s curlftpfs $out/bin/mount.curlftpfs
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
|
|
||||||
# TODO: try to sandbox this better? maybe i can have fuse (unsandboxed) invoke curlftpfs (sandboxed)?
|
|
||||||
# - landlock gives EPERM
|
|
||||||
# - bwrap just silently doesn't mount it, maybe because of setuid stuff around fuse?
|
|
||||||
# sandbox.method = "capshonly";
|
|
||||||
# sandbox.net = "all";
|
|
||||||
# sandbox.capabilities = [
|
|
||||||
# "sys_admin"
|
|
||||||
# "sys_module"
|
|
||||||
# ];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,9 @@
|
|||||||
./assorted.nix
|
./assorted.nix
|
||||||
./audacity.nix
|
./audacity.nix
|
||||||
./ausyscall.nix
|
./ausyscall.nix
|
||||||
|
./avahi.nix
|
||||||
./bemenu.nix
|
./bemenu.nix
|
||||||
|
./bitcoin-cli.nix
|
||||||
./blast-ugjka
|
./blast-ugjka
|
||||||
./bonsai.nix
|
./bonsai.nix
|
||||||
./brave.nix
|
./brave.nix
|
||||||
@@ -19,12 +21,15 @@
|
|||||||
./callaudiod.nix
|
./callaudiod.nix
|
||||||
./calls.nix
|
./calls.nix
|
||||||
./cantata.nix
|
./cantata.nix
|
||||||
|
./capsh.nix
|
||||||
|
./captree.nix
|
||||||
./catt.nix
|
./catt.nix
|
||||||
./celeste64.nix
|
./celeste64.nix
|
||||||
./chatty.nix
|
./chatty.nix
|
||||||
./conky
|
./conky
|
||||||
./cozy.nix
|
./cozy.nix
|
||||||
./cups.nix
|
./cups.nix
|
||||||
|
./curl.nix
|
||||||
./curlftpfs.nix
|
./curlftpfs.nix
|
||||||
./dbus.nix
|
./dbus.nix
|
||||||
./dconf.nix
|
./dconf.nix
|
||||||
@@ -39,10 +44,13 @@
|
|||||||
./epiphany.nix
|
./epiphany.nix
|
||||||
./errno.nix
|
./errno.nix
|
||||||
./evince.nix
|
./evince.nix
|
||||||
|
./exiftool.nix
|
||||||
./fcitx5.nix
|
./fcitx5.nix
|
||||||
./feedbackd.nix
|
./feedbackd.nix
|
||||||
./firefox.nix
|
./firefox.nix
|
||||||
|
./firefox-xdg-open.nix
|
||||||
./flare-signal.nix
|
./flare-signal.nix
|
||||||
|
./foliate.nix
|
||||||
./fontconfig.nix
|
./fontconfig.nix
|
||||||
./fractal.nix
|
./fractal.nix
|
||||||
./free.nix
|
./free.nix
|
||||||
@@ -50,8 +58,11 @@
|
|||||||
./fwupd.nix
|
./fwupd.nix
|
||||||
./g4music.nix
|
./g4music.nix
|
||||||
./gajim.nix
|
./gajim.nix
|
||||||
|
./gdb.nix
|
||||||
./gdbus.nix
|
./gdbus.nix
|
||||||
./geary.nix
|
./geary.nix
|
||||||
|
./geoclue-demo-agent.nix
|
||||||
|
./geoclue2.nix
|
||||||
./git.nix
|
./git.nix
|
||||||
./gnome-clocks.nix
|
./gnome-clocks.nix
|
||||||
./gnome-feeds.nix
|
./gnome-feeds.nix
|
||||||
@@ -59,7 +70,10 @@
|
|||||||
./gnome-maps.nix
|
./gnome-maps.nix
|
||||||
./gnome-weather.nix
|
./gnome-weather.nix
|
||||||
./go2tv.nix
|
./go2tv.nix
|
||||||
|
./gocryptfs.nix
|
||||||
./gpodder.nix
|
./gpodder.nix
|
||||||
|
./gpsd.nix
|
||||||
|
./gps-share.nix
|
||||||
./grimshot.nix
|
./grimshot.nix
|
||||||
./gst-device-monitor.nix
|
./gst-device-monitor.nix
|
||||||
./gthumb.nix
|
./gthumb.nix
|
||||||
@@ -67,13 +81,16 @@
|
|||||||
./handbrake.nix
|
./handbrake.nix
|
||||||
./helix.nix
|
./helix.nix
|
||||||
./htop
|
./htop
|
||||||
|
./iio-sensor-proxy.nix
|
||||||
./imagemagick.nix
|
./imagemagick.nix
|
||||||
./jellyfin-media-player.nix
|
./jellyfin-media-player.nix
|
||||||
./kdenlive.nix
|
./kdenlive.nix
|
||||||
|
./keymapp.nix
|
||||||
./komikku.nix
|
./komikku.nix
|
||||||
./koreader
|
./koreader
|
||||||
./less.nix
|
./less.nix
|
||||||
./lftp.nix
|
./lftp.nix
|
||||||
|
./lgtrombetta-compass.nix
|
||||||
./libreoffice.nix
|
./libreoffice.nix
|
||||||
./lemoa.nix
|
./lemoa.nix
|
||||||
./loupe.nix
|
./loupe.nix
|
||||||
@@ -81,16 +98,19 @@
|
|||||||
./megapixels.nix
|
./megapixels.nix
|
||||||
./mepo.nix
|
./mepo.nix
|
||||||
./mimeo
|
./mimeo
|
||||||
|
./mimetype.nix
|
||||||
./mmcli.nix
|
./mmcli.nix
|
||||||
./mopidy.nix
|
./mopidy.nix
|
||||||
./mpv
|
./mpv
|
||||||
./msmtp.nix
|
./msmtp.nix
|
||||||
./nautilus.nix
|
./nautilus.nix
|
||||||
./neovim.nix
|
./neovim.nix
|
||||||
|
./networkmanager_dmenu
|
||||||
./newsflash.nix
|
./newsflash.nix
|
||||||
./nheko.nix
|
./nheko.nix
|
||||||
./nicotine-plus.nix
|
./nicotine-plus.nix
|
||||||
./nix-index.nix
|
./nix-index.nix
|
||||||
|
./nix.nix
|
||||||
./nmcli.nix
|
./nmcli.nix
|
||||||
./notejot.nix
|
./notejot.nix
|
||||||
./ntfy-sh.nix
|
./ntfy-sh.nix
|
||||||
@@ -98,25 +118,34 @@
|
|||||||
./objdump.nix
|
./objdump.nix
|
||||||
./obsidian.nix
|
./obsidian.nix
|
||||||
./offlineimap.nix
|
./offlineimap.nix
|
||||||
|
./ols.nix
|
||||||
./open-in-mpv.nix
|
./open-in-mpv.nix
|
||||||
./pactl.nix
|
./pactl.nix
|
||||||
./pipewire.nix
|
./pidof.nix
|
||||||
|
./pipewire
|
||||||
|
./pkill.nix
|
||||||
./planify.nix
|
./planify.nix
|
||||||
./portfolio-filemanager.nix
|
./portfolio-filemanager.nix
|
||||||
./playerctl.nix
|
./playerctl.nix
|
||||||
./ps.nix
|
./ps.nix
|
||||||
|
./qmk-udev-rules.nix
|
||||||
./rhythmbox.nix
|
./rhythmbox.nix
|
||||||
./ripgrep.nix
|
./ripgrep.nix
|
||||||
./rofi
|
./rofi
|
||||||
|
./rsyslog
|
||||||
./rtkit.nix
|
./rtkit.nix
|
||||||
./s6-rc.nix
|
./s6-rc.nix
|
||||||
|
./sane-deadlines.nix
|
||||||
./sane-input-handler
|
./sane-input-handler
|
||||||
./sane-open.nix
|
./sane-open.nix
|
||||||
|
./sane-private-unlock-remote.nix
|
||||||
./sane-screenshot.nix
|
./sane-screenshot.nix
|
||||||
./sane-scripts.nix
|
./sane-scripts.nix
|
||||||
./sane-sysinfo.nix
|
./sane-secrets-unlock.nix
|
||||||
|
./sane-sysload.nix
|
||||||
./sane-theme.nix
|
./sane-theme.nix
|
||||||
./sanebox.nix
|
./sanebox.nix
|
||||||
|
./satellite.nix
|
||||||
./schlock.nix
|
./schlock.nix
|
||||||
./seatd.nix
|
./seatd.nix
|
||||||
./sfeed.nix
|
./sfeed.nix
|
||||||
@@ -136,14 +165,18 @@
|
|||||||
./swaylock.nix
|
./swaylock.nix
|
||||||
./swaynotificationcenter
|
./swaynotificationcenter
|
||||||
./switchboard.nix
|
./switchboard.nix
|
||||||
./sysvol.nix
|
./syshud.nix
|
||||||
./tangram.nix
|
./tangram.nix
|
||||||
./tor-browser.nix
|
./tor-browser.nix
|
||||||
./tuba.nix
|
./tuba.nix
|
||||||
./unl0kr
|
./unl0kr
|
||||||
|
./via.nix
|
||||||
|
./visidata.nix
|
||||||
./vlc.nix
|
./vlc.nix
|
||||||
|
./wally-cli.nix
|
||||||
./waybar
|
./waybar
|
||||||
./waylock.nix
|
./waylock.nix
|
||||||
|
./where-am-i.nix
|
||||||
./wike.nix
|
./wike.nix
|
||||||
./wine.nix
|
./wine.nix
|
||||||
./wireplumber.nix
|
./wireplumber.nix
|
||||||
@@ -151,14 +184,18 @@
|
|||||||
./wvkbd.nix
|
./wvkbd.nix
|
||||||
./xarchiver.nix
|
./xarchiver.nix
|
||||||
./xdg-desktop-portal.nix
|
./xdg-desktop-portal.nix
|
||||||
|
./xdg-desktop-portal-gnome
|
||||||
./xdg-desktop-portal-gtk.nix
|
./xdg-desktop-portal-gtk.nix
|
||||||
./xdg-desktop-portal-wlr.nix
|
./xdg-desktop-portal-wlr.nix
|
||||||
./xdg-terminal-exec.nix
|
./xdg-terminal-exec.nix
|
||||||
./xdg-utils.nix
|
./xdg-utils.nix
|
||||||
|
./youtube-tui.nix
|
||||||
./zathura.nix
|
./zathura.nix
|
||||||
./zeal.nix
|
./zeal.nix
|
||||||
./zecwallet-lite.nix
|
./zecwallet-lite.nix
|
||||||
./zulip.nix
|
./zulip.nix
|
||||||
|
./zsa-udev-rules.nix
|
||||||
|
./zfs-tools.nix
|
||||||
./zsh
|
./zsh
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@@ -50,32 +50,13 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
packageUnwrapped = (pkgs.dino.override {
|
packageUnwrapped = pkgs.dino.override {
|
||||||
# XXX(2024/04/24): build without echo cancelation (i.e. force WITH_VOICE_PROCESSOR to be undefined).
|
# XXX(2024/04/24): build without echo cancelation (i.e. force WITH_VOICE_PROCESSOR to be undefined).
|
||||||
# this means that if the other end of the call is on speaker phone, i'm liable to hear my own voice
|
# this means that if the other end of the call is on speaker phone, i'm liable to hear my own voice
|
||||||
# leave their speaker, enter their mic, and then return to me.
|
# leave their speaker, enter their mic, and then return to me.
|
||||||
# the benefit is a >50% reduction in CPU use. insignificant on any modern PC; make-or-break on a low-power Pinephone.
|
# the benefit is a >50% reduction in CPU use. insignificant on any modern PC; make-or-break on a low-power Pinephone.
|
||||||
webrtc-audio-processing = null;
|
webrtc-audio-processing = null;
|
||||||
}).overrideAttrs (upstream: {
|
};
|
||||||
# i'm updating experimentally to see if it improves call performance.
|
|
||||||
# i don't *think* this is actually necessary; i don't notice any difference.
|
|
||||||
version = "0.4.3-unstable-2024-04-28";
|
|
||||||
src = lib.warnIf (lib.versionOlder "0.4.3" upstream.version) "dino update: safe to remove sane patches" pkgs.fetchFromGitHub {
|
|
||||||
owner = "dino";
|
|
||||||
repo = "dino";
|
|
||||||
rev = "657502955567dd538e56f300e075c7db52e25d74";
|
|
||||||
hash = "sha256-SApJy9FgxxLOB5A/zGtpdFZtSqSiS03vggRrCte1tFE=";
|
|
||||||
};
|
|
||||||
# avoid double-application of upstreamed patches
|
|
||||||
# https://github.com/NixOS/nixpkgs/pull/309265
|
|
||||||
patches = [];
|
|
||||||
checkPhase = ''
|
|
||||||
runHook preCheck
|
|
||||||
./xmpp-vala-test
|
|
||||||
# ./signal-protocol-vala-test # doesn't exist anymore
|
|
||||||
runHook postCheck
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
|
|
||||||
sandbox.method = "bwrap";
|
sandbox.method = "bwrap";
|
||||||
sandbox.net = "clearnet";
|
sandbox.net = "clearnet";
|
||||||
|
@@ -6,6 +6,17 @@ in
|
|||||||
sane.programs.eg25-control = {
|
sane.programs.eg25-control = {
|
||||||
suggestedPrograms = [ "mmcli" ];
|
suggestedPrograms = [ "mmcli" ];
|
||||||
|
|
||||||
|
sandbox.method = "bwrap";
|
||||||
|
sandbox.extraPaths = [
|
||||||
|
"/sys/class/modem-power"
|
||||||
|
"/sys/devices"
|
||||||
|
# "/var/lib/eg25-control"
|
||||||
|
];
|
||||||
|
sandbox.net = "all"; #< for downloading the almanac
|
||||||
|
sandbox.whitelistDbus = [
|
||||||
|
"system" #< used by `mmcli`
|
||||||
|
];
|
||||||
|
|
||||||
services.eg25-control-powered = {
|
services.eg25-control-powered = {
|
||||||
description = "eg25-control-powered: power to the Qualcomm eg25 modem used by PinePhone";
|
description = "eg25-control-powered: power to the Qualcomm eg25 modem used by PinePhone";
|
||||||
startCommand = "eg25-control --power-on --verbose";
|
startCommand = "eg25-control --power-on --verbose";
|
||||||
@@ -21,6 +32,7 @@ in
|
|||||||
startCommand = "eg25-control --enable-gps --dump-debug-info --verbose";
|
startCommand = "eg25-control --enable-gps --dump-debug-info --verbose";
|
||||||
cleanupCommand = "eg25-control --disable-gps --dump-debug-info --verbose";
|
cleanupCommand = "eg25-control --disable-gps --dump-debug-info --verbose";
|
||||||
depends = [ "eg25-control-powered" ];
|
depends = [ "eg25-control-powered" ];
|
||||||
|
partOf = [ "gps" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
persist.byStore.plaintext = [ ".cache/eg25-control" ]; #< for cached agps data
|
persist.byStore.plaintext = [ ".cache/eg25-control" ]; #< for cached agps data
|
||||||
|
@@ -45,6 +45,9 @@
|
|||||||
"Videos/servo"
|
"Videos/servo"
|
||||||
"tmp"
|
"tmp"
|
||||||
];
|
];
|
||||||
|
sandbox.extraPaths = [
|
||||||
|
"/dev/snd" #< needed only when playing embedded audio (not embedded video!)
|
||||||
|
];
|
||||||
|
|
||||||
# creds/session keys, etc
|
# creds/session keys, etc
|
||||||
persist.byStore.private = [ ".config/Element" ];
|
persist.byStore.private = [ ".config/Element" ];
|
||||||
|
@@ -1,19 +1,15 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
sane.programs.errno = {
|
sane.programs.errno = {
|
||||||
# packageUnwrapped = pkgs.linkIntoOwnPackage pkgs.moreutils "bin/errno";
|
# packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.moreutils "errno";
|
||||||
# actually, don't build all of moreutils because not all of it builds for cross targets.
|
# actually, don't build all of moreutils because not all of it builds for cross targets.
|
||||||
# some of this can be simplified after <https://github.com/NixOS/nixpkgs/pull/316446>
|
|
||||||
packageUnwrapped = pkgs.moreutils.overrideAttrs (base: {
|
packageUnwrapped = pkgs.moreutils.overrideAttrs (base: {
|
||||||
makeFlags = (base.makeFlags or []) ++ [
|
makeFlags = (base.makeFlags or []) ++ [
|
||||||
"BINS=errno"
|
"BINS=errno"
|
||||||
"MANS=errno.1"
|
"MANS=errno.1"
|
||||||
"PERLSCRIPTS=errno" #< Makefile errors if empty, but this works :)
|
"PERLSCRIPTS=errno" #< Makefile errors if empty, but this works :)
|
||||||
"INSTALL_BIN=install"
|
|
||||||
];
|
];
|
||||||
#v disable the perl-specific stuff
|
buildInputs = []; #< errno has no runtime perl deps, and they don't cross compile, so disable them.
|
||||||
propagatedBuildInputs = [];
|
|
||||||
postInstall = "";
|
|
||||||
});
|
});
|
||||||
|
|
||||||
sandbox.method = "landlock";
|
sandbox.method = "landlock";
|
||||||
|
7
hosts/common/programs/exiftool.nix
Normal file
7
hosts/common/programs/exiftool.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
sane.programs.exiftool = {
|
||||||
|
sandbox.method = "bwrap";
|
||||||
|
sandbox.autodetectCliPaths = "existingFile";
|
||||||
|
};
|
||||||
|
}
|
@@ -55,7 +55,7 @@ in
|
|||||||
# - theme-demo
|
# - theme-demo
|
||||||
# - timeout-completed
|
# - timeout-completed
|
||||||
# - window-close
|
# - window-close
|
||||||
fs.".config/feedbackd/themes/proxied.json".symlink.text = builtins.toJSON {
|
fs.".config/feedbackd/themes/proxied.json".symlink.target = pkgs.writers.writeJSON "proxied.json" {
|
||||||
name = "proxied";
|
name = "proxied";
|
||||||
parent-theme = "default";
|
parent-theme = "default";
|
||||||
profiles = [
|
profiles = [
|
||||||
|
13
hosts/common/programs/firefox-xdg-open.nix
Normal file
13
hosts/common/programs/firefox-xdg-open.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
sane.programs.firefox-xdg-open = {
|
||||||
|
packageUnwrapped = pkgs.firefox-extensions.firefox-xdg-open.systemComponent;
|
||||||
|
|
||||||
|
sandbox.method = "bwrap";
|
||||||
|
sandbox.whitelistDbus = [ "user" ]; # for xdg-open/portals
|
||||||
|
|
||||||
|
mime.associations."x-scheme-handler/xdg-open" = "xdg-open.desktop";
|
||||||
|
|
||||||
|
suggestedPrograms = [ "xdg-utils" ];
|
||||||
|
};
|
||||||
|
}
|
@@ -105,6 +105,33 @@ let
|
|||||||
};
|
};
|
||||||
# extraPrefs = ...
|
# extraPrefs = ...
|
||||||
}).overrideAttrs (base: {
|
}).overrideAttrs (base: {
|
||||||
|
nativeBuildInputs = (base.nativeBuildInputs or []) ++ [
|
||||||
|
pkgs.copyDesktopItems
|
||||||
|
];
|
||||||
|
desktopItems = (base.desktopItems or []) ++ [
|
||||||
|
(pkgs.makeDesktopItem {
|
||||||
|
name = "${cfg.browser.libName}-in-vpn";
|
||||||
|
desktopName = "${cfg.browser.libName} (VPN)";
|
||||||
|
genericName = "Web Browser";
|
||||||
|
# N.B.: --new-instance ensures we don't reuse an existing differenty-namespaced instance.
|
||||||
|
# OTOH, it may error about "only one instance can run at a time": close the other instance if you see that.
|
||||||
|
exec = "${lib.getExe pkgs.sane-scripts.vpn} do default -- ${cfg.browser.libName} --new-instance";
|
||||||
|
icon = cfg.browser.libName;
|
||||||
|
categories = [ "Network" "WebBrowser" ];
|
||||||
|
type = "Application";
|
||||||
|
})
|
||||||
|
(pkgs.makeDesktopItem {
|
||||||
|
name = "${cfg.browser.libName}-stub-dns";
|
||||||
|
desktopName = "${cfg.browser.libName} (stub DNS)";
|
||||||
|
genericName = "Web Browser";
|
||||||
|
# N.B.: --new-instance ensures we don't reuse an existing differently-namespaced instance.
|
||||||
|
# OTOH, it may error about "only one instance can run at a time": close the other instance if you see that.
|
||||||
|
exec = "${lib.getExe pkgs.sane-scripts.vpn} do none -- ${cfg.browser.libName} --new-instance";
|
||||||
|
icon = cfg.browser.libName;
|
||||||
|
categories = [ "Network" "WebBrowser" ];
|
||||||
|
type = "Application";
|
||||||
|
})
|
||||||
|
];
|
||||||
# de-associate `ctrl+shift+c` from activating the devtools.
|
# de-associate `ctrl+shift+c` from activating the devtools.
|
||||||
# based on <https://stackoverflow.com/a/54260938>
|
# based on <https://stackoverflow.com/a/54260938>
|
||||||
# TODO: could use `zip -f` to only update the one changed file, instead of rezipping everything.
|
# TODO: could use `zip -f` to only update the one changed file, instead of rezipping everything.
|
||||||
@@ -130,7 +157,8 @@ let
|
|||||||
echo "omni.ja AFTER:"
|
echo "omni.ja AFTER:"
|
||||||
ls -l $out/lib/${cfg.browser.libName}/browser/omni.ja
|
ls -l $out/lib/${cfg.browser.libName}/browser/omni.ja
|
||||||
|
|
||||||
# runHook postFixup to allow sane.programs sandbox wrappers to wrap the binaries
|
runHook postBuild
|
||||||
|
runHook postInstall
|
||||||
runHook postFixup
|
runHook postFixup
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
@@ -160,7 +188,7 @@ let
|
|||||||
persistCache = mkOption {
|
persistCache = mkOption {
|
||||||
description = "optional store name to which persist browser cache";
|
description = "optional store name to which persist browser cache";
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = "cryptClearOnBoot";
|
default = "ephemeral";
|
||||||
};
|
};
|
||||||
addons = mkOption {
|
addons = mkOption {
|
||||||
type = types.attrsOf addonOpts;
|
type = types.attrsOf addonOpts;
|
||||||
@@ -203,6 +231,11 @@ in
|
|||||||
package = pkgs.firefox-extensions.ether-metamask;
|
package = pkgs.firefox-extensions.ether-metamask;
|
||||||
enable = lib.mkDefault false; # until i can disable the first-run notification
|
enable = lib.mkDefault false; # until i can disable the first-run notification
|
||||||
};
|
};
|
||||||
|
firefox-xdg-open = {
|
||||||
|
# test: `xdg-open xdg-open:https://uninsane.org`
|
||||||
|
package = pkgs.firefox-extensions.firefox-xdg-open;
|
||||||
|
enable = lib.mkDefault true;
|
||||||
|
};
|
||||||
i2p-in-private-browsing = {
|
i2p-in-private-browsing = {
|
||||||
package = pkgs.firefox-extensions.i2p-in-private-browsing;
|
package = pkgs.firefox-extensions.i2p-in-private-browsing;
|
||||||
enable = lib.mkDefault config.services.i2p.enable;
|
enable = lib.mkDefault config.services.i2p.enable;
|
||||||
@@ -214,7 +247,7 @@ in
|
|||||||
open-in-mpv = {
|
open-in-mpv = {
|
||||||
# test: `open-in-mpv 'mpv:///open?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ'`
|
# test: `open-in-mpv 'mpv:///open?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ'`
|
||||||
package = pkgs.firefox-extensions.open-in-mpv;
|
package = pkgs.firefox-extensions.open-in-mpv;
|
||||||
enable = lib.mkDefault config.sane.programs.open-in-mpv.enabled;
|
enable = lib.mkDefault false;
|
||||||
};
|
};
|
||||||
sidebery = {
|
sidebery = {
|
||||||
package = pkgs.firefox-extensions.sidebery;
|
package = pkgs.firefox-extensions.sidebery;
|
||||||
@@ -263,13 +296,15 @@ in
|
|||||||
# TODO: find a way to not expose ~/.ssh to firefox
|
# TODO: find a way to not expose ~/.ssh to firefox
|
||||||
# - unlock sops at login (or before firefox launch)?
|
# - unlock sops at login (or before firefox launch)?
|
||||||
# - see if ssh has a more formal type of subkey system?
|
# - see if ssh has a more formal type of subkey system?
|
||||||
".ssh/id_ed25519"
|
# ".ssh/id_ed25519"
|
||||||
# ".config/sops"
|
# ".config/sops"
|
||||||
"knowledge/secrets/accounts"
|
"knowledge/secrets/accounts"
|
||||||
];
|
];
|
||||||
fs.".config/sops".dir = lib.mkIf cfg.addons.browserpass-extension.enable {}; #< needs to be created, not *just* added to the sandbox
|
fs.".config/sops".dir = lib.mkIf cfg.addons.browserpass-extension.enable {}; #< needs to be created, not *just* added to the sandbox
|
||||||
|
|
||||||
suggestedPrograms = [
|
suggestedPrograms = lib.optionals cfg.addons.firefox-xdg-open.enable [
|
||||||
|
"firefox-xdg-open"
|
||||||
|
] ++ lib.optionals cfg.addons.open-in-mpv.enable [
|
||||||
"open-in-mpv"
|
"open-in-mpv"
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -341,13 +376,11 @@ in
|
|||||||
// configure which extensions are visible by default (TODO: requires a lot of trial and error)
|
// configure which extensions are visible by default (TODO: requires a lot of trial and error)
|
||||||
// defaultPref("browser.uiCustomization.state", ...);
|
// defaultPref("browser.uiCustomization.state", ...);
|
||||||
|
|
||||||
// auto-open mpv:// URIs without prompting.
|
// auto-open specific URI schemes without prompting:
|
||||||
// can do this with other protocols too (e.g. matrix?). see about:config for common handlers.
|
defaultPref("network.protocol-handler.external.xdg-open", true); // for firefox-xdg-open extension
|
||||||
defaultPref("network.protocol-handler.external.mpv", true);
|
defaultPref("network.protocol-handler.external.mpv", true); // for open-in-mpv extension
|
||||||
// element:// for Element matrix client
|
defaultPref("network.protocol-handler.external.element", true); // for Element matrix client
|
||||||
defaultPref("network.protocol-handler.external.element", true);
|
defaultPref("network.protocol-handler.external.matrix", true); // for Nheko matrix client
|
||||||
// matrix: for Nheko matrix client
|
|
||||||
defaultPref("network.protocol-handler.external.matrix", true);
|
|
||||||
'';
|
'';
|
||||||
# instruct Firefox to put the profile in a predictable directory (so we can do things like persist just it).
|
# instruct Firefox to put the profile in a predictable directory (so we can do things like persist just it).
|
||||||
# XXX: the directory *must* exist, even if empty; Firefox will not create the directory itself.
|
# XXX: the directory *must* exist, even if empty; Firefox will not create the directory itself.
|
||||||
@@ -372,14 +405,14 @@ in
|
|||||||
if (cfg.persistData != null) then
|
if (cfg.persistData != null) then
|
||||||
cfg.persistData
|
cfg.persistData
|
||||||
else
|
else
|
||||||
"cryptClearOnBoot"
|
"ephemeral"
|
||||||
;
|
;
|
||||||
|
|
||||||
persist.byPath."${cfg.browser.dotDir}/default".store =
|
persist.byPath."${cfg.browser.dotDir}/default".store =
|
||||||
if (cfg.persistData != null) then
|
if (cfg.persistData != null) then
|
||||||
cfg.persistData
|
cfg.persistData
|
||||||
else
|
else
|
||||||
"cryptClearOnBoot"
|
"ephemeral"
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1,12 +1,16 @@
|
|||||||
# Flare is a 3rd-party GTK4 Signal app.
|
# Flare is a 3rd-party GTK4 Signal app.
|
||||||
# UI is effectively a clone of Fractal.
|
# UI is effectively a clone of Fractal.
|
||||||
#
|
#
|
||||||
### compatibility:
|
### compatibility (2023-10-30):
|
||||||
# - desko: works fine. pairs, and exchanges contact list (but not message history) with the paired device. exchanges future messages fine.
|
# - desko: works fine. pairs, and exchanges contact list (but not message history) with the paired device. exchanges future messages fine.
|
||||||
# - moby (cross compiled flare-signal-nixified): nope. it pairs, but can only *receive* messages and never *send* them.
|
# - moby (cross compiled flare-signal-nixified): nope. it pairs, but can only *receive* messages and never *send* them.
|
||||||
# - even `rsync`ing the data and keyrings from desko -> moby, still fails in that same manner.
|
# - even `rsync`ing the data and keyrings from desko -> moby, still fails in that same manner.
|
||||||
# - console shows error messages. quite possibly an endianness mismatch somewhere
|
# - console shows error messages. quite possibly an endianness mismatch somewhere
|
||||||
# - moby (partially-emulated flare-signal): works! pairs and can send/receive messages, same as desko.
|
# - moby (partially-emulated flare-signal): works! pairs and can send/receive messages, same as desko.
|
||||||
|
### compatibility (2024-08-07):
|
||||||
|
# - linking flare to iOS signal "works", but neither side can exchange messages nor contacts
|
||||||
|
# in iOS i see "A message from Colin could not be delivered"
|
||||||
|
# - registering as primary device does not work ("you are not authorized", or some such)
|
||||||
#
|
#
|
||||||
### debugging:
|
### debugging:
|
||||||
# - `RUST_LOG=flare=trace flare`
|
# - `RUST_LOG=flare=trace flare`
|
||||||
@@ -18,7 +22,7 @@
|
|||||||
# ERROR presage::manager] Error opening envelope: ProtobufDecodeError(DecodeError { description: "invalid tag value: 0", stack: [("Content", "data_message")] }), message will be skipped!
|
# ERROR presage::manager] Error opening envelope: ProtobufDecodeError(DecodeError { description: "invalid tag value: 0", stack: [("Content", "data_message")] }), message will be skipped!
|
||||||
# ERROR presage::manager] Error opening envelope: ProtobufDecodeError(DecodeError { description: "invalid tag value: 0", stack: [("Content", "data_message")] }), message will be skipped!
|
# ERROR presage::manager] Error opening envelope: ProtobufDecodeError(DecodeError { description: "invalid tag value: 0", stack: [("Content", "data_message")] }), message will be skipped!
|
||||||
# ```
|
# ```
|
||||||
# - this occurs on moby, desko, `flare-signal` and `flare-signal-nixified`
|
# - this occurs on moby, desko, `flare-signal` and `flare-signal-nixified` (2023-12-14)
|
||||||
# - the Websocket error seems to be unrelated, occurs during normal/good operation
|
# - the Websocket error seems to be unrelated, occurs during normal/good operation
|
||||||
# - related issues: <https://github.com/whisperfish/presage/issues/152>
|
# - related issues: <https://github.com/whisperfish/presage/issues/152>
|
||||||
#
|
#
|
||||||
@@ -28,7 +32,7 @@
|
|||||||
# No current session
|
# No current session
|
||||||
# ERROR presage::manager] Error opening envelope: SignalProtocolError(InvalidKyberPreKeyId), message will be skipped!
|
# ERROR presage::manager] Error opening envelope: SignalProtocolError(InvalidKyberPreKeyId), message will be skipped!
|
||||||
# ```
|
# ```
|
||||||
# - but signal iOS will still read it.
|
# - but signal iOS will still read it (2023-12-14).
|
||||||
#
|
#
|
||||||
#### HTTP 405 when linking flare to iOS signal:
|
#### HTTP 405 when linking flare to iOS signal:
|
||||||
# [DEBUG libsignal_service_hyper::push_service] HTTP request PUT https://chat.signal.org/v1/devices/{uuid}.{timestamp?}:{b64-string}
|
# [DEBUG libsignal_service_hyper::push_service] HTTP request PUT https://chat.signal.org/v1/devices/{uuid}.{timestamp?}:{b64-string}
|
||||||
@@ -43,7 +47,7 @@
|
|||||||
# ),
|
# ),
|
||||||
# ),
|
# ),
|
||||||
# )
|
# )
|
||||||
# flare matrix suggests the signal endpoint has changed:
|
# flare matrix suggests the signal endpoint has changed (2023-12-14):
|
||||||
# - "/v1/device/link instead of confirming via /v1/devices/{I'd}"
|
# - "/v1/device/link instead of confirming via /v1/devices/{I'd}"
|
||||||
# - this endpoint is declared in libsignal-service-rs (used both by flare and presage)
|
# - this endpoint is declared in libsignal-service-rs (used both by flare and presage)
|
||||||
# - libsignal-service/src/provisioning/manager.rs
|
# - libsignal-service/src/provisioning/manager.rs
|
||||||
@@ -73,5 +77,13 @@
|
|||||||
# and it persists some dconf settings (e.g. device name). reset with:
|
# and it persists some dconf settings (e.g. device name). reset with:
|
||||||
# - `dconf reset -f /de/schmidhuberj/Flare/`.
|
# - `dconf reset -f /de/schmidhuberj/Flare/`.
|
||||||
];
|
];
|
||||||
|
#VVV flare complains if its data directory is a symlink, so put it in a subdirectory behind my persistence symlink.
|
||||||
|
env.FLARE_DATA_PATH = "$HOME/.local/share/flare/data";
|
||||||
|
# sandbox.method = "bwrap";
|
||||||
|
# sandbox.net = "clearnet";
|
||||||
|
# sandbox.whitelistWayland = true;
|
||||||
|
# sandbox.whitelistDbus = [
|
||||||
|
# "user" # so i can click on links, at least
|
||||||
|
# ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
42
hosts/common/programs/foliate.nix
Normal file
42
hosts/common/programs/foliate.nix
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# foliate: <https://johnfactotum.github.io/foliate/>
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
sane.programs.foliate = {
|
||||||
|
sandbox.method = "bwrap";
|
||||||
|
sandbox.net = "clearnet"; #< for dictionary, wikipedia, online book libraries
|
||||||
|
sandbox.whitelistDbus = [ "user" ]; #< when clicking on links
|
||||||
|
sandbox.whitelistDri = true; # reduces startup time and subjective page flip time
|
||||||
|
sandbox.whitelistWayland = true;
|
||||||
|
sandbox.extraHomePaths = [
|
||||||
|
"Books/local"
|
||||||
|
"Books/servo"
|
||||||
|
"tmp" #< for downloaded files
|
||||||
|
];
|
||||||
|
sandbox.extraPaths = [
|
||||||
|
# foliate sandboxes itself with bwrap, which needs these.
|
||||||
|
# but it actually only cares that /sys/{block,bus,class/block} *exist*: it doesn't care if there's anything in them.
|
||||||
|
# so bind empty (sub)directories
|
||||||
|
# and it looks like i might need to keep IPC namespace if i want TTS.
|
||||||
|
"/sys/block/loop7"
|
||||||
|
"/sys/bus/container/devices"
|
||||||
|
"/sys/class/block/loop7"
|
||||||
|
];
|
||||||
|
sandbox.autodetectCliPaths = "existing";
|
||||||
|
|
||||||
|
persist.byStore.plaintext = [
|
||||||
|
".local/share/com.github.johnfactotum.Foliate" #< books added, reading position
|
||||||
|
".cache/com.github.johnfactotum.Foliate" #< webkit cache
|
||||||
|
];
|
||||||
|
|
||||||
|
buildCost = 2; #< webkitgtk 6.0
|
||||||
|
# these associations were taken from its .desktop file
|
||||||
|
mime.associations."application/epub+zip" = "com.github.johnfactotum.Foliate.desktop";
|
||||||
|
mime.associations."application/x-mobipocket-ebook" = "com.github.johnfactotum.Foliate.desktop";
|
||||||
|
mime.associations."application/vnd.amazon.mobi8-ebook" = "com.github.johnfactotum.Foliate.desktop";
|
||||||
|
mime.associations."application/x-fictionbook+xml" = "com.github.johnfactotum.Foliate.desktop";
|
||||||
|
mime.associations."application/x-zip-compressed-fb2" = "com.github.johnfactotum.Foliate.desktop";
|
||||||
|
mime.associations."application/vnd.comicbook+zip" = "com.github.johnfactotum.Foliate.desktop"; # .cbz
|
||||||
|
mime.associations."x-scheme-handler/opds" = "com.github.johnfactotum.Foliate.desktop";
|
||||||
|
mime.priority = 120; #< default is 100; fallback to more specialized cbz handlers, e.g., but keep specializations for epub
|
||||||
|
};
|
||||||
|
}
|
@@ -65,6 +65,9 @@ in
|
|||||||
|
|
||||||
suggestedPrograms = [ "gnome-keyring" ];
|
suggestedPrograms = [ "gnome-keyring" ];
|
||||||
|
|
||||||
|
# direct room links opened from other programs, to fractal.
|
||||||
|
mime.urlAssociations."^https?://matrix.to/#/.+$" = "org.gnome.Fractal.desktop";
|
||||||
|
|
||||||
services.fractal = {
|
services.fractal = {
|
||||||
description = "fractal Matrix client";
|
description = "fractal Matrix client";
|
||||||
partOf = lib.mkIf cfg.config.autostart [ "graphical-session" ];
|
partOf = lib.mkIf cfg.config.autostart [ "graphical-session" ];
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
sane.programs.free = {
|
sane.programs.free = {
|
||||||
packageUnwrapped = pkgs.linkIntoOwnPackage pkgs.procps "bin/free";
|
packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.procps "free";
|
||||||
sandbox.method = "bwrap";
|
sandbox.method = "bwrap";
|
||||||
sandbox.isolatePids = false;
|
sandbox.isolatePids = false;
|
||||||
};
|
};
|
||||||
|
13
hosts/common/programs/gdb.nix
Normal file
13
hosts/common/programs/gdb.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
sane.programs.gdb = {
|
||||||
|
sandbox.enable = false; # gdb doesn't sandbox well. i don't know how you could.
|
||||||
|
# sandbox.method = "landlock"; # permission denied when trying to attach, even as root
|
||||||
|
sandbox.autodetectCliPaths = true;
|
||||||
|
fs.".config/gdb/gdbinit".symlink.text = ''
|
||||||
|
# enable commands like `py-bt`, `py-list`, etc.
|
||||||
|
# for usage, see: <https://wiki.python.org/moin/DebuggingWithGdb>
|
||||||
|
source ${pkgs.python3}/share/gdb/libpython.py
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
@@ -1,7 +1,7 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
sane.programs.gdbus = {
|
sane.programs.gdbus = {
|
||||||
packageUnwrapped = pkgs.linkIntoOwnPackage pkgs.glib "bin/gdbus";
|
packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.glib "gdbus";
|
||||||
|
|
||||||
sandbox.method = "bwrap";
|
sandbox.method = "bwrap";
|
||||||
sandbox.whitelistDbus = [ "user" ]; #< XXX: maybe future users will also want system access
|
sandbox.whitelistDbus = [ "user" ]; #< XXX: maybe future users will also want system access
|
||||||
|
@@ -5,10 +5,10 @@
|
|||||||
# <https://gitlab.gnome.org/GNOME/geary/-/issues/1212>
|
# <https://gitlab.gnome.org/GNOME/geary/-/issues/1212>
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.sane.programs."gnome.geary";
|
cfg = config.sane.programs."geary";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
sane.programs."gnome.geary" = {
|
sane.programs."geary" = {
|
||||||
configOption = with lib; mkOption {
|
configOption = with lib; mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
type = types.submodule {
|
type = types.submodule {
|
||||||
@@ -23,6 +23,13 @@ in
|
|||||||
sandbox.net = "clearnet";
|
sandbox.net = "clearnet";
|
||||||
sandbox.whitelistDbus = [ "user" ]; # notifications
|
sandbox.whitelistDbus = [ "user" ]; # notifications
|
||||||
sandbox.whitelistWayland = true;
|
sandbox.whitelistWayland = true;
|
||||||
|
sandbox.extraHomePaths = [
|
||||||
|
# it shouldn't need these, but portal integration seems incomplete?
|
||||||
|
"tmp"
|
||||||
|
"Pictures/from"
|
||||||
|
"Pictures/Photos"
|
||||||
|
"Pictures/Screenshots"
|
||||||
|
];
|
||||||
sandbox.extraPaths = [
|
sandbox.extraPaths = [
|
||||||
# geary sandboxes *itself* with bwrap, and dbus-proxy which, confusingly, causes it to *require* these paths.
|
# geary sandboxes *itself* with bwrap, and dbus-proxy which, confusingly, causes it to *require* these paths.
|
||||||
# TODO: these could maybe be mounted empty. or maybe there's an env-var to disable geary's dbus-proxy.
|
# TODO: these could maybe be mounted empty. or maybe there's an env-var to disable geary's dbus-proxy.
|
||||||
|
23
hosts/common/programs/geoclue-demo-agent.nix
Normal file
23
hosts/common/programs/geoclue-demo-agent.nix
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
sane.programs.geoclue-demo-agent = {
|
||||||
|
packageUnwrapped = pkgs.linkFarm "geoclue-demo-agent" [{
|
||||||
|
# bring the demo agent into a `bin/` directory so it can be invokable via PATH
|
||||||
|
name = "bin/geoclue-demo-agent";
|
||||||
|
path = "${config.sane.programs.geoclue2.packageUnwrapped}/libexec/geoclue-2.0/demos/agent";
|
||||||
|
}];
|
||||||
|
|
||||||
|
sandbox.method = "bwrap";
|
||||||
|
sandbox.whitelistDbus = [
|
||||||
|
"system"
|
||||||
|
];
|
||||||
|
|
||||||
|
services.geoclue-agent = {
|
||||||
|
description = "geoclue 'demo' agent";
|
||||||
|
# XXX: i don't actually understand how this works: upstream dbus rules would appear to restrict
|
||||||
|
# the dbus owner to just root/geoclue, but we're neither and this still works (and breaks if i remove the agent service!)
|
||||||
|
command = "geoclue-demo-agent";
|
||||||
|
partOf = [ "graphical-session" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
76
hosts/common/programs/geoclue2.nix
Normal file
76
hosts/common/programs/geoclue2.nix
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
# geoclue location services daemon.
|
||||||
|
#
|
||||||
|
# SUPPORT:
|
||||||
|
# - irc: #gnome-maps on irc.gimp.org
|
||||||
|
# - Matrix: #gnome-maps:gnome.org (unclear if bridged to IRC)
|
||||||
|
# - forums: <https://discourse.gnome.org/c/platform>
|
||||||
|
# - git: <https://gitlab.freedesktop.org/geoclue/geoclue/>
|
||||||
|
# - D-Bus API docs: <https://www.freedesktop.org/software/geoclue/docs/>
|
||||||
|
#
|
||||||
|
# HOW TO TEST:
|
||||||
|
# - just invoke `where-am-i`: it should output the current latitude/longitude.
|
||||||
|
## more manual testing:
|
||||||
|
# - build `geoclue2-with-demo-agent`
|
||||||
|
# - run the service: `systemctl start geoclue` or "${geoclue2-with-demo-agent}/libexec/geoclue"
|
||||||
|
# - run "${geoclue2-with-demo-agent}/libexec/geoclue-2.0/demos/agent"
|
||||||
|
# - keep this running in the background
|
||||||
|
# - run "${geoclue2-with-demo-agent}/libexec/geoclue-2.0/demos/where-am-i"
|
||||||
|
#
|
||||||
|
# DATA FLOW:
|
||||||
|
# - geoclue2 does http calls into local `ols`, which either hits the local disk or queries https://wigle.net.
|
||||||
|
# - geoclue users like gnome-maps somehow depend on an "agent",
|
||||||
|
# a user service which launches the geoclue system service on-demand (via dbus activation).
|
||||||
|
#
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.sane.programs.geoclue2;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
sane.programs.geoclue2 = {
|
||||||
|
# packageUnwrapped = pkgs.rmDbusServices pkgs.geoclue2;
|
||||||
|
# packageUnwrapped = pkgs.geoclue2.override { withDemoAgent = true; };
|
||||||
|
packageUnwrapped = pkgs.geoclue2-with-demo-agent;
|
||||||
|
suggestedPrograms = [
|
||||||
|
"avahi" #< to discover LAN gps devices
|
||||||
|
"geoclue-demo-agent"
|
||||||
|
# "gps-share"
|
||||||
|
"iio-sensor-proxy"
|
||||||
|
"ols" #< WiFi SSID -> lat/long lookups
|
||||||
|
"satellite" #< graphical view into GPS fix data
|
||||||
|
"where-am-i" #< handy debugging/testing tool
|
||||||
|
];
|
||||||
|
|
||||||
|
# XXX(2024/07/05): no way to plumb my sandboxed geoclue into `services.geoclue2`.
|
||||||
|
# then, the package doesn't get used directly anywhere. but other programs reference `packageUnwrapped`,
|
||||||
|
# so keep that part still.
|
||||||
|
sandbox.enable = false;
|
||||||
|
package = lib.mkForce null;
|
||||||
|
|
||||||
|
# experimental sandboxing (2024/07/05)
|
||||||
|
# sandbox.method = "bwrap";
|
||||||
|
# sandbox.whitelistDbus = [
|
||||||
|
# "system"
|
||||||
|
# ];
|
||||||
|
# sandbox.net = "all";
|
||||||
|
};
|
||||||
|
|
||||||
|
# sane.programs.geoclue2.enableFor.system = lib.mkIf (builtins.any (en: en) (builtins.attrValues cfg.enableFor.user)) true;
|
||||||
|
|
||||||
|
services.geoclue2 = lib.mkIf cfg.enabled {
|
||||||
|
enable = true;
|
||||||
|
geoProviderUrl = "http://127.0.0.1:8088/v1/geolocate"; #< ols
|
||||||
|
# XXX(2024/06/25): when Geoclue uses ModemManager's GPS API, it wants to enable GPS
|
||||||
|
# tracking at the start, and disable it at the end. that causes tracking to be lost, regularly.
|
||||||
|
# this is not optional behavior: if Geoclue fails to control modem manager (because of a polkit policy, say),
|
||||||
|
# then it won't even try to read the data from modem manager.
|
||||||
|
# SOLUTION: tell Geoclue to get GPS from gps-share ("enableNmea", i.e. `network-nmea.enable`)
|
||||||
|
# and NOT from modem manager.
|
||||||
|
enableModemGPS = false;
|
||||||
|
enableNmea = true;
|
||||||
|
};
|
||||||
|
systemd.user.services = lib.mkIf cfg.enabled {
|
||||||
|
# nixos services.geoclue2 runs the agent as a user service by default, but i don't use systemd so that doesn't work.
|
||||||
|
# i manage the agent myself, in sane.programs.geoclue-demo-agent.
|
||||||
|
geoclue-agent.enable = false;
|
||||||
|
};
|
||||||
|
}
|
@@ -40,6 +40,7 @@ in
|
|||||||
alias.amend = "commit --amend --no-edit";
|
alias.amend = "commit --amend --no-edit";
|
||||||
alias.br = "branch";
|
alias.br = "branch";
|
||||||
alias.co = "checkout";
|
alias.co = "checkout";
|
||||||
|
alias.com = "commit";
|
||||||
alias.cp = "cherry-pick";
|
alias.cp = "cherry-pick";
|
||||||
alias.d = "difftool";
|
alias.d = "difftool";
|
||||||
alias.dif = "diff"; # common typo
|
alias.dif = "diff"; # common typo
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
# gnome feeds RSS viewer
|
# gnome feeds RSS viewer
|
||||||
{ config, lib, sane-lib, ... }:
|
{ config, lib, pkgs, sane-lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
feeds = sane-lib.feeds;
|
feeds = sane-lib.feeds;
|
||||||
all-feeds = config.sane.feeds;
|
all-feeds = config.sane.feeds;
|
||||||
wanted-feeds = feeds.filterByFormat ["text" "image"] all-feeds;
|
wanted-feeds = feeds.filterByFormat ["text" "image"] all-feeds;
|
||||||
in {
|
in {
|
||||||
sane.programs.gnome-feeds.fs.".config/org.gabmus.gfeeds.json".symlink.text = builtins.toJSON {
|
sane.programs.gnome-feeds.fs.".config/org.gabmus.gfeeds.json".symlink.target = pkgs.writers.writeJSON "org.gabmus.gfeeds.json" {
|
||||||
# feed format is a map from URL to a dict,
|
# feed format is a map from URL to a dict,
|
||||||
# with dict["tags"] a list of string tags.
|
# with dict["tags"] a list of string tags.
|
||||||
feeds = sane-lib.mapToAttrs (feed: {
|
feeds = sane-lib.mapToAttrs (feed: {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
{ lib, pkgs, ... }:
|
{ lib, pkgs, ... }:
|
||||||
{
|
{
|
||||||
sane.programs.gnome-keyring = {
|
sane.programs.gnome-keyring = {
|
||||||
packageUnwrapped = pkgs.rmDbusServices pkgs.gnome.gnome-keyring;
|
packageUnwrapped = pkgs.rmDbusServices pkgs.gnome-keyring;
|
||||||
sandbox.method = "bwrap";
|
sandbox.method = "bwrap";
|
||||||
sandbox.whitelistDbus = [ "user" ];
|
sandbox.whitelistDbus = [ "user" ];
|
||||||
sandbox.extraRuntimePaths = [
|
sandbox.extraRuntimePaths = [
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
];
|
];
|
||||||
sandbox.capabilities = [
|
sandbox.capabilities = [
|
||||||
# ipc_lock: used to `mlock` the secrets so they don't get swapped out.
|
# ipc_lock: used to `mlock` the secrets so they don't get swapped out.
|
||||||
# this is optional, and systemd likely doesn't propagate it anyway
|
# this is optional, and user namespacing (bwrap) likely doesn't propagate it anyway
|
||||||
"ipc_lock"
|
"ipc_lock"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user