mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-19 14:20:19 +00:00
Compare commits
814 Commits
wip-home-a
...
python-upd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
adcb962602 | ||
|
|
642a9fbf91 | ||
|
|
3866c31293 | ||
|
|
fa245b0ed1 | ||
|
|
337391905d | ||
|
|
cf5bc09677 | ||
|
|
e897ed12c0 | ||
|
|
b7b75e170d | ||
|
|
de313dbc65 | ||
|
|
3778694de1 | ||
|
|
bf11684a07 | ||
|
|
c28c8c4968 | ||
|
|
a0f72dc54b | ||
|
|
d1a808ebb5 | ||
|
|
377e002e62 | ||
|
|
350e502ee3 | ||
|
|
58949c1424 | ||
|
|
44b7f94bb6 | ||
|
|
fd29e75bed | ||
|
|
946985e138 | ||
|
|
e5fd0c42e1 | ||
|
|
2ed94e34be | ||
|
|
630c0bf485 | ||
|
|
c63c6131a2 | ||
|
|
da6428a8e9 | ||
|
|
b53240d4a7 | ||
|
|
88bbe204d6 | ||
|
|
962966884b | ||
|
|
b5ba00d6e6 | ||
|
|
58b445add9 | ||
|
|
f5ee660af8 | ||
|
|
0a1e9464ac | ||
|
|
c4c42d7576 | ||
|
|
1d657c44aa | ||
|
|
f1db300fb7 | ||
|
|
a1a982f3ac | ||
|
|
c8abf6799f | ||
|
|
b1caebbe53 | ||
|
|
4bde980b79 | ||
|
|
68b7274801 | ||
|
|
2870c1590e | ||
|
|
3b4d0b5b50 | ||
|
|
83739cbff4 | ||
|
|
410e6786ee | ||
|
|
eafd86e06e | ||
|
|
532a3cfd2c | ||
|
|
fbed18c67e | ||
|
|
7b7b2cd2a4 | ||
|
|
bc69884708 | ||
|
|
3045b3eec1 | ||
|
|
a4d32b7043 | ||
|
|
a1c4313910 | ||
|
|
a8d3c0bf4f | ||
|
|
5ce039dd14 | ||
|
|
74b82a2f0e | ||
|
|
7dac397d6a | ||
|
|
d4237b8be4 | ||
|
|
690c999c43 | ||
|
|
1cff7d4155 | ||
|
|
b48491f273 | ||
|
|
1f2479e6df | ||
|
|
4d71937a61 | ||
|
|
5e41d0ecc0 | ||
|
|
057216a37c | ||
|
|
5c57aa1672 | ||
|
|
5d26fdeb1e | ||
|
|
b8bb1cdaf6 | ||
|
|
1069057748 | ||
|
|
381deaa64d | ||
|
|
3588b0fb4e | ||
|
|
7a96dc70ba | ||
|
|
4ba2463f94 | ||
|
|
a50d28d1d3 | ||
|
|
6736e60ae6 | ||
|
|
7105f3a928 | ||
|
|
85a7ac53e8 | ||
|
|
5a30525159 | ||
|
|
b06389d558 | ||
|
|
a77e5ae971 | ||
|
|
f411bb6c64 | ||
|
|
f90f3bf4cc | ||
|
|
64484b8597 | ||
|
|
92c054dd8e | ||
|
|
7c7e9b63a7 | ||
|
|
f2b42c63c7 | ||
|
|
032a9ef168 | ||
|
|
d53de93bf8 | ||
|
|
20e242f787 | ||
|
|
f90873247c | ||
|
|
749366b838 | ||
|
|
8417c78282 | ||
|
|
9c41ccbeb4 | ||
|
|
26a5b458bf | ||
|
|
1683cefb76 | ||
|
|
8a7e8fa5d7 | ||
|
|
a71d8d0a77 | ||
|
|
3e4ed063dc | ||
|
|
a14987429b | ||
|
|
de2ffda7f5 | ||
|
|
6510ee7902 | ||
|
|
2f964dc707 | ||
|
|
e5309b78c7 | ||
|
|
acee2e4eb1 | ||
|
|
047568e93a | ||
|
|
b7a4631688 | ||
|
|
6da9824e6e | ||
|
|
67ed03f1b7 | ||
|
|
5d46ad4f70 | ||
|
|
3ed80cb0f8 | ||
|
|
52364cdb4d | ||
|
|
7e5819dd50 | ||
|
|
efea347888 | ||
|
|
cefd637655 | ||
|
|
c461b30a44 | ||
|
|
e2afc6389a | ||
|
|
388118e924 | ||
|
|
ab9b56b1cd | ||
|
|
5525532c90 | ||
|
|
e1152ac37f | ||
|
|
6f15bff33f | ||
|
|
608440c308 | ||
|
|
8800315219 | ||
|
|
fc4addd5e2 | ||
|
|
d44b305df6 | ||
|
|
c46c9099d1 | ||
|
|
10a1d7bbc7 | ||
|
|
1f6e6e4b2a | ||
|
|
f199154f96 | ||
|
|
33d84624d0 | ||
|
|
477b99c160 | ||
|
|
456fce4635 | ||
|
|
9e5cc8229d | ||
|
|
979419f503 | ||
|
|
b6c65d644a | ||
|
|
49226ffb1f | ||
|
|
0266c7934c | ||
|
|
23dcee7522 | ||
|
|
6890e07ba0 | ||
|
|
544f754c20 | ||
|
|
f741d64136 | ||
|
|
891da74fce | ||
|
|
06dfbf0d11 | ||
|
|
e198511a40 | ||
|
|
fddffb3ed3 | ||
|
|
1e2e151fdd | ||
|
|
fc6387d3e8 | ||
|
|
06adb831b5 | ||
|
|
e1a8d25480 | ||
|
|
939cd9f1e1 | ||
|
|
d6121a657e | ||
|
|
2230303f37 | ||
|
|
e2cff646dd | ||
|
|
c9e96c441e | ||
|
|
76952c433e | ||
|
|
54c092e389 | ||
|
|
866622fe13 | ||
|
|
903f3e3aa3 | ||
|
|
3ae9c6bfdc | ||
|
|
9915bfc097 | ||
|
|
e1cb5ae41a | ||
|
|
1945caaef1 | ||
|
|
8d4be9ccfc | ||
|
|
809f92fd89 | ||
|
|
453bebb437 | ||
|
|
0a6fdc8d9e | ||
|
|
910643a2db | ||
|
|
00b7e866a1 | ||
|
|
077887b25a | ||
|
|
b6639e5a94 | ||
|
|
981d025718 | ||
|
|
93fa0d921c | ||
|
|
083c8228c8 | ||
|
|
95bda981d9 | ||
|
|
1eb54d57ee | ||
|
|
d5032f3479 | ||
|
|
67f30614fa | ||
|
|
651b4f5df0 | ||
|
|
74a9028cba | ||
|
|
3c610a0aac | ||
|
|
5fec93cca0 | ||
|
|
b6b7b35322 | ||
|
|
28102d6050 | ||
|
|
0a45115096 | ||
|
|
b0afb74b1f | ||
|
|
445ed02f81 | ||
|
|
f52fcacc8b | ||
|
|
af5d1e82cb | ||
|
|
10a59042c9 | ||
|
|
b353942f83 | ||
|
|
199d96bb89 | ||
|
|
ca77359dab | ||
|
|
3138bfc3c4 | ||
|
|
bffe2190a6 | ||
|
|
e58309c955 | ||
|
|
82a540c7cf | ||
|
|
273b74f254 | ||
|
|
8470182210 | ||
|
|
131ff07c1d | ||
|
|
46fe22c9be | ||
|
|
5ef38a76d6 | ||
|
|
cb0f1e0fe8 | ||
|
|
36fd0f4277 | ||
|
|
1506b598a1 | ||
|
|
44b985112d | ||
|
|
6db5dfb52c | ||
|
|
adb3fb7ea4 | ||
|
|
6c1d572992 | ||
|
|
83845ea052 | ||
|
|
099791b16e | ||
|
|
255370948c | ||
|
|
6d34f77eac | ||
|
|
43c33091cf | ||
|
|
57c881ca75 | ||
|
|
340a9fba78 | ||
|
|
61b48aa20d | ||
|
|
b272417adb | ||
|
|
e32c7f646b | ||
|
|
5ce51871f1 | ||
|
|
4c8b3c949a | ||
|
|
e3d61b4a30 | ||
|
|
e1574ff116 | ||
|
|
93be76f22e | ||
|
|
fb55523cc9 | ||
|
|
499b069560 | ||
|
|
5ce79908e4 | ||
|
|
324d00771d | ||
|
|
ba0d9ac39e | ||
|
|
b195440c27 | ||
|
|
d9fb8767ea | ||
|
|
ec24eed6be | ||
|
|
368b4e3e8f | ||
|
|
f41f9e40ec | ||
|
|
d7799a5777 | ||
|
|
cacfd88b36 | ||
|
|
0b271e701f | ||
|
|
9626bfd0b3 | ||
|
|
ed753aa380 | ||
|
|
a22b968cde | ||
|
|
37a1386ae4 | ||
|
|
0bea3bc3bb | ||
|
|
b76a2e5d8a | ||
|
|
e662b812c2 | ||
|
|
26888d68cf | ||
|
|
f48b39f6e2 | ||
|
|
e2e3dfbe8b | ||
|
|
bb8f863ed5 | ||
|
|
4543a1076a | ||
|
|
1411e5f2e4 | ||
|
|
698e7f1bf8 | ||
|
|
6930f049f7 | ||
|
|
14979ee144 | ||
|
|
944f2aedef | ||
|
|
287e40969e | ||
|
|
78606619c9 | ||
|
|
e61bbe73d6 | ||
|
|
b60d32eaa0 | ||
|
|
52adf233e7 | ||
|
|
3545da3e6f | ||
|
|
5a385de6e6 | ||
|
|
3264dc441f | ||
|
|
26799bffc4 | ||
|
|
f40b43c757 | ||
|
|
f2b8b10dd2 | ||
|
|
eea26947e0 | ||
|
|
9124c445f9 | ||
|
|
dc303a6911 | ||
|
|
5b0714066b | ||
|
|
1c0485361e | ||
|
|
190f48674f | ||
|
|
dff4bac425 | ||
|
|
3647038b49 | ||
|
|
266771687d | ||
|
|
51c34c5cb0 | ||
|
|
3f88eca4ef | ||
|
|
cf6a587939 | ||
|
|
aa98290bd5 | ||
|
|
9db3a0f536 | ||
|
|
84e5bb992b | ||
|
|
5f7017d408 | ||
|
|
ab4633cdb5 | ||
|
|
0b8d1e228b | ||
|
|
791ccd6a86 | ||
|
|
d9576d7a6f | ||
|
|
86fc9e9ea6 | ||
|
|
821eced83d | ||
|
|
25254b4718 | ||
|
|
9c6107fafe | ||
|
|
ec5de6e3d8 | ||
|
|
8545db5000 | ||
|
|
4bd2c14901 | ||
|
|
692674689b | ||
|
|
c88cc0c63a | ||
|
|
6da65ad9af | ||
|
|
caf3208951 | ||
|
|
3ad2416d6e | ||
|
|
925aab1556 | ||
|
|
8982190615 | ||
|
|
f0aabcfb11 | ||
|
|
1f09b63abd | ||
|
|
f892aa56fe | ||
|
|
2d54c62f24 | ||
|
|
1469eabcde | ||
|
|
15cacb1fae | ||
|
|
e4dc456594 | ||
|
|
c067eaaa9b | ||
|
|
5718283335 | ||
|
|
c0ed90edb4 | ||
|
|
2b08ab0361 | ||
|
|
f01f9be291 | ||
|
|
3be7fd074e | ||
|
|
504c80164f | ||
|
|
a4a9a62690 | ||
|
|
863df2caa7 | ||
|
|
5dd1b9161b | ||
|
|
55d525b34d | ||
|
|
55b8e342d7 | ||
|
|
c61a66652f | ||
|
|
d3edbaeb90 | ||
|
|
7f57362882 | ||
|
|
d9598bee2f | ||
|
|
c050e495b9 | ||
|
|
2f332e5484 | ||
|
|
942423db98 | ||
|
|
9e53c77b61 | ||
|
|
19d1af29aa | ||
|
|
1b2a108956 | ||
|
|
2c77c60443 | ||
|
|
b55c0e5856 | ||
|
|
859d1bf0d5 | ||
|
|
f8f90eee14 | ||
|
|
e4c2e37eb7 | ||
|
|
49d5798f40 | ||
|
|
7516eee35a | ||
|
|
ba4f118c5e | ||
|
|
36f1637d2b | ||
|
|
ea48ece60c | ||
|
|
24c54a9513 | ||
|
|
6f8000896b | ||
|
|
f448359a18 | ||
|
|
e924a92468 | ||
|
|
7542cb50fb | ||
|
|
3db5a4aae5 | ||
|
|
bcab3054f9 | ||
|
|
d05fc64b89 | ||
|
|
e741a26ae6 | ||
|
|
4ae4a7ca67 | ||
|
|
57d8c9e9ad | ||
|
|
e8366ad33e | ||
|
|
86fa284ce3 | ||
|
|
89e73983c5 | ||
|
|
9d7d266930 | ||
|
|
5965e56fca | ||
|
|
bff998742b | ||
|
|
a1c2dc3534 | ||
|
|
3887b9156c | ||
|
|
041d3f0d94 | ||
|
|
b69582a642 | ||
|
|
60eb6176ca | ||
|
|
7c46d43b6c | ||
|
|
74f668d5f2 | ||
|
|
ade1d5dd46 | ||
|
|
670e6b39d2 | ||
|
|
da5861ef2b | ||
|
|
6786ea6325 | ||
|
|
0e683a4a39 | ||
|
|
1418a69d95 | ||
|
|
7463d02587 | ||
|
|
c7d342aae6 | ||
|
|
89e5386aee | ||
|
|
07be90df68 | ||
|
|
0a9ac260bc | ||
|
|
ee2fafe994 | ||
|
|
efb7906bf9 | ||
|
|
db90242296 | ||
|
|
f4657d0c3b | ||
|
|
f139a08c29 | ||
|
|
d8b83369ea | ||
|
|
9e3013116c | ||
|
|
d07b5a5113 | ||
|
|
64b62a5cb0 | ||
|
|
f1f96de800 | ||
|
|
eafd9c1e07 | ||
|
|
d2b366654a | ||
|
|
828beb3cdf | ||
|
|
0ed9752f34 | ||
|
|
40c53f986a | ||
|
|
51a395e432 | ||
|
|
b4f41c6e2f | ||
|
|
3031bc9c94 | ||
|
|
4403511ea5 | ||
|
|
7d9f2917ad | ||
|
|
ddf7e65a07 | ||
|
|
6ad413f34d | ||
|
|
a19a79870d | ||
|
|
7b00585e50 | ||
|
|
2ef8b564d4 | ||
|
|
4aa653f993 | ||
|
|
8a9c6b007b | ||
|
|
00c45fdb36 | ||
|
|
d13bf4b28a | ||
|
|
2faf0d8eaa | ||
|
|
0c88b229f8 | ||
|
|
a9e252e639 | ||
|
|
893e68d1c0 | ||
|
|
502f9cc1e9 | ||
|
|
19adc38062 | ||
|
|
3d6ee9bd0a | ||
|
|
1b5362f4b6 | ||
|
|
18f7864e80 | ||
|
|
ff7f396fec | ||
|
|
a8c7fb30b9 | ||
|
|
4677725164 | ||
|
|
85f00f3888 | ||
|
|
116a83ad8f | ||
|
|
184fa95254 | ||
|
|
2385946eb7 | ||
|
|
ac9a50f8e5 | ||
|
|
87d0c0243c | ||
|
|
e1b5c2f335 | ||
|
|
6451c5234e | ||
|
|
5119bea3bf | ||
|
|
386d5ff2fe | ||
|
|
0ae2782668 | ||
|
|
1f0faea2a4 | ||
|
|
5e20fb5c99 | ||
|
|
0de0f457a0 | ||
|
|
8d48b402a3 | ||
|
|
2be06dd200 | ||
|
|
540acca8ed | ||
|
|
d06a446383 | ||
|
|
d363998154 | ||
|
|
207d5c3c21 | ||
|
|
7ca2a73185 | ||
|
|
81dcaa099c | ||
|
|
1409fec3b6 | ||
|
|
57554f3957 | ||
|
|
9fe50455d2 | ||
|
|
f7a4954bf5 | ||
|
|
b15e1dd61f | ||
|
|
a1a8d2344c | ||
|
|
6ecbbd7ee2 | ||
|
|
7321cc4e38 | ||
|
|
9097373d6a | ||
|
|
8950825857 | ||
|
|
94e74097fc | ||
|
|
108906408a | ||
|
|
ef78334db4 | ||
|
|
a9f07cd22b | ||
|
|
a604d063ef | ||
|
|
16ea1b063e | ||
|
|
c56a021c54 | ||
|
|
f330d9a250 | ||
|
|
e6851865e1 | ||
|
|
681888fe13 | ||
|
|
9af19f0383 | ||
|
|
0dff61d866 | ||
|
|
92e582fc65 | ||
|
|
a784fc9480 | ||
|
|
ed2e3bd19b | ||
|
|
bbeefb4722 | ||
|
|
ece3343867 | ||
|
|
2acab174f1 | ||
|
|
47e041d7ef | ||
|
|
58bbcb4a0e | ||
|
|
3182fa4ff6 | ||
|
|
11659460f3 | ||
|
|
06b5cf8889 | ||
|
|
33384c706e | ||
|
|
847df597c0 | ||
|
|
876f68c957 | ||
|
|
77e8497dde | ||
|
|
6cc9fddf77 | ||
|
|
781d4f8d04 | ||
|
|
a291f75563 | ||
|
|
a705b6d7e9 | ||
|
|
caa4518896 | ||
|
|
02adbd6118 | ||
|
|
e5fbdd5244 | ||
|
|
40574a2d00 | ||
|
|
eebc652bbc | ||
|
|
83d990326f | ||
|
|
d824389ec6 | ||
|
|
b181a0f6b1 | ||
|
|
1cc834e9f1 | ||
|
|
af6552c7b1 | ||
|
|
801e8ee371 | ||
|
|
5c49c50e7d | ||
|
|
de4945c206 | ||
|
|
cafb11842a | ||
|
|
4706edac92 | ||
|
|
f4781e37ac | ||
|
|
54c7fef77a | ||
|
|
b36f03172c | ||
|
|
23f6d25717 | ||
|
|
3fd00ea287 | ||
|
|
975a364f9c | ||
|
|
b883d1fda7 | ||
|
|
97382f6c33 | ||
|
|
3212eb31aa | ||
|
|
f9d920fc24 | ||
|
|
fc75774074 | ||
|
|
b97f702f3a | ||
|
|
ef9fd1a677 | ||
|
|
5929c9cd9e | ||
|
|
a6f1baa456 | ||
|
|
587129f931 | ||
|
|
2794d8b25a | ||
|
|
79d9f29cf3 | ||
|
|
d5cd6246c9 | ||
|
|
e3eac307b2 | ||
|
|
7250d02ee5 | ||
|
|
bd6af361d3 | ||
|
|
a06546d85d | ||
|
|
e5aedf1290 | ||
|
|
95bb57062a | ||
|
|
a4a950b6a2 | ||
|
|
6b24ce981f | ||
|
|
9d02bb22de | ||
|
|
a0ae440586 | ||
|
|
6a8d5fb088 | ||
|
|
867828012b | ||
|
|
56e0323aca | ||
|
|
d158c0f829 | ||
|
|
babbd29a31 | ||
|
|
33d44ea844 | ||
|
|
ed99820e7c | ||
|
|
444623526a | ||
|
|
7a50c8902c | ||
|
|
cbfc11cf20 | ||
|
|
a4387e8de4 | ||
|
|
186e316b6e | ||
|
|
26b83d4b38 | ||
|
|
8e12cc5caf | ||
|
|
8ba376e900 | ||
|
|
b61328ad76 | ||
|
|
69e30b8505 | ||
|
|
ea4927edc4 | ||
|
|
a7441b6046 | ||
|
|
41e74b8988 | ||
|
|
8f4a4de9be | ||
|
|
7f8e7883da | ||
|
|
b921db5753 | ||
|
|
cffa7f5c84 | ||
|
|
3c4071c408 | ||
|
|
73f1682660 | ||
|
|
b07ecf1f95 | ||
|
|
4793b25276 | ||
|
|
812803d34f | ||
|
|
e25490001d | ||
|
|
a4821e4327 | ||
|
|
209819ee59 | ||
|
|
33e595486f | ||
|
|
79a5400a42 | ||
|
|
39f5970748 | ||
|
|
6b9565d1f7 | ||
|
|
7a00ab8f5c | ||
|
|
27b000ab98 | ||
|
|
03570f0fe0 | ||
|
|
fe7ec9aca8 | ||
|
|
570151cab6 | ||
|
|
f736366402 | ||
|
|
6ccddc4a29 | ||
|
|
60db2bac75 | ||
|
|
8b54bad9b2 | ||
|
|
11392a43ac | ||
|
|
0be3a54895 | ||
|
|
47ba4c4c41 | ||
|
|
094eab3263 | ||
|
|
fc178263ab | ||
|
|
c7bbc03790 | ||
|
|
326e2efdf7 | ||
|
|
21fc5f6c96 | ||
|
|
7ef8c98605 | ||
|
|
bea8e2c42d | ||
|
|
e7075b33df | ||
|
|
5588a4114c | ||
|
|
ef497fb4dd | ||
|
|
344b5e4a23 | ||
|
|
f652472d44 | ||
|
|
71e141a939 | ||
|
|
fa1ad4bf50 | ||
|
|
ead2ca9748 | ||
|
|
70a9024554 | ||
|
|
42b54470e1 | ||
|
|
4f4f833f03 | ||
|
|
9020c570ba | ||
|
|
8771698a5b | ||
|
|
29b449bb9c | ||
|
|
dc2287720e | ||
|
|
b1eb1d5ac4 | ||
|
|
d7192ca583 | ||
|
|
fa0e9d1707 | ||
|
|
26525e318e | ||
|
|
0a5ae99be7 | ||
|
|
98a4ac41e7 | ||
|
|
b83cd70661 | ||
|
|
1a00846a6d | ||
|
|
8d77c864bc | ||
|
|
395954da3c | ||
|
|
58f85b60ba | ||
|
|
8b804bca84 | ||
|
|
fad29117cd | ||
|
|
c1528dcf18 | ||
|
|
45c6c0dacf | ||
|
|
c3f54a0fe7 | ||
|
|
525c922663 | ||
|
|
5445e5568b | ||
|
|
9701f215b6 | ||
|
|
40367998de | ||
|
|
d86838c3ce | ||
|
|
a26bbefab7 | ||
|
|
463b92737c | ||
|
|
6d526ea03e | ||
|
|
3d3e7772be | ||
|
|
462ab4e903 | ||
|
|
73e1150055 | ||
|
|
cea8a31013 | ||
|
|
c1eb87ac8c | ||
|
|
c9eaea5c59 | ||
|
|
378034f39b | ||
|
|
f4437c20a3 | ||
|
|
326ed4a489 | ||
|
|
03bec812cf | ||
|
|
08ed330284 | ||
|
|
341b0f006f | ||
|
|
7b950c35ea | ||
|
|
170e2c53c2 | ||
|
|
18d22c296f | ||
|
|
f5419112b3 | ||
|
|
76fc62a4ff | ||
|
|
f1c8a9dccf | ||
|
|
243023c59f | ||
|
|
61426b952c | ||
|
|
2d72859977 | ||
|
|
092b81d1b2 | ||
|
|
607b78b8d6 | ||
|
|
15d87a6f6a | ||
|
|
3a75353415 | ||
|
|
20cb1af78e | ||
|
|
d4c3de4fee | ||
|
|
b1e3176308 | ||
|
|
7b3757289d | ||
|
|
16ca00d858 | ||
|
|
3cb612acb8 | ||
|
|
347ed477a4 | ||
|
|
864b6b274b | ||
|
|
18fea87be1 | ||
|
|
86cc2ec0bb | ||
|
|
563e58a579 | ||
|
|
da790a532a | ||
|
|
34623b1337 | ||
|
|
c3e2ca860c | ||
|
|
40cd37e2e7 | ||
|
|
1cedc5c564 | ||
|
|
ee8846f1ef | ||
|
|
401ac6a1d5 | ||
|
|
ffd93b67a1 | ||
|
|
31a7d3558e | ||
|
|
f0c4efeff2 | ||
|
|
5dc7bd083a | ||
|
|
2b68575862 | ||
|
|
cf46a560b4 | ||
|
|
3c6c57a723 | ||
|
|
186cec7145 | ||
|
|
bf5197a65e | ||
|
|
4f8b588c9b | ||
|
|
268af4fa13 | ||
|
|
9389f532c8 | ||
|
|
b06f598d96 | ||
|
|
2cd69df9e2 | ||
|
|
d7e449dd55 | ||
|
|
676e32f018 | ||
|
|
a8f84fd85f | ||
|
|
15c7bd4ac0 | ||
|
|
09cbb7889c | ||
|
|
ce3d864a96 | ||
|
|
5a2006a03f | ||
|
|
835b4eae9b | ||
|
|
a276ae0a21 | ||
|
|
e4243618e5 | ||
|
|
63566738ae | ||
|
|
9362859ce4 | ||
|
|
0f3cfe4f81 | ||
|
|
25ae24bb9b | ||
|
|
5c0064324e | ||
|
|
2481a68a59 | ||
|
|
2a85e1db6c | ||
|
|
29a5aa357c | ||
|
|
b195596045 | ||
|
|
94846c88fb | ||
|
|
54022c9502 | ||
|
|
475a60b7d5 | ||
|
|
6e837cd77c | ||
|
|
9a2f606c8d | ||
|
|
70df608e3b | ||
|
|
bfd2076960 | ||
|
|
b3741499c4 | ||
|
|
b1f7cfc432 | ||
|
|
a9ab24dcfd | ||
|
|
8266a99042 | ||
|
|
b0c27a86e1 | ||
|
|
49476baf49 | ||
|
|
489ac8d8f7 | ||
|
|
6cdf08861c | ||
|
|
08994be3c7 | ||
|
|
ffe2e13bad | ||
|
|
77f0199bcc | ||
|
|
ad2f178027 | ||
|
|
214edf7b8c | ||
|
|
880c342134 | ||
|
|
2bb81d73ef | ||
|
|
48cf1eb80f | ||
|
|
7d4f096a7b | ||
|
|
0935c8e495 | ||
|
|
930c8e9e26 | ||
|
|
7d5dbca098 | ||
|
|
9d44cfba88 | ||
|
|
84969077c1 | ||
|
|
642695ad83 | ||
|
|
4ad3307df7 | ||
|
|
18677e9005 | ||
|
|
26f6991cfc | ||
|
|
418eb2c39d | ||
|
|
4fb106f289 | ||
|
|
52397d834f | ||
|
|
bf398265a0 | ||
|
|
19e416de15 | ||
|
|
eb901e94ce | ||
|
|
71d4a58a41 | ||
|
|
01723ab80a | ||
|
|
5925682b6f | ||
|
|
1f97a2fd4a | ||
|
|
2e96796e37 | ||
|
|
97597dff04 | ||
|
|
b56a009699 | ||
|
|
7a7f5fc993 | ||
|
|
f3c2483e0a | ||
|
|
a68bcae7ee | ||
|
|
9e685a1586 | ||
|
|
fb1b7e0c3e | ||
|
|
a795a02721 | ||
|
|
03820fd8ab | ||
|
|
c74a434f78 | ||
|
|
01f25a11a1 | ||
|
|
675324c7eb | ||
|
|
bdd1e3b62f | ||
|
|
0a4e563665 | ||
|
|
570eb566b4 | ||
|
|
72a971ab03 | ||
|
|
8d7caaea50 | ||
|
|
7db9c7ebeb | ||
|
|
fbd0a0633c | ||
|
|
60ce0f7db6 | ||
|
|
8e5cbfaf7b | ||
|
|
ed06a13e39 | ||
|
|
21b180eb4b | ||
|
|
64bf2cc093 | ||
|
|
0ee5d59d1f | ||
|
|
729fcd8f10 | ||
|
|
6db1e0933c | ||
|
|
6dc31cd4da | ||
|
|
5f30573fb4 | ||
|
|
0c2e350997 | ||
|
|
fcef5e359b | ||
|
|
df3ff49869 | ||
|
|
1c04b95b22 | ||
|
|
c6065371e2 | ||
|
|
5df83b898c | ||
|
|
eab3108172 | ||
|
|
d6fdead0f3 | ||
|
|
4808572dcf | ||
|
|
0b59eab01f | ||
|
|
3103284e5a | ||
|
|
85e756065e | ||
|
|
72422068fd | ||
|
|
8c3cd1a2c2 | ||
|
|
9d00d91c87 | ||
|
|
f2a5ca8a20 | ||
|
|
c9638bd7c9 | ||
|
|
b573b7b695 | ||
|
|
c6fce33b87 | ||
|
|
ebc38fa795 | ||
|
|
a1a232b471 | ||
|
|
9522bf9d6c | ||
|
|
564da11dd4 | ||
|
|
ef0f2bf210 | ||
|
|
52a58e6465 | ||
|
|
b59a36d874 | ||
|
|
9d99444486 | ||
|
|
a910fbf5ed | ||
|
|
62b5ec0cef | ||
|
|
f5073d3a8a | ||
|
|
a084ca2557 | ||
|
|
ae380da2fc | ||
|
|
27f0b4544f | ||
|
|
30d64aed75 | ||
|
|
313c73971c | ||
|
|
7f5d8d1888 | ||
|
|
10705c93fd | ||
|
|
4899257e7a | ||
|
|
38691da286 | ||
|
|
36d4dc7578 | ||
|
|
0fe60f516e | ||
|
|
1df6920fa9 | ||
|
|
6f9e207dc9 | ||
|
|
a79457f0e9 | ||
|
|
13d2ccfaaf | ||
|
|
6612bf03f4 | ||
|
|
b40c514e9a | ||
|
|
d3731cb537 | ||
|
|
3bb433eb16 | ||
|
|
dd909fe254 | ||
|
|
bdd04fd7e8 | ||
|
|
afd722eb9e |
@@ -79,7 +79,7 @@ indent_size = unset
|
|||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
# binaries
|
# binaries
|
||||||
[*.{nib,torrent}]
|
[*.nib]
|
||||||
end_of_line = unset
|
end_of_line = unset
|
||||||
insert_final_newline = unset
|
insert_final_newline = unset
|
||||||
trim_trailing_whitespace = unset
|
trim_trailing_whitespace = unset
|
||||||
|
|||||||
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -62,6 +62,3 @@ ci/OWNERS linguist-language=CODEOWNERS
|
|||||||
# patching CRLF line endings from an upstream source package.
|
# patching CRLF line endings from an upstream source package.
|
||||||
*.diff !text !eol
|
*.diff !text !eol
|
||||||
*.patch !text !eol
|
*.patch !text !eol
|
||||||
|
|
||||||
# Torrent files are binary files and should not be re-encoded.
|
|
||||||
*.torrent !text !eol
|
|
||||||
|
|||||||
5
.github/workflows/bot.yml
vendored
5
.github/workflows/bot.yml
vendored
@@ -49,7 +49,7 @@ jobs:
|
|||||||
ci/github-script
|
ci/github-script
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci --package-lock-only=false --no-audit @actions/artifact bottleneck
|
run: npm ci --package-lock-only=false @actions/artifact bottleneck
|
||||||
working-directory: ci/github-script
|
working-directory: ci/github-script
|
||||||
|
|
||||||
# Use a GitHub App, because it has much higher rate limits: 12,500 instead of 5,000 req / hour.
|
# Use a GitHub App, because it has much higher rate limits: 12,500 instead of 5,000 req / hour.
|
||||||
@@ -76,8 +76,7 @@ jobs:
|
|||||||
github-token: ${{ steps.app-token.outputs.token || github.token }}
|
github-token: ${{ steps.app-token.outputs.token || github.token }}
|
||||||
retries: 3
|
retries: 3
|
||||||
script: |
|
script: |
|
||||||
const { default: bot } = await import('${{ github.workspace }}/ci/github-script/bot.js')
|
require('./ci/github-script/bot.js')({
|
||||||
await bot({
|
|
||||||
github,
|
github,
|
||||||
context,
|
context,
|
||||||
core,
|
core,
|
||||||
|
|||||||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -59,7 +59,7 @@ jobs:
|
|||||||
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
||||||
target-as-trusted-at: ${{ inputs.targetSha }}
|
target-as-trusted-at: ${{ inputs.targetSha }}
|
||||||
|
|
||||||
- uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
|
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
|
||||||
with:
|
with:
|
||||||
# Sandbox is disabled on MacOS by default.
|
# Sandbox is disabled on MacOS by default.
|
||||||
extra_nix_config: sandbox = true
|
extra_nix_config: sandbox = true
|
||||||
|
|||||||
40
.github/workflows/check.yml
vendored
40
.github/workflows/check.yml
vendored
@@ -51,7 +51,7 @@ jobs:
|
|||||||
ci/github-script
|
ci/github-script
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci --package-lock-only=false --no-audit bottleneck
|
run: npm ci --package-lock-only=false bottleneck
|
||||||
working-directory: trusted/ci/github-script
|
working-directory: trusted/ci/github-script
|
||||||
|
|
||||||
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||||
@@ -76,8 +76,7 @@ jobs:
|
|||||||
github-token: ${{ steps.app-token.outputs.token || github.token }}
|
github-token: ${{ steps.app-token.outputs.token || github.token }}
|
||||||
script: |
|
script: |
|
||||||
const targetsStable = JSON.parse(process.env.TARGETS_STABLE)
|
const targetsStable = JSON.parse(process.env.TARGETS_STABLE)
|
||||||
const { default: commits } = await import('${{ github.workspace }}/trusted/ci/github-script/commits.js')
|
require('./trusted/ci/github-script/commits.js')({
|
||||||
await commits({
|
|
||||||
github,
|
github,
|
||||||
context,
|
context,
|
||||||
core,
|
core,
|
||||||
@@ -122,8 +121,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
github-token: ${{ steps.app-token.outputs.token || github.token }}
|
github-token: ${{ steps.app-token.outputs.token || github.token }}
|
||||||
script: |
|
script: |
|
||||||
const { default: checkManualFileEdits } = await import('${{ github.workspace }}/trusted/ci/github-script/manual-file-edits.js')
|
require('./trusted/ci/github-script/manual-file-edits.js')({
|
||||||
await checkManualFileEdits({
|
|
||||||
github,
|
github,
|
||||||
context,
|
context,
|
||||||
core,
|
core,
|
||||||
@@ -136,35 +134,6 @@ jobs:
|
|||||||
GH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}
|
GH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}
|
||||||
run: gh api /rate_limit | jq
|
run: gh api /rate_limit | jq
|
||||||
|
|
||||||
github-script:
|
|
||||||
runs-on: ubuntu-24.04-arm
|
|
||||||
timeout-minutes: 5
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
sparse-checkout: .github/actions
|
|
||||||
|
|
||||||
- name: Checkout merge and target commits
|
|
||||||
uses: ./.github/actions/checkout
|
|
||||||
with:
|
|
||||||
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
|
||||||
target-as-trusted-at: ${{ inputs.targetSha }}
|
|
||||||
|
|
||||||
- name: Install dependencies to trusted/
|
|
||||||
run: |
|
|
||||||
npm ci --package-lock-only=false --no-audit
|
|
||||||
echo "$PWD/node_modules/.bin" >> "$GITHUB_PATH"
|
|
||||||
working-directory: nixpkgs/trusted/ci/github-script
|
|
||||||
|
|
||||||
- name: Link trusted/ dependencies to untrusted/
|
|
||||||
run: ln -s "$PWD/trusted/ci/github-script/node_modules" untrusted/ci/github-script/node_modules
|
|
||||||
working-directory: nixpkgs
|
|
||||||
|
|
||||||
- name: Check ci/github-script
|
|
||||||
run: npm test
|
|
||||||
working-directory: nixpkgs/untrusted/ci/github-script
|
|
||||||
|
|
||||||
owners:
|
owners:
|
||||||
runs-on: ubuntu-24.04-arm
|
runs-on: ubuntu-24.04-arm
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
@@ -173,14 +142,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
sparse-checkout: .github/actions
|
sparse-checkout: .github/actions
|
||||||
|
|
||||||
- name: Checkout merge and target commits
|
- name: Checkout merge and target commits
|
||||||
uses: ./.github/actions/checkout
|
uses: ./.github/actions/checkout
|
||||||
with:
|
with:
|
||||||
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
||||||
target-as-trusted-at: ${{ inputs.targetSha }}
|
target-as-trusted-at: ${{ inputs.targetSha }}
|
||||||
|
|
||||||
- uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
|
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
|
||||||
|
|
||||||
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
|
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|||||||
2
.github/workflows/comment.yml
vendored
2
.github/workflows/comment.yml
vendored
@@ -43,7 +43,7 @@ jobs:
|
|||||||
github-token: ${{ steps.app-token.outputs.token || github.token }}
|
github-token: ${{ steps.app-token.outputs.token || github.token }}
|
||||||
retries: 3
|
retries: 3
|
||||||
script: |
|
script: |
|
||||||
const { handleMergeComment } = await import('${{ github.workspace }}/ci/github-script/merge.js')
|
const { handleMergeComment } = require('./ci/github-script/merge.js')
|
||||||
const { body, node_id } = context.payload.comment
|
const { body, node_id } = context.payload.comment
|
||||||
|
|
||||||
await handleMergeComment({
|
await handleMergeComment({
|
||||||
|
|||||||
11
.github/workflows/eval.yml
vendored
11
.github/workflows/eval.yml
vendored
@@ -139,7 +139,7 @@ jobs:
|
|||||||
core.info(`Found pinned.json commit: ${ciPinBumpCommit}`)
|
core.info(`Found pinned.json commit: ${ciPinBumpCommit}`)
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
|
uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
|
||||||
|
|
||||||
- name: Load supported versions
|
- name: Load supported versions
|
||||||
id: versions
|
id: versions
|
||||||
@@ -187,7 +187,7 @@ jobs:
|
|||||||
target-as-trusted-at: ${{ inputs.targetSha }}
|
target-as-trusted-at: ${{ inputs.targetSha }}
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
|
uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
|
||||||
|
|
||||||
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
|
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -277,7 +277,7 @@ jobs:
|
|||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
|
uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
|
||||||
|
|
||||||
- name: Combine all output paths and eval stats
|
- name: Combine all output paths and eval stats
|
||||||
run: |
|
run: |
|
||||||
@@ -375,8 +375,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
github-token: ${{ steps.app-token.outputs.token || github.token }}
|
github-token: ${{ steps.app-token.outputs.token || github.token }}
|
||||||
script: |
|
script: |
|
||||||
const { checkTargetBranch } = await import('${{ github.workspace }}/nixpkgs/trusted/ci/github-script/check-target-branch.ts')
|
require('./nixpkgs/trusted/ci/github-script/check-target-branch.ts')({
|
||||||
await checkTargetBranch({
|
|
||||||
github,
|
github,
|
||||||
context,
|
context,
|
||||||
core,
|
core,
|
||||||
@@ -487,7 +486,7 @@ jobs:
|
|||||||
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
|
uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
|
||||||
|
|
||||||
- name: Ensure flake outputs on all systems still evaluate
|
- name: Ensure flake outputs on all systems still evaluate
|
||||||
run: nix flake check --all-systems --no-build './nixpkgs/untrusted?shallow=1'
|
run: nix flake check --all-systems --no-build './nixpkgs/untrusted?shallow=1'
|
||||||
|
|||||||
10
.github/workflows/lint.yml
vendored
10
.github/workflows/lint.yml
vendored
@@ -35,7 +35,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
||||||
|
|
||||||
- uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
|
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
|
||||||
|
|
||||||
# TODO: Figure out how to best enable caching for the treefmt job. Cachix won't work well,
|
# TODO: Figure out how to best enable caching for the treefmt job. Cachix won't work well,
|
||||||
# because the cache would be invalidated on every commit - treefmt checks every file.
|
# because the cache would be invalidated on every commit - treefmt checks every file.
|
||||||
@@ -70,7 +70,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
||||||
|
|
||||||
- uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
|
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
|
||||||
|
|
||||||
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
|
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -100,7 +100,7 @@ jobs:
|
|||||||
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
merged-as-untrusted-at: ${{ inputs.mergedSha }}
|
||||||
target-as-trusted-at: ${{ inputs.targetSha }}
|
target-as-trusted-at: ${{ inputs.targetSha }}
|
||||||
|
|
||||||
- uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
|
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
|
||||||
|
|
||||||
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
|
- uses: cachix/cachix-action@5f2d7c5294214f71b873db4b969586b980625e71 # v17
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -142,9 +142,9 @@ jobs:
|
|||||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const { default: checkCommitMessages } = await import('${{ github.workspace }}/trusted/ci/github-script/lint-commits.js')
|
const checkCommitMessages = require('./trusted/ci/github-script/lint-commits.js')
|
||||||
|
|
||||||
await checkCommitMessages({
|
checkCommitMessages({
|
||||||
github,
|
github,
|
||||||
context,
|
context,
|
||||||
core,
|
core,
|
||||||
|
|||||||
6
.github/workflows/merge-group.yml
vendored
6
.github/workflows/merge-group.yml
vendored
@@ -29,7 +29,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
sparse-checkout: |
|
sparse-checkout: |
|
||||||
ci/github-script
|
ci/github-script/supportedSystems.js
|
||||||
|
|
||||||
- id: prepare
|
- id: prepare
|
||||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||||
@@ -38,8 +38,8 @@ jobs:
|
|||||||
TARGET_SHA: ${{ inputs.targetSha }}
|
TARGET_SHA: ${{ inputs.targetSha }}
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const { classify } = await import('${{ github.workspace }}/ci/github-script/supportedBranches.js')
|
const { classify } = require('./ci/supportedBranches.js')
|
||||||
const { default: supportedSystems } = await import('${{ github.workspace }}/ci/github-script/supportedSystems.js')
|
const supportedSystems = require('./ci/github-script/supportedSystems.js')
|
||||||
|
|
||||||
const baseBranch = (
|
const baseBranch = (
|
||||||
context.payload.merge_group?.base_ref ??
|
context.payload.merge_group?.base_ref ??
|
||||||
|
|||||||
4
.github/workflows/periodic-merge.yml
vendored
4
.github/workflows/periodic-merge.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
|||||||
client-id: ${{ vars.NIXPKGS_CI_CLIENT_ID }}
|
client-id: ${{ vars.NIXPKGS_CI_CLIENT_ID }}
|
||||||
private-key: ${{ secrets.NIXPKGS_CI_APP_PRIVATE_KEY }}
|
private-key: ${{ secrets.NIXPKGS_CI_APP_PRIVATE_KEY }}
|
||||||
permission-contents: write
|
permission-contents: write
|
||||||
permission-issues: write
|
permission-pull-requests: write
|
||||||
|
|
||||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||||
with:
|
with:
|
||||||
@@ -66,4 +66,4 @@ jobs:
|
|||||||
Periodic merge from `${{ inputs.from }}` into [`${{ inputs.into }}`](https://github.com/NixOS/nixpkgs/tree/${{ inputs.into }}) has [failed](https://github.com/NixOS/nixpkgs/actions/runs/${{ github.run_id }}).
|
Periodic merge from `${{ inputs.from }}` into [`${{ inputs.into }}`](https://github.com/NixOS/nixpkgs/tree/${{ inputs.into }}) has [failed](https://github.com/NixOS/nixpkgs/actions/runs/${{ github.run_id }}).
|
||||||
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
run: |
|
run: |
|
||||||
gh issue comment 562905 --body "$BODY_TEXT"
|
gh pr comment 105153 --body "$BODY_TEXT"
|
||||||
|
|||||||
3
.github/workflows/pull-request-target.yml
vendored
3
.github/workflows/pull-request-target.yml
vendored
@@ -64,8 +64,7 @@ jobs:
|
|||||||
# https://github.com/octokit/plugin-retry.js/blob/9a2443746c350b3beedec35cf26e197ea318a261/src/index.ts#L14
|
# https://github.com/octokit/plugin-retry.js/blob/9a2443746c350b3beedec35cf26e197ea318a261/src/index.ts#L14
|
||||||
retry-exempt-status-codes: 400,401,403,404
|
retry-exempt-status-codes: 400,401,403,404
|
||||||
script: |
|
script: |
|
||||||
const { default: prepare } = await import('${{ github.workspace }}/ci/github-script/prepare.js')
|
require('./ci/github-script/prepare.js')({
|
||||||
await prepare({
|
|
||||||
github,
|
github,
|
||||||
context,
|
context,
|
||||||
core,
|
core,
|
||||||
|
|||||||
2
.github/workflows/review.yml
vendored
2
.github/workflows/review.yml
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
github-token: ${{ steps.app-token.outputs.token || github.token }}
|
github-token: ${{ steps.app-token.outputs.token || github.token }}
|
||||||
retries: 3
|
retries: 3
|
||||||
script: |
|
script: |
|
||||||
const { handleMergeComment } = await import('${{ github.workspace }}/ci/github-script/merge.js')
|
const { handleMergeComment } = require('./ci/github-script/merge.js')
|
||||||
|
|
||||||
// PRs from forks don't have any PRs associated by default.
|
// PRs from forks don't have any PRs associated by default.
|
||||||
// Thus, we request the PR number with an API call *to* the fork's repo.
|
// Thus, we request the PR number with an API call *to* the fork's repo.
|
||||||
|
|||||||
6
.github/workflows/teams.yml
vendored
6
.github/workflows/teams.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
maintainers/github-teams.json
|
maintainers/github-teams.json
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci --package-lock-only=false --no-audit bottleneck
|
run: npm ci --package-lock-only=false bottleneck
|
||||||
working-directory: ci/github-script
|
working-directory: ci/github-script
|
||||||
|
|
||||||
- name: Synchronise teams
|
- name: Synchronise teams
|
||||||
@@ -46,8 +46,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
github-token: ${{ steps.app-token.outputs.token }}
|
github-token: ${{ steps.app-token.outputs.token }}
|
||||||
script: |
|
script: |
|
||||||
const { default: getTeams } = await import('${{ github.workspace }}/ci/github-script/get-teams.js')
|
require('./ci/github-script/get-teams.js')({
|
||||||
await getTeams({
|
|
||||||
github,
|
github,
|
||||||
context,
|
context,
|
||||||
core,
|
core,
|
||||||
@@ -79,3 +78,4 @@ jobs:
|
|||||||
This is an automated PR to sync the GitHub teams with access to this repository to the `lib.teams` list.
|
This is an automated PR to sync the GitHub teams with access to this repository to the `lib.teams` list.
|
||||||
|
|
||||||
This PR can be merged without taking any further action.
|
This PR can be merged without taking any further action.
|
||||||
|
|
||||||
|
|||||||
11
.github/workflows/test.yml
vendored
11
.github/workflows/test.yml
vendored
@@ -35,8 +35,7 @@ jobs:
|
|||||||
# https://github.com/octokit/plugin-retry.js/blob/9a2443746c350b3beedec35cf26e197ea318a261/src/index.ts#L14
|
# https://github.com/octokit/plugin-retry.js/blob/9a2443746c350b3beedec35cf26e197ea318a261/src/index.ts#L14
|
||||||
retry-exempt-status-codes: 400,401,403,404
|
retry-exempt-status-codes: 400,401,403,404
|
||||||
script: |
|
script: |
|
||||||
const { default: prepare } = await import('${{ github.workspace }}/ci/github-script/prepare.js')
|
require('./ci/github-script/prepare.js')({
|
||||||
await prepare({
|
|
||||||
github,
|
github,
|
||||||
context,
|
context,
|
||||||
core,
|
core,
|
||||||
@@ -62,11 +61,9 @@ jobs:
|
|||||||
'.github/workflows/lint.yml',
|
'.github/workflows/lint.yml',
|
||||||
'.github/workflows/merge-group.yml',
|
'.github/workflows/merge-group.yml',
|
||||||
'.github/workflows/test.yml',
|
'.github/workflows/test.yml',
|
||||||
'ci/github-script/package.json',
|
|
||||||
'ci/github-script/package-lock.json',
|
|
||||||
'ci/github-script/supportedBranches.js',
|
|
||||||
'ci/github-script/supportedSystems.js',
|
'ci/github-script/supportedSystems.js',
|
||||||
'ci/pinned.json',
|
'ci/pinned.json',
|
||||||
|
'ci/supportedBranches.js',
|
||||||
'pkgs/top-level/release-supported-systems.json',
|
'pkgs/top-level/release-supported-systems.json',
|
||||||
].includes(file))) core.setOutput('merge-group', true)
|
].includes(file))) core.setOutput('merge-group', true)
|
||||||
|
|
||||||
@@ -85,15 +82,13 @@ jobs:
|
|||||||
'ci/github-script/get-pr-commit-details.js',
|
'ci/github-script/get-pr-commit-details.js',
|
||||||
'ci/github-script/lint-commits.js',
|
'ci/github-script/lint-commits.js',
|
||||||
'ci/github-script/merge.js',
|
'ci/github-script/merge.js',
|
||||||
'ci/github-script/package.json',
|
|
||||||
'ci/github-script/package-lock.json',
|
|
||||||
'ci/github-script/prepare.js',
|
'ci/github-script/prepare.js',
|
||||||
'ci/github-script/reviewers.js',
|
'ci/github-script/reviewers.js',
|
||||||
'ci/github-script/reviews.js',
|
'ci/github-script/reviews.js',
|
||||||
'ci/github-script/supportedBranches.js',
|
|
||||||
'ci/github-script/supportedSystems.js',
|
'ci/github-script/supportedSystems.js',
|
||||||
'ci/github-script/withRateLimit.js',
|
'ci/github-script/withRateLimit.js',
|
||||||
'ci/pinned.json',
|
'ci/pinned.json',
|
||||||
|
'ci/supportedBranches.js',
|
||||||
'pkgs/top-level/release-supported-systems.json',
|
'pkgs/top-level/release-supported-systems.json',
|
||||||
].includes(file))) core.setOutput('pr', true)
|
].includes(file))) core.setOutput('pr', true)
|
||||||
|
|
||||||
|
|||||||
1
.mailmap
1
.mailmap
@@ -6,7 +6,6 @@ Christina Sørensen <christina@cafkafk.com> <christinaafk@gmail.com>
|
|||||||
Christina Sørensen <christina@cafkafk.com> <89321978+cafkafk@users.noreply.github.com>
|
Christina Sørensen <christina@cafkafk.com> <89321978+cafkafk@users.noreply.github.com>
|
||||||
Daniel Løvbrøtte Olsen <me@dandellion.xyz> <daniel.olsen99@gmail.com>
|
Daniel Løvbrøtte Olsen <me@dandellion.xyz> <daniel.olsen99@gmail.com>
|
||||||
Ethan Carter Edwards <ethan@ethancedwards.com> Ethan Edwards <ethancarteredwards@gmail.com>
|
Ethan Carter Edwards <ethan@ethancedwards.com> Ethan Edwards <ethancarteredwards@gmail.com>
|
||||||
Ethan Carter Edwards <ethan@ethancedwards.com> <ethancedwards8@users.noreply.github.com>
|
|
||||||
Fabian Affolter <mail@fabian-affolter.ch> <fabian@affolter-engineering.ch>
|
Fabian Affolter <mail@fabian-affolter.ch> <fabian@affolter-engineering.ch>
|
||||||
Fiona Behrens <me@kloenk.dev>
|
Fiona Behrens <me@kloenk.dev>
|
||||||
Fiona Behrens <me@kloenk.dev> <me@kloenk.de>
|
Fiona Behrens <me@kloenk.dev> <me@kloenk.de>
|
||||||
|
|||||||
@@ -587,9 +587,9 @@ CI [enforces](./.github/workflows/lint.yml) all Nix files to be formatted using
|
|||||||
|
|
||||||
You can ensure this locally using either of these commands:
|
You can ensure this locally using either of these commands:
|
||||||
```
|
```
|
||||||
nix fmt
|
|
||||||
nix develop --command treefmt
|
|
||||||
nix-shell --run treefmt
|
nix-shell --run treefmt
|
||||||
|
nix develop --command treefmt
|
||||||
|
nix fmt
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're starting your editor in `nix-shell` or `nix develop`, you can also set it up to automatically run `treefmt` on save.
|
If you're starting your editor in `nix-shell` or `nix develop`, you can also set it up to automatically run `treefmt` on save.
|
||||||
@@ -957,6 +957,7 @@ The following situations are fully or partially exempt:
|
|||||||
|
|
||||||
If you believe that someone is using automation without appropriate disclosure and review, you can politely ask them if that’s the case and point them to this policy as appropriate.
|
If you believe that someone is using automation without appropriate disclosure and review, you can politely ask them if that’s the case and point them to this policy as appropriate.
|
||||||
Please assume good faith and remain civil; it’s not always possible to determine, and it is more likely that someone overlooked this policy than deliberately violated it.
|
Please assume good faith and remain civil; it’s not always possible to determine, and it is more likely that someone overlooked this policy than deliberately violated it.
|
||||||
|
If you think someone is continuing to break the policy after this, please escalate to the [Nixpkgs core team](https://nixos.org/community/teams/nixpkgs-core/) rather than fighting over it.
|
||||||
|
|
||||||
If a contribution is clearly in violation of the policy (e.g. the contributor admits it was not followed, or there are AI tool attributions that do not meet our required format), it can be closed or hidden, preferably after informing the contributor of the policy and giving them a chance to address the violations.
|
If a contribution is clearly in violation of the policy (e.g. the contributor admits it was not followed, or there are AI tool attributions that do not meet our required format), it can be closed or hidden, preferably after informing the contributor of the policy and giving them a chance to address the violations.
|
||||||
Deliberate violations of this policy are considered to break the [Code of Conduct](https://github.com/NixOS/.github/blob/master/CODE_OF_CONDUCT.md) clause against “Wasting other people’s time with low quality contributions, including but not limited to LLM and bot spam”.
|
Deliberate violations of this policy are considered to break the [Code of Conduct](https://github.com/NixOS/.github/blob/master/CODE_OF_CONDUCT.md) clause against “Wasting other people’s time with low quality contributions, including but not limited to LLM and bot spam”.
|
||||||
|
|||||||
22
ci/OWNERS
22
ci/OWNERS
@@ -97,7 +97,8 @@ nixos/modules/installer/tools/nix-fallback-paths.nix @Artturin @Ericson2314 @lo
|
|||||||
# Contributor documentation
|
# Contributor documentation
|
||||||
/CONTRIBUTING.md
|
/CONTRIBUTING.md
|
||||||
/.github/PULL_REQUEST_TEMPLATE.md
|
/.github/PULL_REQUEST_TEMPLATE.md
|
||||||
/doc/contributing.md @infinisil
|
/doc/contributing/
|
||||||
|
/doc/contributing/contributing-to-documentation.chapter.md @jtojnar
|
||||||
/lib/README.md
|
/lib/README.md
|
||||||
/doc/README.md
|
/doc/README.md
|
||||||
/nixos/README.md
|
/nixos/README.md
|
||||||
@@ -105,6 +106,10 @@ nixos/modules/installer/tools/nix-fallback-paths.nix @Artturin @Ericson2314 @lo
|
|||||||
/pkgs/by-name/README.md
|
/pkgs/by-name/README.md
|
||||||
/maintainers/README.md
|
/maintainers/README.md
|
||||||
|
|
||||||
|
# User-facing development documentation
|
||||||
|
/doc/development.md @infinisil
|
||||||
|
/doc/development @infinisil
|
||||||
|
|
||||||
# NixOS Internals
|
# NixOS Internals
|
||||||
/nixos/default.nix @infinisil
|
/nixos/default.nix @infinisil
|
||||||
/nixos/lib/from-env.nix @infinisil
|
/nixos/lib/from-env.nix @infinisil
|
||||||
@@ -194,7 +199,7 @@ nixos/modules/installer/tools/nix-fallback-paths.nix @Artturin @Ericson2314 @lo
|
|||||||
/doc/languages-frameworks/haskell.section.md @sternenseemann @maralorn @wolfgangwalther
|
/doc/languages-frameworks/haskell.section.md @sternenseemann @maralorn @wolfgangwalther
|
||||||
/maintainers/scripts/haskell @sternenseemann @maralorn @wolfgangwalther
|
/maintainers/scripts/haskell @sternenseemann @maralorn @wolfgangwalther
|
||||||
/pkgs/development/compilers/ghc @sternenseemann @maralorn @wolfgangwalther
|
/pkgs/development/compilers/ghc @sternenseemann @maralorn @wolfgangwalther
|
||||||
/pkgs/development/compilers/ghc/9.6.6-debian-binary.nix @sternenseemann @maralorn @wolfgangwalther @OPNA2608 @liberodark @NixOS/loongarch64
|
/pkgs/development/compilers/ghc/9.6.6-debian-binary.nix @sternenseemann @maralorn @wolfgangwalther @OPNA2608
|
||||||
/pkgs/development/haskell-modules @sternenseemann @maralorn @wolfgangwalther
|
/pkgs/development/haskell-modules @sternenseemann @maralorn @wolfgangwalther
|
||||||
/pkgs/test/haskell @sternenseemann @maralorn @wolfgangwalther
|
/pkgs/test/haskell @sternenseemann @maralorn @wolfgangwalther
|
||||||
/pkgs/top-level/release-haskell.nix @sternenseemann @maralorn @wolfgangwalther
|
/pkgs/top-level/release-haskell.nix @sternenseemann @maralorn @wolfgangwalther
|
||||||
@@ -356,10 +361,7 @@ pkgs/development/python-modules/buildcatrust/ @ajs124 @lukegb @mweinelt
|
|||||||
/pkgs/applications/editors/kakoune @philiptaron
|
/pkgs/applications/editors/kakoune @philiptaron
|
||||||
|
|
||||||
# LuaPackages
|
# LuaPackages
|
||||||
/pkgs/development/interpreters/lua-5 @NixOS/lua
|
|
||||||
/pkgs/development/interpreters/luajit @NixOS/lua
|
|
||||||
/pkgs/development/lua-modules @NixOS/lua
|
/pkgs/development/lua-modules @NixOS/lua
|
||||||
/pkgs/top-level/lua-packages.nix @NixOS/lua
|
|
||||||
|
|
||||||
# Neovim
|
# Neovim
|
||||||
/pkgs/applications/editors/neovim @NixOS/neovim
|
/pkgs/applications/editors/neovim @NixOS/neovim
|
||||||
@@ -388,9 +390,9 @@ pkgs/development/python-modules/buildcatrust/ @ajs124 @lukegb @mweinelt
|
|||||||
/doc/build-helpers/images/dockertools.section.md @roberth @jhol
|
/doc/build-helpers/images/dockertools.section.md @roberth @jhol
|
||||||
|
|
||||||
# Go
|
# Go
|
||||||
/doc/languages-frameworks/go.section.md @kalbasit @Mic92
|
/doc/languages-frameworks/go.section.md @kalbasit @katexochen @Mic92
|
||||||
/pkgs/build-support/go @kalbasit @Mic92
|
/pkgs/build-support/go @kalbasit @katexochen @Mic92
|
||||||
/pkgs/development/compilers/go @kalbasit @Mic92
|
/pkgs/development/compilers/go @kalbasit @katexochen @Mic92
|
||||||
|
|
||||||
# GNOME
|
# GNOME
|
||||||
/pkgs/desktops/gnome @NixOS/gnome
|
/pkgs/desktops/gnome @NixOS/gnome
|
||||||
@@ -523,7 +525,3 @@ pkgs/by-name/wa/warp-terminal/ @emilytrau @imadnyc @4evy @johnrtitor
|
|||||||
/nixos/lib/testing @NixOS/test-driver
|
/nixos/lib/testing @NixOS/test-driver
|
||||||
/nixos/tests/nixos-test-driver @NixOS/test-driver
|
/nixos/tests/nixos-test-driver @NixOS/test-driver
|
||||||
/nixos/modules/virtualisation/nspawn-container/run-nspawn @NixOS/test-driver
|
/nixos/modules/virtualisation/nspawn-container/run-nspawn @NixOS/test-driver
|
||||||
|
|
||||||
# Boot security
|
|
||||||
/pkgs/by-name/au/autopen @NixOS/boot-security
|
|
||||||
/pkgs/misc/signed-packages @NixOS/boot-security
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ For the purposes of CI, branches in the NixOS/nixpkgs repository are classified
|
|||||||
|
|
||||||
Some branches also have a version component, which is either `unstable` or `YY.MM`.
|
Some branches also have a version component, which is either `unstable` or `YY.MM`.
|
||||||
|
|
||||||
`ci/github-script/supportedBranches.js` is a script imported by CI to classify the base and head branches of a Pull Request.
|
`ci/supportedBranches.js` is a script imported by CI to classify the base and head branches of a Pull Request.
|
||||||
This classification will then be used to skip certain jobs.
|
This classification will then be used to skip certain jobs.
|
||||||
This script can also be run locally to print basic test cases.
|
This script can also be run locally to print basic test cases.
|
||||||
|
|
||||||
|
|||||||
1
ci/github-script/.gitignore
vendored
1
ci/github-script/.gitignore
vendored
@@ -2,4 +2,3 @@ comparison
|
|||||||
comparison.zip
|
comparison.zip
|
||||||
node_modules
|
node_modules
|
||||||
step-summary.md
|
step-summary.md
|
||||||
*.tsbuildinfo
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import { readFile, writeFile } from 'node:fs/promises'
|
module.exports = async ({ github, context, core, dry }) => {
|
||||||
import path from 'node:path'
|
const path = require('node:path')
|
||||||
import { DefaultArtifactClient } from '@actions/artifact'
|
const { DefaultArtifactClient } = await import('@actions/artifact')
|
||||||
import { handleMerge } from './merge.js'
|
const { readFile, writeFile } = require('node:fs/promises')
|
||||||
import { handleReviewers } from './reviewers.js'
|
const withRateLimit = require('./withRateLimit.js')
|
||||||
import { classify } from './supportedBranches.js'
|
const { classify } = require('../supportedBranches.js')
|
||||||
import withRateLimit from './withRateLimit.js'
|
const { handleMerge } = require('./merge.js')
|
||||||
|
const { handleReviewers } = require('./reviewers.js')
|
||||||
|
|
||||||
export default async ({ github, context, core, dry }) => {
|
|
||||||
const artifactClient = new DefaultArtifactClient()
|
const artifactClient = new DefaultArtifactClient()
|
||||||
|
|
||||||
// Detect if running in a fork (not NixOS/nixpkgs)
|
// Detect if running in a fork (not NixOS/nixpkgs)
|
||||||
@@ -397,11 +397,11 @@ export default async ({ github, context, core, dry }) => {
|
|||||||
per_page: 100,
|
per_page: 100,
|
||||||
})
|
})
|
||||||
|
|
||||||
// label llm-assisted PRs accordingly, retaining it if manually set
|
// label llm-assisted PRs accordingly
|
||||||
const assistedByPattern = /Assisted-by: (?!nix-init)/i
|
const assistedByPattern = /Assisted-by: (?!nix-init)/i
|
||||||
if (prCommits.some((c) => assistedByPattern.test(c.commit.message))) {
|
evalLabels['llm-assisted'] = prCommits.some((c) =>
|
||||||
evalLabels['llm-assisted'] = true
|
assistedByPattern.test(c.commit.message),
|
||||||
}
|
)
|
||||||
|
|
||||||
const commitSubjects = prCommits.map(
|
const commitSubjects = prCommits.map(
|
||||||
(c) => c.commit.message.split('\n')[0],
|
(c) => c.commit.message.split('\n')[0],
|
||||||
@@ -689,21 +689,16 @@ export default async ({ github, context, core, dry }) => {
|
|||||||
if (context.payload.pull_request) {
|
if (context.payload.pull_request) {
|
||||||
await handle({ item: context.payload.pull_request, stats })
|
await handle({ item: context.payload.pull_request, stats })
|
||||||
} else {
|
} else {
|
||||||
// We don't use filters here because that causes GitHub to use an often-outdated index,
|
|
||||||
// resulting in the cursor not being updated, and therefore causing the same PRs
|
|
||||||
// to use up our rate limit over and over again.
|
|
||||||
const lastRun = (
|
const lastRun = (
|
||||||
await github.rest.actions.listWorkflowRuns({
|
await github.rest.actions.listWorkflowRuns({
|
||||||
...context.repo,
|
...context.repo,
|
||||||
workflow_id: 'bot.yml',
|
workflow_id: 'bot.yml',
|
||||||
|
event: 'schedule',
|
||||||
|
status: 'success',
|
||||||
|
exclude_pull_requests: true,
|
||||||
|
per_page: 1,
|
||||||
})
|
})
|
||||||
).data.workflow_runs.find(
|
).data.workflow_runs[0]
|
||||||
(run) => run.event === 'schedule' && run.conclusion === 'success',
|
|
||||||
)
|
|
||||||
|
|
||||||
core.info(
|
|
||||||
`Last successful run created at: ${lastRun?.created_at ?? '<n/a>'}`,
|
|
||||||
)
|
|
||||||
|
|
||||||
const cutoff = new Date(
|
const cutoff = new Date(
|
||||||
Math.max(
|
Math.max(
|
||||||
@@ -799,7 +794,6 @@ export default async ({ github, context, core, dry }) => {
|
|||||||
} else {
|
} else {
|
||||||
// No stats.artifacts++, because this does not allow passing a custom token.
|
// No stats.artifacts++, because this does not allow passing a custom token.
|
||||||
// Thus, the upload will not happen with the app token, but the default github.token.
|
// Thus, the upload will not happen with the app token, but the default github.token.
|
||||||
core.info(`pagination-cursor: ${cursor}`)
|
|
||||||
await artifactClient.uploadArtifact(
|
await artifactClient.uploadArtifact(
|
||||||
'pagination-cursor',
|
'pagination-cursor',
|
||||||
[uploadPath],
|
[uploadPath],
|
||||||
@@ -809,8 +803,6 @@ export default async ({ github, context, core, dry }) => {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
core.info('pagination-cursor: <n/a>')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some items might be in both search results, so filtering out duplicates as well.
|
// Some items might be in both search results, so filtering out duplicates as well.
|
||||||
|
|||||||
@@ -1,242 +0,0 @@
|
|||||||
import assert from 'node:assert/strict'
|
|
||||||
import test from 'node:test'
|
|
||||||
import { evaluateTargetBranchPolicy } from './check-target-branch-policy.ts'
|
|
||||||
|
|
||||||
type DecisionFacts = {
|
|
||||||
base: string
|
|
||||||
head: string
|
|
||||||
maxRebuildCount: number
|
|
||||||
rebuildsAllTests: boolean
|
|
||||||
onlyChangedFile: string | null
|
|
||||||
}
|
|
||||||
|
|
||||||
type Decision =
|
|
||||||
| 'mass-rebuild'
|
|
||||||
| 'nixos-rebuild'
|
|
||||||
| 'possible-mass-rebuild'
|
|
||||||
| 'skip-development-merge'
|
|
||||||
| 'dismiss'
|
|
||||||
|
|
||||||
const defaults: DecisionFacts = {
|
|
||||||
base: 'master',
|
|
||||||
head: 'topic-branch',
|
|
||||||
maxRebuildCount: 0,
|
|
||||||
rebuildsAllTests: false,
|
|
||||||
onlyChangedFile: null,
|
|
||||||
}
|
|
||||||
|
|
||||||
const cases: Array<{
|
|
||||||
name: string
|
|
||||||
facts: Partial<DecisionFacts>
|
|
||||||
expected: Decision
|
|
||||||
}> = [
|
|
||||||
{
|
|
||||||
name: 'allows fewer than 500 rebuilds on master',
|
|
||||||
facts: { maxRebuildCount: 499 },
|
|
||||||
expected: 'dismiss',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'flags 500 rebuilds on master as a possible mass rebuild',
|
|
||||||
facts: { maxRebuildCount: 500 },
|
|
||||||
expected: 'possible-mass-rebuild',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'flags 999 rebuilds on master as a possible mass rebuild',
|
|
||||||
facts: { maxRebuildCount: 999 },
|
|
||||||
expected: 'possible-mass-rebuild',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'flags 1000 rebuilds on master as a mass rebuild',
|
|
||||||
facts: { maxRebuildCount: 1000 },
|
|
||||||
expected: 'mass-rebuild',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'flags a mass rebuild on staging-nixos',
|
|
||||||
facts: { base: 'staging-nixos', maxRebuildCount: 24_000 },
|
|
||||||
expected: 'mass-rebuild',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'flags a mass rebuild on a release staging-nixos branch',
|
|
||||||
facts: { base: 'staging-nixos-26.05', maxRebuildCount: 1000 },
|
|
||||||
expected: 'mass-rebuild',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'allows mass rebuilds on staging',
|
|
||||||
facts: { base: 'staging', maxRebuildCount: 1000 },
|
|
||||||
expected: 'dismiss',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'flags a mass rebuild on a release branch',
|
|
||||||
facts: { base: 'release-26.05', maxRebuildCount: 1000 },
|
|
||||||
expected: 'mass-rebuild',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'flags NixOS test rebuilds on master',
|
|
||||||
facts: { rebuildsAllTests: true },
|
|
||||||
expected: 'nixos-rebuild',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'flags NixOS test rebuilds on a release branch',
|
|
||||||
facts: { base: 'release-26.05', rebuildsAllTests: true },
|
|
||||||
expected: 'nixos-rebuild',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'allows NixOS test rebuilds on staging-nixos',
|
|
||||||
facts: { base: 'staging-nixos', rebuildsAllTests: true },
|
|
||||||
expected: 'dismiss',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'does not flag a possible mass rebuild when staging-nixos rebuilds all NixOS tests',
|
|
||||||
facts: {
|
|
||||||
base: 'staging-nixos',
|
|
||||||
maxRebuildCount: 500,
|
|
||||||
rebuildsAllTests: true,
|
|
||||||
},
|
|
||||||
expected: 'dismiss',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'flags other possible mass rebuilds on staging-nixos',
|
|
||||||
facts: { base: 'staging-nixos', maxRebuildCount: 500 },
|
|
||||||
expected: 'possible-mass-rebuild',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'skips staging into master',
|
|
||||||
facts: {
|
|
||||||
head: 'staging',
|
|
||||||
maxRebuildCount: 24_000,
|
|
||||||
},
|
|
||||||
expected: 'skip-development-merge',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'skips staging-nixos into master',
|
|
||||||
facts: {
|
|
||||||
head: 'staging-nixos',
|
|
||||||
maxRebuildCount: 24_000,
|
|
||||||
},
|
|
||||||
expected: 'skip-development-merge',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'skips master into staging-nixos',
|
|
||||||
facts: {
|
|
||||||
base: 'staging-nixos',
|
|
||||||
head: 'master',
|
|
||||||
maxRebuildCount: 24_000,
|
|
||||||
},
|
|
||||||
expected: 'skip-development-merge',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'checks staging into staging-nixos',
|
|
||||||
facts: {
|
|
||||||
base: 'staging-nixos',
|
|
||||||
head: 'staging',
|
|
||||||
maxRebuildCount: 24_000,
|
|
||||||
},
|
|
||||||
expected: 'mass-rebuild',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'skips release staging-nixos into its release branch',
|
|
||||||
facts: {
|
|
||||||
base: 'release-26.05',
|
|
||||||
head: 'staging-nixos-26.05',
|
|
||||||
maxRebuildCount: 24_000,
|
|
||||||
},
|
|
||||||
expected: 'skip-development-merge',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'skips a release branch into its staging-nixos branch',
|
|
||||||
facts: {
|
|
||||||
base: 'staging-nixos-26.05',
|
|
||||||
head: 'release-26.05',
|
|
||||||
maxRebuildCount: 24_000,
|
|
||||||
},
|
|
||||||
expected: 'skip-development-merge',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'checks release staging into its staging-nixos branch',
|
|
||||||
facts: {
|
|
||||||
base: 'staging-nixos-26.05',
|
|
||||||
head: 'staging-26.05',
|
|
||||||
maxRebuildCount: 24_000,
|
|
||||||
},
|
|
||||||
expected: 'mass-rebuild',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'kernels-org exemption suppresses a possible mass rebuild',
|
|
||||||
facts: {
|
|
||||||
maxRebuildCount: 999,
|
|
||||||
onlyChangedFile: 'pkgs/os-specific/linux/kernel/kernels-org.json',
|
|
||||||
},
|
|
||||||
expected: 'dismiss',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'kernels-org exemption suppresses a definite mass rebuild',
|
|
||||||
facts: {
|
|
||||||
maxRebuildCount: 1000,
|
|
||||||
onlyChangedFile: 'pkgs/os-specific/linux/kernel/kernels-org.json',
|
|
||||||
},
|
|
||||||
expected: 'dismiss',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'kernels-org exemption suppresses a NixOS test rebuild',
|
|
||||||
facts: {
|
|
||||||
rebuildsAllTests: true,
|
|
||||||
onlyChangedFile: 'pkgs/os-specific/linux/kernel/kernels-org.json',
|
|
||||||
},
|
|
||||||
expected: 'dismiss',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'xanmod kernel exemption suppresses a possible mass rebuild',
|
|
||||||
facts: {
|
|
||||||
maxRebuildCount: 999,
|
|
||||||
onlyChangedFile: 'pkgs/os-specific/linux/kernel/xanmod-kernels.nix',
|
|
||||||
},
|
|
||||||
expected: 'dismiss',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'xanmod kernel exemption suppresses a definite mass rebuild',
|
|
||||||
facts: {
|
|
||||||
maxRebuildCount: 1000,
|
|
||||||
onlyChangedFile: 'pkgs/os-specific/linux/kernel/xanmod-kernels.nix',
|
|
||||||
},
|
|
||||||
expected: 'dismiss',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'xanmod kernel exemption suppresses a NixOS test rebuild',
|
|
||||||
facts: {
|
|
||||||
rebuildsAllTests: true,
|
|
||||||
onlyChangedFile: 'pkgs/os-specific/linux/kernel/xanmod-kernels.nix',
|
|
||||||
},
|
|
||||||
expected: 'dismiss',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Home Assistant exemption suppresses a mass rebuild',
|
|
||||||
facts: {
|
|
||||||
head: 'wip-home-assistant',
|
|
||||||
maxRebuildCount: 1500,
|
|
||||||
},
|
|
||||||
expected: 'dismiss',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'does not exempt a Home Assistant update above 1500 rebuilds',
|
|
||||||
facts: { head: 'wip-home-assistant', maxRebuildCount: 1501 },
|
|
||||||
expected: 'mass-rebuild',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Home Assistant exemption does not suppress a NixOS test rebuild',
|
|
||||||
facts: {
|
|
||||||
head: 'wip-home-assistant',
|
|
||||||
maxRebuildCount: 1500,
|
|
||||||
rebuildsAllTests: true,
|
|
||||||
},
|
|
||||||
expected: 'nixos-rebuild',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
for (const { name, facts, expected } of cases) {
|
|
||||||
test(name, () => {
|
|
||||||
assert.equal(
|
|
||||||
evaluateTargetBranchPolicy({ ...defaults, ...facts }).decision,
|
|
||||||
expected,
|
|
||||||
)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
import { classify, split } from './supportedBranches.js'
|
|
||||||
|
|
||||||
type TargetBranchPolicyFacts = {
|
|
||||||
base: string
|
|
||||||
head: string
|
|
||||||
maxRebuildCount: number
|
|
||||||
rebuildsAllTests: boolean
|
|
||||||
onlyChangedFile: string | null
|
|
||||||
}
|
|
||||||
|
|
||||||
type TargetBranchReviewDecision =
|
|
||||||
| 'mass-rebuild'
|
|
||||||
| 'nixos-rebuild'
|
|
||||||
| 'possible-mass-rebuild'
|
|
||||||
| 'skip-development-merge'
|
|
||||||
| 'dismiss'
|
|
||||||
|
|
||||||
type TargetBranchPolicyResult = {
|
|
||||||
decision: TargetBranchReviewDecision
|
|
||||||
details: {
|
|
||||||
isExemptKernelUpdate: boolean
|
|
||||||
isExemptHomeAssistantUpdate: boolean
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getTargetBranchPolicy({
|
|
||||||
base,
|
|
||||||
head,
|
|
||||||
}: {
|
|
||||||
base: string
|
|
||||||
head: string
|
|
||||||
}) {
|
|
||||||
const baseClassification = classify(base)
|
|
||||||
const headClassification = classify(head)
|
|
||||||
const isPrimaryBase = baseClassification.type.includes('primary')
|
|
||||||
const isPrimaryHead = headClassification.type.includes('primary')
|
|
||||||
const isStagingNixosBase = split(base).prefix === 'staging-nixos'
|
|
||||||
const isDevelopmentHead = headClassification.type.includes('development')
|
|
||||||
const shouldSkipDevelopmentMerge =
|
|
||||||
isDevelopmentHead && (!isStagingNixosBase || isPrimaryHead)
|
|
||||||
|
|
||||||
return {
|
|
||||||
isStagingNixosBase,
|
|
||||||
shouldSkipDevelopmentMerge,
|
|
||||||
shouldCheckMassRebuild:
|
|
||||||
!shouldSkipDevelopmentMerge && (isPrimaryBase || isStagingNixosBase),
|
|
||||||
shouldCheckNixosRebuild: !shouldSkipDevelopmentMerge && isPrimaryBase,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function evaluateTargetBranchPolicy({
|
|
||||||
base,
|
|
||||||
head,
|
|
||||||
maxRebuildCount,
|
|
||||||
rebuildsAllTests,
|
|
||||||
onlyChangedFile,
|
|
||||||
}: TargetBranchPolicyFacts): TargetBranchPolicyResult {
|
|
||||||
const {
|
|
||||||
isStagingNixosBase,
|
|
||||||
shouldSkipDevelopmentMerge,
|
|
||||||
shouldCheckMassRebuild,
|
|
||||||
shouldCheckNixosRebuild,
|
|
||||||
} = getTargetBranchPolicy({ base, head })
|
|
||||||
|
|
||||||
// https://github.com/NixOS/nixpkgs/pull/553786#issuecomment-5510286851
|
|
||||||
// kernels-org should go to staging-nixos (or master) and staging-nixos-xx.xx (or release-xx.xx) when backported
|
|
||||||
// https://github.com/NixOS/nixpkgs/pull/521157
|
|
||||||
// xanmod should go to master and release-xx.xx when backported
|
|
||||||
const isExemptKernelUpdate =
|
|
||||||
onlyChangedFile === 'pkgs/os-specific/linux/kernel/kernels-org.json' ||
|
|
||||||
onlyChangedFile === 'pkgs/os-specific/linux/kernel/xanmod-kernels.nix'
|
|
||||||
|
|
||||||
// https://github.com/NixOS/nixpkgs/pull/483194#issuecomment-3793393218
|
|
||||||
const isExemptHomeAssistantUpdate =
|
|
||||||
maxRebuildCount <= 1500 && head === 'wip-home-assistant'
|
|
||||||
|
|
||||||
const details = {
|
|
||||||
isExemptKernelUpdate,
|
|
||||||
isExemptHomeAssistantUpdate,
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = (decision: TargetBranchReviewDecision) => ({
|
|
||||||
decision,
|
|
||||||
details,
|
|
||||||
})
|
|
||||||
|
|
||||||
const isMassRebuild =
|
|
||||||
maxRebuildCount >= 1000 &&
|
|
||||||
!isExemptKernelUpdate &&
|
|
||||||
!isExemptHomeAssistantUpdate
|
|
||||||
|
|
||||||
if (shouldCheckMassRebuild && isMassRebuild) {
|
|
||||||
return result('mass-rebuild')
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shouldCheckNixosRebuild && rebuildsAllTests && !isExemptKernelUpdate) {
|
|
||||||
return result('nixos-rebuild')
|
|
||||||
}
|
|
||||||
|
|
||||||
const isPossibleMassRebuild =
|
|
||||||
maxRebuildCount >= 500 &&
|
|
||||||
!isMassRebuild &&
|
|
||||||
!isExemptKernelUpdate &&
|
|
||||||
!isExemptHomeAssistantUpdate
|
|
||||||
if (
|
|
||||||
shouldCheckMassRebuild &&
|
|
||||||
isPossibleMassRebuild &&
|
|
||||||
!(rebuildsAllTests && isStagingNixosBase)
|
|
||||||
) {
|
|
||||||
return result('possible-mass-rebuild')
|
|
||||||
}
|
|
||||||
|
|
||||||
return result(
|
|
||||||
shouldSkipDevelopmentMerge ? 'skip-development-merge' : 'dismiss',
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,18 +1,15 @@
|
|||||||
import { readFile } from 'node:fs/promises'
|
|
||||||
import type * as actionsCore from '@actions/core'
|
import type * as actionsCore from '@actions/core'
|
||||||
import type { context as actionsContext } from '@actions/github'
|
import type { context as actionsContext } from '@actions/github'
|
||||||
import type { GitHub } from '@actions/github/lib/utils'
|
import type { GitHub } from '@actions/github/lib/utils'
|
||||||
import {
|
|
||||||
evaluateTargetBranchPolicy,
|
|
||||||
getTargetBranchPolicy,
|
|
||||||
} from './check-target-branch-policy.ts'
|
|
||||||
import { dismissReviews, postReview } from './reviews.js'
|
|
||||||
import { split } from './supportedBranches.js'
|
|
||||||
|
|
||||||
// TODO: should this be combined with the branch checks in prepare.js?
|
// TODO: should this be combined with the branch checks in prepare.js?
|
||||||
// They do seem quite similar, but this needs to run after eval,
|
// They do seem quite similar, but this needs to run after eval,
|
||||||
// and prepare.js obviously doesn't.
|
// and prepare.js obviously doesn't.
|
||||||
|
|
||||||
|
const { classify, split } = require('../supportedBranches.js')
|
||||||
|
const { readFile } = require('node:fs/promises')
|
||||||
|
const { postReview, dismissReviews } = require('./reviews.js')
|
||||||
|
|
||||||
const reviewKey = 'check-target-branch'
|
const reviewKey = 'check-target-branch'
|
||||||
|
|
||||||
type ChangedPaths = {
|
type ChangedPaths = {
|
||||||
@@ -43,93 +40,7 @@ type ChangedPaths = {
|
|||||||
rebuildsByPlatform: Record<string, string[]>
|
rebuildsByPlatform: Record<string, string[]>
|
||||||
}
|
}
|
||||||
|
|
||||||
type TargetBranchReviewFacts = {
|
async function checkTargetBranch({
|
||||||
github: InstanceType<typeof GitHub>
|
|
||||||
context: typeof actionsContext
|
|
||||||
core: typeof actionsCore
|
|
||||||
dry: boolean
|
|
||||||
base: string
|
|
||||||
maxRebuildCount: number
|
|
||||||
}
|
|
||||||
|
|
||||||
function getStagingBranch(base: string) {
|
|
||||||
const version = split(base).version
|
|
||||||
return version ? `staging-${version}` : 'staging'
|
|
||||||
}
|
|
||||||
|
|
||||||
async function postMassRebuildReview(facts: TargetBranchReviewFacts) {
|
|
||||||
const { github, context, core, dry, base, maxRebuildCount } = facts
|
|
||||||
const desiredBranch = getStagingBranch(base)
|
|
||||||
const body = [
|
|
||||||
`The PR's base branch is set to \`${base}\`, but this PR causes ${maxRebuildCount} rebuilds.`,
|
|
||||||
'It is therefore considered a mass rebuild.',
|
|
||||||
`Please [change the base branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request) to [the right base branch for your changes](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#branch-conventions) (probably \`${desiredBranch}\`).`,
|
|
||||||
].join('\n')
|
|
||||||
|
|
||||||
await postReview({
|
|
||||||
github,
|
|
||||||
context,
|
|
||||||
core,
|
|
||||||
dry,
|
|
||||||
body,
|
|
||||||
event: 'REQUEST_CHANGES',
|
|
||||||
reviewKey,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function postNixosRebuildReview(facts: TargetBranchReviewFacts) {
|
|
||||||
const { github, context, core, dry, base, maxRebuildCount } = facts
|
|
||||||
let branchText: string
|
|
||||||
if (base === 'master' && maxRebuildCount >= 500) {
|
|
||||||
branchText = '(probably either `staging-nixos` or `staging`)'
|
|
||||||
} else if (base === 'master') {
|
|
||||||
branchText = '(probably `staging-nixos`)'
|
|
||||||
} else if (maxRebuildCount >= 500) {
|
|
||||||
branchText = `(probably either \`staging-nixos-${split(base).version}\` or \`staging-${split(base).version}\`)`
|
|
||||||
} else {
|
|
||||||
branchText = `(probably \`staging-nixos-${split(base).version}\`)`
|
|
||||||
}
|
|
||||||
const body = [
|
|
||||||
`The PR's base branch is set to \`${base}\`, but this PR rebuilds all NixOS tests.`,
|
|
||||||
base === 'master' && maxRebuildCount >= 500
|
|
||||||
? `Since this PR also causes ${maxRebuildCount} rebuilds, it may also be considered a mass rebuild.`
|
|
||||||
: '',
|
|
||||||
`Please [change the base branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request) to [the right base branch for your changes](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#branch-conventions) ${branchText}.`,
|
|
||||||
].join('\n')
|
|
||||||
|
|
||||||
await postReview({
|
|
||||||
github,
|
|
||||||
context,
|
|
||||||
core,
|
|
||||||
dry,
|
|
||||||
body,
|
|
||||||
event: 'REQUEST_CHANGES',
|
|
||||||
reviewKey,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function postPossibleMassRebuildReview(facts: TargetBranchReviewFacts) {
|
|
||||||
const { github, context, core, dry, base, maxRebuildCount } = facts
|
|
||||||
const stagingBranch = getStagingBranch(base)
|
|
||||||
const body = [
|
|
||||||
`The PR's base branch is set to \`${base}\`, and this PR causes ${maxRebuildCount} rebuilds.`,
|
|
||||||
`Please consider whether this PR causes a mass rebuild according to [our conventions](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#branch-conventions).`,
|
|
||||||
`If it does cause a mass rebuild, please [change the base branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request) to [the right base branch for your changes](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#branch-conventions) (probably \`${stagingBranch}\`).`,
|
|
||||||
`If it does not cause a mass rebuild, this message can be ignored.`,
|
|
||||||
].join('\n')
|
|
||||||
|
|
||||||
await postReview({
|
|
||||||
github,
|
|
||||||
context,
|
|
||||||
core,
|
|
||||||
dry,
|
|
||||||
body,
|
|
||||||
event: 'REQUEST_CHANGES',
|
|
||||||
reviewKey,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function checkTargetBranch({
|
|
||||||
github,
|
github,
|
||||||
context,
|
context,
|
||||||
core,
|
core,
|
||||||
@@ -158,7 +69,41 @@ export async function checkTargetBranch({
|
|||||||
).data
|
).data
|
||||||
const base = prInfo.base.ref
|
const base = prInfo.base.ref
|
||||||
const head = prInfo.head.ref
|
const head = prInfo.head.ref
|
||||||
const { shouldCheckMassRebuild } = getTargetBranchPolicy({ base, head })
|
const baseClassification = classify(base)
|
||||||
|
const headClassification = classify(head)
|
||||||
|
|
||||||
|
// Don't run on, e.g., staging-nixos to master merges.
|
||||||
|
if (headClassification.type.includes('development')) {
|
||||||
|
core.info(
|
||||||
|
`Skipping checkTargetBranch: PR is from a development branch (${head})`,
|
||||||
|
)
|
||||||
|
|
||||||
|
await dismissReviews({
|
||||||
|
github,
|
||||||
|
context,
|
||||||
|
core,
|
||||||
|
dry,
|
||||||
|
reviewKey,
|
||||||
|
})
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Don't run on PRs against staging branches, wip branches, haskell-updates, etc.
|
||||||
|
if (!baseClassification.type.includes('primary')) {
|
||||||
|
core.info(
|
||||||
|
`Skipping checkTargetBranch: PR is against a non-primary base branch (${base})`,
|
||||||
|
)
|
||||||
|
|
||||||
|
await dismissReviews({
|
||||||
|
github,
|
||||||
|
context,
|
||||||
|
core,
|
||||||
|
dry,
|
||||||
|
reviewKey,
|
||||||
|
})
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const maxRebuildCount = Math.max(
|
const maxRebuildCount = Math.max(
|
||||||
...Object.values(changed.rebuildCountByKernel),
|
...Object.values(changed.rebuildCountByKernel),
|
||||||
@@ -167,28 +112,25 @@ export async function checkTargetBranch({
|
|||||||
changed.attrdiff.changed.includes('nixosTests.simple-container') ||
|
changed.attrdiff.changed.includes('nixosTests.simple-container') ||
|
||||||
changed.attrdiff.changed.includes('nixosTests.simple-vm')
|
changed.attrdiff.changed.includes('nixosTests.simple-vm')
|
||||||
|
|
||||||
let onlyChangedFile: string | null = null
|
// https://github.com/NixOS/nixpkgs/pull/521157
|
||||||
if (shouldCheckMassRebuild && prInfo.changed_files === 1) {
|
// These should go to master and release-xx.xx when backported
|
||||||
|
let isExemptKernelUpdate = false
|
||||||
|
if (prInfo.changed_files === 1) {
|
||||||
const changedFiles = (
|
const changedFiles = (
|
||||||
await github.rest.pulls.listFiles({
|
await github.rest.pulls.listFiles({
|
||||||
...context.repo,
|
...context.repo,
|
||||||
pull_number,
|
pull_number,
|
||||||
})
|
})
|
||||||
).data
|
).data
|
||||||
onlyChangedFile =
|
isExemptKernelUpdate =
|
||||||
changedFiles.length === 1 ? changedFiles[0].filename : null
|
changedFiles.length === 1 &&
|
||||||
|
changedFiles[0].filename ===
|
||||||
|
'pkgs/os-specific/linux/kernel/xanmod-kernels.nix'
|
||||||
}
|
}
|
||||||
|
|
||||||
const {
|
// https://github.com/NixOS/nixpkgs/pull/483194#issuecomment-3793393218
|
||||||
decision,
|
const isExemptHomeAssistantUpdate =
|
||||||
details: { isExemptKernelUpdate, isExemptHomeAssistantUpdate },
|
maxRebuildCount <= 1500 && head === 'wip-home-assistant'
|
||||||
} = evaluateTargetBranchPolicy({
|
|
||||||
base,
|
|
||||||
head,
|
|
||||||
maxRebuildCount,
|
|
||||||
rebuildsAllTests,
|
|
||||||
onlyChangedFile,
|
|
||||||
})
|
|
||||||
|
|
||||||
core.info(
|
core.info(
|
||||||
[
|
[
|
||||||
@@ -200,43 +142,90 @@ export async function checkTargetBranch({
|
|||||||
].join('\n'),
|
].join('\n'),
|
||||||
)
|
)
|
||||||
|
|
||||||
const reviewFacts: TargetBranchReviewFacts = {
|
if (
|
||||||
github,
|
maxRebuildCount >= 1000 &&
|
||||||
context,
|
!isExemptHomeAssistantUpdate &&
|
||||||
core,
|
!isExemptKernelUpdate
|
||||||
dry,
|
) {
|
||||||
base,
|
const desiredBranch =
|
||||||
maxRebuildCount,
|
base === 'master' ? 'staging' : `staging-${split(base).version}`
|
||||||
}
|
const body = [
|
||||||
|
`The PR's base branch is set to \`${base}\`, but this PR causes ${maxRebuildCount} rebuilds.`,
|
||||||
|
'It is therefore considered a mass rebuild.',
|
||||||
|
`Please [change the base branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request) to [the right base branch for your changes](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#branch-conventions) (probably \`${desiredBranch}\`).`,
|
||||||
|
].join('\n')
|
||||||
|
|
||||||
if (decision === 'mass-rebuild') {
|
await postReview({
|
||||||
await postMassRebuildReview(reviewFacts)
|
github,
|
||||||
return
|
context,
|
||||||
}
|
core,
|
||||||
|
dry,
|
||||||
|
body,
|
||||||
|
event: 'REQUEST_CHANGES',
|
||||||
|
reviewKey,
|
||||||
|
})
|
||||||
|
} else if (rebuildsAllTests && !isExemptKernelUpdate) {
|
||||||
|
let branchText: string
|
||||||
|
if (base === 'master' && maxRebuildCount >= 500) {
|
||||||
|
branchText = '(probably either `staging-nixos` or `staging`)'
|
||||||
|
} else if (base === 'master') {
|
||||||
|
branchText = '(probably `staging-nixos`)'
|
||||||
|
} else if (maxRebuildCount >= 500) {
|
||||||
|
branchText = `(probably either \`staging-nixos-${split(base).version}\` or \`staging-${split(base).version}\`)`
|
||||||
|
} else {
|
||||||
|
branchText = `(probably \`staging-nixos-${split(base).version}\`)`
|
||||||
|
}
|
||||||
|
const body = [
|
||||||
|
`The PR's base branch is set to \`${base}\`, but this PR rebuilds all NixOS tests.`,
|
||||||
|
base === 'master' && maxRebuildCount >= 500
|
||||||
|
? `Since this PR also causes ${maxRebuildCount} rebuilds, it may also be considered a mass rebuild.`
|
||||||
|
: '',
|
||||||
|
`Please [change the base branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request) to [the right base branch for your changes](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#branch-conventions) ${branchText}.`,
|
||||||
|
].join('\n')
|
||||||
|
|
||||||
if (decision === 'nixos-rebuild') {
|
await postReview({
|
||||||
await postNixosRebuildReview(reviewFacts)
|
github,
|
||||||
return
|
context,
|
||||||
}
|
core,
|
||||||
|
dry,
|
||||||
|
body,
|
||||||
|
event: 'REQUEST_CHANGES',
|
||||||
|
reviewKey,
|
||||||
|
})
|
||||||
|
} else if (
|
||||||
|
maxRebuildCount >= 500 &&
|
||||||
|
!isExemptKernelUpdate &&
|
||||||
|
!isExemptHomeAssistantUpdate
|
||||||
|
) {
|
||||||
|
const stagingBranch =
|
||||||
|
base === 'master' ? 'staging' : `staging-${split(base).version}`
|
||||||
|
const body = [
|
||||||
|
`The PR's base branch is set to \`${base}\`, and this PR causes ${maxRebuildCount} rebuilds.`,
|
||||||
|
`Please consider whether this PR causes a mass rebuild according to [our conventions](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#branch-conventions).`,
|
||||||
|
`If it does cause a mass rebuild, please [change the base branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request) to [the right base branch for your changes](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#branch-conventions) (probably \`${stagingBranch}\`).`,
|
||||||
|
`If it does not cause a mass rebuild, this message can be ignored.`,
|
||||||
|
].join('\n')
|
||||||
|
|
||||||
if (decision === 'possible-mass-rebuild') {
|
await postReview({
|
||||||
await postPossibleMassRebuildReview(reviewFacts)
|
github,
|
||||||
return
|
context,
|
||||||
}
|
core,
|
||||||
|
dry,
|
||||||
if (decision === 'skip-development-merge') {
|
body,
|
||||||
core.info(
|
event: 'REQUEST_CHANGES',
|
||||||
`Skipping checkTargetBranch: PR merges the development branch ${head} into ${base}`,
|
reviewKey,
|
||||||
)
|
})
|
||||||
} else {
|
} else {
|
||||||
core.info('checkTargetBranch: this PR is against an appropriate branch.')
|
core.info('checkTargetBranch: this PR is against an appropriate branch.')
|
||||||
}
|
|
||||||
|
|
||||||
await dismissReviews({
|
await dismissReviews({
|
||||||
github,
|
github,
|
||||||
context,
|
context,
|
||||||
core,
|
core,
|
||||||
dry,
|
dry,
|
||||||
reviewKey,
|
reviewKey,
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = checkTargetBranch
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import { execFileSync } from 'node:child_process'
|
module.exports = async ({ github, context, core, dry, cherryPicks }) => {
|
||||||
import { dismissReviews, postReview } from './reviews.js'
|
const { execFileSync } = require('node:child_process')
|
||||||
import { classify } from './supportedBranches.js'
|
const { classify } = require('../supportedBranches.js')
|
||||||
import withRateLimit from './withRateLimit.js'
|
const withRateLimit = require('./withRateLimit.js')
|
||||||
|
const { dismissReviews, postReview } = require('./reviews.js')
|
||||||
const dirname = import.meta.dirname
|
|
||||||
|
|
||||||
export default async ({ github, context, core, dry, cherryPicks }) => {
|
|
||||||
const reviewKey = 'check-commits'
|
const reviewKey = 'check-commits'
|
||||||
|
|
||||||
await withRateLimit({ github, core }, async (stats) => {
|
await withRateLimit({ github, core }, async (stats) => {
|
||||||
@@ -96,7 +93,7 @@ export default async ({ github, context, core, dry, cherryPicks }) => {
|
|||||||
function diff({ sha, commit, original_sha }) {
|
function diff({ sha, commit, original_sha }) {
|
||||||
const diff = execFileSync('git', [
|
const diff = execFileSync('git', [
|
||||||
'-C',
|
'-C',
|
||||||
dirname,
|
__dirname,
|
||||||
'range-diff',
|
'range-diff',
|
||||||
'--no-color',
|
'--no-color',
|
||||||
'--ignore-all-space',
|
'--ignore-all-space',
|
||||||
@@ -123,7 +120,7 @@ export default async ({ github, context, core, dry, cherryPicks }) => {
|
|||||||
|
|
||||||
const colored_diff = execFileSync('git', [
|
const colored_diff = execFileSync('git', [
|
||||||
'-C',
|
'-C',
|
||||||
dirname,
|
__dirname,
|
||||||
'range-diff',
|
'range-diff',
|
||||||
'--color',
|
'--color',
|
||||||
'--no-notes',
|
'--no-notes',
|
||||||
@@ -162,7 +159,7 @@ export default async ({ github, context, core, dry, cherryPicks }) => {
|
|||||||
// Fetching all commits we need for diff at once is much faster than any other method.
|
// Fetching all commits we need for diff at once is much faster than any other method.
|
||||||
execFileSync('git', [
|
execFileSync('git', [
|
||||||
'-C',
|
'-C',
|
||||||
dirname,
|
__dirname,
|
||||||
'fetch',
|
'fetch',
|
||||||
'--depth=2',
|
'--depth=2',
|
||||||
'origin',
|
'origin',
|
||||||
@@ -290,7 +287,7 @@ export default async ({ github, context, core, dry, cherryPicks }) => {
|
|||||||
// that's too long. We think this is unlikely to happen, and so don't deal with it explicitly.
|
// that's too long. We think this is unlikely to happen, and so don't deal with it explicitly.
|
||||||
const truncated = []
|
const truncated = []
|
||||||
let total_length = 0
|
let total_length = 0
|
||||||
for (const line of diff) {
|
for (line of diff) {
|
||||||
total_length += line.length
|
total_length += line.length
|
||||||
if (total_length > 10000) {
|
if (total_length > 10000) {
|
||||||
truncated.push('', '[...truncated...]')
|
truncated.push('', '[...truncated...]')
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { execFile as nodeExecFile } from 'node:child_process'
|
// @ts-nocheck
|
||||||
import { promisify } from 'node:util'
|
const { promisify } = require('node:util')
|
||||||
|
const execFile = promisify(require('node:child_process').execFile)
|
||||||
const execFile = promisify(nodeExecFile)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{
|
* @typedef {{
|
||||||
@@ -42,13 +41,13 @@ async function runGit({ args, repoPath, core, quiet }) {
|
|||||||
*
|
*
|
||||||
* @param {{
|
* @param {{
|
||||||
* core: typeof import('@actions/core'),
|
* core: typeof import('@actions/core'),
|
||||||
* pr: Awaited<ReturnType<InstanceType<typeof import('@actions/github/lib/utils').GitHub>["rest"]["pulls"]["get"]>>["data"]
|
* pr: Awaited<ReturnType<InstanceType<import('@actions/github/lib/utils').GitHub>["rest"]["pulls"]["get"]>>["data"]
|
||||||
* repoPath?: string,
|
* repoPath?: string,
|
||||||
* }} GetCommitMessagesForPRProps
|
* }} GetCommitMessagesForPRProps
|
||||||
*
|
*
|
||||||
* @returns {Promise<Commit[]>}
|
* @returns {Promise<Commit[]>}
|
||||||
*/
|
*/
|
||||||
export async function getCommitDetailsForPR({ core, pr, repoPath }) {
|
async function getCommitDetailsForPR({ core, pr, repoPath }) {
|
||||||
await runGit({
|
await runGit({
|
||||||
args: ['fetch', `--depth=1`, 'origin', pr.base.sha],
|
args: ['fetch', `--depth=1`, 'origin', pr.base.sha],
|
||||||
repoPath,
|
repoPath,
|
||||||
@@ -114,3 +113,5 @@ export async function getCommitDetailsForPR({ core, pr, repoPath }) {
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = { getCommitDetailsForPR }
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import { writeFileSync } from 'node:fs'
|
|
||||||
import withRateLimit from './withRateLimit.js'
|
|
||||||
|
|
||||||
const excludeTeams = [
|
const excludeTeams = [
|
||||||
/^voters.*$/,
|
/^voters.*$/,
|
||||||
/^nixpkgs-maintainers$/,
|
/^nixpkgs-maintainers$/,
|
||||||
/^nixpkgs-committers$/,
|
/^nixpkgs-committers$/,
|
||||||
]
|
]
|
||||||
|
|
||||||
export default async ({ github, context, core, outFile }) => {
|
module.exports = async ({ github, context, core, outFile }) => {
|
||||||
|
const withRateLimit = require('./withRateLimit.js')
|
||||||
|
const { writeFileSync } = require('node:fs')
|
||||||
|
|
||||||
const org = context.repo.owner
|
const org = context.repo.owner
|
||||||
|
|
||||||
const result = {}
|
const result = {}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { getCommitDetailsForPR } from './get-pr-commit-details.js'
|
const { classify } = require('../supportedBranches.js')
|
||||||
import { classify } from './supportedBranches.js'
|
const { getCommitDetailsForPR } = require('./get-pr-commit-details.js')
|
||||||
|
|
||||||
/** @typedef {import('./get-pr-commit-details.js').Commit} Commit */
|
/** @typedef {import('./get-pr-commit-details.js').Commit} Commit */
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ import { classify } from './supportedBranches.js'
|
|||||||
* repoPath?: string,
|
* repoPath?: string,
|
||||||
* }} LintCommitsProps
|
* }} LintCommitsProps
|
||||||
*/
|
*/
|
||||||
export default async function lintCommits({ github, context, core, repoPath }) {
|
async function lintCommits({ github, context, core, repoPath }) {
|
||||||
// This check should only be run when we have the pull_request context.
|
// This check should only be run when we have the pull_request context.
|
||||||
const pull_number = context.payload.pull_request?.number
|
const pull_number = context.payload.pull_request?.number
|
||||||
if (!pull_number) {
|
if (!pull_number) {
|
||||||
@@ -220,3 +220,5 @@ async function checkCommitMetadata({ commits, core }) {
|
|||||||
core.setFailed('Committers: merging is discouraged.')
|
core.setFailed('Committers: merging is discouraged.')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = lintCommits
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { getCommitDetailsForPR } from './get-pr-commit-details.js'
|
const { classify } = require('../supportedBranches.js')
|
||||||
import { dismissReviews, postReview } from './reviews.js'
|
const { getCommitDetailsForPR } = require('./get-pr-commit-details')
|
||||||
import { classify } from './supportedBranches.js'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {{
|
* @param {{
|
||||||
@@ -11,13 +10,8 @@ import { classify } from './supportedBranches.js'
|
|||||||
* dry: boolean,
|
* dry: boolean,
|
||||||
* }} CheckManualFileEditsProps
|
* }} CheckManualFileEditsProps
|
||||||
*/
|
*/
|
||||||
export default async function checkManualFileEdits({
|
async function checkManualFileEdits({ github, context, core, repoPath, dry }) {
|
||||||
github,
|
const { dismissReviews, postReview } = require('./reviews.js')
|
||||||
context,
|
|
||||||
core,
|
|
||||||
repoPath,
|
|
||||||
dry,
|
|
||||||
}) {
|
|
||||||
const reviewKey = 'manual-file-edits'
|
const reviewKey = 'manual-file-edits'
|
||||||
|
|
||||||
const pull_number = context.payload.pull_request?.number
|
const pull_number = context.payload.pull_request?.number
|
||||||
@@ -96,3 +90,5 @@ export default async function checkManualFileEdits({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = checkManualFileEdits
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import { classify } from './supportedBranches.js'
|
const { classify } = require('../supportedBranches.js')
|
||||||
|
|
||||||
function runChecklist({
|
function runChecklist({
|
||||||
committers,
|
committers,
|
||||||
@@ -123,7 +123,7 @@ function hasMergeCommand(body) {
|
|||||||
.match(/^@NixOS\/nixpkgs-merge-bot merge\s*$/im)
|
.match(/^@NixOS\/nixpkgs-merge-bot merge\s*$/im)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function handleMergeComment({ github, body, node_id, reaction }) {
|
async function handleMergeComment({ github, body, node_id, reaction }) {
|
||||||
if (!hasMergeCommand(body)) return
|
if (!hasMergeCommand(body)) return
|
||||||
|
|
||||||
await github.graphql(
|
await github.graphql(
|
||||||
@@ -138,7 +138,7 @@ export async function handleMergeComment({ github, body, node_id, reaction }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function handleMerge({
|
async function handleMerge({
|
||||||
github,
|
github,
|
||||||
context,
|
context,
|
||||||
core,
|
core,
|
||||||
@@ -409,3 +409,8 @@ export async function handleMerge({
|
|||||||
// This is used to set the respective label in bot.js.
|
// This is used to set the respective label in bot.js.
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
handleMerge,
|
||||||
|
handleMergeComment,
|
||||||
|
}
|
||||||
|
|||||||
8
ci/github-script/package-lock.json
generated
8
ci/github-script/package-lock.json
generated
@@ -12,6 +12,7 @@
|
|||||||
"commander": "14.0.3"
|
"commander": "14.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@tsconfig/node24": "24.0.4",
|
||||||
"@types/node": "24.13.3",
|
"@types/node": "24.13.3",
|
||||||
"typescript": "7.0.2"
|
"typescript": "7.0.2"
|
||||||
}
|
}
|
||||||
@@ -629,6 +630,13 @@
|
|||||||
"@protobuf-ts/runtime": "^2.11.1"
|
"@protobuf-ts/runtime": "^2.11.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@tsconfig/node24": {
|
||||||
|
"version": "24.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tsconfig/node24/-/node24-24.0.4.tgz",
|
||||||
|
"integrity": "sha512-2A933l5P5oCbv6qSxHs7ckKwobs8BDAe9SJ/Xr2Hy+nDlwmLE1GhFh/g/vXGRZWgxBg9nX/5piDtHR9Dkw/XuA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "24.13.3",
|
"version": "24.13.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.13.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.13.3.tgz",
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
|
||||||
"typecheck": "tsc --build",
|
|
||||||
"testsuite": "node --test",
|
|
||||||
"test": "npm run typecheck && npm run testsuite"
|
|
||||||
},
|
|
||||||
"type": "module",
|
|
||||||
"//": [
|
"//": [
|
||||||
"Keep `@actions/core` and `@actions/github` in sync with",
|
"Keep `@actions/core` and `@actions/github` in sync with",
|
||||||
"https://github.com/actions/github-script/blob/main/package.json."
|
"https://github.com/actions/github-script/blob/main/package.json."
|
||||||
@@ -18,6 +12,7 @@
|
|||||||
"commander": "14.0.3"
|
"commander": "14.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@tsconfig/node24": "24.0.4",
|
||||||
"@types/node": "24.13.3",
|
"@types/node": "24.13.3",
|
||||||
"typescript": "7.0.2"
|
"typescript": "7.0.2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import { dismissReviews, postReview } from './reviews.js'
|
const { classify } = require('../supportedBranches.js')
|
||||||
import { classify } from './supportedBranches.js'
|
const { postReview, dismissReviews } = require('./reviews.js')
|
||||||
import supportedSystems from './supportedSystems.js'
|
|
||||||
|
|
||||||
const reviewKey = 'prepare'
|
const reviewKey = 'prepare'
|
||||||
|
const supportedSystems = require('./supportedSystems.js')
|
||||||
|
|
||||||
export default async ({ github, context, core, dry }) => {
|
module.exports = async ({ github, context, core, dry }) => {
|
||||||
const pull_number = context.payload.pull_request.number
|
const pull_number = context.payload.pull_request.number
|
||||||
|
|
||||||
for (const retryInterval of [5, 10, 20, 40, 80]) {
|
for (const retryInterval of [5, 10, 20, 40, 80]) {
|
||||||
@@ -66,7 +65,7 @@ export default async ({ github, context, core, dry }) => {
|
|||||||
// commits between that base and head is the real base. We can query for this via GitHub's
|
// commits between that base and head is the real base. We can query for this via GitHub's
|
||||||
// REST API. There can be multiple candidates for the real base with the same number of
|
// REST API. There can be multiple candidates for the real base with the same number of
|
||||||
// commits. In this case we pick the "best" candidate by a fixed ordering of branches,
|
// commits. In this case we pick the "best" candidate by a fixed ordering of branches,
|
||||||
// as defined in ci/github-script/supportedBranches.js.
|
// as defined in ci/supportedBranches.js.
|
||||||
//
|
//
|
||||||
// These requests take a while, when comparing against the wrong release - they need
|
// These requests take a while, when comparing against the wrong release - they need
|
||||||
// to look at way more than 10k commits in that case. Thus, we try to minimize the
|
// to look at way more than 10k commits in that case. Thus, we try to minimize the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
export async function handleReviewers({
|
async function handleReviewers({
|
||||||
github,
|
github,
|
||||||
context,
|
context,
|
||||||
core,
|
core,
|
||||||
@@ -183,3 +183,7 @@ export async function handleReviewers({
|
|||||||
teams_reached.size === 0
|
teams_reached.size === 0
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
handleReviewers,
|
||||||
|
}
|
||||||
|
|||||||
@@ -30,13 +30,7 @@ const reviewUsers = [
|
|||||||
* reviewKey?: string,
|
* reviewKey?: string,
|
||||||
* }} DismissReviewsProps
|
* }} DismissReviewsProps
|
||||||
*/
|
*/
|
||||||
export async function dismissReviews({
|
async function dismissReviews({ github, context, core, dry, reviewKey }) {
|
||||||
github,
|
|
||||||
context,
|
|
||||||
core,
|
|
||||||
dry,
|
|
||||||
reviewKey,
|
|
||||||
}) {
|
|
||||||
const pull_number = context.payload.pull_request?.number
|
const pull_number = context.payload.pull_request?.number
|
||||||
if (!pull_number) {
|
if (!pull_number) {
|
||||||
core.warning('dismissReviews called outside of pull_request context')
|
core.warning('dismissReviews called outside of pull_request context')
|
||||||
@@ -176,7 +170,7 @@ export async function dismissReviews({
|
|||||||
* reviewKey: string,
|
* reviewKey: string,
|
||||||
* }} PostReviewProps
|
* }} PostReviewProps
|
||||||
*/
|
*/
|
||||||
export async function postReview({
|
async function postReview({
|
||||||
github,
|
github,
|
||||||
context,
|
context,
|
||||||
core,
|
core,
|
||||||
@@ -268,3 +262,8 @@ export async function postReview({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
dismissReviews,
|
||||||
|
postReview,
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env -S node --import ./run
|
||||||
import { execSync } from 'node:child_process'
|
import { execSync } from 'node:child_process'
|
||||||
import { closeSync, mkdtempSync, openSync, rmSync } from 'node:fs'
|
import { closeSync, mkdtempSync, openSync, rmSync } from 'node:fs'
|
||||||
import { tmpdir } from 'node:os'
|
import { tmpdir } from 'node:os'
|
||||||
@@ -112,7 +112,7 @@ program
|
|||||||
.argument('<repo>', 'Name of the GitHub repository to run on (Example: nixpkgs)')
|
.argument('<repo>', 'Name of the GitHub repository to run on (Example: nixpkgs)')
|
||||||
.argument('<pr>', 'Number of the Pull Request to run on')
|
.argument('<pr>', 'Number of the Pull Request to run on')
|
||||||
.action(async (owner, repo, pr, options) => {
|
.action(async (owner, repo, pr, options) => {
|
||||||
const checkTargetBranch = (await import('./check-target-branch.ts')).checkTargetBranch
|
const checkTargetBranch = (await import('./check-target-branch.ts')).default
|
||||||
await run(checkTargetBranch, owner, repo, pr, options)
|
await run(checkTargetBranch, owner, repo, pr, options)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
export default async ({ github, context, targetSha }) => {
|
module.exports = async ({ github, context, targetSha }) => {
|
||||||
const { content, encoding } = (
|
const { content, encoding } = (
|
||||||
await github.rest.repos.getContent({
|
await github.rest.repos.getContent({
|
||||||
...context.repo,
|
...context.repo,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
"strict": true,
|
"strict": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"moduleResolution": "nodenext",
|
"moduleResolution": "node16",
|
||||||
|
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import Bottleneck from 'bottleneck'
|
module.exports = async ({ github, core, maxConcurrent = 1 }, callback) => {
|
||||||
|
const Bottleneck = require('bottleneck')
|
||||||
|
|
||||||
export default async ({ github, core, maxConcurrent = 1 }, callback) => {
|
|
||||||
const stats = {
|
const stats = {
|
||||||
issues: 0,
|
issues: 0,
|
||||||
prs: 0,
|
prs: 0,
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ runCommand "nixpkgs-vet"
|
|||||||
env.NIXPKGS_VET_NIX_PACKAGE = nix;
|
env.NIXPKGS_VET_NIX_PACKAGE = nix;
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
export NIX_STORE_DIR=$(mktemp -d)
|
|
||||||
export NIX_STATE_DIR=$(mktemp -d)
|
export NIX_STATE_DIR=$(mktemp -d)
|
||||||
$NIXPKGS_VET_NIX_PACKAGE/bin/nix-store --init
|
$NIXPKGS_VET_NIX_PACKAGE/bin/nix-store --init
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
#!nix-shell -i node -p nodejs
|
#!nix-shell -i node -p nodejs
|
||||||
*/
|
*/
|
||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import { resolve } from 'node:path'
|
|
||||||
import { fileURLToPath } from 'node:url'
|
|
||||||
|
|
||||||
const typeConfig = {
|
const typeConfig = {
|
||||||
master: ['development', 'primary'],
|
master: ['development', 'primary'],
|
||||||
@@ -47,13 +45,10 @@ function classify(branch) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { classify, split }
|
module.exports = { classify, split }
|
||||||
|
|
||||||
// If called directly via CLI, runs the following tests:
|
// If called directly via CLI, runs the following tests:
|
||||||
if (
|
if (!module.parent) {
|
||||||
process.argv[1] &&
|
|
||||||
fileURLToPath(import.meta.url) === resolve(process.argv[1])
|
|
||||||
) {
|
|
||||||
console.log('split(branch)')
|
console.log('split(branch)')
|
||||||
function testSplit(branch) {
|
function testSplit(branch) {
|
||||||
console.log(branch, split(branch))
|
console.log(branch, split(branch))
|
||||||
@@ -15,3 +15,15 @@ In addition, it offers various options to customize parts of the builds.
|
|||||||
There is no uniform interface for build helpers.
|
There is no uniform interface for build helpers.
|
||||||
[Trivial build helpers](#chap-trivial-builders) and [fetchers](#chap-pkgs-fetchers) have various input types for convenience.
|
[Trivial build helpers](#chap-trivial-builders) and [fetchers](#chap-pkgs-fetchers) have various input types for convenience.
|
||||||
[Language- or framework-specific build helpers](#chap-language-support) usually follow the style of `stdenv.mkDerivation`, which accepts an attribute set or a fixed-point function taking an attribute set.
|
[Language- or framework-specific build helpers](#chap-language-support) usually follow the style of `stdenv.mkDerivation`, which accepts an attribute set or a fixed-point function taking an attribute set.
|
||||||
|
|
||||||
|
```{=include=} chapters
|
||||||
|
build-helpers/fixed-point-arguments.chapter.md
|
||||||
|
build-helpers/fetchers.chapter.md
|
||||||
|
build-helpers/trivial-build-helpers.chapter.md
|
||||||
|
build-helpers/testers.chapter.md
|
||||||
|
build-helpers/dev-shell-tools.chapter.md
|
||||||
|
build-helpers/special.md
|
||||||
|
build-helpers/images.md
|
||||||
|
hooks/index.md
|
||||||
|
packages/index.md
|
||||||
|
```
|
||||||
|
|||||||
@@ -988,20 +988,6 @@ fetchRadiclePatch {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## `fetchFromTangled` {#fetchfromtangled}
|
|
||||||
|
|
||||||
This is to be used with tangled repositories. `fetchFromTangled` works with
|
|
||||||
very similar arguments to `fetchFromGithub`. However, instead of a `owner` and
|
|
||||||
`repo`, a `did` argument is expected.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
fetchFromTangled {
|
|
||||||
did = "did:plc:jj6ajj6duxnlthwtnob4qyuv"; # tranquil.farm/tranquil-pds
|
|
||||||
tag = "v6.6.0";
|
|
||||||
hash = "sha256-cfTsjmK/IMqT5kMKOGpwwWbBlvtrCDOerUJJ8AVI3kY=";
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## `requireFile` {#requirefile}
|
## `requireFile` {#requirefile}
|
||||||
|
|
||||||
`requireFile` allows requesting files that cannot be fetched automatically, but whose content is known.
|
`requireFile` allows requesting files that cannot be fetched automatically, but whose content is known.
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
# Images {#chap-images}
|
# Images {#chap-images}
|
||||||
|
|
||||||
This chapter describes tools for creating various types of images.
|
This chapter describes tools for creating various types of images.
|
||||||
|
|
||||||
|
```{=include=} sections
|
||||||
|
images/appimagetools.section.md
|
||||||
|
images/dockertools.section.md
|
||||||
|
images/ocitools.section.md
|
||||||
|
images/portableservice.section.md
|
||||||
|
images/makediskimage.section.md
|
||||||
|
images/binarycache.section.md
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,3 +1,13 @@
|
|||||||
# Special build helpers {#chap-special}
|
# Special build helpers {#chap-special}
|
||||||
|
|
||||||
This chapter describes several special build helpers.
|
This chapter describes several special build helpers.
|
||||||
|
|
||||||
|
```{=include=} sections
|
||||||
|
special/buildenv.section.md
|
||||||
|
special/fakenss.section.md
|
||||||
|
special/fhs-environments.section.md
|
||||||
|
special/makesetuphook.section.md
|
||||||
|
special/mkshell.section.md
|
||||||
|
special/vm-tools.section.md
|
||||||
|
special/checkpoint-build.section.md
|
||||||
|
```
|
||||||
|
|||||||
@@ -3,35 +3,6 @@
|
|||||||
Nixpkgs provides a variety of wrapper functions that help build commonly useful derivations.
|
Nixpkgs provides a variety of wrapper functions that help build commonly useful derivations.
|
||||||
Like [`stdenv.mkDerivation`](#sec-using-stdenv), each of these build helpers creates a derivation, but the arguments passed are different (usually simpler) from those required by `stdenv.mkDerivation`.
|
Like [`stdenv.mkDerivation`](#sec-using-stdenv), each of these build helpers creates a derivation, but the arguments passed are different (usually simpler) from those required by `stdenv.mkDerivation`.
|
||||||
|
|
||||||
## Arguments with finalAttrs {#trivial-builder-finalAttrs}
|
|
||||||
|
|
||||||
In parameters that reference this section, you may either pass the value itself,
|
|
||||||
or a function that produces it.
|
|
||||||
When it's a function the argument value is [`finalAttrs`] from [`mkDerivation`].
|
|
||||||
|
|
||||||
Typically both the *attributes* and *script* arguments support this, simultaneously if needed.
|
|
||||||
|
|
||||||
::: {.example #ex-trivial-builder-finalAttrs}
|
|
||||||
# Using `finalAttrs` in a build helper
|
|
||||||
|
|
||||||
```nix
|
|
||||||
runCommand "hi" (finalAttrs: { passthru.exe = "${finalAttrs.finalPackage}/bin/hi"; }) ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
substitute ${./hi.foo} $out/bin/hi --replace-fail "@foo@" ${lib.getExe foo}
|
|
||||||
''
|
|
||||||
```
|
|
||||||
|
|
||||||
This creates a package with an executable script that's in the standard `bin/` directory,
|
|
||||||
but also convenient to interpolate without reliance on `$PATH`, e.g assuming the result of the above is in binding `hi`:
|
|
||||||
```nix
|
|
||||||
''
|
|
||||||
echo START_GREETING
|
|
||||||
${hi.exe} --rude
|
|
||||||
echo END_GREETING
|
|
||||||
''
|
|
||||||
```
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
## `runCommandWith` {#trivial-builder-runCommandWith}
|
## `runCommandWith` {#trivial-builder-runCommandWith}
|
||||||
|
|
||||||
@@ -52,10 +23,8 @@ runCommandWith :: {
|
|||||||
name :: name;
|
name :: name;
|
||||||
stdenv? :: Derivation;
|
stdenv? :: Derivation;
|
||||||
runLocal? :: Bool;
|
runLocal? :: Bool;
|
||||||
derivationArgs? :: { ... } | finalAttrs@{ finalPackage :: Derivation, ... } -> { ... };
|
derivationArgs? :: { ... };
|
||||||
}
|
} -> String -> Derivation
|
||||||
-> (String | finalAttrs@{ finalPackage :: Derivation, ... } -> String)
|
|
||||||
-> Derivation
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Inputs {#trivial-builder-runCommandWith-Inputs}
|
### Inputs {#trivial-builder-runCommandWith-Inputs}
|
||||||
@@ -78,10 +47,10 @@ runCommandWith :: {
|
|||||||
`stdenv` (Derivation)
|
`stdenv` (Derivation)
|
||||||
: The [standard environment](#chap-stdenv) to use, defaulting to `pkgs.stdenv`.
|
: The [standard environment](#chap-stdenv) to use, defaulting to `pkgs.stdenv`.
|
||||||
|
|
||||||
`derivationArgs` (Attribute set *or* [function from `finalAttrs`](#trivial-builder-finalAttrs))
|
`derivationArgs` (Attribute set)
|
||||||
: Additional arguments for [`mkDerivation`](#sec-using-stdenv).
|
: Additional arguments for [`mkDerivation`](#sec-using-stdenv).
|
||||||
|
|
||||||
`buildCommand` (String *or* [function from `finalAttrs`](#trivial-builder-finalAttrs))
|
`buildCommand` (String)
|
||||||
: Shell commands to run in the derivation builder.
|
: Shell commands to run in the derivation builder.
|
||||||
|
|
||||||
::: {.note}
|
::: {.note}
|
||||||
@@ -140,10 +109,10 @@ While the type signature(s) differ from [`runCommandWith`], individual arguments
|
|||||||
`name` (String)
|
`name` (String)
|
||||||
: The derivation's name
|
: The derivation's name
|
||||||
|
|
||||||
`derivationArgs` (Attribute set *or* [function from `finalAttrs`](#trivial-builder-finalAttrs))
|
`derivationArgs` (Attribute set)
|
||||||
: Additional parameters passed to [`mkDerivation`]
|
: Additional parameters passed to [`mkDerivation`]
|
||||||
|
|
||||||
`buildCommand` (String *or* [function from `finalAttrs`](#trivial-builder-finalAttrs))
|
`buildCommand` (String)
|
||||||
: The command(s) run to build the derivation.
|
: The command(s) run to build the derivation.
|
||||||
|
|
||||||
|
|
||||||
@@ -933,6 +902,3 @@ produces an output path `/nix/store/<hash>-runtime-references` containing
|
|||||||
|
|
||||||
but none of `hello`'s dependencies because those are not referenced directly
|
but none of `hello`'s dependencies because those are not referenced directly
|
||||||
by `hi`'s output.
|
by `hi`'s output.
|
||||||
|
|
||||||
[`finalAttrs`]: #mkderivation-recursive-attributes
|
|
||||||
[`mkDerivation`]: #sec-using-stdenv
|
|
||||||
|
|||||||
@@ -1,84 +1,10 @@
|
|||||||
# Contributing {#part-contributing}
|
# Contributing to Nixpkgs {#part-contributing}
|
||||||
|
|
||||||
<!--
|
```{=include=} chapters
|
||||||
Legacy anchors. The sections behind these ids used to live in this manual and are
|
contributing/quick-start.chapter.md
|
||||||
now maintained elsewhere. We keep these invisible anchor ids so external URIs would link to this page.
|
contributing/coding-conventions.chapter.md
|
||||||
-->
|
contributing/submitting-changes.chapter.md
|
||||||
<!-- moved to CONTRIBUTING.md -->
|
contributing/vulnerability-roundup.chapter.md
|
||||||
[]{#chap-conventions}
|
contributing/reviewing-contributions.chapter.md
|
||||||
[]{#sec-syntax}
|
contributing/contributing-to-documentation.chapter.md
|
||||||
[]{#sec-organisation}
|
```
|
||||||
[]{#chap-submitting-changes}
|
|
||||||
[]{#submitting-changes-submitting-changes}
|
|
||||||
[]{#submitting-changes-pull-request-template}
|
|
||||||
[]{#submitting-changes-tested-with-sandbox}
|
|
||||||
[]{#submitting-changes-platform-diversity}
|
|
||||||
[]{#submitting-changes-nixos-tests}
|
|
||||||
[]{#submitting-changes-tested-compilation}
|
|
||||||
[]{#submitting-changes-tested-execution}
|
|
||||||
[]{#submitting-changes-contribution-standards}
|
|
||||||
[]{#submitting-changes-hotfixing-pull-requests}
|
|
||||||
[]{#submitting-changes-commit-policy}
|
|
||||||
[]{#submitting-changes-branches}
|
|
||||||
[]{#submitting-changes-master-branch}
|
|
||||||
[]{#submitting-changes-staging-branch}
|
|
||||||
[]{#submitting-changes-staging-next-branch}
|
|
||||||
[]{#submitting-changes-stable-release-branches}
|
|
||||||
[]{#submitting-changes-stable-release-branches-automatic-backports}
|
|
||||||
[]{#submitting-changes-stable-release-branches-manual-backports}
|
|
||||||
[]{#acceptable-backport-criteria}
|
|
||||||
[]{#chap-reviewing-contributions}
|
|
||||||
[]{#reviewing-contributions-other-submissions}
|
|
||||||
[]{#reviewing-contributions--merging-pull-requests}
|
|
||||||
[]{#part-development}
|
|
||||||
|
|
||||||
<!-- moved to pkgs/README.md -->
|
|
||||||
[]{#chap-quick-start}
|
|
||||||
[]{#sec-package-naming}
|
|
||||||
[]{#sec-versioning}
|
|
||||||
[]{#sec-sources}
|
|
||||||
[]{#sec-source-hashes}
|
|
||||||
[]{#sec-source-hashes-security}
|
|
||||||
[]{#sec-patches}
|
|
||||||
[]{#sec-package-tests}
|
|
||||||
[]{#ssec-inline-package-tests-writing}
|
|
||||||
[]{#ssec-package-tests-writing}
|
|
||||||
[]{#ssec-package-tests-running}
|
|
||||||
[]{#ssec-package-tests-examples}
|
|
||||||
[]{#ssec-nixos-tests-linking}
|
|
||||||
[]{#ssec-import-from-derivation}
|
|
||||||
[]{#submitting-changes-submitting-security-fixes}
|
|
||||||
[]{#submitting-changes-deprecating-packages}
|
|
||||||
[]{#steps-to-remove-a-package-from-nixpkgs}
|
|
||||||
[]{#chap-vulnerability-roundup}
|
|
||||||
[]{#vulnerability-roundup-issues}
|
|
||||||
[]{#vulnerability-roundup-triaging-and-fixing}
|
|
||||||
[]{#reviewing-contributions-package-updates}
|
|
||||||
[]{#reviewing-contributions-new-packages}
|
|
||||||
|
|
||||||
<!-- moved to nixos/README.md -->
|
|
||||||
[]{#reviewing-contributions-module-updates}
|
|
||||||
[]{#reviewing-contributions-new-modules}
|
|
||||||
|
|
||||||
<!-- moved to maintainers/README.md -->
|
|
||||||
[]{#reviewing-contributions-individual-maintainer-list}
|
|
||||||
[]{#reviewing-contributions-maintainer-teams}
|
|
||||||
|
|
||||||
<!-- moved to doc/README.md -->
|
|
||||||
[]{#chap-contributing}
|
|
||||||
|
|
||||||
Contribution documentation lives along the repository scope it applies to:
|
|
||||||
|
|
||||||
- [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md): coding conventions, file organisation, submitting changes, commit policy, branches and backports, reviewing contributions.
|
|
||||||
- [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md): adding and updating packages, package naming and versioning, source fetching and hashes, patches, package tests, deprecating packages, security fixes.
|
|
||||||
- [nixos/README.md](https://github.com/NixOS/nixpkgs/blob/master/nixos/README.md): NixOS modules and reviewing module changes.
|
|
||||||
- [maintainers/README.md](https://github.com/NixOS/nixpkgs/blob/master/maintainers/README.md): maintainer entries and maintainer teams.
|
|
||||||
- [doc/README.md](https://github.com/NixOS/nixpkgs/blob/master/doc/README.md): writing and building this manual.
|
|
||||||
|
|
||||||
## Opening issues {#sec-opening-issues}
|
|
||||||
|
|
||||||
- Make sure you have a [GitHub account](https://github.com/signup/free)
|
|
||||||
- Make sure there is no open issue on the topic
|
|
||||||
- [Submit a new issue](https://github.com/NixOS/nixpkgs/issues/new/choose) by choosing the kind of topic and filling out the template
|
|
||||||
|
|
||||||
<!-- In the future this section could also include more detailed information on the issue templates -->
|
|
||||||
|
|||||||
63
doc/contributing/coding-conventions.chapter.md
Normal file
63
doc/contributing/coding-conventions.chapter.md
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
# Coding conventions {#chap-conventions}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
## Syntax {#sec-syntax}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
## Package naming {#sec-package-naming}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
## File naming and organisation {#sec-organisation}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
### Versioning {#sec-versioning}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
## Fetching Sources {#sec-sources}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
## Obtaining source hash {#sec-source-hashes}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
### Obtaining hashes securely {#sec-source-hashes-security}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
## Patches {#sec-patches}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
## Package tests {#sec-package-tests}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
### Writing inline package tests {#ssec-inline-package-tests-writing}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
### Writing larger package tests {#ssec-package-tests-writing}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
### Running package tests {#ssec-package-tests-running}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
### Examples of package tests {#ssec-package-tests-examples}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
### Linking NixOS module tests to a package {#ssec-nixos-tests-linking}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
### Import From Derivation {#ssec-import-from-derivation}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Contributing to Nixpkgs documentation {#chap-contributing}
|
||||||
|
|
||||||
|
This section has been moved to [doc/README.md](https://github.com/NixOS/nixpkgs/blob/master/doc/README.md).
|
||||||
3
doc/contributing/quick-start.chapter.md
Normal file
3
doc/contributing/quick-start.chapter.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Quick Start to Adding a Package {#chap-quick-start}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
35
doc/contributing/reviewing-contributions.chapter.md
Normal file
35
doc/contributing/reviewing-contributions.chapter.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# Reviewing contributions {#chap-reviewing-contributions}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
## Package updates {#reviewing-contributions-package-updates}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
## New packages {#reviewing-contributions-new-packages}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
## Module updates {#reviewing-contributions-module-updates}
|
||||||
|
|
||||||
|
This section has been moved to [nixos/README.md](https://github.com/NixOS/nixpkgs/blob/master/nixos/README.md).
|
||||||
|
|
||||||
|
## New modules {#reviewing-contributions-new-modules}
|
||||||
|
|
||||||
|
This section has been moved to [nixos/README.md](https://github.com/NixOS/nixpkgs/blob/master/nixos/README.md#new-modules).
|
||||||
|
|
||||||
|
## Individual maintainer list {#reviewing-contributions-individual-maintainer-list}
|
||||||
|
|
||||||
|
This section has been moved to [maintainers/README.md](https://github.com/NixOS/nixpkgs/blob/master/maintainers/README.md).
|
||||||
|
|
||||||
|
## Maintainer teams {#reviewing-contributions-maintainer-teams}
|
||||||
|
|
||||||
|
This section has been moved to [maintainers/README.md](https://github.com/NixOS/nixpkgs/blob/master/maintainers/README.md).
|
||||||
|
|
||||||
|
## Other submissions {#reviewing-contributions-other-submissions}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
## Merging pull requests {#reviewing-contributions--merging-pull-requests}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
88
doc/contributing/submitting-changes.chapter.md
Normal file
88
doc/contributing/submitting-changes.chapter.md
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
# Submitting changes {#chap-submitting-changes}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
## Submitting changes {#submitting-changes-submitting-changes}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
## Submitting security fixes {#submitting-changes-submitting-security-fixes}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
## Deprecating/removing packages {#submitting-changes-deprecating-packages}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
### Steps to remove a package from Nixpkgs {#steps-to-remove-a-package-from-nixpkgs}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
## Pull Request Template {#submitting-changes-pull-request-template}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
### Tested using sandboxing {#submitting-changes-tested-with-sandbox}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
### Built on platform(s) {#submitting-changes-platform-diversity}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
### Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests) {#submitting-changes-nixos-tests}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
### Tested compilation of all pkgs that depend on this change using `nixpkgs-review` {#submitting-changes-tested-compilation}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
### Tested execution of all binary files (usually in `./result/bin/`) {#submitting-changes-tested-execution}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
### Meets Nixpkgs contribution standards {#submitting-changes-contribution-standards}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
## Hotfixing pull requests {#submitting-changes-hotfixing-pull-requests}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
## Commit policy {#submitting-changes-commit-policy}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
### Branches {#submitting-changes-branches}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
#### Master branch {#submitting-changes-master-branch}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
#### Staging branch {#submitting-changes-staging-branch}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
#### Staging-next branch {#submitting-changes-staging-next-branch}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
#### Stable release branches {#submitting-changes-stable-release-branches}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
#### Automatically backporting a Pull Request {#submitting-changes-stable-release-branches-automatic-backports}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
#### Manually backporting changes {#submitting-changes-stable-release-branches-manual-backports}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
#### Acceptable backport criteria {#acceptable-backport-criteria}
|
||||||
|
|
||||||
|
This section has been moved to [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
11
doc/contributing/vulnerability-roundup.chapter.md
Normal file
11
doc/contributing/vulnerability-roundup.chapter.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Vulnerability Roundup {#chap-vulnerability-roundup}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
## Issues {#vulnerability-roundup-issues}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
|
|
||||||
|
## Triaging and Fixing {#vulnerability-roundup-triaging-and-fixing}
|
||||||
|
|
||||||
|
This section has been moved to [pkgs/README.md](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md).
|
||||||
10
doc/development.md
Normal file
10
doc/development.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Development of Nixpkgs {#part-development}
|
||||||
|
|
||||||
|
This section shows you how Nixpkgs is developed and how you can interact with the contributors and the latest updates.
|
||||||
|
If you are interested in contributing yourself, see [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
<!-- In the future this section should also include: How to test pull requests, how to know if pull requests are available in channels, etc. -->
|
||||||
|
|
||||||
|
```{=include=} chapters
|
||||||
|
development/opening-issues.chapter.md
|
||||||
|
```
|
||||||
7
doc/development/opening-issues.chapter.md
Normal file
7
doc/development/opening-issues.chapter.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# Opening issues {#sec-opening-issues}
|
||||||
|
|
||||||
|
* Make sure you have a [GitHub account](https://github.com/signup/free)
|
||||||
|
* Make sure there is no open issue on the topic
|
||||||
|
* [Submit a new issue](https://github.com/NixOS/nixpkgs/issues/new/choose) by choosing the kind of topic and filling out the template
|
||||||
|
|
||||||
|
<!-- In the future this section could also include more detailed information on the issue templates -->
|
||||||
@@ -1,205 +0,0 @@
|
|||||||
import json
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import TypedDict
|
|
||||||
|
|
||||||
# Coupled to where this file lives!
|
|
||||||
# Needed to resolve the relative includes file paths
|
|
||||||
REPO_ROOT = Path(__file__).resolve().parent.parent.parent
|
|
||||||
|
|
||||||
ROOT_FILE = REPO_ROOT / "nixos/doc/manual/manual.md"
|
|
||||||
DOC_ROOT = ROOT_FILE.parent
|
|
||||||
|
|
||||||
INCLUDE_RE = re.compile(r"^```\{=include=\}(?P<rest>.*)$")
|
|
||||||
FENCE_RE = re.compile(r"^(```|~~~)")
|
|
||||||
HEADING_RE = re.compile(r"^(#{1,6})\s+(.*?)\s*(?:\{#([^}]+)\})?\s*$")
|
|
||||||
|
|
||||||
|
|
||||||
class TokenIncludeBlock:
|
|
||||||
"""Represents a complete include block like:
|
|
||||||
|
|
||||||
```{=include=} sections
|
|
||||||
special/buildenv.section.md
|
|
||||||
```
|
|
||||||
|
|
||||||
As
|
|
||||||
|
|
||||||
typ = "sections"
|
|
||||||
files = [ "special/buildenv.section.md" ]
|
|
||||||
|
|
||||||
"""
|
|
||||||
kind = "include"
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
# For debugging
|
|
||||||
return f"```{{=include=}} {self.typ}\n" "\n".join(self.files) + "\n```"
|
|
||||||
|
|
||||||
def __init__(self, typ, args, files, start, end):
|
|
||||||
self.typ: str = typ
|
|
||||||
self.args: list[str] = args
|
|
||||||
self.files: list[str] = files
|
|
||||||
self.start: int = start
|
|
||||||
self.end: int = end
|
|
||||||
|
|
||||||
def is_option_block(self) -> bool:
|
|
||||||
# option blocks have some special syntax which is part of another migration
|
|
||||||
# 8 coccurrences, seperate migration
|
|
||||||
return self.typ == "options"
|
|
||||||
|
|
||||||
def into_file(self) -> bool:
|
|
||||||
# into-file is trivial after the nav migration
|
|
||||||
# 2 coccurrences, can be migrated by hand
|
|
||||||
return any("html:into-file=" in arg for arg in self.args)
|
|
||||||
|
|
||||||
def keep(self) -> bool:
|
|
||||||
# Keep the include blocks that require seperate migration
|
|
||||||
return self.is_option_block() or self.into_file()
|
|
||||||
|
|
||||||
class TokenHeading:
|
|
||||||
kind = "heading"
|
|
||||||
|
|
||||||
def __init__(self, level, title, anchor):
|
|
||||||
self.level: int = level
|
|
||||||
self.title: str = title
|
|
||||||
self.anchor: str = anchor
|
|
||||||
|
|
||||||
|
|
||||||
def tokenize(src: str) -> list[TokenIncludeBlock|TokenHeading]:
|
|
||||||
"""Finds all Includes and Headings"""
|
|
||||||
lines = src.splitlines()
|
|
||||||
items = []
|
|
||||||
fenced = False
|
|
||||||
i = 0
|
|
||||||
while i < len(lines):
|
|
||||||
line = lines[i]
|
|
||||||
m = INCLUDE_RE.match(line)
|
|
||||||
if m and not fenced:
|
|
||||||
typ, *args = m.group("rest").split()
|
|
||||||
end = i + 1
|
|
||||||
while end < len(lines) and not lines[end].startswith("```"):
|
|
||||||
end += 1
|
|
||||||
if end == len(lines):
|
|
||||||
sys.exit(f"unterminated include block at line {i + 1}")
|
|
||||||
files = [f.strip() for f in lines[i + 1 : end] if f.strip()]
|
|
||||||
items.append(TokenIncludeBlock(typ, args, files, i, end))
|
|
||||||
i = end + 1
|
|
||||||
continue
|
|
||||||
if FENCE_RE.match(line):
|
|
||||||
fenced = not fenced
|
|
||||||
i += 1
|
|
||||||
continue
|
|
||||||
if not fenced:
|
|
||||||
m = HEADING_RE.match(line)
|
|
||||||
if m:
|
|
||||||
items.append(TokenHeading(len(m.group(1)), m.group(2), m.group(3)))
|
|
||||||
i += 1
|
|
||||||
return items
|
|
||||||
|
|
||||||
|
|
||||||
def read_source(source: Path) -> None | tuple[str, Path]:
|
|
||||||
"""Read a return [content,Path]
|
|
||||||
|
|
||||||
library.md is called .md.in; provided at build time via nixdoc
|
|
||||||
|
|
||||||
So the filename might differ
|
|
||||||
"""
|
|
||||||
if source.exists():
|
|
||||||
return source.read_text(), source
|
|
||||||
|
|
||||||
in_file = Path(str(source) + ".in")
|
|
||||||
if in_file.exists():
|
|
||||||
return in_file.read_text(), in_file
|
|
||||||
return None
|
|
||||||
|
|
||||||
# Make sure we process every file only once
|
|
||||||
visited = set()
|
|
||||||
|
|
||||||
# Map from filename -> line_nrs
|
|
||||||
# These lines will be deleted from the file
|
|
||||||
rewrites: dict[str, tuple[int,int]] = {}
|
|
||||||
|
|
||||||
group_ids: set[str] = set()
|
|
||||||
|
|
||||||
class Green(TypedDict):
|
|
||||||
label: str
|
|
||||||
id: str
|
|
||||||
children: list["Green"]
|
|
||||||
file: str | None
|
|
||||||
|
|
||||||
def convert_md_in(md_in: Path) -> Green:
|
|
||||||
"""Build up items for the nav.json as we recurse.
|
|
||||||
Collecting line-areas and group_ids
|
|
||||||
"""
|
|
||||||
if md_in in visited:
|
|
||||||
sys.exit(f"{md_in}: reached twice")
|
|
||||||
|
|
||||||
visited.add(md_in)
|
|
||||||
|
|
||||||
res = read_source(md_in)
|
|
||||||
|
|
||||||
rel_file = md_in.relative_to(DOC_ROOT).as_posix()
|
|
||||||
if not res:
|
|
||||||
return {"file": rel_file}
|
|
||||||
|
|
||||||
text, actual = res
|
|
||||||
token: list[TokenHeading|TokenIncludeBlock] = tokenize(text)
|
|
||||||
|
|
||||||
# Collect a list of actual files to be processed
|
|
||||||
# Recurse for files
|
|
||||||
# Do not recurse for "options", "into-file"
|
|
||||||
all_file_includes: list[TokenIncludeBlock] = [it for it in token if it.kind == "include" and not (it.is_option_block() or it.into_file())]
|
|
||||||
children = [convert_md_in((md_in.parent / f).resolve()) for b in all_file_includes for f in b.files]
|
|
||||||
|
|
||||||
# Lines to rewrite
|
|
||||||
include_blocks_to_rewrite: list[TokenIncludeBlock] = [it for it in all_file_includes if not it.keep()]
|
|
||||||
rewrites[actual] = [(b.start, b.end) for b in include_blocks_to_rewrite]
|
|
||||||
|
|
||||||
if not children:
|
|
||||||
return {"file": rel_file}
|
|
||||||
|
|
||||||
title = next((it for it in token if it.kind == "heading" and it.level == 1), None)
|
|
||||||
if title is None:
|
|
||||||
sys.exit(f"{md_in}: no level-1 heading to label its group")
|
|
||||||
if not title.anchor:
|
|
||||||
sys.exit(f"{md_in}: level-1 heading has no id")
|
|
||||||
if title.anchor in group_ids:
|
|
||||||
sys.exit(f"{md_in}: duplicate group id {title.anchor}")
|
|
||||||
group_ids.add(title.anchor)
|
|
||||||
|
|
||||||
return Green({
|
|
||||||
"label": title.title.replace("`", ""),
|
|
||||||
"id": title.anchor,
|
|
||||||
"children": [{"file": rel_file}] + children,
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
def remove_includes(path: Path, drop_lines: tuple[int,int]):
|
|
||||||
if not drop_lines:
|
|
||||||
return
|
|
||||||
|
|
||||||
lines = path.read_text().splitlines()
|
|
||||||
for start, end in sorted(drop_lines, reverse=True):
|
|
||||||
del lines[start : end + 1]
|
|
||||||
if 0 < start < len(lines) and not lines[start - 1].strip() and not lines[start].strip():
|
|
||||||
del lines[start]
|
|
||||||
while lines and not lines[-1].strip():
|
|
||||||
lines.pop()
|
|
||||||
path.write_text("\n".join(lines) + "\n")
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
nav = DOC_ROOT / "nav.json"
|
|
||||||
if json.loads(nav.read_text())["items"]:
|
|
||||||
sys.exit("nav.json already has items; This tool can only run once")
|
|
||||||
|
|
||||||
root = convert_md_in(ROOT_FILE)
|
|
||||||
items = root["children"][1:]
|
|
||||||
|
|
||||||
nav.write_text(json.dumps({"open": [], "items": items}, indent=2) + "\n")
|
|
||||||
for path, lines in rewrites.items():
|
|
||||||
remove_includes(path, lines)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
@@ -1,27 +1,151 @@
|
|||||||
# Generates the documentation for library functions via nixdoc.
|
# Generates the documentation for library functions via nixdoc.
|
||||||
# To build this derivation, run `nix-build -A nixpkgs-manual.lib-docs`
|
# To build this derivation, run `nix-build -A nixpkgs-manual.lib-docs`
|
||||||
{
|
{
|
||||||
|
lib,
|
||||||
stdenvNoCC,
|
stdenvNoCC,
|
||||||
nixdoc,
|
nixdoc,
|
||||||
|
nix,
|
||||||
|
nixpkgs ? { },
|
||||||
|
libsets ? [
|
||||||
|
{
|
||||||
|
name = "asserts";
|
||||||
|
description = "assertion functions";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "attrsets";
|
||||||
|
description = "attribute set functions";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "strings";
|
||||||
|
description = "string manipulation functions";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "versions";
|
||||||
|
description = "version string functions";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "trivial";
|
||||||
|
description = "miscellaneous functions";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "fixedPoints";
|
||||||
|
baseName = "fixed-points";
|
||||||
|
description = "explicit recursion functions";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "lists";
|
||||||
|
description = "list manipulation functions";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "debug";
|
||||||
|
description = "debugging functions";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "options";
|
||||||
|
description = "NixOS / nixpkgs option handling";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "path";
|
||||||
|
description = "path functions";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "fetchers";
|
||||||
|
description = "functions which can be reused across fetchers";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "filesystem";
|
||||||
|
description = "filesystem functions";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "fileset";
|
||||||
|
description = "file set functions";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "sources";
|
||||||
|
description = "source filtering functions";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "cli";
|
||||||
|
description = "command-line serialization functions";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "generators";
|
||||||
|
description = "functions that create file formats from nix data structures";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "gvariant";
|
||||||
|
description = "GVariant formatted string serialization functions";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "customisation";
|
||||||
|
description = "Functions to customise (derivation-related) functions, derivations, or attribute sets";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "meta";
|
||||||
|
description = "functions for derivation metadata";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "derivations";
|
||||||
|
description = "miscellaneous derivation-specific functions";
|
||||||
|
}
|
||||||
|
],
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenvNoCC.mkDerivation {
|
stdenvNoCC.mkDerivation {
|
||||||
name = "nixpkgs-lib-docs";
|
name = "nixpkgs-lib-docs";
|
||||||
|
|
||||||
src = ../../lib;
|
src = ../../lib;
|
||||||
|
|
||||||
nativeBuildInputs = [ nixdoc ];
|
nativeBuildInputs = [
|
||||||
|
nixdoc
|
||||||
buildPhase = ''
|
nix
|
||||||
mkdir -p src
|
];
|
||||||
cp -r ${../../lib} src/lib
|
|
||||||
|
|
||||||
mkdir -p $out
|
|
||||||
nixdoc --manifest ${../function-catalog.json} --root src --output $out/lib-functions.json
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
export NIX_STATE_DIR=$(mktemp -d)
|
||||||
|
nix-instantiate --eval --strict --json ${./lib-function-locations.nix} \
|
||||||
|
--arg nixpkgsPath "./." \
|
||||||
|
--argstr revision ${nixpkgs.rev or "master"} \
|
||||||
|
--argstr libsetsJSON ${lib.escapeShellArg (builtins.toJSON libsets)} \
|
||||||
|
--store $(mktemp -d) \
|
||||||
|
> locations.json
|
||||||
|
|
||||||
|
function docgen {
|
||||||
|
name=$1
|
||||||
|
baseName=$2
|
||||||
|
description=$3
|
||||||
|
# TODO: wrap lib.$name in <literal>, make nixdoc not escape it
|
||||||
|
if [[ -e "lib/$baseName.nix" ]]; then
|
||||||
|
nixdoc -c "$name" -d "lib.$name: $description" -l locations.json -f "lib/$baseName.nix" > "$out/$name.md"
|
||||||
|
else
|
||||||
|
nixdoc -c "$name" -d "lib.$name: $description" -l locations.json -f "lib/$baseName/default.nix" > "$out/$name.md"
|
||||||
|
fi
|
||||||
|
echo "$out/$name.md" >> "$out/index.md"
|
||||||
|
}
|
||||||
|
|
||||||
|
mkdir -p "$out"
|
||||||
|
|
||||||
|
cat > "$out/index.md" << 'EOF'
|
||||||
|
```{=include=} sections auto-id-prefix=auto-generated
|
||||||
|
EOF
|
||||||
|
|
||||||
|
${lib.concatMapStrings (
|
||||||
|
{
|
||||||
|
name,
|
||||||
|
baseName ? name,
|
||||||
|
description,
|
||||||
|
}:
|
||||||
|
''
|
||||||
|
docgen ${name} ${baseName} ${lib.escapeShellArg description}
|
||||||
|
''
|
||||||
|
) libsets}
|
||||||
|
|
||||||
|
echo '```' >> "$out/index.md"
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
82
doc/doc-support/lib-function-locations.nix
Normal file
82
doc/doc-support/lib-function-locations.nix
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
{
|
||||||
|
nixpkgsPath,
|
||||||
|
revision,
|
||||||
|
libsetsJSON,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
lib = import (nixpkgsPath + "/lib");
|
||||||
|
libsets = builtins.fromJSON libsetsJSON;
|
||||||
|
|
||||||
|
libDefPos =
|
||||||
|
prefix: set:
|
||||||
|
builtins.concatMap (
|
||||||
|
name:
|
||||||
|
[
|
||||||
|
{
|
||||||
|
name = builtins.concatStringsSep "." (prefix ++ [ name ]);
|
||||||
|
location = builtins.unsafeGetAttrPos name set;
|
||||||
|
}
|
||||||
|
]
|
||||||
|
++ lib.optionals (builtins.length prefix == 0 && builtins.isAttrs set.${name}) (
|
||||||
|
libDefPos (prefix ++ [ name ]) set.${name}
|
||||||
|
)
|
||||||
|
) (builtins.attrNames set);
|
||||||
|
|
||||||
|
libset =
|
||||||
|
toplib:
|
||||||
|
map (subsetname: {
|
||||||
|
subsetname = subsetname;
|
||||||
|
functions = libDefPos [ ] toplib.${subsetname};
|
||||||
|
}) (map (x: x.name) libsets);
|
||||||
|
|
||||||
|
flattenedLibSubset =
|
||||||
|
{ subsetname, functions }:
|
||||||
|
map (fn: {
|
||||||
|
name = "lib.${subsetname}.${fn.name}";
|
||||||
|
value = fn.location;
|
||||||
|
}) functions;
|
||||||
|
|
||||||
|
locatedlibsets = libs: map flattenedLibSubset (libset libs);
|
||||||
|
removeFilenamePrefix =
|
||||||
|
prefix: filename:
|
||||||
|
let
|
||||||
|
prefixLen = (builtins.stringLength prefix) + 1; # +1 to remove the leading /
|
||||||
|
filenameLen = builtins.stringLength filename;
|
||||||
|
substr = builtins.substring prefixLen filenameLen filename;
|
||||||
|
in
|
||||||
|
substr;
|
||||||
|
|
||||||
|
removeNixpkgs = removeFilenamePrefix (toString nixpkgsPath);
|
||||||
|
|
||||||
|
liblocations = builtins.filter (elem: elem.value != null) (lib.lists.flatten (locatedlibsets lib));
|
||||||
|
|
||||||
|
fnLocationRelative =
|
||||||
|
{ name, value }:
|
||||||
|
{
|
||||||
|
inherit name;
|
||||||
|
value = value // {
|
||||||
|
file = removeNixpkgs value.file;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
relativeLocs = (map fnLocationRelative liblocations);
|
||||||
|
sanitizeId = builtins.replaceStrings [ "'" ] [ "-prime" ];
|
||||||
|
|
||||||
|
urlPrefix = "https://github.com/NixOS/nixpkgs/blob/${revision}";
|
||||||
|
jsonLocs = builtins.listToAttrs (
|
||||||
|
map (
|
||||||
|
{ name, value }:
|
||||||
|
{
|
||||||
|
name = sanitizeId name;
|
||||||
|
value =
|
||||||
|
let
|
||||||
|
text = "${value.file}:${toString value.line}";
|
||||||
|
target = "${urlPrefix}/${value.file}#L${toString value.line}";
|
||||||
|
in
|
||||||
|
"[${text}](${target}) in `<nixpkgs>`";
|
||||||
|
}
|
||||||
|
) relativeLocs
|
||||||
|
);
|
||||||
|
|
||||||
|
in
|
||||||
|
jsonLocs
|
||||||
@@ -91,7 +91,7 @@ stdenvNoCC.mkDerivation (
|
|||||||
substituteInPlace ./languages-frameworks/python.section.md \
|
substituteInPlace ./languages-frameworks/python.section.md \
|
||||||
--subst-var-by python-interpreter-table "$(<"${pythonInterpreterTable}")"
|
--subst-var-by python-interpreter-table "$(<"${pythonInterpreterTable}")"
|
||||||
|
|
||||||
cp ${lib-docs}/lib-functions.json ./lib-functions.json
|
cat ./functions/library.md.in ${lib-docs}/index.md > ./functions/library.md
|
||||||
|
|
||||||
substitute ./manual.md.in ./manual.md \
|
substitute ./manual.md.in ./manual.md \
|
||||||
--replace-fail '@MANUAL_VERSION@' '${lib.version}'
|
--replace-fail '@MANUAL_VERSION@' '${lib.version}'
|
||||||
@@ -147,7 +147,7 @@ stdenvNoCC.mkDerivation (
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
lib-docs = callPackage ./lib-function-docs.nix { };
|
lib-docs = callPackage ./lib-function-docs.nix { inherit nixpkgs; };
|
||||||
|
|
||||||
epub = callPackage ./epub.nix { };
|
epub = callPackage ./epub.nix { };
|
||||||
|
|
||||||
@@ -176,7 +176,5 @@ stdenvNoCC.mkDerivation (
|
|||||||
manpage-urls = callPackage ../tests/manpage-urls.nix { };
|
manpage-urls = callPackage ../tests/manpage-urls.nix { };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
meta.license = lib.licenses.mit;
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,124 +0,0 @@
|
|||||||
{
|
|
||||||
"version": 1,
|
|
||||||
"groups": [
|
|
||||||
{ "id": "asserts", "description": "assertion functions" },
|
|
||||||
{ "id": "attrsets", "description": "attribute set functions" },
|
|
||||||
{ "id": "strings", "description": "string manipulation functions" },
|
|
||||||
{ "id": "versions", "description": "version string functions" },
|
|
||||||
{ "id": "trivial", "description": "miscellaneous functions" },
|
|
||||||
{ "id": "fixedPoints", "description": "explicit recursion functions" },
|
|
||||||
{ "id": "lists", "description": "list manipulation functions" },
|
|
||||||
{ "id": "debug", "description": "debugging functions" },
|
|
||||||
{ "id": "options", "description": "NixOS / nixpkgs option handling" },
|
|
||||||
{ "id": "path", "description": "path functions" },
|
|
||||||
{
|
|
||||||
"id": "fetchers",
|
|
||||||
"description": "functions which can be reused across fetchers"
|
|
||||||
},
|
|
||||||
{ "id": "filesystem", "description": "filesystem functions" },
|
|
||||||
{ "id": "fileset" },
|
|
||||||
{ "id": "sources", "description": "source filtering functions" },
|
|
||||||
{ "id": "cli", "description": "command-line serialization functions" },
|
|
||||||
{
|
|
||||||
"id": "generators",
|
|
||||||
"description": "functions that create file formats from nix data structures"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "gvariant",
|
|
||||||
"description": "GVariant formatted string serialization functions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "customisation",
|
|
||||||
"description": "Functions to customise (derivation-related) functions, derivations, or attribute sets"
|
|
||||||
},
|
|
||||||
{ "id": "meta", "description": "functions for derivation metadata" },
|
|
||||||
{
|
|
||||||
"id": "derivations",
|
|
||||||
"description": "miscellaneous derivation-specific functions"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"sources": [
|
|
||||||
{ "path": "lib.trivial", "file": "lib/trivial.nix", "groups": ["trivial"] },
|
|
||||||
{
|
|
||||||
"path": "lib.fixedPoints",
|
|
||||||
"file": "lib/fixed-points.nix",
|
|
||||||
"groups": ["fixedPoints"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "lib.attrsets",
|
|
||||||
"file": "lib/attrsets.nix",
|
|
||||||
"groups": ["attrsets"]
|
|
||||||
},
|
|
||||||
{ "path": "lib.lists", "file": "lib/lists.nix", "groups": ["lists"] },
|
|
||||||
{ "path": "lib.strings", "file": "lib/strings.nix", "groups": ["strings"] },
|
|
||||||
{
|
|
||||||
"path": "lib.customisation",
|
|
||||||
"file": "lib/customisation.nix",
|
|
||||||
"groups": ["customisation"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "lib.derivations",
|
|
||||||
"file": "lib/derivations.nix",
|
|
||||||
"groups": ["derivations"]
|
|
||||||
},
|
|
||||||
{ "path": "lib.meta", "file": "lib/meta.nix", "groups": ["meta"] },
|
|
||||||
{
|
|
||||||
"path": "lib.versions",
|
|
||||||
"file": "lib/versions.nix",
|
|
||||||
"groups": ["versions"]
|
|
||||||
},
|
|
||||||
{ "path": "lib.cli", "file": "lib/cli.nix", "groups": ["cli"] },
|
|
||||||
{
|
|
||||||
"path": "lib.gvariant",
|
|
||||||
"file": "lib/gvariant.nix",
|
|
||||||
"groups": ["gvariant"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "lib.generators",
|
|
||||||
"file": "lib/generators.nix",
|
|
||||||
"groups": ["generators"]
|
|
||||||
},
|
|
||||||
{ "path": "lib.asserts", "file": "lib/asserts.nix", "groups": ["asserts"] },
|
|
||||||
{ "path": "lib.debug", "file": "lib/debug.nix", "groups": ["debug"] },
|
|
||||||
{
|
|
||||||
"path": "lib.fetchers",
|
|
||||||
"file": "lib/fetchers.nix",
|
|
||||||
"groups": ["fetchers"]
|
|
||||||
},
|
|
||||||
{ "path": "lib.path", "file": "lib/path/default.nix", "groups": ["path"] },
|
|
||||||
{
|
|
||||||
"path": "lib.filesystem",
|
|
||||||
"file": "lib/filesystem.nix",
|
|
||||||
"groups": ["filesystem"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "lib.fileset",
|
|
||||||
"file": "lib/fileset/default.nix",
|
|
||||||
"groups": ["fileset"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "lib.sources",
|
|
||||||
"file": "lib/sources.nix",
|
|
||||||
"groups": ["sources"],
|
|
||||||
"mode": "deep",
|
|
||||||
"include": [
|
|
||||||
"pathIsGitRepo",
|
|
||||||
"commitIdFromGitRepo",
|
|
||||||
"cleanSource",
|
|
||||||
"cleanSourceWith",
|
|
||||||
"cleanSourceFilter",
|
|
||||||
"pathHasContext",
|
|
||||||
"canCleanSource",
|
|
||||||
"urlToName",
|
|
||||||
"shortRev",
|
|
||||||
"revOrTag",
|
|
||||||
"repoRevToName",
|
|
||||||
"sourceByRegex",
|
|
||||||
"sourceFilesBySuffices",
|
|
||||||
"sourceByGlobs",
|
|
||||||
"trace"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{ "path": "lib.options", "file": "lib/options.nix", "groups": ["options"] }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,11 @@
|
|||||||
# Functions reference {#chap-functions}
|
# Functions reference {#chap-functions}
|
||||||
|
|
||||||
The Nixpkgs repository has several utility functions to manipulate Nix expressions.
|
The Nixpkgs repository has several utility functions to manipulate Nix expressions.
|
||||||
|
|
||||||
|
```{=include=} sections
|
||||||
|
functions/library.md
|
||||||
|
functions/generators.section.md
|
||||||
|
functions/debug.section.md
|
||||||
|
functions/prefer-remote-fetch.section.md
|
||||||
|
functions/nix-gitignore.section.md
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
# Nixpkgs Library Functions {#sec-functions-library}
|
# Nixpkgs Library Functions {#sec-functions-library}
|
||||||
|
|
||||||
Nixpkgs provides a standard library at `pkgs.lib`, or through `import <nixpkgs/lib>`.
|
Nixpkgs provides a standard library at `pkgs.lib`, or through `import <nixpkgs/lib>`.
|
||||||
|
|
||||||
|
<!-- nixdoc-generated documentation must be appended here during build! -->
|
||||||
@@ -1 +1,6 @@
|
|||||||
# Getting started {#getting-started}
|
# Getting started {#getting-started}
|
||||||
|
|
||||||
|
```{=include=} chapters
|
||||||
|
first-package.chapter.md
|
||||||
|
dev-environments.md
|
||||||
|
```
|
||||||
|
|||||||
3
doc/hooks/ghc.section.md
Normal file
3
doc/hooks/ghc.section.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# GHC {#ghc}
|
||||||
|
|
||||||
|
Creates a temporary package database and registers every Haskell build input in it (TODO: how?).
|
||||||
@@ -4,3 +4,54 @@ Nixpkgs has several hook packages that augment the stdenv phases.
|
|||||||
|
|
||||||
The stdenv built-in hooks are documented in [](#ssec-setup-hooks).
|
The stdenv built-in hooks are documented in [](#ssec-setup-hooks).
|
||||||
|
|
||||||
|
```{=include=} sections
|
||||||
|
autoconf.section.md
|
||||||
|
automake.section.md
|
||||||
|
autopatchcil.section.md
|
||||||
|
autopatchelf.section.md
|
||||||
|
aws-c-common.section.md
|
||||||
|
bmake.section.md
|
||||||
|
breakpoint.section.md
|
||||||
|
cernlib.section.md
|
||||||
|
check-phase-thread-limit-hook.section.md
|
||||||
|
cmake.section.md
|
||||||
|
desktop-file-utils.section.md
|
||||||
|
gdk-pixbuf.section.md
|
||||||
|
ghc.section.md
|
||||||
|
gnome.section.md
|
||||||
|
haredo.section.md
|
||||||
|
installShellFiles.section.md
|
||||||
|
installFonts.section.md
|
||||||
|
julec.section.md
|
||||||
|
just.section.md
|
||||||
|
libglycin.section.md
|
||||||
|
libiconv.section.md
|
||||||
|
libxml2.section.md
|
||||||
|
meson.section.md
|
||||||
|
mpi-check-hook.section.md
|
||||||
|
ninja.section.md
|
||||||
|
nodejs-install-executables.section.md
|
||||||
|
nodejs-install-manuals.section.md
|
||||||
|
npm-build-hook.section.md
|
||||||
|
npm-config-hook.section.md
|
||||||
|
npm-install-hook.section.md
|
||||||
|
patch-rc-path-hooks.section.md
|
||||||
|
perl.section.md
|
||||||
|
pkg-config.section.md
|
||||||
|
pnpm.section.md
|
||||||
|
postgresql-test-hook.section.md
|
||||||
|
premake.section.md
|
||||||
|
python.section.md
|
||||||
|
scons.section.md
|
||||||
|
tauri.section.md
|
||||||
|
tetex-tex-live.section.md
|
||||||
|
udevCheckHook.section.md
|
||||||
|
unzip.section.md
|
||||||
|
validatePkgConfig.section.md
|
||||||
|
versionCheckHook.section.md
|
||||||
|
waf.section.md
|
||||||
|
writable-tmpdir-as-home-hook.section.md
|
||||||
|
zig.section.md
|
||||||
|
xcbuild.section.md
|
||||||
|
xfce4-dev-tools.section.md
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
# `installAgentSkills` {#installAgentSkills}
|
|
||||||
|
|
||||||
This hook automatically installs LLM agent skills into the proper location in `$out/share/skills/($pname|$base)/$skill/`.
|
|
||||||
|
|
||||||
Agents do not scan package outputs themselves. Expose skills via `environment.pathsToLink = [ "/share/skills" ];` and symlink the wanted `share/skills/<pname>/<skill>` directories into the agent's skill directory (e.g. `~/.claude/skills/`).
|
|
||||||
|
|
||||||
The automatic behavior of the hook can be disabled by setting the `dontInstallAgentSkills` variable to true.
|
|
||||||
|
|
||||||
Additionally, it exposes the `installSkill` function that can be used from `postInstall`
|
|
||||||
|
|
||||||
## `installSkill` {#installAgentSkills-installSkill}
|
|
||||||
|
|
||||||
The `installSkill` function takes one or two arguments: a directory to copy to the install location, and an optional base directory.
|
|
||||||
|
|
||||||
NB: passing a SKILL.md file directly as the first argument will fail as skills often contain other examples and tooling within the same directory.
|
|
||||||
|
|
||||||
### Example Usage {#installAgentSkills-installSkill-exampleusage}
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
nativeBuildInputs = [ installAgentSkills ];
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
installSkill skills/skill-xyz
|
|
||||||
'';
|
|
||||||
# installs to $out/share/skills/$pname/skill-xyz
|
|
||||||
|
|
||||||
# OR
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
installSkill skills/skill-xyz random-base
|
|
||||||
'';
|
|
||||||
# installs to $out/share/skills/random-base/skill-xyz
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Where `skills/skill-xyz` may look like:
|
|
||||||
|
|
||||||
```
|
|
||||||
skills/skill-xyz:
|
|
||||||
- SKILL.md
|
|
||||||
- scripts/
|
|
||||||
- references/
|
|
||||||
- assets/
|
|
||||||
- ...
|
|
||||||
```
|
|
||||||
|
|
||||||
@@ -24,10 +24,10 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
## Variables controlling `juce.projucerHook` {#juce-projucer-hook-variables}
|
## Variables controlling `juce.projucerHook` {#juce-projucer-hook-variables}
|
||||||
|
|
||||||
### `dontUseProjucerConfigure` {#juce-dontuseprojucerconfigure}
|
### `dontUseProjucerConfigure`
|
||||||
|
|
||||||
Disables `projucerConfigurePhase`
|
Disables `projucerConfigurePhase`
|
||||||
|
|
||||||
### `dontUseProjucerInstall` {#juce-dontuseprojucerinstall}
|
### `dontUseProjucerInstall`
|
||||||
|
|
||||||
Disables `projucerInstallPhase`
|
Disables `projucerInstallPhase`
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ Controls the flags passed to `cargo tauri build`.
|
|||||||
|
|
||||||
#### `tauriBundleType` {#tauri-bundle-type}
|
#### `tauriBundleType` {#tauri-bundle-type}
|
||||||
|
|
||||||
The [bundle type](https://tauri.app/reference/javascript/api/namespaceapp/#bundletype) to build.
|
The [bundle type](https://tauri.app/v1/guides/building/) to build.
|
||||||
|
|
||||||
#### `dontTauriBuild` {#dont-tauri-build}
|
#### `dontTauriBuild` {#dont-tauri-build}
|
||||||
|
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
This setup hook provides a writable home directory for packages that require it.
|
This setup hook provides a writable home directory for packages that require it.
|
||||||
|
|
||||||
To use, just add the hook to the `nativeBuildInputs` (or `nativeCheckInputs`, `nativeInstallCheckInputs`, etc.) of the package.
|
To use, just add the hook to the `nativeBuildInputs` of the package.
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
# Interoperability Standards {#part-interoperability}
|
# Interoperability Standards {#part-interoperability}
|
||||||
|
|
||||||
|
```{=include=} chapters
|
||||||
|
interoperability/cyclonedx.md
|
||||||
|
```
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ The `nix:narinfo` properties should be accompanied by a `nix:store_path` propert
|
|||||||
| `nix:narinfo:system` | The hardware and software platform on which this component is produced. |
|
| `nix:narinfo:system` | The hardware and software platform on which this component is produced. |
|
||||||
| `nix:narinfo:sig` | Signatures claiming that this component is what it claims to be. |
|
| `nix:narinfo:sig` | Signatures claiming that this component is what it claims to be. |
|
||||||
| `nix:narinfo:ca` | Content address of this store object's file system object, used to compute its store path. |
|
| `nix:narinfo:ca` | Content address of this store object's file system object, used to compute its store path. |
|
||||||
| `nix:narinfo:references` | A whitespace-separated array of store paths that this component references. |
|
| `nix:narinfo:references` | A whitespace separated array of store paths that this component references. |
|
||||||
|
|
||||||
### `nix:fod` {#sec-interop.cylonedx-fod}
|
### `nix:fod` {#sec-interop.cylonedx-fod}
|
||||||
|
|
||||||
|
|||||||
@@ -34,21 +34,17 @@ Inside each package set are:
|
|||||||
- builders: mixRelease, buildRebar3, etc
|
- builders: mixRelease, buildRebar3, etc
|
||||||
- hooks: for composing builders and packages
|
- hooks: for composing builders and packages
|
||||||
|
|
||||||
The package set is the only place Erlang and Elixir versions are chosen. Builders such as `mixRelease`, `fetchMixDeps` and `buildMix` take them from the set they are called from, and do not accept `erlang`, `elixir` or `hex` arguments.
|
To use a non-default Elixir it's important to keep the rest of the package set consistent, so it's recommended to use `.extend`. This ensures that builders like `mixRelease`, `fetchMixDeps`, and `buildMix` all pick up the overridden Elixir:
|
||||||
|
|
||||||
To use a non-default Elixir, derive a new set with `overrideScope`. This keeps the rest of the set consistent, so every builder picks up the overridden Elixir:
|
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
let
|
let
|
||||||
beamPackages = beam27Packages.overrideScope (final: prev: { elixir = final.elixir_1_18; });
|
beamPackages = beam27Packages.extend (self: super: { elixir = self.elixir_1_18; });
|
||||||
in
|
in
|
||||||
beamPackages.mixRelease {
|
beamPackages.mixRelease {
|
||||||
# ...
|
# ...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
`erlang` can be replaced the same way, which is useful for a patched OTP. Every member of the set is built from the set's own `erlang`, so overriding it rebuilds Elixir, Rebar3 and the rest against it.
|
|
||||||
|
|
||||||
## Build Tools {#beam-build-tools}
|
## Build Tools {#beam-build-tools}
|
||||||
|
|
||||||
### Rebar3 {#beam-build-tools-rebar3}
|
### Rebar3 {#beam-build-tools-rebar3}
|
||||||
@@ -336,8 +332,8 @@ Usually, we need to create a `shell.nix` file and do our development inside the
|
|||||||
|
|
||||||
with pkgs;
|
with pkgs;
|
||||||
let
|
let
|
||||||
# pin OTP via beam27Packages/beam28Packages/... and Elixir via overrideScope
|
# pin OTP via beam27Packages/beam28Packages/... and Elixir via .extend
|
||||||
beamPackages = beam27Packages.overrideScope (final: prev: { elixir = final.elixir_1_18; });
|
beamPackages = beam27Packages.extend (self: super: { elixir = self.elixir_1_18; });
|
||||||
in
|
in
|
||||||
mkShell { buildInputs = [ beamPackages.elixir ]; }
|
mkShell { buildInputs = [ beamPackages.elixir ]; }
|
||||||
```
|
```
|
||||||
@@ -372,8 +368,8 @@ Here is an example `shell.nix`.
|
|||||||
with import <nixpkgs> { };
|
with import <nixpkgs> { };
|
||||||
|
|
||||||
let
|
let
|
||||||
# pin OTP via beam27Packages/beam28Packages/... and Elixir via overrideScope
|
# pin OTP via beam27Packages/beam28Packages/... and Elixir via .extend
|
||||||
beamPackages = beam27Packages.overrideScope (final: prev: { elixir = final.elixir_1_18; });
|
beamPackages = beam27Packages.extend (self: super: { elixir = self.elixir_1_18; });
|
||||||
|
|
||||||
# define packages to install
|
# define packages to install
|
||||||
basePackages = [
|
basePackages = [
|
||||||
|
|||||||
@@ -1,32 +1,8 @@
|
|||||||
# CHICKEN {#sec-chicken}
|
# CHICKEN {#sec-chicken}
|
||||||
|
|
||||||
[CHICKEN](https://call-cc.org/) is a Scheme compiler. It includes an
|
[CHICKEN](https://call-cc.org/) is a
|
||||||
interactive mode and a custom package format, "eggs". CHICKEN 5 is
|
[R⁵RS](https://schemers.org/Documents/Standards/R5RS/HTML/)-compliant Scheme
|
||||||
[R⁵RS](https://schemers.org/Documents/Standards/R5RS/HTML/)-compliant, whereas
|
compiler. It includes an interactive mode and a custom package format, "eggs".
|
||||||
CHICKEN 6 targets
|
|
||||||
[R⁷RS](https://standards.scheme.org/official/r7rs.pdf).
|
|
||||||
|
|
||||||
## Package Sets {#sec-chicken-package-sets}
|
|
||||||
|
|
||||||
Each major release of CHICKEN has its own package set, because eggs are
|
|
||||||
compiled against a specific binary version of the compiler and cannot be shared
|
|
||||||
between releases:
|
|
||||||
|
|
||||||
* `chickenPackages_5` — CHICKEN 5, and the set the unversioned attributes
|
|
||||||
(`chicken`, `chickenPackages`, `eggDerivation`, `fetchegg`) point at.
|
|
||||||
* `chickenPackages_6` — CHICKEN 6.
|
|
||||||
* `chickenPackages_4` — CHICKEN 4; kept for the few packages that still need
|
|
||||||
it and maintained on a best-effort basis.
|
|
||||||
|
|
||||||
Each set provides `chicken`, `eggDerivation`, `fetchegg` and an `chickenEggs`
|
|
||||||
attrset of eggs published for that release. Note that upstream has not ported
|
|
||||||
every egg to CHICKEN 6 yet, so `chickenPackages_6.chickenEggs` is considerably
|
|
||||||
smaller than its CHICKEN 5 counterpart.
|
|
||||||
|
|
||||||
CHICKEN 5 and 6 are built from the same expressions, in
|
|
||||||
`pkgs/development/compilers/chicken/common/`; the release directories next to
|
|
||||||
it hold only what differs between releases, which is the compiler's version and
|
|
||||||
its egg set. CHICKEN 4 predates that arrangement and stands on its own.
|
|
||||||
|
|
||||||
## Using Eggs {#sec-chicken-using}
|
## Using Eggs {#sec-chicken-using}
|
||||||
|
|
||||||
@@ -50,43 +26,29 @@ variables `CHICKEN_INCLUDE_PATH` and `CHICKEN_REPOSITORY_PATH`.
|
|||||||
|
|
||||||
## Updating Eggs {#sec-chicken-updating-eggs}
|
## Updating Eggs {#sec-chicken-updating-eggs}
|
||||||
|
|
||||||
For CHICKEN 5 and 6, the egg set is generated from upstream's list of latest
|
Nixpkgs only knows about a subset of all published eggs. It uses
|
||||||
egg releases, so there is no list of eggs to curate in Nixpkgs: every egg
|
[egg2nix](https://github.com/the-kenny/egg2nix) to generate a
|
||||||
published for that release is included. The generated metadata lives in the
|
package set from a list of eggs to include.
|
||||||
release directory's `deps.toml`, and is regenerated by running the shared
|
|
||||||
`update.sh` script with the release to update:
|
The package set is regenerated by running the following shell commands:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ cd pkgs/development/compilers/chicken/common/
|
$ nix-shell -p chickenPackages.egg2nix
|
||||||
$ ./update.sh 6
|
$ cd pkgs/development/compilers/chicken/5/
|
||||||
```
|
|
||||||
|
|
||||||
This clones upstream's `eggs-<major>-latest` repository, prefetches each egg
|
|
||||||
tarball and converts the egg metadata into `deps.toml`. Do not edit
|
|
||||||
`deps.toml` by hand.
|
|
||||||
|
|
||||||
Eggs that need extra native dependencies or other fixups are patched up in
|
|
||||||
`overrides.nix` in the release directory; the entries there are keyed by egg
|
|
||||||
name and applied automatically by `eggDerivation`.
|
|
||||||
|
|
||||||
## Adding Eggs {#sec-chicken-adding-eggs}
|
|
||||||
|
|
||||||
CHICKEN 4 predates the workflow above: its much smaller set is generated with
|
|
||||||
[egg2nix](https://github.com/the-kenny/egg2nix) from a hand-written list of
|
|
||||||
eggs, so eggs have to be added explicitly. The list is
|
|
||||||
`pkgs/development/compilers/chicken/4/eggs.scm`; the first section lists eggs
|
|
||||||
which are required by `egg2nix` itself, all other eggs go into the second
|
|
||||||
section. After editing, regenerate the set:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ nix-shell -p chickenPackages_4.egg2nix
|
|
||||||
$ cd pkgs/development/compilers/chicken/4/
|
|
||||||
$ egg2nix eggs.scm > eggs.nix
|
$ egg2nix eggs.scm > eggs.nix
|
||||||
```
|
```
|
||||||
|
|
||||||
`egg2nix` resolves one collection of eggs with mutually-compatible versions, so
|
## Adding Eggs {#sec-chicken-adding-eggs}
|
||||||
adding an egg may update existing ones. To keep those changes separate,
|
|
||||||
regenerate the set before adding more eggs.
|
When we run `egg2nix`, we obtain one collection of eggs with
|
||||||
|
mutually-compatible versions. This means that when we add new eggs, we may
|
||||||
|
need to update existing eggs. To keep those separate, follow the procedure for
|
||||||
|
updating eggs before including more eggs.
|
||||||
|
|
||||||
|
To include more eggs, edit `pkgs/development/compilers/chicken/5/eggs.scm`.
|
||||||
|
The first section of this file lists eggs which are required by `egg2nix`
|
||||||
|
itself; all other eggs go into the second section. After editing, follow the
|
||||||
|
procedure for updating eggs.
|
||||||
|
|
||||||
## Override Scope {#sec-chicken-override-scope}
|
## Override Scope {#sec-chicken-override-scope}
|
||||||
|
|
||||||
|
|||||||
@@ -53,3 +53,56 @@ Each supported language or software ecosystem has its own package set named `<la
|
|||||||
…
|
…
|
||||||
```
|
```
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
```{=include=} sections
|
||||||
|
agda.section.md
|
||||||
|
android.section.md
|
||||||
|
astal.section.md
|
||||||
|
beam.section.md
|
||||||
|
chicken.section.md
|
||||||
|
cosmic.section.md
|
||||||
|
crystal.section.md
|
||||||
|
cuda.section.md
|
||||||
|
cuelang.section.md
|
||||||
|
dart.section.md
|
||||||
|
dhall.section.md
|
||||||
|
dlang.section.md
|
||||||
|
dotnet.section.md
|
||||||
|
emscripten.section.md
|
||||||
|
factor.section.md
|
||||||
|
gnome.section.md
|
||||||
|
go.section.md
|
||||||
|
gradle.section.md
|
||||||
|
hare.section.md
|
||||||
|
haskell.section.md
|
||||||
|
hy.section.md
|
||||||
|
idris.section.md
|
||||||
|
idris2.section.md
|
||||||
|
ios.section.md
|
||||||
|
java.section.md
|
||||||
|
javascript.section.md
|
||||||
|
julia.section.md
|
||||||
|
lean4.section.md
|
||||||
|
lisp.section.md
|
||||||
|
lua.section.md
|
||||||
|
maven.section.md
|
||||||
|
nim.section.md
|
||||||
|
ocaml.section.md
|
||||||
|
octave.section.md
|
||||||
|
perl.section.md
|
||||||
|
php.section.md
|
||||||
|
pkg-config.section.md
|
||||||
|
python.section.md
|
||||||
|
qt.section.md
|
||||||
|
r.section.md
|
||||||
|
rocq.section.md
|
||||||
|
ruby.section.md
|
||||||
|
rust.section.md
|
||||||
|
scheme.section.md
|
||||||
|
swift.section.md
|
||||||
|
tcl.section.md
|
||||||
|
texlive.section.md
|
||||||
|
typst.section.md
|
||||||
|
vim.section.md
|
||||||
|
neovim.section.md
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,30 +1,49 @@
|
|||||||
# JavaScript {#language-javascript}
|
# Javascript {#language-javascript}
|
||||||
|
|
||||||
## Introduction {#javascript-introduction}
|
## Introduction {#javascript-introduction}
|
||||||
|
|
||||||
Package JavaScript applications with the tools below.
|
This contains instructions on how to package JavaScript applications.
|
||||||
|
|
||||||
|
The various tools available will be listed in the [tools-overview](#javascript-tools-overview).
|
||||||
|
Some general principles for packaging will follow.
|
||||||
|
Finally, some tool-specific instructions will be given.
|
||||||
|
|
||||||
|
## Getting unstuck / finding code examples {#javascript-finding-examples}
|
||||||
|
|
||||||
|
If you find you are lacking inspiration for packaging JavaScript applications, the links below might prove useful.
|
||||||
|
Searching online for prior art can be helpful if you are running into solved problems.
|
||||||
|
|
||||||
|
### Github {#javascript-finding-examples-github}
|
||||||
|
|
||||||
|
- Searching Nix files for `yarnConfigHook`: <https://github.com/search?q=yarnConfigHook+language%3ANix&type=code>
|
||||||
|
- Searching just `flake.nix` files for `yarnConfigHook`: <https://github.com/search?q=yarnConfigHook+path%3A**%2Fflake.nix&type=code>
|
||||||
|
|
||||||
|
### Gitlab {#javascript-finding-examples-gitlab}
|
||||||
|
|
||||||
|
- Searching Nix files for `yarnConfigHook`: <https://gitlab.com/search?scope=blobs&search=yarnConfigHook+extension%3Anix>
|
||||||
|
- Searching just `flake.nix` files for `yarnConfigHook`: <https://gitlab.com/search?scope=blobs&search=yarnConfigHook+filename%3Aflake.nix>
|
||||||
|
|
||||||
## Tools overview {#javascript-tools-overview}
|
## Tools overview {#javascript-tools-overview}
|
||||||
|
|
||||||
## General principles {#javascript-general-principles}
|
## General principles {#javascript-general-principles}
|
||||||
|
|
||||||
The principles below are ordered by importance.
|
The following principles are given in order of importance with potential exceptions.
|
||||||
|
|
||||||
### Use the project's Node.js version {#javascript-upstream-node-version}
|
### Try to use the same node version used upstream {#javascript-upstream-node-version}
|
||||||
|
|
||||||
It is often not documented which Node.js version the project uses, but if it is, use the same version when packaging.
|
It is often not documented which node version is used upstream, but if it is, try to use the same version when packaging.
|
||||||
|
|
||||||
This can be a problem if the project uses the latest and greatest and you are trying to use an earlier version of Node.js.
|
This can be a problem if upstream is using the latest and greatest and you are trying to use an earlier version of node.
|
||||||
Some cryptic errors regarding V8 may appear.
|
Some cryptic errors regarding V8 may appear.
|
||||||
|
|
||||||
### Use the project's package manager and lock file {#javascript-upstream-package-manager}
|
### Try to respect the package manager originally used by upstream (and use the upstream lock file) {#javascript-upstream-package-manager}
|
||||||
|
|
||||||
A lock file (package-lock.json, yarn.lock...) is supposed to make reproducible installations of `node_modules` for each tool.
|
A lock file (package-lock.json, yarn.lock...) is supposed to make reproducible installations of `node_modules` for each tool.
|
||||||
|
|
||||||
Package manager guidelines recommend committing those lock files to the repository.
|
Guidelines of package managers, recommend to commit those lock files to the repos.
|
||||||
If a particular lock file is present, it is a strong indication of which package manager the project uses.
|
If a particular lock file is present, it is a strong indication of which package manager is used upstream.
|
||||||
|
|
||||||
Use a Nix tool that understands the lock file.
|
It's better to try to use a Nix tool that understands the lock file.
|
||||||
Using a different tool might give you a hard-to-understand error because different packages have been installed.
|
Using a different tool might give you a hard-to-understand error because different packages have been installed.
|
||||||
|
|
||||||
Using a different tool forces you to commit a lock file to the repository.
|
Using a different tool forces you to commit a lock file to the repository.
|
||||||
@@ -32,16 +51,16 @@ These files are fairly large, so when packaging for nixpkgs, this approach does
|
|||||||
|
|
||||||
Exceptions to this rule are:
|
Exceptions to this rule are:
|
||||||
|
|
||||||
- When you encounter one of the bugs from a Nix tool. In each of the tool-specific instructions, known problems are detailed. If a tool has a problem, try another. You may have to re-create a lock file and commit it to Nixpkgs.
|
- When you encounter one of the bugs from a Nix tool. In each of the tool-specific instructions, known problems will be detailed. If you have a problem with a particular tool, then it's best to try another tool, even if this means you will have to re-create a lock file and commit it to Nixpkgs.
|
||||||
- Some lock files contain a particular version of a package that has been pulled off npm for some reason. In that case, you can recreate the lock file (by removing the original and running `npm install`, `yarn`, etc.) and commit this to Nixpkgs.
|
- Some lock files contain particular version of a package that has been pulled off npm for some reason. In that case, you can recreate upstream lock (by removing the original and `npm install`, `yarn`, ...) and commit this to nixpkgs.
|
||||||
|
|
||||||
### Use the project's `package.json` {#javascript-upstream-package-json}
|
### Try to use upstream package.json {#javascript-upstream-package-json}
|
||||||
|
|
||||||
Exceptions to this rule are:
|
Exceptions to this rule are:
|
||||||
|
|
||||||
- Sometimes the project assumes some dependencies are installed globally. Add them to the `package.json` manually (`yarn add xxx` or `npm install xxx`). Run locally installed CLI tools with `npx`, for example `npx postcss`. That is how you call them in the phases.
|
- Sometimes the upstream repo assumes some dependencies should be installed globally. In that case, you can add them manually to the upstream `package.json` (`yarn add xxx` or `npm install xxx`, ...). Dependencies that are installed locally can be executed with `npx` for CLI tools (e.g. `npx postcss ...`, this is how you can call those dependencies in the phases).
|
||||||
- Sometimes there is a version conflict between some dependency requirements. In that case you can fix a version by removing the `^`.
|
- Sometimes there is a version conflict between some dependency requirements. In that case you can fix a version by removing the `^`.
|
||||||
- Sometimes a script in `package.json` does not work as is. It might call a CLI tool that is not available, or `cd` into a directory with a different `package.json`, which is common with workspaces. Read what the script does. Reproduce it in the build phases. For example, a `build` script may call `build:ui` and `build:server` in turn. If one fails, split them into separate steps.
|
- Sometimes the script defined in the package.json does not work as is. Some scripts for example use CLI tools that might not be available, or cd in directory with a different package.json (for workspaces notably). In that case, it's perfectly fine to look at what the particular script is doing and break this down in the phases. In the build script you can see `build:*` calling in turns several other build scripts like `build:ui` or `build:server`. If one of those fails, you can try to separate those into,
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
yarn build:ui
|
yarn build:ui
|
||||||
@@ -51,7 +70,7 @@ Exceptions to this rule are:
|
|||||||
npm run build:server
|
npm run build:server
|
||||||
```
|
```
|
||||||
|
|
||||||
When you need to override `package.json`, it is best to use the one from the project and make explicit overrides. Here is an example:
|
when you need to override a package.json. It's nice to use the one from the upstream source and do some explicit override. Here is an example:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
@@ -63,22 +82,22 @@ Exceptions to this rule are:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
You still need to commit the modified version of the lock files, but at least the overrides are explicit for everyone to see.
|
You will still need to commit the modified version of the lock files, but at least the overrides are explicit for everyone to see.
|
||||||
|
|
||||||
### Use `node_modules` directly {#javascript-using-node_modules}
|
### Using node_modules directly {#javascript-using-node_modules}
|
||||||
|
|
||||||
Each tool has an abstraction to build the node_modules (dependencies) directory.
|
Each tool has an abstraction to just build the node_modules (dependencies) directory.
|
||||||
You can always use the `stdenv.mkDerivation` with the node_modules to build the package (symlink the node_modules directory and then use the package build command).
|
You can always use the `stdenv.mkDerivation` with the node_modules to build the package (symlink the node_modules directory and then use the package build command).
|
||||||
The `node_modules` abstraction can also be used to build some web framework frontends.
|
The node_modules abstraction can be also used to build some web framework frontends.
|
||||||
For an example of this, see how [plausible](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/pl/plausible/package.nix) is built.
|
For an example of this see how [plausible](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/pl/plausible/package.nix) is built.
|
||||||
Then, when building the frontend, you can symlink the `node_modules` directory.
|
Then when building the frontend you can just symlink the node_modules directory.
|
||||||
|
|
||||||
## Tool-specific instructions {#javascript-tool-specific}
|
## Tool-specific instructions {#javascript-tool-specific}
|
||||||
|
|
||||||
### buildNpmPackage {#javascript-buildNpmPackage}
|
### buildNpmPackage {#javascript-buildNpmPackage}
|
||||||
|
|
||||||
`buildNpmPackage` packages npm-based projects in Nixpkgs without the use of an auto-generated dependencies file.
|
`buildNpmPackage` allows you to package npm-based projects in Nixpkgs without the use of an auto-generated dependencies file.
|
||||||
It uses npm's cache. It builds a reproducible cache of the project's dependencies and points npm at it.
|
It works by utilizing npm's cache functionality -- creating a reproducible cache that contains the dependencies of a project, and pointing npm to it.
|
||||||
|
|
||||||
Here's an example:
|
Here's an example:
|
||||||
|
|
||||||
@@ -116,9 +135,9 @@ buildNpmPackage (finalAttrs: {
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
In the default `installPhase` set by `buildNpmPackage`, it uses `npm pack --json --dry-run` to decide what files to install. They go in `$out/lib/node_modules/$name/`, where `$name` is the `name` string in the package's `package.json`.
|
In the default `installPhase` set by `buildNpmPackage`, it uses `npm pack --json --dry-run` to decide what files to install in `$out/lib/node_modules/$name/`, where `$name` is the `name` string defined in the package's `package.json`.
|
||||||
Additionally, the `bin` and `man` keys in the source's `package.json` are used to decide what binaries and manpages are supposed to be installed.
|
Additionally, the `bin` and `man` keys in the source's `package.json` are used to decide what binaries and manpages are supposed to be installed.
|
||||||
If these are not defined, `npm pack` may miss some files, and no binaries are produced.
|
If these are not defined, `npm pack` may miss some files, and no binaries will be produced.
|
||||||
|
|
||||||
#### Arguments {#javascript-buildNpmPackage-arguments}
|
#### Arguments {#javascript-buildNpmPackage-arguments}
|
||||||
|
|
||||||
@@ -153,8 +172,8 @@ sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
|
|||||||
|
|
||||||
`fetchNpmDeps` is a Nix function that requires the following mandatory arguments:
|
`fetchNpmDeps` is a Nix function that requires the following mandatory arguments:
|
||||||
|
|
||||||
- `src`: A directory or tarball with a `package-lock.json` file
|
- `src`: A directory / tarball with `package-lock.json` file
|
||||||
- `hash`: The output hash of the dependencies defined in `package-lock.json`.
|
- `hash`: The output hash of the node dependencies defined in `package-lock.json`.
|
||||||
|
|
||||||
It returns a derivation with all `package-lock.json` dependencies downloaded into `$out/`, usable as an npm cache.
|
It returns a derivation with all `package-lock.json` dependencies downloaded into `$out/`, usable as an npm cache.
|
||||||
|
|
||||||
@@ -168,7 +187,7 @@ There is no need to specify a `hash`, since it relies entirely on the integrity
|
|||||||
|
|
||||||
##### Inputs {#javascript-buildNpmPackage-inputs}
|
##### Inputs {#javascript-buildNpmPackage-inputs}
|
||||||
|
|
||||||
- `npmRoot`: Path to the package directory containing the source tree.
|
- `npmRoot`: Path to package directory containing the source tree.
|
||||||
If this is omitted, the `package` and `packageLock` arguments must be specified instead.
|
If this is omitted, the `package` and `packageLock` arguments must be specified instead.
|
||||||
- `package`: Parsed contents of `package.json`
|
- `package`: Parsed contents of `package.json`
|
||||||
- `packageLock`: Parsed contents of `package-lock.json`
|
- `packageLock`: Parsed contents of `package-lock.json`
|
||||||
@@ -176,7 +195,7 @@ There is no need to specify a `hash`, since it relies entirely on the integrity
|
|||||||
- `version`: Package version
|
- `version`: Package version
|
||||||
- `fetcherOpts`: An attribute set of arguments forwarded to the underlying fetcher.
|
- `fetcherOpts`: An attribute set of arguments forwarded to the underlying fetcher.
|
||||||
|
|
||||||
It returns a derivation with a patched `package.json` and `package-lock.json` with all dependencies resolved to Nix store paths.
|
It returns a derivation with a patched `package.json` & `package-lock.json` with all dependencies resolved to Nix store paths.
|
||||||
|
|
||||||
:::{.note}
|
:::{.note}
|
||||||
`npmHooks.npmConfigHook` cannot be used with `importNpmLock`.
|
`npmHooks.npmConfigHook` cannot be used with `importNpmLock`.
|
||||||
@@ -238,18 +257,18 @@ buildNpmPackage {
|
|||||||
|
|
||||||
`importNpmLock.buildNodeModules` returns a derivation with a pre-built `node_modules` directory, as imported by `importNpmLock`.
|
`importNpmLock.buildNodeModules` returns a derivation with a pre-built `node_modules` directory, as imported by `importNpmLock`.
|
||||||
|
|
||||||
This is to be used together with `importNpmLock.hooks.linkNodeModulesHook` to support `nix-shell`/`nix develop` development workflows.
|
This is to be used together with `importNpmLock.hooks.linkNodeModulesHook` to facilitate `nix-shell`/`nix develop` based development workflows.
|
||||||
|
|
||||||
It accepts an argument with the following attributes:
|
It accepts an argument with the following attributes:
|
||||||
|
|
||||||
`npmRoot` (Path; optional)
|
`npmRoot` (Path; optional)
|
||||||
: Path to the package directory containing the source tree. If not specified, the `package` and `packageLock` arguments must both be specified.
|
: Path to package directory containing the source tree. If not specified, the `package` and `packageLock` arguments must both be specified.
|
||||||
|
|
||||||
`package` (Attrset; optional)
|
`package` (Attrset; optional)
|
||||||
: Parsed contents of `package.json`, as returned by `lib.importJSON ./my-package.json`. If not specified, the `package.json` in `npmRoot` is used.
|
: Parsed contents of `package.json`, as returned by `lib.importJSON ./my-package.json`. If not specified, the `package.json` in `npmRoot` is used.
|
||||||
|
|
||||||
`packageLock` (Attrset; optional)
|
`packageLock` (Attrset; optional)
|
||||||
: Parsed contents of `package-lock.json`, as returned by `lib.importJSON ./my-package-lock.json`. If not specified, the `package-lock.json` in `npmRoot` is used.
|
: Parsed contents of `package-lock.json`, as returned `lib.importJSON ./my-package-lock.json`. If not specified, the `package-lock.json` in `npmRoot` is used.
|
||||||
|
|
||||||
`derivationArgs` (`mkDerivation` attrset; optional)
|
`derivationArgs` (`mkDerivation` attrset; optional)
|
||||||
: Arguments passed to `stdenv.mkDerivation`
|
: Arguments passed to `stdenv.mkDerivation`
|
||||||
@@ -269,26 +288,26 @@ pkgs.mkShell {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
creates a development shell where a `node_modules` directory is created and packages are symlinked to the Nix store when activated.
|
will create a development shell where a `node_modules` directory is created & packages symlinked to the Nix store when activated.
|
||||||
|
|
||||||
:::{.note}
|
:::{.note}
|
||||||
Commands like `npm install` and `npm add` that write packages and executables need to be used with `--package-lock-only`.
|
Commands like `npm install` & `npm add` that write packages & executables need to be used with `--package-lock-only`.
|
||||||
|
|
||||||
This means `npm` installs dependencies by writing into `package-lock.json` without modifying the `node_modules` folder. It installs by reloading the devShell.
|
This means `npm` installs dependencies by writing into `package-lock.json` without modifying the `node_modules` folder. Installation happens through reloading the devShell.
|
||||||
This gives the `nix shell` near-exclusive ownership over your `node_modules` folder.
|
This might be best practice since it gives the `nix shell` virtually exclusive ownership over your `node_modules` folder.
|
||||||
|
|
||||||
Set `package-lock-only = true` in your project-local [`.npmrc`](https://docs.npmjs.com/cli/v11/configuring-npm/npmrc).
|
It's recommended to set `package-lock-only = true` in your project-local [`.npmrc`](https://docs.npmjs.com/cli/v11/configuring-npm/npmrc).
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### corepack {#javascript-corepack}
|
### corepack {#javascript-corepack}
|
||||||
|
|
||||||
This package puts the corepack wrappers for pnpm and yarn in your PATH, and they honor the `packageManager` setting in the `package.json`.
|
This package puts the corepack wrappers for pnpm and yarn in your PATH, and they will honor the `packageManager` setting in the `package.json`.
|
||||||
|
|
||||||
### pnpm {#javascript-pnpm}
|
### pnpm {#javascript-pnpm}
|
||||||
|
|
||||||
pnpm is available as the top-level package `pnpm`. Additionally, there are variants pinned to certain major versions, like `pnpm_9`, `pnpm_10`, `pnpm_10_29_2` and `pnpm_11`, which support different sets of lock file versions.
|
pnpm is available as the top-level package `pnpm`. Additionally, there are variants pinned to certain major versions, like `pnpm_9`, `pnpm_10`, `pnpm_10_29_2` and `pnpm_11`, which support different sets of lock file versions.
|
||||||
|
|
||||||
When packaging an application that includes a `pnpm-lock.yaml`, you need to fetch the pnpm store for that project using a fixed-output-derivation. The function `fetchPnpmDeps` can create this pnpm store derivation. In conjunction, the setup hook `pnpmConfigHook` prepares the build environment to install the pre-fetched dependencies store. The example below uses the fetcher and setup hook for a package that has `package.json` and `pnpm-lock.yaml`:
|
When packaging an application that includes a `pnpm-lock.yaml`, you need to fetch the pnpm store for that project using a fixed-output-derivation. The function `fetchPnpmDeps` can create this pnpm store derivation. In conjunction, the setup hook `pnpmConfigHook` will prepare the build environment to install the pre-fetched dependencies store. Here is an example for a package that contains `package.json` and a `pnpm-lock.yaml` files using the fetcher and setup hook above:
|
||||||
|
|
||||||
There is also the [`pnpmBuildHook`](#pnpm-build-hook) for building packages with `pnpm`, as seen in [](#ex-pnpm-build-hook).
|
There is also the [`pnpmBuildHook`](#pnpm-build-hook) for building packages with `pnpm`, as seen in [](#ex-pnpm-build-hook).
|
||||||
|
|
||||||
@@ -331,7 +350,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
Use a pinned version of pnpm (for example `pnpm_9` or `pnpm_10`) to increase reproducibility. An older version may be required if the package needs a certain lock file version. To do so, pass the `pnpm` argument to `fetchPnpmDeps`. Then override the `pnpm` arg in `pnpmConfigHook`. Here are the changes in the example above to use a pinned pnpm version:
|
It is highly recommended to use a pinned version of pnpm (i.e., `pnpm_9` or `pnpm_10`), to increase future reproducibility. It might also be required to use an older version if the package needs support for a certain lock file version. To do so, you can pass the `pnpm` argument to `fetchPnpmDeps` and override the `pnpm` arg in `pnpmConfigHook`. Here are the changes in the example above to use a pinned pnpm version:
|
||||||
|
|
||||||
<!-- TODO: Does splicing still work when overriding in nativeBuildInputs here? -->
|
<!-- TODO: Does splicing still work when overriding in nativeBuildInputs here? -->
|
||||||
|
|
||||||
@@ -373,7 +392,7 @@ Use a pinned version of pnpm (for example `pnpm_9` or `pnpm_10`) to increase rep
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
In case you are patching `package.json` or `pnpm-lock.yaml`, make sure to pass `finalAttrs.patches` to the function as well (i.e., `inherit (finalAttrs) patches`).
|
In case you are patching `package.json` or `pnpm-lock.yaml`, make sure to pass `finalAttrs.patches` to the function as well (i.e., `inherit (finalAttrs) patches`.
|
||||||
|
|
||||||
`pnpmConfigHook` supports adding additional `pnpm install` flags via `pnpmInstallFlags` which can be set to a Nix string array:
|
`pnpmConfigHook` supports adding additional `pnpm install` flags via `pnpmInstallFlags` which can be set to a Nix string array:
|
||||||
|
|
||||||
@@ -389,14 +408,14 @@ In case you are patching `package.json` or `pnpm-lock.yaml`, make sure to pass `
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
If needed, set `dontPnpmConfigure = true;` to fully disable `pnpmConfigHook` without removing it from inputs manually.
|
If needed, `dontPnpmConfigure = true;` can be used to fully disable `pnpmConfigHook` without manually removing it from inputs.
|
||||||
|
|
||||||
#### Dealing with `sourceRoot` {#javascript-pnpm-sourceRoot}
|
#### Dealing with `sourceRoot` {#javascript-pnpm-sourceRoot}
|
||||||
|
|
||||||
If the pnpm project is in a subdirectory, you can define `sourceRoot` or `setSourceRoot` for `fetchPnpmDeps`.
|
If the pnpm project is in a subdirectory, you can just define `sourceRoot` or `setSourceRoot` for `fetchPnpmDeps`.
|
||||||
If `sourceRoot` is different between the parent derivation and `fetchPnpmDeps`, you have to set `pnpmRoot` to effectively be the same location as it is in `fetchPnpmDeps`.
|
If `sourceRoot` is different between the parent derivation and `fetchPnpmDeps`, you will have to set `pnpmRoot` to effectively be the same location as it is in `fetchPnpmDeps`.
|
||||||
|
|
||||||
Assuming the directory structure below, you can define `sourceRoot` and `pnpmRoot`:
|
Assuming the following directory structure, we can define `sourceRoot` and `pnpmRoot` as follows:
|
||||||
|
|
||||||
```
|
```
|
||||||
.
|
.
|
||||||
@@ -420,9 +439,10 @@ Assuming the directory structure below, you can define `sourceRoot` and `pnpmRoo
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### pnpm workspaces {#javascript-pnpm-workspaces}
|
#### PNPM Workspaces {#javascript-pnpm-workspaces}
|
||||||
|
|
||||||
For a pnpm workspace, set `pnpmWorkspaces = [ "<workspace project name 1>" "<workspace project name 2>" ]` in your `fetchPnpmDeps` call. pnpm then installs only the dependencies for those workspace packages.
|
If you need to use a PNPM workspace for your project, then set `pnpmWorkspaces = [ "<workspace project name 1>" "<workspace project name 2>" ]`, etc, in your `fetchPnpmDeps` call,
|
||||||
|
which will make PNPM only install dependencies for those workspace packages.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
@@ -438,9 +458,9 @@ For example:
|
|||||||
```
|
```
|
||||||
|
|
||||||
The above would make `fetchPnpmDeps` call only install dependencies for the `@astrojs/language-server` workspace package.
|
The above would make `fetchPnpmDeps` call only install dependencies for the `@astrojs/language-server` workspace package.
|
||||||
You do not need to set `sourceRoot` to make this work.
|
Note that you do not need to set `sourceRoot` to make this work.
|
||||||
|
|
||||||
For these projects, build with `pnpm --filter=<pnpm workspace name> build`, because `npmHooks.npmBuildHook` may not work. The example below fits most workspace projects:
|
Usually, in such cases, you'd want to use `pnpm --filter=<pnpm workspace name> build` to build your project, as `npmHooks.npmBuildHook` probably won't work. A `buildPhase` based on the following example will probably fit most workspace projects:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
@@ -454,9 +474,9 @@ For these projects, build with `pnpm --filter=<pnpm workspace name> build`, beca
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Additional pnpm commands and settings {#javascript-pnpm-extraCommands}
|
#### Additional PNPM Commands and settings {#javascript-pnpm-extraCommands}
|
||||||
|
|
||||||
If you require setting an additional pnpm configuration setting (such as `dedupe-peer-dependents` or similar),
|
If you require setting an additional PNPM configuration setting (such as `dedupe-peer-dependents` or similar),
|
||||||
set `prePnpmInstall` to the right commands to run. For example:
|
set `prePnpmInstall` to the right commands to run. For example:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
@@ -471,11 +491,11 @@ set `prePnpmInstall` to the right commands to run. For example:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
In this example, `prePnpmInstall` runs in both `pnpmConfigHook` and the `fetchPnpmDeps` builder.
|
In this example, `prePnpmInstall` will be run by both `pnpmConfigHook` and by the `fetchPnpmDeps` builder.
|
||||||
|
|
||||||
#### pnpm `fetcherVersion` {#javascript-pnpm-fetcherVersion}
|
#### pnpm `fetcherVersion` {#javascript-pnpm-fetcherVersion}
|
||||||
|
|
||||||
This is the version of the output of `fetchPnpmDeps`. Use `4` for new packages:
|
This is the version of the output of `fetchPnpmDeps`. New packages should use `4`:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
@@ -491,7 +511,7 @@ This is the version of the output of `fetchPnpmDeps`. Use `4` for new packages:
|
|||||||
When upgrading to a newer `fetcherVersion`, you need to regenerate the hash.
|
When upgrading to a newer `fetcherVersion`, you need to regenerate the hash.
|
||||||
|
|
||||||
This variable ensures that we can make changes to the output of `fetchPnpmDeps` without breaking existing hashes.
|
This variable ensures that we can make changes to the output of `fetchPnpmDeps` without breaking existing hashes.
|
||||||
Changes can include workarounds or bug fixes to existing pnpm issues.
|
Changes can include workarounds or bug fixes to existing PNPM issues.
|
||||||
|
|
||||||
##### Version history {#javascript-pnpm-fetcherVersion-versionHistory}
|
##### Version history {#javascript-pnpm-fetcherVersion-versionHistory}
|
||||||
|
|
||||||
@@ -504,9 +524,9 @@ Version 3 is the minimum supported value. Versions 1 and 2 were removed in the 2
|
|||||||
|
|
||||||
### Yarn {#javascript-yarn}
|
### Yarn {#javascript-yarn}
|
||||||
|
|
||||||
Yarn-based projects use a `yarn.lock` file instead of a `package-lock.json` to pin dependencies.
|
Yarn based projects use a `yarn.lock` file instead of a `package-lock.json` to pin dependencies.
|
||||||
|
|
||||||
To package Yarn-based applications, you need to distinguish by the version pointers in the `yarn.lock` file. See the following sections.
|
To package yarn-based applications, you need to distinguish by the version pointers in the `yarn.lock` file. See the following sections.
|
||||||
|
|
||||||
#### Yarn v1 {#javascript-yarn-v1}
|
#### Yarn v1 {#javascript-yarn-v1}
|
||||||
|
|
||||||
@@ -562,29 +582,6 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
##### `fetchYarnDeps` arguments {#javascript-fetchyarndeps}
|
|
||||||
|
|
||||||
`fetchYarnDeps` accepts the following arguments:
|
|
||||||
|
|
||||||
- `yarnLock`: Path to the `yarn.lock` file to fetch dependencies for.
|
|
||||||
- `hash` (or `sha256`): The output hash of the offline cache.
|
|
||||||
- `mirrorUrl`: Optional registry mirror URL used in place of the default yarn
|
|
||||||
registry (`https://registry.yarnpkg.com/`). When set, any resolved URL
|
|
||||||
pointing at the default registry is rewritten to use this mirror before
|
|
||||||
downloading. This is useful for pointing at a local or internal registry
|
|
||||||
mirror. Note that changing the mirror does not change the output hash, since
|
|
||||||
the downloaded contents are identical.
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
yarnOfflineCache = fetchYarnDeps {
|
|
||||||
yarnLock = finalAttrs.src + "/yarn.lock";
|
|
||||||
mirrorUrl = "https://registry.npmmirror.com/";
|
|
||||||
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
##### `yarnConfigHook` arguments {#javascript-yarnconfighook}
|
##### `yarnConfigHook` arguments {#javascript-yarnconfighook}
|
||||||
|
|
||||||
By default, `yarnConfigHook` relies upon the attribute `${yarnOfflineCache}` (or `${offlineCache}` if the former is not set) to find the location of the offline cache produced by `fetchYarnDeps`. To disable this phase, you can set `dontYarnInstallDeps = true` or override the `configurePhase`.
|
By default, `yarnConfigHook` relies upon the attribute `${yarnOfflineCache}` (or `${offlineCache}` if the former is not set) to find the location of the offline cache produced by `fetchYarnDeps`. To disable this phase, you can set `dontYarnInstallDeps = true` or override the `configurePhase`.
|
||||||
@@ -598,12 +595,12 @@ This script by default runs `yarn --offline build`, and it relies upon the proje
|
|||||||
|
|
||||||
##### `yarnInstallHook` arguments {#javascript-yarninstallhook}
|
##### `yarnInstallHook` arguments {#javascript-yarninstallhook}
|
||||||
|
|
||||||
To install the package, `yarnInstallHook` uses both `npm` and `yarn` to clean up project files and dependencies. To disable this phase, you can set `dontYarnInstall = true` or override the `installPhase`. Below is a list of additional `mkDerivation` arguments read by this hook:
|
To install the package `yarnInstallHook` uses both `npm` and `yarn` to cleanup project files and dependencies. To disable this phase, you can set `dontYarnInstall = true` or override the `installPhase`. Below is a list of additional `mkDerivation` arguments read by this hook:
|
||||||
|
|
||||||
- `yarnKeepDevDeps`: Disables the removal of devDependencies from `node_modules` before installation.
|
- `yarnKeepDevDeps`: Disables the removal of devDependencies from `node_modules` before installation.
|
||||||
|
|
||||||
#### Yarn Berry v3/v4 {#javascript-yarn-v3-v4}
|
#### Yarn Berry v3/v4 {#javascript-yarn-v3-v4}
|
||||||
Yarn Berry (v3 / v4) versions have similar formats. They start with blocks like these:
|
Yarn Berry (v3 / v4) have similar formats, they start with blocks like these:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
__metadata:
|
__metadata:
|
||||||
@@ -623,7 +620,7 @@ For these packages, we have some helpers exposed under the respective `yarn-berr
|
|||||||
- `fetchYarnBerryDeps`
|
- `fetchYarnBerryDeps`
|
||||||
- `yarnBerryConfigHook`
|
- `yarnBerryConfigHook`
|
||||||
|
|
||||||
Explicitly pin the major version. For example, capture the `yarn-berry_Xn` argument and re-define it as a `yarn-berry` `let` binding.
|
It's recommended to ensure you're explicitly pinning the major version used, for example by capturing the `yarn-berry_Xn` argument and then re-defining it as a `yarn-berry` `let` binding.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
@@ -659,26 +656,26 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
##### `yarn-berry_X.fetchYarnBerryDeps` {#javascript-fetchYarnBerryDeps}
|
##### `yarn-berry_X.fetchYarnBerryDeps` {#javascript-fetchYarnBerryDeps}
|
||||||
`fetchYarnBerryDeps` runs `yarn-berry-fetcher fetch` in a fixed-output-derivation. It is a custom fetcher designed to reproducibly download all files in the `yarn.lock` file, validating their hashes in the process. For git dependencies, it creates a checkout at `${offlineCache}/checkouts/<40-character-commit-hash>` (relying on the git commit hash to describe the contents of the checkout).
|
`fetchYarnBerryDeps` runs `yarn-berry-fetcher fetch` in a fixed-output-derivation. It is a custom fetcher designed to reproducibly download all files in the `yarn.lock` file, validating their hashes in the process. For git dependencies, it creates a checkout at `${offlineCache}/checkouts/<40-character-commit-hash>` (relying on the git commit hash to describe the contents of the checkout).
|
||||||
|
|
||||||
To produce the `hash` argument for the `fetchYarnBerryDeps` call, run `yarn-berry-fetcher prefetch`:
|
To produce the `hash` argument for `fetchYarnBerryDeps` function call, the `yarn-berry-fetcher prefetch` command can be used:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ yarn-berry-fetcher prefetch </path/to/yarn.lock> [/path/to/missing-hashes.json]
|
$ yarn-berry-fetcher prefetch </path/to/yarn.lock> [/path/to/missing-hashes.json]
|
||||||
```
|
```
|
||||||
|
|
||||||
This prints the hash to stdout. Use it in update scripts to recalculate the hash for a new `yarn.lock`.
|
This prints the hash to stdout and can be used in update scripts to recalculate the hash for a new version of `yarn.lock`.
|
||||||
|
|
||||||
##### `yarn-berry_X.yarnBerryConfigHook` {#javascript-yarnBerryConfigHook}
|
##### `yarn-berry_X.yarnBerryConfigHook` {#javascript-yarnBerryConfigHook}
|
||||||
`yarnBerryConfigHook` uses the store path `offlineCache` points to, to run a `yarn install` during the build, producing a usable `node_modules` directory from the downloaded dependencies.
|
`yarnBerryConfigHook` uses the store path `offlineCache` points to, to run a `yarn install` during the build, producing a usable `node_modules` directory from the downloaded dependencies.
|
||||||
|
|
||||||
Internally, this uses a patched version of Yarn to ensure git dependencies are re-packed and any attempted downloads fail immediately.
|
Internally, this uses a patched version of Yarn to ensure git dependencies are re-packed and any attempted downloads fail immediately.
|
||||||
|
|
||||||
##### Patching the project's `package.json` or `yarn.lock` files {#javascript-yarnBerry-patching}
|
##### Patching upstream `package.json` or `yarn.lock` files {#javascript-yarnBerry-patching}
|
||||||
In case patching the project's `package.json` or `yarn.lock` is needed, it's important to pass `finalAttrs.patches` to `fetchYarnBerryDeps` as well, so the patched variants are picked up (i.e., `inherit (finalAttrs) patches`).
|
In case patching the upstream `package.json` or `yarn.lock` is needed, it's important to pass `finalAttrs.patches` to `fetchYarnBerryDeps` as well, so the patched variants are picked up (i.e., `inherit (finalAttrs) patches`.
|
||||||
|
|
||||||
##### Missing hashes in the `yarn.lock` file {#javascript-yarnBerry-missing-hashes}
|
##### Missing hashes in the `yarn.lock` file {#javascript-yarnBerry-missing-hashes}
|
||||||
Unfortunately, `yarn.lock` files do not include hashes for optional/platform-specific dependencies. This is [by design](https://github.com/yarnpkg/berry/issues/6759).
|
Unfortunately, `yarn.lock` files do not include hashes for optional/platform-specific dependencies. This is [by design](https://github.com/yarnpkg/berry/issues/6759).
|
||||||
|
|
||||||
To compensate for this, run the `yarn-berry-fetcher missing-hashes` subcommand to produce all missing hashes. These are stored in a `missing-hashes.json` file, which needs to be passed to both the build itself, as well as the `fetchYarnBerryDeps` helper:
|
To compensate for this, the `yarn-berry-fetcher missing-hashes` subcommand can be used to produce all missing hashes. These are usually stored in a `missing-hashes.json` file, which needs to be passed to both the build itself, as well as the `fetchYarnBerryDeps` helper:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
@@ -721,7 +718,7 @@ If you are packaging something outside Nixpkgs, consider the following:
|
|||||||
|
|
||||||
### npmlock2nix {#javascript-npmlock2nix}
|
### npmlock2nix {#javascript-npmlock2nix}
|
||||||
|
|
||||||
[npmlock2nix](https://github.com/nix-community/npmlock2nix) aims at building `node_modules` without code generation. It hasn't reached v1 yet; the API may change.
|
[npmlock2nix](https://github.com/nix-community/npmlock2nix) aims at building `node_modules` without code generation. It hasn't reached v1 yet, the API might be subject to change.
|
||||||
|
|
||||||
#### Pitfalls {#javascript-npmlock2nix-pitfalls}
|
#### Pitfalls {#javascript-npmlock2nix-pitfalls}
|
||||||
|
|
||||||
@@ -729,7 +726,7 @@ There are some [problems with npm v7](https://github.com/tweag/npmlock2nix/issue
|
|||||||
|
|
||||||
### nix-npm-buildpackage {#javascript-nix-npm-buildpackage}
|
### nix-npm-buildpackage {#javascript-nix-npm-buildpackage}
|
||||||
|
|
||||||
[nix-npm-buildpackage](https://github.com/serokell/nix-npm-buildpackage) aims at building `node_modules` without code generation. It hasn't reached v1 yet; the API may change. It supports both `package-lock.json` and yarn.lock.
|
[nix-npm-buildpackage](https://github.com/serokell/nix-npm-buildpackage) aims at building `node_modules` without code generation. It hasn't reached v1 yet, the API might change. It supports both `package-lock.json` and yarn.lock.
|
||||||
|
|
||||||
#### Pitfalls {#javascript-nix-npm-buildpackage-pitfalls}
|
#### Pitfalls {#javascript-nix-npm-buildpackage-pitfalls}
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,6 @@
|
|||||||
# Nixpkgs `lib` {#id-1.4}
|
# Nixpkgs `lib` {#id-1.4}
|
||||||
|
|
||||||
|
```{=include=} chapters
|
||||||
|
functions.md
|
||||||
|
module-system/module-system.chapter.md
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,6 +1,27 @@
|
|||||||
# Nixpkgs Manual {#nixpkgs-manual}
|
# Nixpkgs Manual {#nixpkgs-manual}
|
||||||
## Version @MANUAL_VERSION@
|
## Version @MANUAL_VERSION@
|
||||||
|
|
||||||
|
```{=include=} chapters
|
||||||
|
preface.chapter.md
|
||||||
|
```
|
||||||
|
|
||||||
|
```{=include=} parts
|
||||||
|
getting-started/getting-started.part.md
|
||||||
|
using-nixpkgs.md
|
||||||
|
lib.md
|
||||||
|
stdenv.md
|
||||||
|
toolchains.md
|
||||||
|
build-helpers.md
|
||||||
|
modules/index.md
|
||||||
|
development.md
|
||||||
|
contributing.md
|
||||||
|
interoperability.md
|
||||||
|
```
|
||||||
|
|
||||||
|
```{=include=} chapters
|
||||||
|
languages-frameworks/index.md
|
||||||
|
```
|
||||||
|
|
||||||
```{=include=} appendix html:into-file=//release-notes.html
|
```{=include=} appendix html:into-file=//release-notes.html
|
||||||
release-notes/release-notes.md
|
release-notes/release-notes.md
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -4,5 +4,9 @@ The Nixpkgs repository provides [Module System] modules for various purposes.
|
|||||||
|
|
||||||
The following sections are organized by [module class].
|
The following sections are organized by [module class].
|
||||||
|
|
||||||
|
```{=include=} chapters
|
||||||
|
generic.chapter.md
|
||||||
|
```
|
||||||
|
|
||||||
[Module System]: https://nixos.org/manual/nixpkgs/unstable/#module-system
|
[Module System]: https://nixos.org/manual/nixpkgs/unstable/#module-system
|
||||||
[module class]: https://nixos.org/manual/nixpkgs/unstable/#module-system-lib-evalModules-param-class
|
[module class]: https://nixos.org/manual/nixpkgs/unstable/#module-system-lib-evalModules-param-class
|
||||||
|
|||||||
668
doc/nav.json
668
doc/nav.json
@@ -1,670 +1,4 @@
|
|||||||
{
|
{
|
||||||
"open": [],
|
"open": [],
|
||||||
"items": [
|
"items": []
|
||||||
{
|
|
||||||
"file": "preface.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Getting started",
|
|
||||||
"id": "getting-started",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"file": "getting-started/getting-started.part.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "getting-started/first-package.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "getting-started/dev-environments.md"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Guides",
|
|
||||||
"id": "guides",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"file": "using-nixpkgs.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "channels.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "using/platform-support.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "using/configuration.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "using/overlays.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "using/overrides.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Standard environment",
|
|
||||||
"id": "part-stdenv",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"file": "stdenv.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "stdenv/stdenv.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "stdenv/meta.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "stdenv/passthru.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "stdenv/multiple-output.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "stdenv/cross-compilation.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "stdenv/platform-notes.chapter.md"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Languages and frameworks",
|
|
||||||
"id": "chap-language-support",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/index.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/agda.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/android.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/astal.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/beam.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/chicken.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/cosmic.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/crystal.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/cuda.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/cuelang.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/dart.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/dhall.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/dlang.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/dotnet.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/emscripten.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/factor.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/gnome.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/go.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/gradle.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/hare.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/haskell.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/hy.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/idris.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/idris2.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/ios.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/java.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/javascript.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/julia.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/lean4.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/lisp.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/lua.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/maven.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/nim.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/ocaml.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/octave.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/perl.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/php.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/pkg-config.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/python.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/qt.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/r.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/rocq.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/ruby.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/rust.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/scheme.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/swift.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/tcl.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/texlive.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/typst.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/vim.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "languages-frameworks/neovim.section.md"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Toolchains",
|
|
||||||
"id": "part-toolchains",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"file": "toolchains.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "toolchains/llvm.chapter.md"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Build helpers",
|
|
||||||
"id": "part-builders",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"file": "build-helpers.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/fixed-point-arguments.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/fetchers.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/trivial-build-helpers.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/testers.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/dev-shell-tools.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Special build helpers",
|
|
||||||
"id": "chap-special",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"file": "build-helpers/special.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/special/buildenv.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/special/fakenss.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/special/fhs-environments.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/special/makesetuphook.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/special/mkshell.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/special/vm-tools.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/special/checkpoint-build.section.md"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Images",
|
|
||||||
"id": "chap-images",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"file": "build-helpers/images.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/images/appimagetools.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/images/dockertools.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/images/ocitools.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/images/portableservice.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/images/makediskimage.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "build-helpers/images/binarycache.section.md"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Hooks reference",
|
|
||||||
"id": "chap-hooks",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"file": "hooks/index.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/autoconf.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/automake.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/autopatchcil.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/autopatchelf.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/aws-c-common.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/bmake.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/breakpoint.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/cernlib.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/check-phase-thread-limit-hook.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/cmake.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/desktop-file-utils.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/gdk-pixbuf.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/gnome.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/haredo.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/installAgentSkills.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/installShellFiles.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/installFonts.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/juce.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/julec.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/just.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/libglycin.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/libiconv.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/libxml2.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/memcached-test-hook.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/meson.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/mpi-check-hook.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/ninja.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/nodejs-install-executables.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/nodejs-install-manuals.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/npm-build-hook.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/npm-config-hook.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/npm-install-hook.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/patch-rc-path-hooks.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/perl.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/pkg-config.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/pnpm.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/postgresql-test-hook.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/premake.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/python.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/redis-test-hook.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/scons.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/tauri.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/tetex-tex-live.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/udevCheckHook.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/unzip.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/validatePkgConfig.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/versionCheckHook.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/waf.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/writable-tmpdir-as-home-hook.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/zig.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/xcbuild.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "hooks/xfce4-dev-tools.section.md"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Packages",
|
|
||||||
"id": "chap-packages",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"file": "packages/index.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/citrix.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/darwin-builder.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/dlib.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/eclipse.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/elm.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/emacs.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/firefox.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/friction-graphics.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/fish.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/fuse.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/geant4.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/ibus.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/inkscape.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/kakoune.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/krita.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/linux.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/lhapdf.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/locales.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/etc-files.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/nginx.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/nrfutil.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/opengl.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/packer.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/shell-helpers.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/python-tree-sitter.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "treefmt",
|
|
||||||
"id": "treefmt",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"file": "packages/treefmt.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id-prefix": "auto-generated-treefmt-functions",
|
|
||||||
"file": "packages/treefmt-functions.section.md"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/steam.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/cataclysm-dda.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/urxvt.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/vcpkg.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/weechat.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/uv.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "packages/build-support.md"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Modules",
|
|
||||||
"id": "modules",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"file": "modules/index.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "modules/generic.chapter.md"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Reference",
|
|
||||||
"id": "reference",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"file": "lib.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "functions.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "functions/library.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"collection": "lib-functions.json",
|
|
||||||
"type": "nixdoc"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "functions/generators.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "functions/debug.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "functions/prefer-remote-fetch.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "functions/nix-gitignore.section.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "module-system/module-system.chapter.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Interoperability Standards",
|
|
||||||
"id": "part-interoperability",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"file": "interoperability.md"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "interoperability/cyclonedx.md"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "contributing.md"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,26 +6,6 @@ The [Citrix Workspace App](https://www.citrix.com/products/workspace-app/) is a
|
|||||||
|
|
||||||
The tarball archive needs to be downloaded manually, as the license agreements of the vendor for [Citrix Workspace](https://www.citrix.com/downloads/workspace-app/linux/workspace-app-for-linux-latest.html) needs to be accepted first. Then run `nix-prefetch-url file://$PWD/linuxx64-$version.tar.gz`. With the archive available in the store, the package can be built and installed with Nix.
|
The tarball archive needs to be downloaded manually, as the license agreements of the vendor for [Citrix Workspace](https://www.citrix.com/downloads/workspace-app/linux/workspace-app-for-linux-latest.html) needs to be accepted first. Then run `nix-prefetch-url file://$PWD/linuxx64-$version.tar.gz`. With the archive available in the store, the package can be built and installed with Nix.
|
||||||
|
|
||||||
The package includes the `ctxcwalogd.service` user unit required by Citrix's logging tools.
|
|
||||||
To enable it on NixOS:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
systemd.packages = [ pkgs.citrix-workspace ];
|
|
||||||
systemd.user.services.ctxcwalogd.wantedBy = [ "default.target" ];
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
For FUSE-based file transfer, enable the privileged helper on NixOS:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
programs.fuse.enable = true;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The package uses `/run/wrappers/bin/fusermount3` when it is available.
|
|
||||||
|
|
||||||
## Citrix Self-service {#sec-citrix-selfservice}
|
## Citrix Self-service {#sec-citrix-selfservice}
|
||||||
|
|
||||||
The [self-service](https://support.citrix.com/article/CTX200337) is an application for managing Citrix desktops and applications. Please note that this feature only works with at least `citrix_workspace_20_06_0` and later versions.
|
The [self-service](https://support.citrix.com/article/CTX200337) is an application for managing Citrix desktops and applications. Please note that this feature only works with at least `citrix_workspace_20_06_0` and later versions.
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ running NixOS integration tests on the builder (macOS 15+, M3 or newer).
|
|||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "https://channels.nixos.org/nixpkgs-26.05-darwin/nixexprs.tar.zst";
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-22.11-darwin";
|
||||||
darwin.url = "github:nix-darwin/nix-darwin/master";
|
darwin.url = "github:nix-darwin/nix-darwin/master";
|
||||||
darwin.inputs.nixpkgs.follows = "nixpkgs";
|
darwin.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +1,39 @@
|
|||||||
# Packages {#chap-packages}
|
# Packages {#chap-packages}
|
||||||
|
|
||||||
This chapter contains information about how to use and maintain the Nix expressions for a number of specific packages, such as the Linux kernel or X.org.
|
This chapter contains information about how to use and maintain the Nix expressions for a number of specific packages, such as the Linux kernel or X.org.
|
||||||
|
|
||||||
|
```{=include=} sections
|
||||||
|
citrix.section.md
|
||||||
|
darwin-builder.section.md
|
||||||
|
dlib.section.md
|
||||||
|
eclipse.section.md
|
||||||
|
elm.section.md
|
||||||
|
emacs.section.md
|
||||||
|
firefox.section.md
|
||||||
|
friction-graphics.section.md
|
||||||
|
fish.section.md
|
||||||
|
fuse.section.md
|
||||||
|
geant4.section.md
|
||||||
|
ibus.section.md
|
||||||
|
inkscape.section.md
|
||||||
|
kakoune.section.md
|
||||||
|
krita.section.md
|
||||||
|
linux.section.md
|
||||||
|
lhapdf.section.md
|
||||||
|
locales.section.md
|
||||||
|
etc-files.section.md
|
||||||
|
nginx.section.md
|
||||||
|
nrfutil.section.md
|
||||||
|
opengl.section.md
|
||||||
|
packer.section.md
|
||||||
|
shell-helpers.section.md
|
||||||
|
python-tree-sitter.section.md
|
||||||
|
treefmt.section.md
|
||||||
|
steam.section.md
|
||||||
|
cataclysm-dda.section.md
|
||||||
|
urxvt.section.md
|
||||||
|
vcpkg.section.md
|
||||||
|
weechat.section.md
|
||||||
|
uv.section.md
|
||||||
|
build-support.md
|
||||||
|
```
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ provides functions for configuring treefmt using the module system, which are [d
|
|||||||
|
|
||||||
Alternatively, treefmt can be configured using [treefmt-nix](https://github.com/numtide/treefmt-nix).
|
Alternatively, treefmt can be configured using [treefmt-nix](https://github.com/numtide/treefmt-nix).
|
||||||
|
|
||||||
|
```{=include=} sections auto-id-prefix=auto-generated-treefmt-functions
|
||||||
|
treefmt-functions.section.md
|
||||||
|
```
|
||||||
|
|
||||||
## Options Reference {#sec-treefmt-options-reference}
|
## Options Reference {#sec-treefmt-options-reference}
|
||||||
|
|
||||||
The following attributes can be passed to [`withConfig`](#pkgs.treefmt.withConfig) or [`evalConfig`](#pkgs.treefmt.evalConfig):
|
The following attributes can be passed to [`withConfig`](#pkgs.treefmt.withConfig) or [`evalConfig`](#pkgs.treefmt.evalConfig):
|
||||||
@@ -16,3 +20,4 @@ id-prefix: opt-treefmt-
|
|||||||
list-id: configuration-variable-list
|
list-id: configuration-variable-list
|
||||||
source: ../treefmt-options.json
|
source: ../treefmt-options.json
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -140,15 +140,9 @@
|
|||||||
"ex-testEqualArrayOrMap-test-function-add-cowbell": [
|
"ex-testEqualArrayOrMap-test-function-add-cowbell": [
|
||||||
"index.html#ex-testEqualArrayOrMap-test-function-add-cowbell"
|
"index.html#ex-testEqualArrayOrMap-test-function-add-cowbell"
|
||||||
],
|
],
|
||||||
"ex-trivial-builder-finalAttrs": [
|
|
||||||
"index.html#ex-trivial-builder-finalAttrs"
|
|
||||||
],
|
|
||||||
"ex-writeShellApplication": [
|
"ex-writeShellApplication": [
|
||||||
"index.html#ex-writeShellApplication"
|
"index.html#ex-writeShellApplication"
|
||||||
],
|
],
|
||||||
"fetchfromtangled": [
|
|
||||||
"index.html#fetchfromtangled"
|
|
||||||
],
|
|
||||||
"first-package-go": [
|
"first-package-go": [
|
||||||
"index.html#first-package-go"
|
"index.html#first-package-go"
|
||||||
],
|
],
|
||||||
@@ -170,15 +164,6 @@
|
|||||||
"inkscape-plugins": [
|
"inkscape-plugins": [
|
||||||
"index.html#inkscape-plugins"
|
"index.html#inkscape-plugins"
|
||||||
],
|
],
|
||||||
"installAgentSkills": [
|
|
||||||
"index.html#installAgentSkills"
|
|
||||||
],
|
|
||||||
"installAgentSkills-installSkill": [
|
|
||||||
"index.html#installAgentSkills-installSkill"
|
|
||||||
],
|
|
||||||
"installAgentSkills-installSkill-exampleusage": [
|
|
||||||
"index.html#installAgentSkills-installSkill-exampleusage"
|
|
||||||
],
|
|
||||||
"installfonts": [
|
"installfonts": [
|
||||||
"index.html#installfonts"
|
"index.html#installfonts"
|
||||||
],
|
],
|
||||||
@@ -230,21 +215,6 @@
|
|||||||
"julec-hook-variables": [
|
"julec-hook-variables": [
|
||||||
"index.html#julec-hook-variables"
|
"index.html#julec-hook-variables"
|
||||||
],
|
],
|
||||||
"juce-projucer-hook": [
|
|
||||||
"index.html#juce-projucer-hook"
|
|
||||||
],
|
|
||||||
"juce-projucer-hook-example": [
|
|
||||||
"index.html#juce-projucer-hook-example"
|
|
||||||
],
|
|
||||||
"juce-projucer-hook-variables": [
|
|
||||||
"index.html#juce-projucer-hook-variables"
|
|
||||||
],
|
|
||||||
"juce-dontuseprojucerconfigure": [
|
|
||||||
"index.html#juce-dontuseprojucerconfigure"
|
|
||||||
],
|
|
||||||
"juce-dontuseprojucerinstall": [
|
|
||||||
"index.html#juce-dontuseprojucerinstall"
|
|
||||||
],
|
|
||||||
"libcxxhardeningextensive": [
|
"libcxxhardeningextensive": [
|
||||||
"index.html#libcxxhardeningextensive"
|
"index.html#libcxxhardeningextensive"
|
||||||
],
|
],
|
||||||
@@ -473,9 +443,6 @@
|
|||||||
"sec-building-packages-with-llvm-using-clang-stdenv": [
|
"sec-building-packages-with-llvm-using-clang-stdenv": [
|
||||||
"index.html#sec-building-packages-with-llvm-using-clang-stdenv"
|
"index.html#sec-building-packages-with-llvm-using-clang-stdenv"
|
||||||
],
|
],
|
||||||
"sec-chicken-package-sets": [
|
|
||||||
"index.html#sec-chicken-package-sets"
|
|
||||||
],
|
|
||||||
"sec-darwin-availability-checks": [
|
"sec-darwin-availability-checks": [
|
||||||
"index.html#sec-darwin-availability-checks"
|
"index.html#sec-darwin-availability-checks"
|
||||||
],
|
],
|
||||||
@@ -1014,9 +981,6 @@
|
|||||||
"treefmt": [
|
"treefmt": [
|
||||||
"index.html#treefmt"
|
"index.html#treefmt"
|
||||||
],
|
],
|
||||||
"trivial-builder-finalAttrs": [
|
|
||||||
"index.html#trivial-builder-finalAttrs"
|
|
||||||
],
|
|
||||||
"typst": [
|
"typst": [
|
||||||
"index.html#typst",
|
"index.html#typst",
|
||||||
"doc/languages-frameworks/typst.section.md#typst"
|
"doc/languages-frameworks/typst.section.md#typst"
|
||||||
@@ -2483,18 +2447,6 @@
|
|||||||
"sec-checkpoint-build-example": [
|
"sec-checkpoint-build-example": [
|
||||||
"index.html#sec-checkpoint-build-example"
|
"index.html#sec-checkpoint-build-example"
|
||||||
],
|
],
|
||||||
"sec-redisTestHook": [
|
|
||||||
"index.html#sec-redisTestHook"
|
|
||||||
],
|
|
||||||
"sec-redisTestHook-variables": [
|
|
||||||
"index.html#sec-redisTestHook-variables"
|
|
||||||
],
|
|
||||||
"sec-memcachedTestHook": [
|
|
||||||
"index.html#sec-memcachedTestHook"
|
|
||||||
],
|
|
||||||
"sec-memcachedTestHook-variables": [
|
|
||||||
"index.html#sec-memcachedTestHook-variables"
|
|
||||||
],
|
|
||||||
"chap-images": [
|
"chap-images": [
|
||||||
"index.html#chap-images"
|
"index.html#chap-images"
|
||||||
],
|
],
|
||||||
@@ -2846,6 +2798,9 @@
|
|||||||
"glycin-dont-wrap": [
|
"glycin-dont-wrap": [
|
||||||
"index.html#glycin-dont-wrap"
|
"index.html#glycin-dont-wrap"
|
||||||
],
|
],
|
||||||
|
"ghc": [
|
||||||
|
"index.html#ghc"
|
||||||
|
],
|
||||||
"gnome-platform": [
|
"gnome-platform": [
|
||||||
"index.html#gnome-platform"
|
"index.html#gnome-platform"
|
||||||
],
|
],
|
||||||
@@ -3693,8 +3648,7 @@
|
|||||||
"index.html#hareHook-cross-compilation"
|
"index.html#hareHook-cross-compilation"
|
||||||
],
|
],
|
||||||
"haskell": [
|
"haskell": [
|
||||||
"index.html#haskell",
|
"index.html#haskell"
|
||||||
"index.html#ghc"
|
|
||||||
],
|
],
|
||||||
"haskell-available-packages": [
|
"haskell-available-packages": [
|
||||||
"index.html#haskell-available-packages"
|
"index.html#haskell-available-packages"
|
||||||
@@ -3823,9 +3777,15 @@
|
|||||||
"index.html#language-javascript"
|
"index.html#language-javascript"
|
||||||
],
|
],
|
||||||
"javascript-introduction": [
|
"javascript-introduction": [
|
||||||
"index.html#javascript-introduction",
|
"index.html#javascript-introduction"
|
||||||
"index.html#javascript-finding-examples",
|
],
|
||||||
"index.html#javascript-finding-examples-github",
|
"javascript-finding-examples": [
|
||||||
|
"index.html#javascript-finding-examples"
|
||||||
|
],
|
||||||
|
"javascript-finding-examples-github": [
|
||||||
|
"index.html#javascript-finding-examples-github"
|
||||||
|
],
|
||||||
|
"javascript-finding-examples-gitlab": [
|
||||||
"index.html#javascript-finding-examples-gitlab"
|
"index.html#javascript-finding-examples-gitlab"
|
||||||
],
|
],
|
||||||
"javascript-tools-overview": [
|
"javascript-tools-overview": [
|
||||||
@@ -3906,9 +3866,6 @@
|
|||||||
"javascript-yarn-v3-v4": [
|
"javascript-yarn-v3-v4": [
|
||||||
"index.html#javascript-yarn-v3-v4"
|
"index.html#javascript-yarn-v3-v4"
|
||||||
],
|
],
|
||||||
"javascript-fetchyarndeps": [
|
|
||||||
"index.html#javascript-fetchyarndeps"
|
|
||||||
],
|
|
||||||
"javascript-yarnconfighook": [
|
"javascript-yarnconfighook": [
|
||||||
"index.html#javascript-yarnconfighook"
|
"index.html#javascript-yarnconfighook"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -16,11 +16,6 @@
|
|||||||
+nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.zst";
|
+nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.zst";
|
||||||
```
|
```
|
||||||
|
|
||||||
- Emacs has been updated to 31.
|
|
||||||
This introduces some backwards‐incompatible changes; see the NEWS for details.
|
|
||||||
NEWS can be viewed from Emacs by typing `C-h n`, or by clicking `Help->Emacs News` from the menu bar.
|
|
||||||
It can also be browsed [online](https://cgit.git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-31).
|
|
||||||
|
|
||||||
- `sing-box` now supports NaïveProxy outbounds.
|
- `sing-box` now supports NaïveProxy outbounds.
|
||||||
|
|
||||||
## Backward Incompatibilities {#sec-nixpkgs-release-26.11-incompatibilities}
|
## Backward Incompatibilities {#sec-nixpkgs-release-26.11-incompatibilities}
|
||||||
@@ -29,14 +24,6 @@
|
|||||||
|
|
||||||
- `moon` has been updated to `2.x` and needs manual migration. See the [migration guide](https://moonrepo.dev/docs/migrate/2.0) for instructions.
|
- `moon` has been updated to `2.x` and needs manual migration. See the [migration guide](https://moonrepo.dev/docs/migrate/2.0) for instructions.
|
||||||
|
|
||||||
- `yeswiki` has been updated from 4.4.2 to 4.6.7 and now requires PHP 8.3 or newer.
|
|
||||||
The release also removes legacy JSONP endpoints and changes several security-sensitive operations from GET to POST with CSRF tokens.
|
|
||||||
Review the upstream [4.6.7 release notes](https://github.com/YesWiki/yeswiki/releases/tag/v4.6.7) before upgrading custom themes or integrations.
|
|
||||||
|
|
||||||
- `perlPackages.NetOAuth` has been updated from 0.28 to 0.33.
|
|
||||||
Callers that verify messages must now set `allowed_signature_methods` per message or configure `@Net::OAuth::ALLOWED_SIGNATURE_METHODS`; `verify` otherwise throws an exception.
|
|
||||||
See the [upstream changelog](https://metacpan.org/dist/Net-OAuth/changes) for details.
|
|
||||||
|
|
||||||
- []{#x86_64-darwin-26.11}
|
- []{#x86_64-darwin-26.11}
|
||||||
|
|
||||||
Support for `x86_64-darwin` has been dropped, due to Apple’s deprecation of the platform and limited build infrastructure and developer time.
|
Support for `x86_64-darwin` has been dropped, due to Apple’s deprecation of the platform and limited build infrastructure and developer time.
|
||||||
@@ -51,28 +38,17 @@
|
|||||||
- `bundlerApp` now sets `__structuredAttrs = true` for its result package.
|
- `bundlerApp` now sets `__structuredAttrs = true` for its result package.
|
||||||
Out-of-tree packages passing `postBuild` to `bundlerApp` should examine if their `postBuild` commands are compatible with structured attributes.
|
Out-of-tree packages passing `postBuild` to `bundlerApp` should examine if their `postBuild` commands are compatible with structured attributes.
|
||||||
|
|
||||||
- `praat` has been updated to `7.x.x`, which changes the location of the settings file, buttons file, and plug-ins to standardized locations for each platform. This is a breaking change for plug-in writers and users of the sendpraat subroutine.
|
|
||||||
|
|
||||||
- `databricks-cli` has been updated from `0.290.2` to `1.x.x`, the first major release. OAuth tokens for interactive logins (`auth_type = databricks-cli`) are now stored in the OS-native secure store by default (Secret Service on Linux) instead of `~/.databricks/token-cache.json`; cached tokens from older versions are not migrated, so run `databricks auth login` once per profile after upgrading. To keep the previous file-backed storage, set `DATABRICKS_AUTH_STORAGE=plaintext` or add `auth_storage = plaintext` under `[__settings__]` in `~/.databrickscfg`. Additionally, the `vector_search_endpoints` DABs resource renamed `min_qps` to `target_qps` (and the `vector-search-endpoints` command renamed `--min-qps` to `--target-qps`). See the [upstream changelog](https://github.com/databricks/cli/blob/main/CHANGELOG.md) for details.
|
- `databricks-cli` has been updated from `0.290.2` to `1.x.x`, the first major release. OAuth tokens for interactive logins (`auth_type = databricks-cli`) are now stored in the OS-native secure store by default (Secret Service on Linux) instead of `~/.databricks/token-cache.json`; cached tokens from older versions are not migrated, so run `databricks auth login` once per profile after upgrading. To keep the previous file-backed storage, set `DATABRICKS_AUTH_STORAGE=plaintext` or add `auth_storage = plaintext` under `[__settings__]` in `~/.databrickscfg`. Additionally, the `vector_search_endpoints` DABs resource renamed `min_qps` to `target_qps` (and the `vector-search-endpoints` command renamed `--min-qps` to `--target-qps`). See the [upstream changelog](https://github.com/databricks/cli/blob/main/CHANGELOG.md) for details.
|
||||||
|
|
||||||
- Gradle 7 has been removed because it is end-of-life. Please [upgrade to a newer version of Gradle](https://docs.gradle.org/current/userguide/upgrading_version_7.html).
|
|
||||||
|
|
||||||
- `hurl` has been updated to `8.x.x` which has some breaking changes. See [upstream changelog](https://github.com/Orange-OpenSource/hurl/releases/tag/8.0.0) for details.
|
- `hurl` has been updated to `8.x.x` which has some breaking changes. See [upstream changelog](https://github.com/Orange-OpenSource/hurl/releases/tag/8.0.0) for details.
|
||||||
|
|
||||||
- The existing `wasm32-wasi` target has become `wasm32-wasip1` and `pkgsCross.wasi32` has become `pkgsCross.wasm32-wasip1`, aligning with LLVM's nomenclature. Aliases are in place and old forms will continue to be parsed but there might be some breakage if you're relying on the exact form of these (e.g., in sysroot paths).
|
- The existing `wasm32-wasi` target has become `wasm32-wasip1` and `pkgsCross.wasi32` has become `pkgsCross.wasm32-wasip1`, aligning with LLVM's nomenclature. Aliases are in place and old forms will continue to be parsed but there might be some breakage if you're relying on the exact form of these (e.g., in sysroot paths).
|
||||||
|
|
||||||
- `sing-box` has been updated to 1.14.0, which has removed some deprecated options. See [upstream documentation](https://sing-box.sagernet.org/migration/) for details and migration options.
|
|
||||||
|
|
||||||
- `gotosocial` has been updated to 0.22.0. This release contains a very long database migration, which should not be cancelled or interrupted under any circumstances.
|
- `gotosocial` has been updated to 0.22.0. This release contains a very long database migration, which should not be cancelled or interrupted under any circumstances.
|
||||||
- Postgres users: Following the migration, if you encounter slowdown on Postgres specifically (ie., timing out while loading timelines) you may need to run some manual database maintenance steps. Please check https://docs.gotosocial.org/en/stable/admin/database_maintenance/#postgres.
|
- Postgres users: Following the migration, if you encounter slowdown on Postgres specifically (ie., timing out while loading timelines) you may need to run some manual database maintenance steps. Please check https://docs.gotosocial.org/en/stable/admin/database_maintenance/#postgres.
|
||||||
|
|
||||||
- `lego` has been updated to 5.x, which has a changed CLI and state layout.
|
|
||||||
See [upstream's v4 to v5 CLI migration guide](https://go-acme.github.io/lego/migration/cli/) for details.
|
|
||||||
|
|
||||||
- `xsecurelock` no longer supports authentication via htaccess files (`~/.xsecurelock.pw`) or via the `pamtester` program by default. Only the recommended PAM module is supported unless rebuilt with `withHtaccess` or `withPamtester`.
|
- `xsecurelock` no longer supports authentication via htaccess files (`~/.xsecurelock.pw`) or via the `pamtester` program by default. Only the recommended PAM module is supported unless rebuilt with `withHtaccess` or `withPamtester`.
|
||||||
|
|
||||||
- `keychain` has been updated to 3.x.x, which is a major and breaking rewrite of the program, including its CLI arguments. See [v3](https://github.com/danielrobbins/keychain/releases/tag/3.0.0) release notes for details and migration.
|
|
||||||
|
|
||||||
- `python3Packages.django-health-check` has been updated to major version 4. See its [migration guide](https://codingjoe.dev/django-health-check/migrate-to-v4/) and [changelog](https://github.com/codingjoe/django-health-check/releases/tag/4.0.0) for breaking changes.
|
- `python3Packages.django-health-check` has been updated to major version 4. See its [migration guide](https://codingjoe.dev/django-health-check/migrate-to-v4/) and [changelog](https://github.com/codingjoe/django-health-check/releases/tag/4.0.0) for breaking changes.
|
||||||
|
|
||||||
- `jmtpfs` has been removed due to lack of maintenance and fuse3 support.
|
- `jmtpfs` has been removed due to lack of maintenance and fuse3 support.
|
||||||
@@ -90,32 +66,24 @@
|
|||||||
- `services.mysql` now sets `root@localhost` authentication to `auth_socket` when used with `mysql` or `percona-server`.
|
- `services.mysql` now sets `root@localhost` authentication to `auth_socket` when used with `mysql` or `percona-server`.
|
||||||
Existing deployments will also be adjusted if possible. See the [security advisory GHSA-6qxx-6rg8-c4p8](https://github.com/NixOS/nixpkgs/security/advisories/GHSA-6qxx-6rg8-c4p8) for more information.
|
Existing deployments will also be adjusted if possible. See the [security advisory GHSA-6qxx-6rg8-c4p8](https://github.com/NixOS/nixpkgs/security/advisories/GHSA-6qxx-6rg8-c4p8) for more information.
|
||||||
|
|
||||||
- `sqlitestudio` has been renamed to `letos` to reflect upstream changes. See [Letos: Name rebranding](https://github.com/pawelsalawa/letos/issues/5441) for more information.
|
|
||||||
|
|
||||||
- `zerofs` has been updated from `1.x` to `2.x` which is a breaking change. Volumes created by earlier releases are refused at open with a clear error. There is no migration tool; older volumes remain readable and writable by the release that created them.
|
- `zerofs` has been updated from `1.x` to `2.x` which is a breaking change. Volumes created by earlier releases are refused at open with a clear error. There is no migration tool; older volumes remain readable and writable by the release that created them.
|
||||||
|
|
||||||
- `keycloak.plugins.keycloak-metrics-spi` has been removed. Keycloak exposes Prometheus metrics natively on its management interface; enable them with the `metrics-enabled` setting (and `event-metrics-user-enabled` for login and event counters). See [Gaining insights with metrics](https://www.keycloak.org/observability/configuration-metrics).
|
- `keycloak.plugins.keycloak-metrics-spi` has been removed. Keycloak exposes Prometheus metrics natively on its management interface; enable them with the `metrics-enabled` setting (and `event-metrics-user-enabled` for login and event counters). See [Gaining insights with metrics](https://www.keycloak.org/observability/configuration-metrics).
|
||||||
|
|
||||||
- `alps` has been rewritten upstream, see [upstream repository](https://github.com/migadu/alps) for documentation.
|
- `alps` has been rewritten upstream, see [upstream repository](https://github.com/migadu/alps) for documentation.
|
||||||
|
|
||||||
- `writers.makeDataWriter` has been removed. It has been deprecated since 2023. Use `pkgs.writeTextFile` instead.
|
|
||||||
|
|
||||||
- `bosun` has been removed as it is no longer maintained upstream. the corresponding monitoring options has been removed.
|
- `bosun` has been removed as it is no longer maintained upstream. the corresponding monitoring options has been removed.
|
||||||
|
|
||||||
- `python3Packages.starlette-admin` v1.0.0 has released, which mainly refactors internals and adds a large set of new features. The high-level API is mostly unchanged, but users migrating from v0.17 may want to view [the migration guide](https://jowilf.github.io/starlette-admin/migration/#from-017x-to-100).
|
|
||||||
|
|
||||||
- `uhttpmock` providing 0.0 ABI was removed. `uhttpmock_1_0` providing 1.0 ABI was renamed to `uhttpmock` and `uhttpmock_1_0` was kept as an alias.
|
- `uhttpmock` providing 0.0 ABI was removed. `uhttpmock_1_0` providing 1.0 ABI was renamed to `uhttpmock` and `uhttpmock_1_0` was kept as an alias.
|
||||||
|
|
||||||
- `himalaya` has been updated from `v1.2.0` to `v2.0.0`, which introduces breaking changes. See the [release notes](https://github.com/pimalaya/himalaya/releases/tag/v2.0.0) and the [migration guide](https://github.com/pimalaya/himalaya/blob/master/MIGRATION.md).
|
- `himalaya` has been updated from `v1.2.0` to `v2.0.0`, which introduces breaking changes. See the [release notes](https://github.com/pimalaya/himalaya/releases/tag/v2.0.0) and the [migration guide](https://github.com/pimalaya/himalaya/blob/master/MIGRATION.md).
|
||||||
|
|
||||||
- `tengine` has been removed as it has seen seriously delayed responses to security vulnerabilities.
|
- `tengine` has been removed as it has seen seriously delayed responses to security vulnerabilities.
|
||||||
|
|
||||||
- `jellyfin` has been upgraded to major version 12, which contains breaking changes. See the [upstream blog post](https://jellyfin.org/posts/jellyfin-release-12.0) for more information on how to safely upgrade.
|
|
||||||
|
|
||||||
- `writeTextFile` now uses structured attributes and `passAsFile` is no longer used or supported.
|
|
||||||
|
|
||||||
- `nix-serve-ng` (and `haskellPackages.nix-serve-ng`) is now built against Lix instead of CppNix, following upstream which has switched to Lix as its supported Nix implementation.
|
- `nix-serve-ng` (and `haskellPackages.nix-serve-ng`) is now built against Lix instead of CppNix, following upstream which has switched to Lix as its supported Nix implementation.
|
||||||
|
|
||||||
|
- `buildPythonPackage` and `buildPythonApplication` now set `__structuredAttrs = true` by default. You can explicitly set `__structuredAttrs = false` in packages broken by this change.
|
||||||
|
|
||||||
- Linux kernel configuration has been moved out of the `linux-kernel` field of the platform structure into the kernel builders:
|
- Linux kernel configuration has been moved out of the `linux-kernel` field of the platform structure into the kernel builders:
|
||||||
- `linux-kernel.name` has been removed.
|
- `linux-kernel.name` has been removed.
|
||||||
- `linux-kernel.target` is available as the `target` parameter and passthru attribute on the kernel builders.
|
- `linux-kernel.target` is available as the `target` parameter and passthru attribute on the kernel builders.
|
||||||
@@ -131,17 +99,10 @@
|
|||||||
`lib.systems.{examples,platforms}.{sheevaplug,pogoplug4}` have been unified into `lib.systems.examples.armv5tel-multiplatform`.
|
`lib.systems.{examples,platforms}.{sheevaplug,pogoplug4}` have been unified into `lib.systems.examples.armv5tel-multiplatform`.
|
||||||
Note that there is no official support for ARMv5 and it is not possible to build even a simple NixOS configuration out of the box.
|
Note that there is no official support for ARMv5 and it is not possible to build even a simple NixOS configuration out of the box.
|
||||||
|
|
||||||
- `tcl.mkTclDerivation` now enables `strictDeps` and `__structuredAttrs`.
|
|
||||||
|
|
||||||
- `pdns` has been updated from `5.0.x` to `5.1.x`. Please be sure to review the [Upgrade Notes](https://doc.powerdns.com/authoritative/upgrading.html#to-5-1-0) before upgrading. Namely LUA record updates are no longer allowed by default, and the embedded webserver no longer includes a `access-control-allow-origin: *` header by default.
|
- `pdns` has been updated from `5.0.x` to `5.1.x`. Please be sure to review the [Upgrade Notes](https://doc.powerdns.com/authoritative/upgrading.html#to-5-1-0) before upgrading. Namely LUA record updates are no longer allowed by default, and the embedded webserver no longer includes a `access-control-allow-origin: *` header by default.
|
||||||
|
|
||||||
- LibreOffice upstream switched from Fresh/Still stable branches to a single Stable branch; `libreoffice` and `libreoffice-qt` work as before, but more specific aliases like `libreoffice-fresh` should be replaced.
|
|
||||||
|
|
||||||
- `davmail` no longer supports building with GTK 2, and the `preferGtk3` override flag has been removed as GTK 3 is always used.
|
- `davmail` no longer supports building with GTK 2, and the `preferGtk3` override flag has been removed as GTK 3 is always used.
|
||||||
|
|
||||||
- `fetchurl` now always enables `strictDeps`.
|
|
||||||
This is a backwards incompatible change if inputs other than `nativeBuildInputs` were used.
|
|
||||||
|
|
||||||
- Support for the legacy U‐Boot image format has been removed from the Linux kernel builders, as it is deprecated upstream and no longer used by any platform in Nixpkgs.
|
- Support for the legacy U‐Boot image format has been removed from the Linux kernel builders, as it is deprecated upstream and no longer used by any platform in Nixpkgs.
|
||||||
|
|
||||||
- `etcd_3_4` package was dropped, as it's gone EOL. Please upgrade to either 3.5 or 3.6. See [migration notes](https://etcd.io/docs/v3.6/upgrades/upgrade_3_6/) for incompatibilities and upgrade procedure.
|
- `etcd_3_4` package was dropped, as it's gone EOL. Please upgrade to either 3.5 or 3.6. See [migration notes](https://etcd.io/docs/v3.6/upgrades/upgrade_3_6/) for incompatibilities and upgrade procedure.
|
||||||
@@ -152,9 +113,6 @@
|
|||||||
Users who must continue using ingress-nginx will now need to manually provide the rke2-images-ingress-nginx tarball.
|
Users who must continue using ingress-nginx will now need to manually provide the rke2-images-ingress-nginx tarball.
|
||||||
- Future Removal: The ingress-nginx chart will not receive any additional updates and will be completely removed in v1.37 for community users.
|
- Future Removal: The ingress-nginx chart will not receive any additional updates and will be completely removed in v1.37 for community users.
|
||||||
|
|
||||||
- `replaceVarsWith` now enables `strictDeps` and `__structuredAttrs` and passing these attributes to the function is no longer allowed.
|
|
||||||
By extension, `replaceVars` now also enables `strictDeps` and `__structuredAttrs`.
|
|
||||||
|
|
||||||
- `buildFHSEnvChroot` has been removed after deprecation in 23.05.
|
- `buildFHSEnvChroot` has been removed after deprecation in 23.05.
|
||||||
|
|
||||||
- `leafnode` has been removed, as it was an unmaintained alpha-release of leafnode 2 and has a dependency on the EOL PRCE-library. Consider using `leafnode1` instead, which is still maintained.
|
- `leafnode` has been removed, as it was an unmaintained alpha-release of leafnode 2 and has a dependency on the EOL PRCE-library. Consider using `leafnode1` instead, which is still maintained.
|
||||||
@@ -167,30 +125,14 @@
|
|||||||
|
|
||||||
- `texlive.combine` is deprecated and scheduled for removal in 27.05. Please migrate to `texliveSmall.withPackages` (see [](#sec-language-texlive-user-guide)).
|
- `texlive.combine` is deprecated and scheduled for removal in 27.05. Please migrate to `texliveSmall.withPackages` (see [](#sec-language-texlive-user-guide)).
|
||||||
|
|
||||||
- `katex` has been updated from 0.16 to 0.18 and has introduced breaking changes. See upstream changelog for details: [0.17.0](https://github.com/KaTeX/KaTeX/releases/tag/v0.17.0), [0.18.0](https://github.com/KaTeX/KaTeX/releases/tag/v0.18.0).
|
|
||||||
|
|
||||||
- `keycloak` was updated to >= 26.7.0 and includes some breaking internal (API) changes. See the [upstream migration guide](https://www.keycloak.org/docs/latest/upgrading/#migrating-to-26-7-0) for more information.
|
- `keycloak` was updated to >= 26.7.0 and includes some breaking internal (API) changes. See the [upstream migration guide](https://www.keycloak.org/docs/latest/upgrading/#migrating-to-26-7-0) for more information.
|
||||||
|
|
||||||
- `pdfium` is now built from source instead of packaging prebuilt binaries. `pdfium-binaries` has been renamed to `pdfium`, and `pdfium-binaries-v8` has been removed.
|
|
||||||
|
|
||||||
- `iocaine` has been updated to `3.5.1`.
|
|
||||||
|
|
||||||
- `librest` providing 0.7 ABI was removed. `librest_1_0` providing 1.0 ABI was renamed to `librest` and `librest_1_0` was kept as an alias.
|
- `librest` providing 0.7 ABI was removed. `librest_1_0` providing 1.0 ABI was renamed to `librest` and `librest_1_0` was kept as an alias.
|
||||||
|
|
||||||
- `luaPackages.lrexlib-pcre` has been removed as part of the process to fully migrate from the end-of-life PRCE library to PCRE2. `luaPackages.lrexlib-pcre2` and multiple other versions of lrexlib can be used instead.
|
- `luaPackages.lrexlib-pcre` has been removed as part of the process to fully migrate from the end-of-life PRCE library to PCRE2. `luaPackages.lrexlib-pcre2` and multiple other versions of lrexlib can be used instead.
|
||||||
|
|
||||||
- `pnpm_10` was upgraded to version 10.34.1+, which introduced stricter integrity checks. If you encounter `ERR_PNPM_MISSING_TARBALL_INTEGRITY`, you can fall back to the older `pnpm_10_34_0`.
|
- `pnpm_10` was upgraded to version 10.34.1+, which introduced stricter integrity checks. If you encounter `ERR_PNPM_MISSING_TARBALL_INTEGRITY`, you can fall back to the older `pnpm_10_34_0`.
|
||||||
|
|
||||||
- `buildMozillaMach` is now using `enable<feature>` and `with<dependency>`
|
|
||||||
terminology from RFC 169 and the `wrapFirefox` and `wrapThunderbird` functions
|
|
||||||
check for these new attribute names on the passed package.
|
|
||||||
The `privacySupport` function argument has been replaced by multiple
|
|
||||||
granular options corresponding to individual features: `enableDataReporting`,
|
|
||||||
`enableLocation`, `enableWebRTC`.
|
|
||||||
The `requireSigning` and `allowAddonSideload` function arguments moved from
|
|
||||||
the outer to the inner function and were renamed to `enableAddonSigning` and
|
|
||||||
`enableAddonSideload`, respectively.
|
|
||||||
|
|
||||||
- `fetchPnpmDeps`' `fetcherVersion = 1` and `fetcherVersion = 2` have been
|
- `fetchPnpmDeps`' `fetcherVersion = 1` and `fetcherVersion = 2` have been
|
||||||
removed, as announced in the 26.05 release. Packages still using them now
|
removed, as announced in the 26.05 release. Packages still using them now
|
||||||
throw an evaluation error and must migrate to `fetcherVersion = 3` (or later)
|
throw an evaluation error and must migrate to `fetcherVersion = 3` (or later)
|
||||||
@@ -211,12 +153,6 @@
|
|||||||
|
|
||||||
- The deprecated `appimageTools.extractType1`, `appimageTools.extractType2`, and `appimageTools.wrapType1` aliases now emit warnings. Use `appimageTools.extract` and `appimageTools.wrapType2` instead.
|
- The deprecated `appimageTools.extractType1`, `appimageTools.extractType2`, and `appimageTools.wrapType1` aliases now emit warnings. Use `appimageTools.extract` and `appimageTools.wrapType2` instead.
|
||||||
|
|
||||||
- netbox plugins have been moved from the python3Packages to the netboxPlugins package set.
|
|
||||||
|
|
||||||
- The `services.freenet` module has been renamed to `services.hyphanet`.
|
|
||||||
For more information, [see the project's website](https://www.hyphanet.org/freenet-renamed-to-hyphanet.html).
|
|
||||||
The `freenet` user, group and `/var/lib/freenet` data directory are renamed to `hyphanet` on systems with `system.stateVersion` at `26.11` or newer.
|
|
||||||
|
|
||||||
## Other Notable Changes {#sec-nixpkgs-release-26.11-notable-changes}
|
## Other Notable Changes {#sec-nixpkgs-release-26.11-notable-changes}
|
||||||
|
|
||||||
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
||||||
@@ -225,8 +161,6 @@
|
|||||||
|
|
||||||
- `buildFHSEnv`, `appimageTools.wrapAppImage`, and `appimageTools.wrapType2` now support the `finalAttrs` pattern. When using `wrapAppImage`, it is now recommended to pass the extracted AppImage to the `contents` attribute (instead of `src`), to avoid shadowing `src`. Passing the extracted contents to `src` is now deprecated and will be removed in a future release.
|
- `buildFHSEnv`, `appimageTools.wrapAppImage`, and `appimageTools.wrapType2` now support the `finalAttrs` pattern. When using `wrapAppImage`, it is now recommended to pass the extracted AppImage to the `contents` attribute (instead of `src`), to avoid shadowing `src`. Passing the extracted contents to `src` is now deprecated and will be removed in a future release.
|
||||||
|
|
||||||
- All databases of the MySQL family – `mysql`, `mariadb` and `percona` – now provide a client-only package `client` sub-attribute. Use the `<dbname>.client` package if the server components are not needed. The main package continues to ship the client binaries as well.
|
|
||||||
|
|
||||||
- Package-URL (PURL, https://github.com/package-url/purl-spec) metadata identifier has been added for `fetchgit`, `fetchpypi` and `fetchFromGithub` fetchers.
|
- Package-URL (PURL, https://github.com/package-url/purl-spec) metadata identifier has been added for `fetchgit`, `fetchpypi` and `fetchFromGithub` fetchers.
|
||||||
`mkDerivation` has been adjusted to reuse this information.
|
`mkDerivation` has been adjusted to reuse this information.
|
||||||
Package-URLs allow reliably identifying and locating software packages.
|
Package-URLs allow reliably identifying and locating software packages.
|
||||||
@@ -237,8 +171,6 @@
|
|||||||
|
|
||||||
- `homebox` v0.26.0 introduced a new, required value to be set, `HBOX_AUTH_API_KEY_PEPPER`. If one is not provided the module will create one, it is recommended that you back this up as it is part of API Key generation and validation.
|
- `homebox` v0.26.0 introduced a new, required value to be set, `HBOX_AUTH_API_KEY_PEPPER`. If one is not provided the module will create one, it is recommended that you back this up as it is part of API Key generation and validation.
|
||||||
|
|
||||||
- `nextpnr` introduced support for the nexus and gatemate architectures. Building support for each individual architecture can be configured using the package parameters.
|
|
||||||
|
|
||||||
- Emacs loads the `early-default` library after `early-init.el`.
|
- Emacs loads the `early-default` library after `early-init.el`.
|
||||||
Users can add `early-init.el` via `emacs.pkgs.withPackages`
|
Users can add `early-init.el` via `emacs.pkgs.withPackages`
|
||||||
by packaging `early-init.el` into a library named `early-default`.
|
by packaging `early-init.el` into a library named `early-default`.
|
||||||
@@ -249,8 +181,6 @@
|
|||||||
They were missing before because Ceph omitted logs when this directory was missing.
|
They were missing before because Ceph omitted logs when this directory was missing.
|
||||||
Ceph logs can grow large, so you may want to configure rotation of these logs.
|
Ceph logs can grow large, so you may want to configure rotation of these logs.
|
||||||
|
|
||||||
- Firefox wrapper now accepts an optional `appDataDir` argument, which sets `MOZ_APP_DATA` to relocate Firefox application data. This is especially useful on macOS 27 and later, where wrapped Firefox applications may be denied access to profiles in traditional application data directory.
|
|
||||||
|
|
||||||
## Nixpkgs Library {#sec-nixpkgs-release-26.11-lib}
|
## Nixpkgs Library {#sec-nixpkgs-release-26.11-lib}
|
||||||
|
|
||||||
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
||||||
@@ -259,8 +189,6 @@
|
|||||||
|
|
||||||
- `fittrackee` 1.0.0 now requires postgres with postgis. The [upgrade guide](https://docs.fittrackee.org/en/upgrading-to-1.0.0.html) has steps to prepare for this upgrade.
|
- `fittrackee` 1.0.0 now requires postgres with postgis. The [upgrade guide](https://docs.fittrackee.org/en/upgrading-to-1.0.0.html) has steps to prepare for this upgrade.
|
||||||
|
|
||||||
- `typescript` 7.0.2 now uses the Golang implementation. The [announcement document](https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/) has information on what was changed.
|
|
||||||
|
|
||||||
### Deprecations {#sec-nixpkgs-release-26.11-lib-deprecations}
|
### Deprecations {#sec-nixpkgs-release-26.11-lib-deprecations}
|
||||||
|
|
||||||
- Setting `config.allowBrokenPredicate` is deprecated in favor of
|
- Setting `config.allowBrokenPredicate` is deprecated in favor of
|
||||||
|
|||||||
@@ -1 +1,10 @@
|
|||||||
# Standard environment {#part-stdenv}
|
# Standard environment {#part-stdenv}
|
||||||
|
|
||||||
|
```{=include=} chapters
|
||||||
|
stdenv/stdenv.chapter.md
|
||||||
|
stdenv/meta.chapter.md
|
||||||
|
stdenv/passthru.chapter.md
|
||||||
|
stdenv/multiple-output.chapter.md
|
||||||
|
stdenv/cross-compilation.chapter.md
|
||||||
|
stdenv/platform-notes.chapter.md
|
||||||
|
```
|
||||||
|
|||||||
@@ -493,7 +493,7 @@ When using native compilation, `stdenv` is lenient towards incorrect placement o
|
|||||||
|
|
||||||
While convenient for getting to a package quickly, this behavior can break cross-compilation. Adding `strictDeps = true` as a parameter to `mkDerivation` or any of its language specific wrappers disables this behavior.
|
While convenient for getting to a package quickly, this behavior can break cross-compilation. Adding `strictDeps = true` as a parameter to `mkDerivation` or any of its language specific wrappers disables this behavior.
|
||||||
|
|
||||||
The specialized `build*` functions for dlang, emacs, go, nim, ocaml, python, rust, and `tcl.mkTclDerivation` enable this option by default.
|
The specialized `build*` functions for dlang, emacs, go, nim, ocaml, python, and rust enable this option by default.
|
||||||
|
|
||||||
## Attributes {#ssec-stdenv-attributes}
|
## Attributes {#ssec-stdenv-attributes}
|
||||||
|
|
||||||
@@ -508,7 +508,6 @@ A number between 0 and 7 indicating how much information to log. If set to 1 or
|
|||||||
#### `enableParallelBuilding` {#var-stdenv-enableParallelBuilding}
|
#### `enableParallelBuilding` {#var-stdenv-enableParallelBuilding}
|
||||||
|
|
||||||
If set to `true`, `stdenv` will pass specific flags to `make` and other build tools to enable parallel building with up to `build-cores` workers.
|
If set to `true`, `stdenv` will pass specific flags to `make` and other build tools to enable parallel building with up to `build-cores` workers.
|
||||||
Can be overridden for a specific phase using `enableParallelInstalling` or `enableParallelChecking`.
|
|
||||||
|
|
||||||
Unless set to `false`, some build systems with good support for parallel building including `cmake`, `meson`, and `qmake` will set it to `true`.
|
Unless set to `false`, some build systems with good support for parallel building including `cmake`, `meson`, and `qmake` will set it to `true`.
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
# Toolchains {#part-toolchains}
|
# Toolchains {#part-toolchains}
|
||||||
|
|
||||||
|
```{=include=} chapters
|
||||||
|
toolchains/llvm.chapter.md
|
||||||
|
```
|
||||||
|
|||||||
@@ -1 +1,9 @@
|
|||||||
# Using Nixpkgs {#part-using}
|
# Using Nixpkgs {#part-using}
|
||||||
|
|
||||||
|
```{=include=} chapters
|
||||||
|
channels.chapter.md
|
||||||
|
using/platform-support.chapter.md
|
||||||
|
using/configuration.chapter.md
|
||||||
|
using/overlays.chapter.md
|
||||||
|
using/overrides.chapter.md
|
||||||
|
```
|
||||||
|
|||||||
@@ -89,14 +89,6 @@ let
|
|||||||
|
|
||||||
# domain-specific
|
# domain-specific
|
||||||
fetchers = callLibs ./fetchers.nix;
|
fetchers = callLibs ./fetchers.nix;
|
||||||
services = callLibs ./services/lib.nix;
|
|
||||||
importService = self.modules.importApply ./services/service.nix;
|
|
||||||
|
|
||||||
# Modules that are not specific to a module class
|
|
||||||
genericModules = {
|
|
||||||
meta-maintainers = ./modules/generic/meta-maintainers.nix;
|
|
||||||
assertions = ./modules/generic/assertions.nix;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Eval-time filesystem handling
|
# Eval-time filesystem handling
|
||||||
path = callLibs ./path;
|
path = callLibs ./path;
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ let
|
|||||||
inherit (lib.lists)
|
inherit (lib.lists)
|
||||||
all
|
all
|
||||||
commonPrefix
|
commonPrefix
|
||||||
commonPrefixLength
|
|
||||||
concatLists
|
concatLists
|
||||||
elemAt
|
elemAt
|
||||||
filter
|
filter
|
||||||
@@ -874,7 +873,9 @@ rec {
|
|||||||
# The common base components prefix, e.g.
|
# The common base components prefix, e.g.
|
||||||
# (/foo/bar, /foo/bar/baz) -> /foo/bar
|
# (/foo/bar, /foo/bar/baz) -> /foo/bar
|
||||||
# (/foo/bar, /foo/baz) -> /foo
|
# (/foo/bar, /foo/baz) -> /foo
|
||||||
commonBaseComponentsLength = commonPrefixLength fileset1._internalBaseComponents fileset2._internalBaseComponents;
|
commonBaseComponentsLength =
|
||||||
|
# TODO: Have a `lib.lists.commonPrefixLength` function such that we don't need the list allocation from commonPrefix here
|
||||||
|
length (commonPrefix fileset1._internalBaseComponents fileset2._internalBaseComponents);
|
||||||
|
|
||||||
# To be able to intersect filesetTree's together, they need to have the same base path.
|
# To be able to intersect filesetTree's together, they need to have the same base path.
|
||||||
# Base paths can be intersected by taking the longest one (if any)
|
# Base paths can be intersected by taking the longest one (if any)
|
||||||
@@ -954,7 +955,9 @@ rec {
|
|||||||
# The common base components prefix, e.g.
|
# The common base components prefix, e.g.
|
||||||
# (/foo/bar, /foo/bar/baz) -> /foo/bar
|
# (/foo/bar, /foo/bar/baz) -> /foo/bar
|
||||||
# (/foo/bar, /foo/baz) -> /foo
|
# (/foo/bar, /foo/baz) -> /foo
|
||||||
commonBaseComponentsLength = commonPrefixLength positive._internalBaseComponents negative._internalBaseComponents;
|
commonBaseComponentsLength =
|
||||||
|
# TODO: Have a `lib.lists.commonPrefixLength` function such that we don't need the list allocation from commonPrefix here
|
||||||
|
length (commonPrefix positive._internalBaseComponents negative._internalBaseComponents);
|
||||||
|
|
||||||
# We need filesetTree's with the same base to be able to compute the difference between them
|
# We need filesetTree's with the same base to be able to compute the difference between them
|
||||||
# This here is the filesetTree from the negative file set, but for a base path that matches the positive file set.
|
# This here is the filesetTree from the negative file set, but for a base path that matches the positive file set.
|
||||||
|
|||||||
@@ -283,12 +283,6 @@ lib.mapAttrs mkLicense (
|
|||||||
fullName = "BSD 3-Clause Tso variant";
|
fullName = "BSD 3-Clause Tso variant";
|
||||||
};
|
};
|
||||||
|
|
||||||
bsdAskToEndorse = {
|
|
||||||
#spdxId = "BSD-ask-to-endorse"; # Accepted to SPDX waiting on next SPDX release
|
|
||||||
fullName = "BSD - ask to endorse";
|
|
||||||
url = "https://github.com/sudo-project/sudo/blob/c1307ea9ff340ce0538779f8e456501461fc44b7/plugins/sudoers/redblack.c#L24-L43";
|
|
||||||
};
|
|
||||||
|
|
||||||
bsdAxisNoDisclaimerUnmodified = {
|
bsdAxisNoDisclaimerUnmodified = {
|
||||||
fullName = "BSD-Axis without Warranty Disclaimer with Unmodified requirement";
|
fullName = "BSD-Axis without Warranty Disclaimer with Unmodified requirement";
|
||||||
url = "https://scancode-licensedb.aboutcode.org/bsd-no-disclaimer-unmodified.html";
|
url = "https://scancode-licensedb.aboutcode.org/bsd-no-disclaimer-unmodified.html";
|
||||||
@@ -715,11 +709,6 @@ lib.mapAttrs mkLicense (
|
|||||||
url = "https://geant4.web.cern.ch/geant4/license/LICENSE.html";
|
url = "https://geant4.web.cern.ch/geant4/license/LICENSE.html";
|
||||||
};
|
};
|
||||||
|
|
||||||
gccException20 = {
|
|
||||||
spdxId = "GCC-exception-2.0";
|
|
||||||
fullName = "GCC Runtime Library exception 2.0";
|
|
||||||
};
|
|
||||||
|
|
||||||
gccException31 = {
|
gccException31 = {
|
||||||
spdxId = "GCC-exception-3.1";
|
spdxId = "GCC-exception-3.1";
|
||||||
fullName = "GCC Runtime Library exception 3.1";
|
fullName = "GCC Runtime Library exception 3.1";
|
||||||
@@ -1295,11 +1284,6 @@ lib.mapAttrs mkLicense (
|
|||||||
fullName = "Open Data Commons Open Database License v1.0";
|
fullName = "Open Data Commons Open Database License v1.0";
|
||||||
};
|
};
|
||||||
|
|
||||||
ofl10 = {
|
|
||||||
spdxId = "OFL-1.0";
|
|
||||||
fullName = "SIL Open Font License 1.0";
|
|
||||||
};
|
|
||||||
|
|
||||||
ofl = {
|
ofl = {
|
||||||
spdxId = "OFL-1.1";
|
spdxId = "OFL-1.1";
|
||||||
fullName = "SIL Open Font License 1.1";
|
fullName = "SIL Open Font License 1.1";
|
||||||
@@ -1486,6 +1470,12 @@ lib.mapAttrs mkLicense (
|
|||||||
fullName = "MIT-STK License";
|
fullName = "MIT-STK License";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sudo = {
|
||||||
|
shortName = "sudo";
|
||||||
|
fullName = "Sudo License (ISC-style)";
|
||||||
|
url = "https://www.sudo.ws/about/license/";
|
||||||
|
};
|
||||||
|
|
||||||
sustainableUse = {
|
sustainableUse = {
|
||||||
spdxId = "SUL-1.0";
|
spdxId = "SUL-1.0";
|
||||||
fullName = "Sustainable Use License";
|
fullName = "Sustainable Use License";
|
||||||
@@ -1653,8 +1643,6 @@ lib.mapAttrs mkLicense (
|
|||||||
vol-sl = {
|
vol-sl = {
|
||||||
fullName = "Volatility Software License, Version 1.0";
|
fullName = "Volatility Software License, Version 1.0";
|
||||||
url = "https://www.volatilityfoundation.org/license/vsl-v1.0";
|
url = "https://www.volatilityfoundation.org/license/vsl-v1.0";
|
||||||
free = false;
|
|
||||||
redistributable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
vsl10 = {
|
vsl10 = {
|
||||||
|
|||||||
@@ -1822,37 +1822,7 @@ rec {
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
*/
|
*/
|
||||||
commonPrefix = list1: list2: take (commonPrefixLength list1 list2) list1;
|
commonPrefix =
|
||||||
|
|
||||||
/**
|
|
||||||
Returns the length of the common prefix of two lists,
|
|
||||||
i.e. the number of leading elements that are pairwise equal.
|
|
||||||
|
|
||||||
This is more efficient than `length (commonPrefix a b)` because
|
|
||||||
it avoids allocating an intermediate list.
|
|
||||||
|
|
||||||
# Type
|
|
||||||
|
|
||||||
```
|
|
||||||
commonPrefixLength :: [a] -> [a] -> Int
|
|
||||||
```
|
|
||||||
|
|
||||||
# Examples
|
|
||||||
:::{.example}
|
|
||||||
## `lib.lists.commonPrefixLength` usage example
|
|
||||||
|
|
||||||
```nix
|
|
||||||
commonPrefixLength [ 1 2 3 4 5 6 ] [ 1 2 4 8 ]
|
|
||||||
=> 2
|
|
||||||
commonPrefixLength [ 1 2 3 ] [ 1 2 3 4 5 ]
|
|
||||||
=> 3
|
|
||||||
commonPrefixLength [ 1 2 3 ] [ 4 5 6 ]
|
|
||||||
=> 0
|
|
||||||
```
|
|
||||||
|
|
||||||
:::
|
|
||||||
*/
|
|
||||||
commonPrefixLength =
|
|
||||||
list1: list2:
|
list1: list2:
|
||||||
let
|
let
|
||||||
# Zip the lists together into a list of booleans whether each element matches
|
# Zip the lists together into a list of booleans whether each element matches
|
||||||
@@ -1861,8 +1831,9 @@ rec {
|
|||||||
# which will then also be the length of the common prefix.
|
# which will then also be the length of the common prefix.
|
||||||
# If all elements match, we fall back to the length of the zipped list,
|
# If all elements match, we fall back to the length of the zipped list,
|
||||||
# which is the same as the length of the smaller list.
|
# which is the same as the length of the smaller list.
|
||||||
|
commonPrefixLength = findFirstIndex id (length matchings) matchings;
|
||||||
in
|
in
|
||||||
findFirstIndex id (length matchings) matchings;
|
take commonPrefixLength list1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the last element of a list.
|
Returns the last element of a list.
|
||||||
|
|||||||
365
lib/modules.nix
365
lib/modules.nix
@@ -31,6 +31,7 @@ let
|
|||||||
length
|
length
|
||||||
mapAttrs
|
mapAttrs
|
||||||
mapAttrsToList
|
mapAttrsToList
|
||||||
|
mapAttrsRecursiveCond
|
||||||
min
|
min
|
||||||
optional
|
optional
|
||||||
optionalAttrs
|
optionalAttrs
|
||||||
@@ -253,7 +254,7 @@ let
|
|||||||
|
|
||||||
# This function takes an empty attrset as an argument.
|
# This function takes an empty attrset as an argument.
|
||||||
# It could theoretically be replaced with its body,
|
# It could theoretically be replaced with its body,
|
||||||
# but such a binding is avoided to allow for earlier garbage collection.
|
# but such a binding is avoided to allow for earlier grabage collection.
|
||||||
doCollect =
|
doCollect =
|
||||||
{ }:
|
{ }:
|
||||||
collectModules class (specialArgs.modulesPath or "") (regularModules ++ [ internalModule ]) (
|
collectModules class (specialArgs.modulesPath or "") (regularModules ++ [ internalModule ]) (
|
||||||
@@ -278,11 +279,7 @@ let
|
|||||||
let
|
let
|
||||||
|
|
||||||
# For definitions that have an associated option
|
# For definitions that have an associated option
|
||||||
declaredConfig =
|
declaredConfig = mapAttrsRecursiveCond (v: !isOption v) (_: v: v.value) options;
|
||||||
let
|
|
||||||
recurse = mapAttrs (n: v: if isOption v then v.value else recurse v);
|
|
||||||
in
|
|
||||||
recurse options;
|
|
||||||
|
|
||||||
# If freeformType is set, this is for definitions that don't have an associated option
|
# If freeformType is set, this is for definitions that don't have an associated option
|
||||||
freeformConfig =
|
freeformConfig =
|
||||||
@@ -567,23 +564,12 @@ let
|
|||||||
modulesPath:
|
modulesPath:
|
||||||
{ disabled, modules }:
|
{ disabled, modules }:
|
||||||
let
|
let
|
||||||
isDisabledModule = isDisabled modulesPath disabled;
|
keyFilter = filter (attrs: !isDisabled modulesPath disabled attrs);
|
||||||
keyFilter = filter (attrs: !isDisabledModule attrs);
|
|
||||||
in
|
in
|
||||||
catAttrs "module" (
|
catAttrs "module" (genericClosure {
|
||||||
genericClosure (
|
startSet = keyFilter modules;
|
||||||
if disabled == [ ] then
|
operator = attrs: keyFilter attrs.modules;
|
||||||
{
|
});
|
||||||
startSet = modules;
|
|
||||||
operator = attrs: attrs.modules;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
startSet = keyFilter modules;
|
|
||||||
operator = attrs: keyFilter attrs.modules;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
toGraph =
|
toGraph =
|
||||||
modulesPath:
|
modulesPath:
|
||||||
@@ -645,28 +631,6 @@ let
|
|||||||
: 3\. Function argument
|
: 3\. Function argument
|
||||||
*/
|
*/
|
||||||
unifyModuleSyntax =
|
unifyModuleSyntax =
|
||||||
let
|
|
||||||
attrsToRemove = [
|
|
||||||
"_class"
|
|
||||||
"_file"
|
|
||||||
"key"
|
|
||||||
"disabledModules"
|
|
||||||
"imports"
|
|
||||||
"options"
|
|
||||||
"config"
|
|
||||||
"meta"
|
|
||||||
"freeformType"
|
|
||||||
];
|
|
||||||
shorthandAttrsToRemove = [
|
|
||||||
"_class"
|
|
||||||
"_file"
|
|
||||||
"key"
|
|
||||||
"disabledModules"
|
|
||||||
"require"
|
|
||||||
"imports"
|
|
||||||
"freeformType"
|
|
||||||
];
|
|
||||||
in
|
|
||||||
file: key: m:
|
file: key: m:
|
||||||
let
|
let
|
||||||
addMeta =
|
addMeta =
|
||||||
@@ -690,7 +654,17 @@ let
|
|||||||
in
|
in
|
||||||
if m ? config || m ? options then
|
if m ? config || m ? options then
|
||||||
let
|
let
|
||||||
badAttrs = removeAttrs m attrsToRemove;
|
badAttrs = removeAttrs m [
|
||||||
|
"_class"
|
||||||
|
"_file"
|
||||||
|
"key"
|
||||||
|
"disabledModules"
|
||||||
|
"imports"
|
||||||
|
"options"
|
||||||
|
"config"
|
||||||
|
"meta"
|
||||||
|
"freeformType"
|
||||||
|
];
|
||||||
in
|
in
|
||||||
if badAttrs != { } then
|
if badAttrs != { } then
|
||||||
throw "Module `${key}' has an unsupported attribute `${head (attrNames badAttrs)}'. This is caused by introducing a top-level `config' or `options' attribute. Add configuration attributes immediately on the top level instead, or move all of them (namely: ${toString (attrNames badAttrs)}) into the explicit `config' attribute."
|
throw "Module `${key}' has an unsupported attribute `${head (attrNames badAttrs)}'. This is caused by introducing a top-level `config' or `options' attribute. Add configuration attributes immediately on the top level instead, or move all of them (namely: ${toString (attrNames badAttrs)}) into the explicit `config' attribute."
|
||||||
@@ -716,7 +690,17 @@ let
|
|||||||
disabledModules = m.disabledModules or [ ];
|
disabledModules = m.disabledModules or [ ];
|
||||||
imports = m.require or [ ] ++ m.imports or [ ];
|
imports = m.require or [ ] ++ m.imports or [ ];
|
||||||
options = { };
|
options = { };
|
||||||
config = addFreeformType (removeAttrs m shorthandAttrsToRemove);
|
config = addFreeformType (
|
||||||
|
removeAttrs m [
|
||||||
|
"_class"
|
||||||
|
"_file"
|
||||||
|
"key"
|
||||||
|
"disabledModules"
|
||||||
|
"require"
|
||||||
|
"imports"
|
||||||
|
"freeformType"
|
||||||
|
]
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
applyModuleArgsIfFunction =
|
applyModuleArgsIfFunction =
|
||||||
@@ -738,9 +722,10 @@ let
|
|||||||
# a module will resolve strictly the attributes used as argument but
|
# a module will resolve strictly the attributes used as argument but
|
||||||
# not their values. The values are forwarding the result of the
|
# not their values. The values are forwarding the result of the
|
||||||
# evaluation of the option.
|
# evaluation of the option.
|
||||||
|
context = name: ''while evaluating the module argument `${name}' in "${key}":'';
|
||||||
extraArgs = mapAttrs (
|
extraArgs = mapAttrs (
|
||||||
name: _:
|
name: _:
|
||||||
addErrorContext ''while evaluating the module argument `${name}' in "${key}":'' (
|
addErrorContext (context name) (
|
||||||
args.${name} or (addErrorContext
|
args.${name} or (addErrorContext
|
||||||
"noting that argument `${name}` is not externally provided, so querying `_module.args` instead, requiring `config`"
|
"noting that argument `${name}` is not externally provided, so querying `_module.args` instead, requiring `config`"
|
||||||
config._module.args.${name}
|
config._module.args.${name}
|
||||||
@@ -892,13 +877,15 @@ let
|
|||||||
# We're descending into attribute ‘name’.
|
# We're descending into attribute ‘name’.
|
||||||
let
|
let
|
||||||
loc = prefix ++ [ name ];
|
loc = prefix ++ [ name ];
|
||||||
|
defns = pushedDownDefinitionsByName.${name} or [ ];
|
||||||
defns' = rawDefinitionsByName.${name} or [ ];
|
defns' = rawDefinitionsByName.${name} or [ ];
|
||||||
isOptionDecl =
|
optionDecls = filter (
|
||||||
m:
|
m:
|
||||||
m.options ? _type
|
m.options ? _type
|
||||||
&& (m.options._type == "option" || throwDeclarationTypeError loc m.options._type m._file);
|
&& (m.options._type == "option" || throwDeclarationTypeError loc m.options._type m._file)
|
||||||
|
) decls;
|
||||||
in
|
in
|
||||||
if all isOptionDecl decls then
|
if length optionDecls == length decls then
|
||||||
let
|
let
|
||||||
opt = fixupOptionType loc (mergeOptionDecls loc decls);
|
opt = fixupOptionType loc (mergeOptionDecls loc decls);
|
||||||
in
|
in
|
||||||
@@ -906,35 +893,7 @@ let
|
|||||||
matchedOptions = evalOptionValue loc opt defns';
|
matchedOptions = evalOptionValue loc opt defns';
|
||||||
unmatchedDefns = [ ];
|
unmatchedDefns = [ ];
|
||||||
}
|
}
|
||||||
# this may look like duplicate computations are performed, but testing
|
else if optionDecls != [ ] then
|
||||||
# with a minimal NixOS config (defined below):
|
|
||||||
#
|
|
||||||
# 1. in 87% of cases, the above `all isOptionDecl decls` passes and we
|
|
||||||
# short-circuit
|
|
||||||
# 2. In 12% of cases, there's only one decl and we short-circuit
|
|
||||||
# 3. in another 1% of cases, we loop again and short-circuit when
|
|
||||||
# `any isOptionDecl decls` fails
|
|
||||||
# 4. In the final case, we pass the `any` and have to refilter. This
|
|
||||||
# only triggers in 1 of the 48000 calls to this function.
|
|
||||||
#
|
|
||||||
# The minimal config was defined with this expression:
|
|
||||||
#
|
|
||||||
# let nixos = import ./nixos/lib/eval-config.nix {
|
|
||||||
# modules = [
|
|
||||||
# ./nixos/modules/profiles/minimal.nix
|
|
||||||
# {
|
|
||||||
# fileSystems."/" = {
|
|
||||||
# device = "/dev/sda1";
|
|
||||||
# fsType = "ext4";
|
|
||||||
# };
|
|
||||||
# boot.loader.grub.devices = [ "/dev/sda" ];
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
# }; in nixos.config.system.build.toplevel
|
|
||||||
else if length decls != 1 && any isOptionDecl decls then
|
|
||||||
let
|
|
||||||
optionDecls = filter isOptionDecl decls;
|
|
||||||
in
|
|
||||||
if
|
if
|
||||||
all (x: x.options.type.name or null == "submodule") optionDecls
|
all (x: x.options.type.name or null == "submodule") optionDecls
|
||||||
# Raw options can only be merged into submodules. Merging into
|
# Raw options can only be merged into submodules. Merging into
|
||||||
@@ -962,7 +921,7 @@ let
|
|||||||
(head optionDecls).options.type.description or "<no description>"
|
(head optionDecls).options.type.description or "<no description>"
|
||||||
}' does not support nested options.\n${showRawDecls loc nonOptions}"
|
}' does not support nested options.\n${showRawDecls loc nonOptions}"
|
||||||
else
|
else
|
||||||
mergeModules' loc decls (pushedDownDefinitionsByName.${name} or [ ])
|
mergeModules' loc decls defns
|
||||||
) declsByName;
|
) declsByName;
|
||||||
|
|
||||||
matchedOptions = mapAttrs (n: v: v.matchedOptions) resultsByName;
|
matchedOptions = mapAttrs (n: v: v.matchedOptions) resultsByName;
|
||||||
@@ -1051,17 +1010,19 @@ let
|
|||||||
: 2\. Function argument
|
: 2\. Function argument
|
||||||
*/
|
*/
|
||||||
mergeOptionDecls =
|
mergeOptionDecls =
|
||||||
loc:
|
loc: opts:
|
||||||
foldl'
|
foldl'
|
||||||
(
|
(
|
||||||
res: opt:
|
res: opt:
|
||||||
let
|
let
|
||||||
|
t = res.type;
|
||||||
|
t' = opt.options.type;
|
||||||
|
mergedType = t.typeMerge t'.functor;
|
||||||
|
typesMergeable = mergedType != null;
|
||||||
|
|
||||||
typeSet =
|
typeSet =
|
||||||
if res ? type && opt.options ? type then
|
if opt.options ? type && res ? type then
|
||||||
let
|
if typesMergeable then
|
||||||
mergedType = res.type.typeMerge opt.options.type.functor;
|
|
||||||
in
|
|
||||||
if mergedType != null then
|
|
||||||
{
|
{
|
||||||
type = mergedType;
|
type = mergedType;
|
||||||
}
|
}
|
||||||
@@ -1072,7 +1033,7 @@ let
|
|||||||
else
|
else
|
||||||
{ };
|
{ };
|
||||||
|
|
||||||
bothHave = k: res ? ${k} && opt.options ? ${k};
|
bothHave = k: opt.options ? ${k} && res ? ${k};
|
||||||
in
|
in
|
||||||
if bothHave "default" || bothHave "example" || bothHave "description" || bothHave "apply" then
|
if bothHave "default" || bothHave "example" || bothHave "description" || bothHave "apply" then
|
||||||
# Keep in sync with the same error above!
|
# Keep in sync with the same error above!
|
||||||
@@ -1117,7 +1078,8 @@ let
|
|||||||
declarations = [ ];
|
declarations = [ ];
|
||||||
declarationPositions = [ ];
|
declarationPositions = [ ];
|
||||||
options = [ ];
|
options = [ ];
|
||||||
};
|
}
|
||||||
|
opts;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Merge all the definitions of an option to produce the final
|
Merge all the definitions of an option to produce the final
|
||||||
@@ -1170,19 +1132,21 @@ let
|
|||||||
throw "The option `${showOption loc}' is read-only, but it's set multiple times. Definition values:${showDefs separateDefs}"
|
throw "The option `${showOption loc}' is read-only, but it's set multiple times. Definition values:${showDefs separateDefs}"
|
||||||
else
|
else
|
||||||
mergeDefinitions loc opt.type defs';
|
mergeDefinitions loc opt.type defs';
|
||||||
|
|
||||||
|
# Apply the 'apply' function to the merged value. This allows options to
|
||||||
|
# yield a value computed from the definitions
|
||||||
|
value = if opt ? apply then opt.apply res.mergedValue else res.mergedValue;
|
||||||
|
|
||||||
|
warnDeprecation =
|
||||||
|
if (opt.type.deprecationMessage != null) then
|
||||||
|
warn "The type `types.${opt.type.name}' of option `${showOption loc}' defined in ${showFiles opt.declarations} is deprecated. ${opt.type.deprecationMessage}"
|
||||||
|
else
|
||||||
|
x: x;
|
||||||
|
|
||||||
in
|
in
|
||||||
(
|
warnDeprecation opt
|
||||||
if opt.type.deprecationMessage != null then
|
|
||||||
warn "The type `types.${opt.type.name}' of option `${showOption loc}' defined in ${showFiles opt.declarations} is deprecated. ${opt.type.deprecationMessage}" opt
|
|
||||||
else
|
|
||||||
opt
|
|
||||||
)
|
|
||||||
// {
|
// {
|
||||||
value = addErrorContext "while evaluating the option `${showOption loc}':" (
|
value = addErrorContext "while evaluating the option `${showOption loc}':" value;
|
||||||
# Apply the 'apply' function to the merged value. This allows options to
|
|
||||||
# yield a value computed from the definitions
|
|
||||||
if opt ? apply then opt.apply res.mergedValue else res.mergedValue
|
|
||||||
);
|
|
||||||
inherit (res.defsFinal') highestPrio;
|
inherit (res.defsFinal') highestPrio;
|
||||||
definitions = catAttrs "value" res.defsFinal;
|
definitions = catAttrs "value" res.defsFinal;
|
||||||
files = catAttrs "file" res.defsFinal;
|
files = catAttrs "file" res.defsFinal;
|
||||||
@@ -1222,16 +1186,49 @@ let
|
|||||||
# Merge definitions of a value of a given type.
|
# Merge definitions of a value of a given type.
|
||||||
mergeDefinitions = loc: type: defs: rec {
|
mergeDefinitions = loc: type: defs: rec {
|
||||||
defsFinal' =
|
defsFinal' =
|
||||||
|
let
|
||||||
|
# Process mkMerge and mkIf properties.
|
||||||
|
defsNormalized = concatMap (
|
||||||
|
m:
|
||||||
|
map (
|
||||||
|
value:
|
||||||
|
if value._type or null == "definition" then
|
||||||
|
value
|
||||||
|
else
|
||||||
|
{
|
||||||
|
inherit (m) file;
|
||||||
|
inherit value;
|
||||||
|
}
|
||||||
|
) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
|
||||||
|
) defs;
|
||||||
|
|
||||||
|
# Process mkOverride properties.
|
||||||
|
defsFiltered = filterOverrides' defsNormalized;
|
||||||
|
|
||||||
|
# Sort mkOrder properties.
|
||||||
|
defsSorted =
|
||||||
|
# Avoid sorting if we don't have to.
|
||||||
|
if any (def: def.value._type or "" == "order") defsFiltered.values then
|
||||||
|
sortProperties defsFiltered.values
|
||||||
|
else
|
||||||
|
defsFiltered.values;
|
||||||
|
in
|
||||||
# Fast path: the overwhelming majority of options have exactly one
|
# Fast path: the overwhelming majority of options have exactly one
|
||||||
# definition whose value carries no property wrapper
|
# definition whose value carries no property wrapper
|
||||||
# (mkIf/mkMerge/mkOverride/mkOrder/definition). In that case the
|
# (mkIf/mkMerge/mkOverride/mkOrder/definition). In that case the
|
||||||
# discharge/filter/sort pipeline below is a no-op but still allocates
|
# discharge/filter/sort pipeline above is a no-op but still allocates
|
||||||
# several intermediate lists and closures. Detect it up front and hand the
|
# several intermediate lists and closures. Detect it up front and hand
|
||||||
# original singleton straight to the type merge.
|
# the original singleton straight to the type merge. The let-bindings
|
||||||
|
# above are lazy and thus never forced on this branch.
|
||||||
if
|
if
|
||||||
length defs == 1
|
length defs == 1
|
||||||
&& addErrorContext "while evaluating definitions from `${(head defs).file}':" (
|
&& (
|
||||||
!(head defs).value ? _type
|
let
|
||||||
|
d = head defs;
|
||||||
|
in
|
||||||
|
addErrorContext "while evaluating definitions from `${d.file}':" (
|
||||||
|
!(isAttrs d.value && d.value ? _type)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
then
|
then
|
||||||
{
|
{
|
||||||
@@ -1239,33 +1236,6 @@ let
|
|||||||
highestPrio = defaultOverridePriority;
|
highestPrio = defaultOverridePriority;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
let
|
|
||||||
# Process mkMerge and mkIf properties.
|
|
||||||
defsNormalized = concatMap (
|
|
||||||
m:
|
|
||||||
map (
|
|
||||||
value:
|
|
||||||
if value._type or null == "definition" then
|
|
||||||
value
|
|
||||||
else
|
|
||||||
{
|
|
||||||
inherit (m) file;
|
|
||||||
inherit value;
|
|
||||||
}
|
|
||||||
) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
|
|
||||||
) defs;
|
|
||||||
|
|
||||||
# Process mkOverride properties.
|
|
||||||
defsFiltered = filterOverrides' defsNormalized;
|
|
||||||
|
|
||||||
# Sort mkOrder properties.
|
|
||||||
defsSorted =
|
|
||||||
# Avoid sorting if we don't have to.
|
|
||||||
if any (def: def.value._type or "" == "order") defsFiltered.values then
|
|
||||||
sortProperties defsFiltered.values
|
|
||||||
else
|
|
||||||
defsFiltered.values;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
values = defsSorted;
|
values = defsSorted;
|
||||||
inherit (defsFiltered) highestPrio;
|
inherit (defsFiltered) highestPrio;
|
||||||
@@ -1377,16 +1347,13 @@ let
|
|||||||
val;
|
val;
|
||||||
in
|
in
|
||||||
cfg:
|
cfg:
|
||||||
if cfg ? _type then
|
if cfg._type or "" == "merge" then
|
||||||
if cfg._type == "if" then
|
concatMap pushDownProperties cfg.contents
|
||||||
map (mapAttrsIfAttrs (n: v: mkIf cfg.condition v)) (pushDownProperties cfg.content)
|
else if cfg._type or "" == "if" then
|
||||||
else if cfg._type == "merge" then
|
map (mapAttrsIfAttrs (n: v: mkIf cfg.condition v)) (pushDownProperties cfg.content)
|
||||||
concatMap pushDownProperties cfg.contents
|
else if cfg._type or "" == "override" then
|
||||||
else if cfg._type == "override" then
|
map (mapAttrsIfAttrs (n: v: mkOverride cfg.priority v)) (pushDownProperties cfg.content)
|
||||||
map (mapAttrsIfAttrs (n: v: mkOverride cfg.priority v)) (pushDownProperties cfg.content)
|
# FIXME: handle mkOrder?
|
||||||
# FIXME: handle mkOrder?
|
|
||||||
else
|
|
||||||
[ cfg ]
|
|
||||||
else
|
else
|
||||||
[ cfg ];
|
[ cfg ];
|
||||||
|
|
||||||
@@ -1409,16 +1376,13 @@ let
|
|||||||
*/
|
*/
|
||||||
dischargeProperties =
|
dischargeProperties =
|
||||||
def:
|
def:
|
||||||
if def ? _type then
|
if def._type or "" == "merge" then
|
||||||
if def._type == "if" then
|
concatMap dischargeProperties def.contents
|
||||||
if isBool def.condition then
|
else if def._type or "" == "if" then
|
||||||
if def.condition then dischargeProperties def.content else [ ]
|
if isBool def.condition then
|
||||||
else
|
if def.condition then dischargeProperties def.content else [ ]
|
||||||
throw "‘mkIf’ called with a non-Boolean condition"
|
|
||||||
else if def._type == "merge" then
|
|
||||||
concatMap dischargeProperties def.contents
|
|
||||||
else
|
else
|
||||||
[ def ]
|
throw "‘mkIf’ called with a non-Boolean condition"
|
||||||
else
|
else
|
||||||
[ def ];
|
[ def ];
|
||||||
|
|
||||||
@@ -1508,7 +1472,7 @@ let
|
|||||||
fixupOptionType =
|
fixupOptionType =
|
||||||
loc: opt:
|
loc: opt:
|
||||||
if opt.type.getSubModules or null == null then
|
if opt.type.getSubModules or null == null then
|
||||||
if opt ? type then opt else opt // { type = types.unspecified; }
|
opt // { type = opt.type or types.unspecified; }
|
||||||
else
|
else
|
||||||
opt
|
opt
|
||||||
// {
|
// {
|
||||||
@@ -1537,21 +1501,23 @@ let
|
|||||||
mergeAttrDefinitionsWithPrio =
|
mergeAttrDefinitionsWithPrio =
|
||||||
opt:
|
opt:
|
||||||
let
|
let
|
||||||
defsByAttr = concatLists (
|
defsByAttr = zipAttrs (
|
||||||
concatMap (
|
concatLists (
|
||||||
{ value, ... }@def:
|
concatMap (
|
||||||
map (mapAttrsToList (
|
{ value, ... }@def:
|
||||||
k: value: {
|
map (mapAttrsToList (
|
||||||
${k} = def // {
|
k: value: {
|
||||||
inherit value;
|
${k} = def // {
|
||||||
};
|
inherit value;
|
||||||
}
|
};
|
||||||
)) (pushDownProperties value)
|
}
|
||||||
) opt.definitionsWithLocations
|
)) (pushDownProperties value)
|
||||||
|
) opt.definitionsWithLocations
|
||||||
|
)
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
assert opt.type.name == "attrsOf" || opt.type.name == "lazyAttrsOf";
|
assert opt.type.name == "attrsOf" || opt.type.name == "lazyAttrsOf";
|
||||||
zipAttrsWith (
|
mapAttrs (
|
||||||
k: v:
|
k: v:
|
||||||
let
|
let
|
||||||
merging = mergeDefinitions (opt.loc ++ [ k ]) opt.type.nestedTypes.elemType v;
|
merging = mergeDefinitions (opt.loc ++ [ k ]) opt.type.nestedTypes.elemType v;
|
||||||
@@ -1636,78 +1602,6 @@ let
|
|||||||
else
|
else
|
||||||
f def;
|
f def;
|
||||||
|
|
||||||
/**
|
|
||||||
Consume the `options` metadata of the submodules typed by `attrsOf submodule`.
|
|
||||||
|
|
||||||
It also works with `lazyAttrsOf` and `attrsWith`.
|
|
||||||
|
|
||||||
# Inputs
|
|
||||||
|
|
||||||
1. A function that takes `name: { cfg, opt }:` and returns anything.
|
|
||||||
`name` is the attribute name at the level of `attrsOf`.
|
|
||||||
`cfg` is the corresponding option *value*, as typically found in `config`.
|
|
||||||
`opt` is the corresponding evaluated option, as typically found in `options`.
|
|
||||||
|
|
||||||
2. An `options` attribute value, e.g. `options.users.groups`.
|
|
||||||
|
|
||||||
# Output
|
|
||||||
|
|
||||||
An attribute set whose attribute names correspond to the definitions of the
|
|
||||||
option, and whose values are the return value of the passed function.
|
|
||||||
|
|
||||||
# Type
|
|
||||||
|
|
||||||
```
|
|
||||||
mapAttrsOfSubmodule :: (String -> { cfg :: AttrSet, opt :: AttrSet } -> a) -> Option -> AttrSetOf a
|
|
||||||
```
|
|
||||||
|
|
||||||
`Option` refers to an evaluated option,
|
|
||||||
retrievable from the `options` module argument
|
|
||||||
or the `options` configuration attribute returned by `evalModules`.
|
|
||||||
It carries attribute `_type = "option";`.
|
|
||||||
|
|
||||||
# Example
|
|
||||||
|
|
||||||
:::{.example}
|
|
||||||
## Use `mapAttrsOfSubmodule` to distinguish which NixOS system services are explicitly enabled or disabled
|
|
||||||
```nix
|
|
||||||
lib.modules.mapAttrsOfSubmodule
|
|
||||||
(name: { cfg, opt }:
|
|
||||||
{
|
|
||||||
isExplicit = opt.enable.highestPrio < (lib.mkOptionDefault null).priority;
|
|
||||||
value = cfg.enable;
|
|
||||||
})
|
|
||||||
(pkgs.nixos { }).options.systemd.services
|
|
||||||
=>
|
|
||||||
{
|
|
||||||
console-getty = {
|
|
||||||
isExplicit = true;
|
|
||||||
value = false;
|
|
||||||
};
|
|
||||||
"container-getty@" = {
|
|
||||||
isExplicit = false;
|
|
||||||
value = true;
|
|
||||||
};
|
|
||||||
# ...
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
:::
|
|
||||||
*/
|
|
||||||
mapAttrsOfSubmodule =
|
|
||||||
f: opt:
|
|
||||||
assert opt._type or null == "option";
|
|
||||||
assert opt.type.name == "attrsOf" || opt.type.name == "lazyAttrsOf";
|
|
||||||
assert opt.type.nestedTypes.elemType.name == "submodule";
|
|
||||||
|
|
||||||
mapAttrs (
|
|
||||||
name: attrMeta:
|
|
||||||
f name {
|
|
||||||
cfg = attrMeta.configuration.config;
|
|
||||||
opt = attrMeta.configuration.options;
|
|
||||||
}
|
|
||||||
) opt.valueMeta.attrs;
|
|
||||||
|
|
||||||
mkBefore = mkOrder 500;
|
mkBefore = mkOrder 500;
|
||||||
defaultOrderPriority = 1000;
|
defaultOrderPriority = 1000;
|
||||||
mkAfter = mkOrder 1500;
|
mkAfter = mkOrder 1500;
|
||||||
@@ -2412,7 +2306,6 @@ private
|
|||||||
importApply
|
importApply
|
||||||
importJSON
|
importJSON
|
||||||
importTOML
|
importTOML
|
||||||
mapAttrsOfSubmodule
|
|
||||||
mapDefinitionValue
|
mapDefinitionValue
|
||||||
mergeDefinitions
|
mergeDefinitions
|
||||||
mergeAttrDefinitionsWithPrio
|
mergeAttrDefinitionsWithPrio
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
{ lib, ... }:
|
|
||||||
{
|
|
||||||
_class = null; # not specific to NixOS
|
|
||||||
|
|
||||||
options = {
|
|
||||||
|
|
||||||
assertions = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.unspecified;
|
|
||||||
internal = true;
|
|
||||||
default = [ ];
|
|
||||||
example = [
|
|
||||||
{
|
|
||||||
assertion = false;
|
|
||||||
message = "you can't enable this for that reason";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
description = ''
|
|
||||||
This option allows modules to express conditions that must
|
|
||||||
hold for the evaluation of the system configuration to
|
|
||||||
succeed, along with associated error messages for the user.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
warnings = lib.mkOption {
|
|
||||||
internal = true;
|
|
||||||
default = [ ];
|
|
||||||
type = lib.types.listOf lib.types.str;
|
|
||||||
example = [ "The `foo' service is deprecated and will go away soon!" ];
|
|
||||||
description = ''
|
|
||||||
This option allows modules to show warnings to users during
|
|
||||||
the evaluation of the system configuration.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
# impl of assertions is in
|
|
||||||
# - <nixpkgs/nixos/modules/system/activation/top-level.nix>
|
|
||||||
# - <nixpkgs/lib/services/lib.nix>
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
# Test:
|
|
||||||
# ../../../modules/generic/meta-maintainers/test.nix
|
|
||||||
{ lib, ... }:
|
|
||||||
let
|
|
||||||
inherit (lib)
|
|
||||||
mkOption
|
|
||||||
types
|
|
||||||
;
|
|
||||||
|
|
||||||
# The resulting value of this type shows where all values were defined
|
|
||||||
sourceList = types.listOf types.raw // {
|
|
||||||
merge = loc: defs: lib.listToAttrs (lib.map ({ file, value }: lib.nameValuePair file value) defs);
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
_class = null; # not specific to NixOS
|
|
||||||
options = {
|
|
||||||
meta = {
|
|
||||||
maintainers = mkOption {
|
|
||||||
type =
|
|
||||||
let
|
|
||||||
allMaintainers = lib.attrValues lib.maintainers;
|
|
||||||
in
|
|
||||||
lib.types.addCheck sourceList (lib.all (v: lib.elem v allMaintainers))
|
|
||||||
// {
|
|
||||||
description = "list of lib.maintainers";
|
|
||||||
};
|
|
||||||
default = [ ];
|
|
||||||
example = lib.literalExpression "[ lib.maintainers.alice lib.maintainers.bob ]";
|
|
||||||
description = ''
|
|
||||||
List of maintainers of each module.
|
|
||||||
This option should be defined at most once per module.
|
|
||||||
|
|
||||||
The option value is not a list of maintainers, but an attribute set that maps module file names to lists of maintainers.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
teams = mkOption {
|
|
||||||
type =
|
|
||||||
let
|
|
||||||
allTeams = lib.attrValues lib.teams;
|
|
||||||
in
|
|
||||||
lib.types.addCheck sourceList (lib.all (v: lib.elem v allTeams))
|
|
||||||
// {
|
|
||||||
description = "list of lib.teams";
|
|
||||||
};
|
|
||||||
default = [ ];
|
|
||||||
example = lib.literalExpression "[ lib.teams.acme lib.teams.haskell ]";
|
|
||||||
description = ''
|
|
||||||
List of team maintainers of each module.
|
|
||||||
This option should be defined at most once per module.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
meta.maintainers = with lib.maintainers; [
|
|
||||||
pierron
|
|
||||||
roberth
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -50,10 +50,10 @@ rec {
|
|||||||
# darwin/modules/services/system.nix
|
# darwin/modules/services/system.nix
|
||||||
{ lib, config, pkgs, ... }:
|
{ lib, config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
modularServiceConfiguration = lib.services.configure {
|
portable-lib = import <nixpkgs/lib/services/lib.nix> { inherit lib; };
|
||||||
|
|
||||||
|
modularServiceConfiguration = portable-lib.configure {
|
||||||
serviceManagerPkgs = pkgs;
|
serviceManagerPkgs = pkgs;
|
||||||
# To load a different portable service base, set `baseModules` instead:
|
|
||||||
# baseModules = [ (lib.importService { inherit pkgs; }) ];
|
|
||||||
extraRootModules = [
|
extraRootModules = [
|
||||||
./launchd-service.nix # launchd-specific options (plist generation, etc.)
|
./launchd-service.nix # launchd-specific options (plist generation, etc.)
|
||||||
];
|
];
|
||||||
@@ -82,27 +82,18 @@ rec {
|
|||||||
`serviceManagerPkgs`
|
`serviceManagerPkgs`
|
||||||
|
|
||||||
: 1\. A Nixpkgs instance used for built-in logic such as converting
|
: 1\. A Nixpkgs instance used for built-in logic such as converting
|
||||||
`configData.<path>.text` to a store path. Required unless `baseModules`
|
`configData.<path>.text` to a store path.
|
||||||
is set.
|
|
||||||
|
|
||||||
`baseModules`
|
|
||||||
|
|
||||||
: 2\. Modules that replace the portable service base. They are loaded
|
|
||||||
into the "root" service submodule and must handle propagation to
|
|
||||||
sub-`services` themselves. Defaults to the portable service base of
|
|
||||||
this Nixpkgs. Set it to supply a different one, for example a
|
|
||||||
`service.nix` pinned from another Nixpkgs.
|
|
||||||
|
|
||||||
`extraRootModules`
|
`extraRootModules`
|
||||||
|
|
||||||
: 3\. Modules to be loaded into the "root" service submodule, but not
|
: 2\. Modules to be loaded into the "root" service submodule, but not
|
||||||
into its sub-`services`. That's the modules' own responsibility.
|
into its sub-`services`. That's the modules' own responsibility.
|
||||||
Typically contains service-manager-specific option modules
|
Typically contains service-manager-specific option modules
|
||||||
(e.g. systemd unit options, launchd plist options).
|
(e.g. systemd unit options, launchd plist options).
|
||||||
|
|
||||||
`extraRootSpecialArgs`
|
`extraRootSpecialArgs`
|
||||||
|
|
||||||
: 4\. Fixed module arguments provided alongside `extraRootModules`.
|
: 3\. Fixed module arguments provided alongside `extraRootModules`.
|
||||||
|
|
||||||
# Output
|
# Output
|
||||||
|
|
||||||
@@ -112,15 +103,17 @@ rec {
|
|||||||
*/
|
*/
|
||||||
configure =
|
configure =
|
||||||
{
|
{
|
||||||
serviceManagerPkgs ? throw "lib.services.configure: `serviceManagerPkgs` is required unless `baseModules` is set",
|
serviceManagerPkgs,
|
||||||
baseModules ? [ (lib.importService { pkgs = serviceManagerPkgs; }) ],
|
|
||||||
extraRootModules ? [ ],
|
extraRootModules ? [ ],
|
||||||
extraRootSpecialArgs ? { },
|
extraRootSpecialArgs ? { },
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
modules = [
|
||||||
|
(lib.modules.importApply ./service.nix { pkgs = serviceManagerPkgs; })
|
||||||
|
];
|
||||||
serviceSubmodule = types.submoduleWith {
|
serviceSubmodule = types.submoduleWith {
|
||||||
class = "service";
|
class = "service";
|
||||||
modules = baseModules ++ extraRootModules;
|
modules = modules ++ extraRootModules;
|
||||||
specialArgs = extraRootSpecialArgs;
|
specialArgs = extraRootSpecialArgs;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ in
|
|||||||
# https://nixos.org/manual/nixos/unstable/#modular-services
|
# https://nixos.org/manual/nixos/unstable/#modular-services
|
||||||
_class = "service";
|
_class = "service";
|
||||||
imports = [
|
imports = [
|
||||||
../modules/generic/meta-maintainers.nix
|
../../modules/generic/meta-maintainers.nix
|
||||||
../modules/generic/assertions.nix
|
../../nixos/modules/misc/assertions.nix
|
||||||
(lib.modules.importApply ./config-data.nix { inherit pkgs; })
|
(lib.modules.importApply ./config-data.nix { inherit pkgs; })
|
||||||
];
|
];
|
||||||
options = {
|
options = {
|
||||||
|
|||||||
@@ -5,7 +5,13 @@ let
|
|||||||
|
|
||||||
inherit (lib) mkOption types;
|
inherit (lib) mkOption types;
|
||||||
|
|
||||||
portable-lib = lib.services;
|
portable-lib = import ./lib.nix { inherit lib; };
|
||||||
|
|
||||||
|
configured = portable-lib.configure {
|
||||||
|
serviceManagerPkgs = throw "do not use pkgs in this test";
|
||||||
|
extraRootModules = [ ];
|
||||||
|
extraRootSpecialArgs = { };
|
||||||
|
};
|
||||||
|
|
||||||
dummyPkg =
|
dummyPkg =
|
||||||
name:
|
name:
|
||||||
@@ -15,17 +21,6 @@ let
|
|||||||
builder = "/bin/false";
|
builder = "/bin/false";
|
||||||
};
|
};
|
||||||
|
|
||||||
configured = portable-lib.configure {
|
|
||||||
# `coreutils` is the only package the portable layer legitimately needs, to derive
|
|
||||||
# `process.reloadCommand` from `process.reloadSignal`. Anything else reaching for
|
|
||||||
# `pkgs` fails on the missing attribute.
|
|
||||||
serviceManagerPkgs = {
|
|
||||||
coreutils = dummyPkg "coreutils";
|
|
||||||
};
|
|
||||||
extraRootModules = [ ];
|
|
||||||
extraRootSpecialArgs = { };
|
|
||||||
};
|
|
||||||
|
|
||||||
exampleConfig = {
|
exampleConfig = {
|
||||||
services = {
|
services = {
|
||||||
service1 = {
|
service1 = {
|
||||||
@@ -53,7 +48,6 @@ let
|
|||||||
(dummyPkg "cowsay.sh")
|
(dummyPkg "cowsay.sh")
|
||||||
"world"
|
"world"
|
||||||
];
|
];
|
||||||
reloadCommand = "${dummyPkg "cowsay.sh"} reload";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
service3 = {
|
service3 = {
|
||||||
@@ -71,7 +65,6 @@ let
|
|||||||
))
|
))
|
||||||
"!"
|
"!"
|
||||||
];
|
];
|
||||||
reloadSignal = "HUP";
|
|
||||||
};
|
};
|
||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
@@ -155,15 +148,13 @@ let
|
|||||||
# Every service carries some assertions that hold; only the violated ones are of interest here.
|
# Every service carries some assertions that hold; only the violated ones are of interest here.
|
||||||
failures = lib.filter (a: !a.assertion);
|
failures = lib.filter (a: !a.assertion);
|
||||||
|
|
||||||
# The goal of this test is to perform and check a complete evaluation of all options.
|
|
||||||
# Only filter out values that are truly infeasible to check, such as function values.
|
|
||||||
filterEval =
|
filterEval =
|
||||||
config:
|
config:
|
||||||
lib.optionalAttrs (config ? process) {
|
lib.optionalAttrs (config ? process) {
|
||||||
inherit (config) warnings;
|
inherit (config) warnings;
|
||||||
assertions = failures config.assertions;
|
assertions = failures config.assertions;
|
||||||
# `flagFormat` is a function and cannot be compared; the rest of `process` is checked.
|
# Only `argv` is relevant here; `process` also carries the reload options.
|
||||||
process = { inherit (config.process) argv reloadCommand reloadSignal; };
|
process = { inherit (config.process) argv; };
|
||||||
}
|
}
|
||||||
// {
|
// {
|
||||||
services = lib.mapAttrs (k: filterEval) config.services;
|
services = lib.mapAttrs (k: filterEval) config.services;
|
||||||
@@ -179,8 +170,6 @@ let
|
|||||||
"/usr/bin/echo"
|
"/usr/bin/echo"
|
||||||
"hello"
|
"hello"
|
||||||
];
|
];
|
||||||
reloadCommand = null;
|
|
||||||
reloadSignal = null;
|
|
||||||
};
|
};
|
||||||
services = { };
|
services = { };
|
||||||
assertions = [
|
assertions = [
|
||||||
@@ -199,8 +188,6 @@ let
|
|||||||
"${dummyPkg "cowsay.sh"}"
|
"${dummyPkg "cowsay.sh"}"
|
||||||
"world"
|
"world"
|
||||||
];
|
];
|
||||||
reloadCommand = "${dummyPkg "cowsay.sh"} reload";
|
|
||||||
reloadSignal = null;
|
|
||||||
};
|
};
|
||||||
services = { };
|
services = { };
|
||||||
assertions = [ ];
|
assertions = [ ];
|
||||||
@@ -209,8 +196,6 @@ let
|
|||||||
service3 = {
|
service3 = {
|
||||||
process = {
|
process = {
|
||||||
argv = [ "/bin/false" ];
|
argv = [ "/bin/false" ];
|
||||||
reloadCommand = null;
|
|
||||||
reloadSignal = null;
|
|
||||||
};
|
};
|
||||||
services.exclacow = {
|
services.exclacow = {
|
||||||
process = {
|
process = {
|
||||||
@@ -218,8 +203,6 @@ let
|
|||||||
"${dummyPkg "cowsay-ng"}/bin/cowsay"
|
"${dummyPkg "cowsay-ng"}/bin/cowsay"
|
||||||
"!"
|
"!"
|
||||||
];
|
];
|
||||||
reloadCommand = "${dummyPkg "coreutils"}/bin/kill -HUP $MAINPID";
|
|
||||||
reloadSignal = "HUP";
|
|
||||||
};
|
};
|
||||||
services = { };
|
services = { };
|
||||||
assertions = [
|
assertions = [
|
||||||
@@ -245,8 +228,6 @@ let
|
|||||||
"--name"
|
"--name"
|
||||||
"example"
|
"example"
|
||||||
];
|
];
|
||||||
reloadCommand = null;
|
|
||||||
reloadSignal = null;
|
|
||||||
};
|
};
|
||||||
services = { };
|
services = { };
|
||||||
assertions = [ ];
|
assertions = [ ];
|
||||||
@@ -260,8 +241,6 @@ let
|
|||||||
"--quiet=false"
|
"--quiet=false"
|
||||||
"--verbose=true"
|
"--verbose=true"
|
||||||
];
|
];
|
||||||
reloadCommand = null;
|
|
||||||
reloadSignal = null;
|
|
||||||
};
|
};
|
||||||
services = { };
|
services = { };
|
||||||
assertions = [ ];
|
assertions = [ ];
|
||||||
@@ -276,8 +255,6 @@ let
|
|||||||
"--host"
|
"--host"
|
||||||
"b"
|
"b"
|
||||||
];
|
];
|
||||||
reloadCommand = null;
|
|
||||||
reloadSignal = null;
|
|
||||||
};
|
};
|
||||||
services = { };
|
services = { };
|
||||||
assertions = [ ];
|
assertions = [ ];
|
||||||
@@ -293,8 +270,6 @@ let
|
|||||||
"a"
|
"a"
|
||||||
"TRAILING"
|
"TRAILING"
|
||||||
];
|
];
|
||||||
reloadCommand = null;
|
|
||||||
reloadSignal = null;
|
|
||||||
};
|
};
|
||||||
services = { };
|
services = { };
|
||||||
assertions = [ ];
|
assertions = [ ];
|
||||||
|
|||||||
@@ -1190,9 +1190,7 @@ rec {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Quote `string` to be used safely within the Bourne shell if it has any
|
Quote `string` to be used safely within the Bourne shell if it has any
|
||||||
special characters. Prior to escaping, if `string` is a path literal, copy
|
special characters.
|
||||||
it into the store; otherwise, coerce `string` to a string via `toString` if
|
|
||||||
it is not one.
|
|
||||||
|
|
||||||
# Inputs
|
# Inputs
|
||||||
|
|
||||||
@@ -1202,7 +1200,7 @@ rec {
|
|||||||
# Type
|
# Type
|
||||||
|
|
||||||
```
|
```
|
||||||
escapeShellArg :: a -> String
|
escapeShellArg :: String -> String
|
||||||
```
|
```
|
||||||
|
|
||||||
# Examples
|
# Examples
|
||||||
@@ -1219,14 +1217,7 @@ rec {
|
|||||||
escapeShellArg =
|
escapeShellArg =
|
||||||
arg:
|
arg:
|
||||||
let
|
let
|
||||||
string =
|
string = toString arg;
|
||||||
# Even a store path can need escaping; as an extreme example, though
|
|
||||||
# it is deeply unwise, a store path prefix can contain any non-null
|
|
||||||
# character.
|
|
||||||
# If a path has a store path prefix but is not itself a store path, we
|
|
||||||
# still want to copy it into a fresh store object, so as not to take a
|
|
||||||
# dependency on the entire original source.
|
|
||||||
if isPath arg && !isStorePath arg then "${arg}" else toString arg;
|
|
||||||
in
|
in
|
||||||
if match "[[:alnum:],._+:@%/-]+" string == null then
|
if match "[[:alnum:],._+:@%/-]+" string == null then
|
||||||
"'${replaceString "'" "'\\''" string}'"
|
"'${replaceString "'" "'\\''" string}'"
|
||||||
@@ -1572,8 +1563,7 @@ rec {
|
|||||||
toUpper = replaceStrings lowerChars upperChars;
|
toUpper = replaceStrings lowerChars upperChars;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Converts the first character of a string `s` to upper-case and leaves the
|
Converts the first character of a string `s` to upper-case.
|
||||||
remainder lower-case.
|
|
||||||
|
|
||||||
# Inputs
|
# Inputs
|
||||||
|
|
||||||
@@ -1591,8 +1581,8 @@ rec {
|
|||||||
## `lib.strings.toSentenceCase` usage example
|
## `lib.strings.toSentenceCase` usage example
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
toSentenceCase "welcome Home"
|
toSentenceCase "home"
|
||||||
=> "Welcome home"
|
=> "Home"
|
||||||
```
|
```
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|||||||
@@ -161,12 +161,14 @@ let
|
|||||||
(with final; isWindows && isAarch64);
|
(with final; isWindows && isAarch64);
|
||||||
|
|
||||||
# Use the split GCC package set (`gccNGPackages`) instead of the
|
# Use the split GCC package set (`gccNGPackages`) instead of the
|
||||||
# monolithic `gcc`.
|
# monolithic `gcc`. No platform selects it yet; it is opt-in, set
|
||||||
|
# explicitly on a platform spec, so that the split set can be exercised
|
||||||
|
# before anything depends on it.
|
||||||
#
|
#
|
||||||
# I (@Ericson2314) plan on making more obscure low-tier
|
# I (@Ericson2314) plan on making obscure low-tier platforms (e.g.
|
||||||
# platforms (e.g. NetBSD) use it soon, so we can dogfood GCC NG
|
# NetBSD) use it soon, so we can dogfood GCC NG and thereby iron out its
|
||||||
# and thereby iron out its bugs.
|
# bugs.
|
||||||
useGccNG = final.isCygwin;
|
useGccNG = false;
|
||||||
|
|
||||||
libc =
|
libc =
|
||||||
if final.isDarwin then
|
if final.isDarwin then
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user