guix-cookbook.zh_Hans.po 158 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500
  1. # SOME DESCRIPTIVE TITLE
  2. # Copyright (C) 2021 the authors of Guix (msgids) and the following authors (msgstr)
  3. # This file is distributed under the same license as the guix manual package.
  4. # Liu Tao <lyuutau@outlook.com>, 2021.
  5. msgid ""
  6. msgstr ""
  7. "Project-Id-Version: guix manual checkout\n"
  8. "Report-Msgid-Bugs-To: bug-guix@gnu.org\n"
  9. "POT-Creation-Date: 2021-08-25 23:26+0200\n"
  10. "PO-Revision-Date: 2021-06-15 17:05+0000\n"
  11. "Last-Translator: Liu Tao <lyuutau@outlook.com>\n"
  12. "Language-Team: Chinese (Simplified) <https://translate.fedoraproject.org/projects/guix/documentation-cookbook/zh_Hans/>\n"
  13. "Language: zh_Hans\n"
  14. "MIME-Version: 1.0\n"
  15. "Content-Type: text/plain; charset=UTF-8\n"
  16. "Content-Transfer-Encoding: 8bit\n"
  17. "Plural-Forms: nplurals=1; plural=0;\n"
  18. "X-Generator: Weblate 4.6.2\n"
  19. #. type: Plain text
  20. #: guix-git/doc/guix-cookbook.texi:7
  21. msgid "@documentencoding UTF-8"
  22. msgstr "@documentencoding UTF-8"
  23. #. type: top
  24. #: guix-git/doc/guix-cookbook.texi:7 guix-git/doc/guix-cookbook.texi:36
  25. #: guix-git/doc/guix-cookbook.texi:50
  26. #, no-wrap
  27. msgid "GNU Guix Cookbook"
  28. msgstr "GNU Guix 烹饪手册"
  29. #. type: copying
  30. #: guix-git/doc/guix-cookbook.texi:21
  31. #, fuzzy
  32. #| msgid "Copyright @copyright{} 2019 Ricardo Wurmus@* Copyright @copyright{} 2019 Efraim Flashner@* Copyright @copyright{} 2019 Pierre Neidhardt@* Copyright @copyright{} 2020 Oleg Pykhalov@* Copyright @copyright{} 2020 Matthew Brooks@* Copyright @copyright{} 2020 Marcin Karpezo@* Copyright @copyright{} 2020 Brice Waegeneire@* Copyright @copyright{} 2020 André Batista@* Copyright @copyright{} 2020 Christopher Lemmer Webber"
  33. msgid "Copyright @copyright{} 2019 Ricardo Wurmus@* Copyright @copyright{} 2019 Efraim Flashner@* Copyright @copyright{} 2019 Pierre Neidhardt@* Copyright @copyright{} 2020 Oleg Pykhalov@* Copyright @copyright{} 2020 Matthew Brooks@* Copyright @copyright{} 2020 Marcin Karpezo@* Copyright @copyright{} 2020 Brice Waegeneire@* Copyright @copyright{} 2020 André Batista@* Copyright @copyright{} 2020 Christine Lemmer-Webber@* Copyright @copyright{} 2021 Joshua Branson@*"
  34. msgstr "Copyright @copyright{} 2019 Ricardo Wurmus@* Copyright @copyright{} 2019 Efraim Flashner@* Copyright @copyright{} 2019 Pierre Neidhardt@* Copyright @copyright{} 2020 Oleg Pykhalov@* Copyright @copyright{} 2020 Matthew Brooks@* Copyright @copyright{} 2020 Marcin Karpezo@* Copyright @copyright{} 2020 Brice Waegeneire@* Copyright @copyright{} 2020 André Batista@* Copyright @copyright{} 2020 Christopher Lemmer Webber"
  35. #. type: copying
  36. #: guix-git/doc/guix-cookbook.texi:28
  37. msgid "Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''."
  38. msgstr "Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''."
  39. #. type: dircategory
  40. #: guix-git/doc/guix-cookbook.texi:30
  41. #, no-wrap
  42. msgid "System administration"
  43. msgstr "系统管理"
  44. #. type: menuentry
  45. #: guix-git/doc/guix-cookbook.texi:33
  46. msgid "Guix cookbook: (guix-cookbook)"
  47. msgstr "Guix 烹饪手册:(guix-cookbook)"
  48. #. type: menuentry
  49. #: guix-git/doc/guix-cookbook.texi:33
  50. msgid "Tutorials and examples for GNU Guix."
  51. msgstr ""
  52. #. type: subtitle
  53. #: guix-git/doc/guix-cookbook.texi:37
  54. #, no-wrap
  55. msgid "Tutorials and examples for using the GNU Guix Functional Package Manager"
  56. msgstr ""
  57. #. type: author
  58. #: guix-git/doc/guix-cookbook.texi:38
  59. #, no-wrap
  60. msgid "The GNU Guix Developers"
  61. msgstr "GNU Guix 开发者"
  62. #. type: node
  63. #: guix-git/doc/guix-cookbook.texi:49
  64. #, no-wrap
  65. msgid "Top"
  66. msgstr ""
  67. #. type: Plain text
  68. #: guix-git/doc/guix-cookbook.texi:56
  69. msgid "This document presents tutorials and detailed examples for GNU@tie{}Guix, a functional package management tool written for the GNU system. Please @pxref{Top,,, guix, GNU Guix reference manual} for details about the system, its API, and related concepts."
  70. msgstr ""
  71. #. You can replace the following paragraph with information on
  72. #. type: Plain text
  73. #: guix-git/doc/guix-cookbook.texi:64
  74. msgid "If you would like to translate this document in your native language, consider joining @uref{https://translate.fedoraproject.org/projects/guix/documentation-cookbook, Weblate}."
  75. msgstr ""
  76. #. type: chapter
  77. #: guix-git/doc/guix-cookbook.texi:71 guix-git/doc/guix-cookbook.texi:80
  78. #: guix-git/doc/guix-cookbook.texi:96 guix-git/doc/guix-cookbook.texi:97
  79. #, no-wrap
  80. msgid "Scheme tutorials"
  81. msgstr ""
  82. #. type: menuentry
  83. #: guix-git/doc/guix-cookbook.texi:71
  84. msgid "Meet your new favorite language!"
  85. msgstr ""
  86. #. type: chapter
  87. #: guix-git/doc/guix-cookbook.texi:71 guix-git/doc/guix-cookbook.texi:84
  88. #: guix-git/doc/guix-cookbook.texi:303 guix-git/doc/guix-cookbook.texi:304
  89. #, no-wrap
  90. msgid "Packaging"
  91. msgstr "打包"
  92. #. type: menuentry
  93. #: guix-git/doc/guix-cookbook.texi:71
  94. msgid "Packaging tutorials"
  95. msgstr "打包教程"
  96. #. type: chapter
  97. #: guix-git/doc/guix-cookbook.texi:71 guix-git/doc/guix-cookbook.texi:88
  98. #: guix-git/doc/guix-cookbook.texi:1346 guix-git/doc/guix-cookbook.texi:1347
  99. #, no-wrap
  100. msgid "System Configuration"
  101. msgstr "系统配置"
  102. #. type: menuentry
  103. #: guix-git/doc/guix-cookbook.texi:71
  104. msgid "Customizing the GNU System"
  105. msgstr "定制 GNU 系统"
  106. #. type: chapter
  107. #: guix-git/doc/guix-cookbook.texi:71 guix-git/doc/guix-cookbook.texi:2441
  108. #: guix-git/doc/guix-cookbook.texi:2442
  109. #, no-wrap
  110. msgid "Advanced package management"
  111. msgstr ""
  112. #. type: menuentry
  113. #: guix-git/doc/guix-cookbook.texi:71
  114. msgid "Power to the users!"
  115. msgstr ""
  116. #. type: chapter
  117. #: guix-git/doc/guix-cookbook.texi:71 guix-git/doc/guix-cookbook.texi:2839
  118. #: guix-git/doc/guix-cookbook.texi:2840
  119. #, no-wrap
  120. msgid "Environment management"
  121. msgstr "环境管理"
  122. #. type: menuentry
  123. #: guix-git/doc/guix-cookbook.texi:71
  124. msgid "Control environment"
  125. msgstr ""
  126. #. type: chapter
  127. #: guix-git/doc/guix-cookbook.texi:75 guix-git/doc/guix-cookbook.texi:2963
  128. #: guix-git/doc/guix-cookbook.texi:2964
  129. #, no-wrap
  130. msgid "Acknowledgments"
  131. msgstr ""
  132. #. type: menuentry
  133. #: guix-git/doc/guix-cookbook.texi:75
  134. msgid "Thanks!"
  135. msgstr ""
  136. #. type: appendix
  137. #: guix-git/doc/guix-cookbook.texi:75 guix-git/doc/guix-cookbook.texi:2988
  138. #: guix-git/doc/guix-cookbook.texi:2989
  139. #, no-wrap
  140. msgid "GNU Free Documentation License"
  141. msgstr ""
  142. #. type: menuentry
  143. #: guix-git/doc/guix-cookbook.texi:75
  144. msgid "The license of this document."
  145. msgstr ""
  146. #. type: unnumbered
  147. #: guix-git/doc/guix-cookbook.texi:75 guix-git/doc/guix-cookbook.texi:2994
  148. #: guix-git/doc/guix-cookbook.texi:2995
  149. #, no-wrap
  150. msgid "Concept Index"
  151. msgstr ""
  152. #. type: menuentry
  153. #: guix-git/doc/guix-cookbook.texi:75
  154. msgid "Concepts."
  155. msgstr ""
  156. #. type: menuentry
  157. #: guix-git/doc/guix-cookbook.texi:78
  158. msgid "--- The Detailed Node Listing ---"
  159. msgstr ""
  160. #. type: section
  161. #: guix-git/doc/guix-cookbook.texi:82 guix-git/doc/guix-cookbook.texi:110
  162. #: guix-git/doc/guix-cookbook.texi:111
  163. #, no-wrap
  164. msgid "A Scheme Crash Course"
  165. msgstr ""
  166. #. type: menuentry
  167. #: guix-git/doc/guix-cookbook.texi:82
  168. msgid "Learn the basics of Scheme"
  169. msgstr ""
  170. #. type: section
  171. #: guix-git/doc/guix-cookbook.texi:86 guix-git/doc/guix-cookbook.texi:315
  172. #: guix-git/doc/guix-cookbook.texi:317 guix-git/doc/guix-cookbook.texi:318
  173. #, no-wrap
  174. msgid "Packaging Tutorial"
  175. msgstr ""
  176. #. type: menuentry
  177. #: guix-git/doc/guix-cookbook.texi:86
  178. msgid "Let's add a package to Guix!"
  179. msgstr ""
  180. #. type: section
  181. #: guix-git/doc/guix-cookbook.texi:91 guix-git/doc/guix-cookbook.texi:1366
  182. #: guix-git/doc/guix-cookbook.texi:1368 guix-git/doc/guix-cookbook.texi:1369
  183. #, no-wrap
  184. msgid "Auto-Login to a Specific TTY"
  185. msgstr ""
  186. #. type: menuentry
  187. #: guix-git/doc/guix-cookbook.texi:91 guix-git/doc/guix-cookbook.texi:1366
  188. msgid "Automatically Login a User to a Specific TTY"
  189. msgstr ""
  190. #. type: section
  191. #: guix-git/doc/guix-cookbook.texi:91 guix-git/doc/guix-cookbook.texi:1366
  192. #: guix-git/doc/guix-cookbook.texi:1413 guix-git/doc/guix-cookbook.texi:1414
  193. #, no-wrap
  194. msgid "Customizing the Kernel"
  195. msgstr ""
  196. #. type: menuentry
  197. #: guix-git/doc/guix-cookbook.texi:91 guix-git/doc/guix-cookbook.texi:1366
  198. msgid "Creating and using a custom Linux kernel on Guix System."
  199. msgstr ""
  200. #. type: Plain text
  201. #: guix-git/doc/guix-cookbook.texi:103
  202. msgid "GNU@tie{}Guix is written in the general purpose programming language Scheme, and many of its features can be accessed and manipulated programmatically. You can use Scheme to generate package definitions, to modify them, to build them, to deploy whole operating systems, etc."
  203. msgstr ""
  204. #. type: Plain text
  205. #: guix-git/doc/guix-cookbook.texi:107
  206. msgid "Knowing the basics of how to program in Scheme will unlock many of the advanced features Guix provides --- and you don't even need to be an experienced programmer to use them!"
  207. msgstr ""
  208. #. type: Plain text
  209. #: guix-git/doc/guix-cookbook.texi:109
  210. msgid "Let's get started!"
  211. msgstr ""
  212. #. type: cindex
  213. #: guix-git/doc/guix-cookbook.texi:113
  214. #, no-wrap
  215. msgid "Scheme, crash course"
  216. msgstr ""
  217. #. type: Plain text
  218. #: guix-git/doc/guix-cookbook.texi:119
  219. msgid "Guix uses the Guile implementation of Scheme. To start playing with the language, install it with @code{guix install guile} and start a @dfn{REPL}---short for @uref{https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop, @dfn{read-eval-print loop}}---by running @code{guile} from the command line."
  220. msgstr ""
  221. #. type: Plain text
  222. #: guix-git/doc/guix-cookbook.texi:122
  223. msgid "Alternatively you can also run @code{guix environment --ad-hoc guile -- guile} if you'd rather not have Guile installed in your user profile."
  224. msgstr ""
  225. #. type: Plain text
  226. #: guix-git/doc/guix-cookbook.texi:128
  227. msgid "In the following examples, lines show what you would type at the REPL; lines starting with ``@result{}'' show evaluation results, while lines starting with ``@print{}'' show things that get printed. @xref{Using Guile Interactively,,, guile, GNU Guile Reference Manual}, for more details on the REPL."
  228. msgstr ""
  229. #. type: itemize
  230. #: guix-git/doc/guix-cookbook.texi:136
  231. msgid "Scheme syntax boils down to a tree of expressions (or @emph{s-expression} in Lisp lingo). An expression can be a literal such as numbers and strings, or a compound which is a parenthesized list of compounds and literals. @code{#true} and @code{#false} (abbreviated @code{#t} and @code{#f}) stand for the Booleans ``true'' and ``false'', respectively."
  232. msgstr ""
  233. #. type: itemize
  234. #: guix-git/doc/guix-cookbook.texi:138
  235. msgid "Examples of valid expressions:"
  236. msgstr ""
  237. #. type: lisp
  238. #: guix-git/doc/guix-cookbook.texi:142
  239. #, no-wrap
  240. msgid ""
  241. "\"Hello World!\"\n"
  242. "@result{} \"Hello World!\"\n"
  243. "\n"
  244. msgstr ""
  245. #. type: lisp
  246. #: guix-git/doc/guix-cookbook.texi:145
  247. #, no-wrap
  248. msgid ""
  249. "17\n"
  250. "@result{} 17\n"
  251. "\n"
  252. msgstr ""
  253. #. type: lisp
  254. #: guix-git/doc/guix-cookbook.texi:149
  255. #, no-wrap
  256. msgid ""
  257. "(display (string-append \"Hello \" \"Guix\" \"\\n\"))\n"
  258. "@print{} Hello Guix!\n"
  259. "@result{} #<unspecified>\n"
  260. msgstr ""
  261. #. type: itemize
  262. #: guix-git/doc/guix-cookbook.texi:156
  263. msgid "This last example is a function call nested in another function call. When a parenthesized expression is evaluated, the first term is the function and the rest are the arguments passed to the function. Every function returns the last evaluated expression as its return value."
  264. msgstr ""
  265. #. type: itemize
  266. #: guix-git/doc/guix-cookbook.texi:159
  267. msgid "Anonymous functions are declared with the @code{lambda} term:"
  268. msgstr ""
  269. #. type: lisp
  270. #: guix-git/doc/guix-cookbook.texi:163
  271. #, no-wrap
  272. msgid ""
  273. "(lambda (x) (* x x))\n"
  274. "@result{} #<procedure 120e348 at <unknown port>:24:0 (x)>\n"
  275. msgstr ""
  276. #. type: itemize
  277. #: guix-git/doc/guix-cookbook.texi:168
  278. msgid "The above procedure returns the square of its argument. Since everything is an expression, the @code{lambda} expression returns an anonymous procedure, which can in turn be applied to an argument:"
  279. msgstr ""
  280. #. type: lisp
  281. #: guix-git/doc/guix-cookbook.texi:172
  282. #, no-wrap
  283. msgid ""
  284. "((lambda (x) (* x x)) 3)\n"
  285. "@result{} 9\n"
  286. msgstr ""
  287. #. type: itemize
  288. #: guix-git/doc/guix-cookbook.texi:176
  289. msgid "Anything can be assigned a global name with @code{define}:"
  290. msgstr ""
  291. #. type: lisp
  292. #: guix-git/doc/guix-cookbook.texi:182
  293. #, no-wrap
  294. msgid ""
  295. "(define a 3)\n"
  296. "(define square (lambda (x) (* x x)))\n"
  297. "(square a)\n"
  298. "@result{} 9\n"
  299. msgstr ""
  300. #. type: itemize
  301. #: guix-git/doc/guix-cookbook.texi:186
  302. msgid "Procedures can be defined more concisely with the following syntax:"
  303. msgstr ""
  304. #. type: lisp
  305. #: guix-git/doc/guix-cookbook.texi:189
  306. #, no-wrap
  307. msgid "(define (square x) (* x x))\n"
  308. msgstr ""
  309. #. type: itemize
  310. #: guix-git/doc/guix-cookbook.texi:193
  311. msgid "A list structure can be created with the @code{list} procedure:"
  312. msgstr ""
  313. #. type: lisp
  314. #: guix-git/doc/guix-cookbook.texi:197
  315. #, no-wrap
  316. msgid ""
  317. "(list 2 a 5 7)\n"
  318. "@result{} (2 3 5 7)\n"
  319. msgstr ""
  320. #. type: itemize
  321. #: guix-git/doc/guix-cookbook.texi:204
  322. msgid "The @dfn{quote} disables evaluation of a parenthesized expression: the first term is not called over the other terms (@pxref{Expression Syntax, quote,, guile, GNU Guile Reference Manual}). Thus it effectively returns a list of terms."
  323. msgstr ""
  324. #. type: lisp
  325. #: guix-git/doc/guix-cookbook.texi:208
  326. #, no-wrap
  327. msgid ""
  328. "'(display (string-append \"Hello \" \"Guix\" \"\\n\"))\n"
  329. "@result{} (display (string-append \"Hello \" \"Guix\" \"\\n\"))\n"
  330. "\n"
  331. msgstr ""
  332. #. type: lisp
  333. #: guix-git/doc/guix-cookbook.texi:211
  334. #, no-wrap
  335. msgid ""
  336. "'(2 a 5 7)\n"
  337. "@result{} (2 a 5 7)\n"
  338. msgstr ""
  339. #. type: itemize
  340. #: guix-git/doc/guix-cookbook.texi:217
  341. msgid "The @dfn{quasiquote} disables evaluation of a parenthesized expression until @dfn{unquote} (a comma) re-enables it. Thus it provides us with fine-grained control over what is evaluated and what is not."
  342. msgstr ""
  343. #. type: lisp
  344. #: guix-git/doc/guix-cookbook.texi:221
  345. #, no-wrap
  346. msgid ""
  347. "`(2 a 5 7 (2 ,a 5 ,(+ a 4)))\n"
  348. "@result{} (2 a 5 7 (2 3 5 7))\n"
  349. msgstr ""
  350. #. type: itemize
  351. #: guix-git/doc/guix-cookbook.texi:225
  352. msgid "Note that the above result is a list of mixed elements: numbers, symbols (here @code{a}) and the last element is a list itself."
  353. msgstr ""
  354. #. type: itemize
  355. #: guix-git/doc/guix-cookbook.texi:229
  356. msgid "Multiple variables can be named locally with @code{let} (@pxref{Local Bindings,,, guile, GNU Guile Reference Manual}):"
  357. msgstr ""
  358. #. type: lisp
  359. #: guix-git/doc/guix-cookbook.texi:236
  360. #, no-wrap
  361. msgid ""
  362. "(define x 10)\n"
  363. "(let ((x 2)\n"
  364. " (y 3))\n"
  365. " (list x y))\n"
  366. "@result{} (2 3)\n"
  367. "\n"
  368. msgstr ""
  369. #. type: lisp
  370. #: guix-git/doc/guix-cookbook.texi:239
  371. #, no-wrap
  372. msgid ""
  373. "x\n"
  374. "@result{} 10\n"
  375. "\n"
  376. msgstr ""
  377. #. type: lisp
  378. #: guix-git/doc/guix-cookbook.texi:242
  379. #, no-wrap
  380. msgid ""
  381. "y\n"
  382. "@error{} In procedure module-lookup: Unbound variable: y\n"
  383. msgstr ""
  384. #. type: itemize
  385. #: guix-git/doc/guix-cookbook.texi:246
  386. msgid "Use @code{let*} to allow later variable declarations to refer to earlier definitions."
  387. msgstr ""
  388. #. type: lisp
  389. #: guix-git/doc/guix-cookbook.texi:252
  390. #, no-wrap
  391. msgid ""
  392. "(let* ((x 2)\n"
  393. " (y (* x 3)))\n"
  394. " (list x y))\n"
  395. "@result{} (2 6)\n"
  396. msgstr ""
  397. #. type: itemize
  398. #: guix-git/doc/guix-cookbook.texi:259
  399. msgid "@dfn{Keywords} are typically used to identify the named parameters of a procedure. They are prefixed by @code{#:} (hash, colon) followed by alphanumeric characters: @code{#:like-this}. @xref{Keywords,,, guile, GNU Guile Reference Manual}."
  400. msgstr ""
  401. #. type: itemize
  402. #: guix-git/doc/guix-cookbook.texi:264
  403. msgid "The percentage @code{%} is typically used for read-only global variables in the build stage. Note that it is merely a convention, like @code{_} in C. Scheme treats @code{%} exactly the same as any other letter."
  404. msgstr ""
  405. #. type: itemize
  406. #: guix-git/doc/guix-cookbook.texi:268
  407. msgid "Modules are created with @code{define-module} (@pxref{Creating Guile Modules,,, guile, GNU Guile Reference Manual}). For instance"
  408. msgstr ""
  409. #. type: lisp
  410. #: guix-git/doc/guix-cookbook.texi:274
  411. #, no-wrap
  412. msgid ""
  413. "(define-module (guix build-system ruby)\n"
  414. " #:use-module (guix store)\n"
  415. " #:export (ruby-build\n"
  416. " ruby-build-system))\n"
  417. msgstr ""
  418. #. type: itemize
  419. #: guix-git/doc/guix-cookbook.texi:280
  420. msgid "defines the module @code{guix build-system ruby} which must be located in @file{guix/build-system/ruby.scm} somewhere in the Guile load path. It depends on the @code{(guix store)} module and it exports two variables, @code{ruby-build} and @code{ruby-build-system}."
  421. msgstr ""
  422. #. type: Plain text
  423. #: guix-git/doc/guix-cookbook.texi:285
  424. msgid "For a more detailed introduction, check out @uref{http://www.troubleshooters.com/codecorn/scheme_guile/hello.htm, Scheme at a Glance}, by Steve Litt."
  425. msgstr ""
  426. #. type: Plain text
  427. #: guix-git/doc/guix-cookbook.texi:297
  428. msgid "One of the reference Scheme books is the seminal ``Structure and Interpretation of Computer Programs'', by Harold Abelson and Gerald Jay Sussman, with Julie Sussman. You'll find a @uref{https://mitpress.mit.edu/sites/default/files/sicp/index.html, free copy online}, together with @uref{https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/video-lectures/, videos of the lectures by the authors}. The book is available in Texinfo format as the @code{sicp} Guix package. Go ahead, run @code{guix install sicp} and start reading with @code{info sicp} (@pxref{,,, sicp, Structure and Interpretation of Computer Programs}). An @uref{https://sarabander.github.io/sicp/, unofficial ebook is also available}."
  429. msgstr ""
  430. #. type: Plain text
  431. #: guix-git/doc/guix-cookbook.texi:300
  432. msgid "You'll find more books, tutorials and other resources at @url{https://schemers.org/}."
  433. msgstr ""
  434. #. type: cindex
  435. #: guix-git/doc/guix-cookbook.texi:306
  436. #, no-wrap
  437. msgid "packaging"
  438. msgstr ""
  439. #. type: Plain text
  440. #: guix-git/doc/guix-cookbook.texi:312
  441. msgid "This chapter is dedicated to teaching you how to add packages to the collection of packages that come with GNU Guix. This involves writing package definitions in Guile Scheme, organizing them in package modules, and building them."
  442. msgstr ""
  443. #. type: menuentry
  444. #: guix-git/doc/guix-cookbook.texi:315
  445. msgid "A tutorial on how to add packages to Guix."
  446. msgstr ""
  447. #. type: Plain text
  448. #: guix-git/doc/guix-cookbook.texi:326
  449. msgid "GNU Guix stands out as the @emph{hackable} package manager, mostly because it uses @uref{https://www.gnu.org/software/guile/, GNU Guile}, a powerful high-level programming language, one of the @uref{https://en.wikipedia.org/wiki/Scheme_%28programming_language%29, Scheme} dialects from the @uref{https://en.wikipedia.org/wiki/Lisp_%28programming_language%29, Lisp family}."
  450. msgstr ""
  451. #. type: Plain text
  452. #: guix-git/doc/guix-cookbook.texi:330
  453. msgid "Package definitions are also written in Scheme, which empowers Guix in some very unique ways, unlike most other package managers that use shell scripts or simple languages."
  454. msgstr ""
  455. #. type: itemize
  456. #: guix-git/doc/guix-cookbook.texi:335
  457. msgid "Use functions, structures, macros and all of Scheme expressiveness for your package definitions."
  458. msgstr ""
  459. #. type: itemize
  460. #: guix-git/doc/guix-cookbook.texi:339
  461. msgid "Inheritance makes it easy to customize a package by inheriting from it and modifying only what is needed."
  462. msgstr ""
  463. #. type: itemize
  464. #: guix-git/doc/guix-cookbook.texi:349
  465. msgid "Batch processing: the whole package collection can be parsed, filtered and processed. Building a headless server with all graphical interfaces stripped out? It's possible. Want to rebuild everything from source using specific compiler optimization flags? Pass the @code{#:make-flags \"...\"} argument to the list of packages. It wouldn't be a stretch to think @uref{https://wiki.gentoo.org/wiki/USE_flag, Gentoo USE flags} here, but this goes even further: the changes don't have to be thought out beforehand by the packager, they can be @emph{programmed} by the user!"
  466. msgstr ""
  467. #. type: Plain text
  468. #: guix-git/doc/guix-cookbook.texi:355
  469. msgid "The following tutorial covers all the basics around package creation with Guix. It does not assume much knowledge of the Guix system nor of the Lisp language. The reader is only expected to be familiar with the command line and to have some basic programming knowledge."
  470. msgstr ""
  471. #. type: subsection
  472. #: guix-git/doc/guix-cookbook.texi:356 guix-git/doc/guix-cookbook.texi:357
  473. #, no-wrap
  474. msgid "A ``Hello World'' package"
  475. msgstr ""
  476. #. type: Plain text
  477. #: guix-git/doc/guix-cookbook.texi:362
  478. msgid "The ``Defining Packages'' section of the manual introduces the basics of Guix packaging (@pxref{Defining Packages,,, guix, GNU Guix Reference Manual}). In the following section, we will partly go over those basics again."
  479. msgstr ""
  480. #. type: Plain text
  481. #: guix-git/doc/guix-cookbook.texi:368
  482. msgid "GNU@tie{}Hello is a dummy project that serves as an idiomatic example for packaging. It uses the GNU build system (@code{./configure && make && make install}). Guix already provides a package definition which is a perfect example to start with. You can look up its declaration with @code{guix edit hello} from the command line. Let's see how it looks:"
  483. msgstr ""
  484. #. type: lisp
  485. #: guix-git/doc/guix-cookbook.texi:389
  486. #, no-wrap
  487. msgid ""
  488. "(define-public hello\n"
  489. " (package\n"
  490. " (name \"hello\")\n"
  491. " (version \"2.10\")\n"
  492. " (source (origin\n"
  493. " (method url-fetch)\n"
  494. " (uri (string-append \"mirror://gnu/hello/hello-\" version\n"
  495. " \".tar.gz\"))\n"
  496. " (sha256\n"
  497. " (base32\n"
  498. " \"0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i\"))))\n"
  499. " (build-system gnu-build-system)\n"
  500. " (synopsis \"Hello, GNU world: An example GNU package\")\n"
  501. " (description\n"
  502. " \"GNU Hello prints the message \\\"Hello, world!\\\" and then exits. It\n"
  503. "serves as an example of standard GNU coding practices. As such, it supports\n"
  504. "command-line arguments, multiple languages, and so on.\")\n"
  505. " (home-page \"https://www.gnu.org/software/hello/\")\n"
  506. " (license gpl3+)))\n"
  507. msgstr ""
  508. #. type: Plain text
  509. #: guix-git/doc/guix-cookbook.texi:393
  510. msgid "As you can see, most of it is rather straightforward. But let's review the fields together:"
  511. msgstr ""
  512. #. type: item
  513. #: guix-git/doc/guix-cookbook.texi:395
  514. #, no-wrap
  515. msgid "name"
  516. msgstr ""
  517. #. type: table
  518. #: guix-git/doc/guix-cookbook.texi:398
  519. msgid "The project name. Using Scheme conventions, we prefer to keep it lower case, without underscore and using dash-separated words."
  520. msgstr ""
  521. #. type: item
  522. #: guix-git/doc/guix-cookbook.texi:399
  523. #, no-wrap
  524. msgid "source"
  525. msgstr ""
  526. #. type: table
  527. #: guix-git/doc/guix-cookbook.texi:402
  528. msgid "This field contains a description of the source code origin. The @code{origin} record contains these fields:"
  529. msgstr ""
  530. #. type: item
  531. #: guix-git/doc/guix-cookbook.texi:404
  532. #, no-wrap
  533. msgid "The method, here @code{url-fetch} to download via HTTP/FTP, but other methods"
  534. msgstr ""
  535. #. type: enumerate
  536. #: guix-git/doc/guix-cookbook.texi:406
  537. msgid "exist, such as @code{git-fetch} for Git repositories."
  538. msgstr ""
  539. #. type: item
  540. #: guix-git/doc/guix-cookbook.texi:406
  541. #, no-wrap
  542. msgid "The URI, which is typically some @code{https://} location for @code{url-fetch}. Here"
  543. msgstr ""
  544. #. type: enumerate
  545. #: guix-git/doc/guix-cookbook.texi:409
  546. msgid "the special `mirror://gnu` refers to a set of well known locations, all of which can be used by Guix to fetch the source, should some of them fail."
  547. msgstr ""
  548. #. type: item
  549. #: guix-git/doc/guix-cookbook.texi:409
  550. #, no-wrap
  551. msgid "The @code{sha256} checksum of the requested file. This is essential to ensure"
  552. msgstr ""
  553. #. type: enumerate
  554. #: guix-git/doc/guix-cookbook.texi:412
  555. msgid "the source is not corrupted. Note that Guix works with base32 strings, hence the call to the @code{base32} function."
  556. msgstr ""
  557. #. type: item
  558. #: guix-git/doc/guix-cookbook.texi:414
  559. #, no-wrap
  560. msgid "build-system"
  561. msgstr ""
  562. #. type: table
  563. #: guix-git/doc/guix-cookbook.texi:423
  564. msgid "This is where the power of abstraction provided by the Scheme language really shines: in this case, the @code{gnu-build-system} abstracts away the famous @code{./configure && make && make install} shell invocations. Other build systems include the @code{trivial-build-system} which does not do anything and requires from the packager to program all the build steps, the @code{python-build-system}, the @code{emacs-build-system}, and many more (@pxref{Build Systems,,, guix, GNU Guix Reference Manual})."
  565. msgstr ""
  566. #. type: item
  567. #: guix-git/doc/guix-cookbook.texi:424
  568. #, no-wrap
  569. msgid "synopsis"
  570. msgstr ""
  571. #. type: table
  572. #: guix-git/doc/guix-cookbook.texi:427
  573. msgid "It should be a concise summary of what the package does. For many packages a tagline from the project's home page can be used as the synopsis."
  574. msgstr ""
  575. #. type: item
  576. #: guix-git/doc/guix-cookbook.texi:428
  577. #, no-wrap
  578. msgid "description"
  579. msgstr ""
  580. #. type: table
  581. #: guix-git/doc/guix-cookbook.texi:431
  582. msgid "Same as for the synopsis, it's fine to re-use the project description from the homepage. Note that Guix uses Texinfo syntax."
  583. msgstr ""
  584. #. type: item
  585. #: guix-git/doc/guix-cookbook.texi:432
  586. #, no-wrap
  587. msgid "home-page"
  588. msgstr ""
  589. #. type: table
  590. #: guix-git/doc/guix-cookbook.texi:434
  591. msgid "Use HTTPS if available."
  592. msgstr ""
  593. #. type: item
  594. #: guix-git/doc/guix-cookbook.texi:435
  595. #, no-wrap
  596. msgid "license"
  597. msgstr ""
  598. #. type: table
  599. #: guix-git/doc/guix-cookbook.texi:438
  600. msgid "See @code{guix/licenses.scm} in the project source for a full list of available licenses."
  601. msgstr ""
  602. #. type: Plain text
  603. #: guix-git/doc/guix-cookbook.texi:442
  604. msgid "Time to build our first package! Nothing fancy here for now: we will stick to a dummy @code{my-hello}, a copy of the above declaration."
  605. msgstr ""
  606. #. type: Plain text
  607. #: guix-git/doc/guix-cookbook.texi:446
  608. msgid "As with the ritualistic ``Hello World'' taught with most programming languages, this will possibly be the most ``manual'' approach. We will work out an ideal setup later; for now we will go the simplest route."
  609. msgstr ""
  610. #. type: Plain text
  611. #: guix-git/doc/guix-cookbook.texi:448
  612. msgid "Save the following to a file @file{my-hello.scm}."
  613. msgstr ""
  614. #. type: lisp
  615. #: guix-git/doc/guix-cookbook.texi:454
  616. #, no-wrap
  617. msgid ""
  618. "(use-modules (guix packages)\n"
  619. " (guix download)\n"
  620. " (guix build-system gnu)\n"
  621. " (guix licenses))\n"
  622. "\n"
  623. msgstr ""
  624. #. type: lisp
  625. #: guix-git/doc/guix-cookbook.texi:473
  626. #, no-wrap
  627. msgid ""
  628. "(package\n"
  629. " (name \"my-hello\")\n"
  630. " (version \"2.10\")\n"
  631. " (source (origin\n"
  632. " (method url-fetch)\n"
  633. " (uri (string-append \"mirror://gnu/hello/hello-\" version\n"
  634. " \".tar.gz\"))\n"
  635. " (sha256\n"
  636. " (base32\n"
  637. " \"0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i\"))))\n"
  638. " (build-system gnu-build-system)\n"
  639. " (synopsis \"Hello, Guix world: An example custom Guix package\")\n"
  640. " (description\n"
  641. " \"GNU Hello prints the message \\\"Hello, world!\\\" and then exits. It\n"
  642. "serves as an example of standard GNU coding practices. As such, it supports\n"
  643. "command-line arguments, multiple languages, and so on.\")\n"
  644. " (home-page \"https://www.gnu.org/software/hello/\")\n"
  645. " (license gpl3+))\n"
  646. msgstr ""
  647. #. type: Plain text
  648. #: guix-git/doc/guix-cookbook.texi:476
  649. msgid "We will explain the extra code in a moment."
  650. msgstr ""
  651. #. type: Plain text
  652. #: guix-git/doc/guix-cookbook.texi:483
  653. msgid "Feel free to play with the different values of the various fields. If you change the source, you'll need to update the checksum. Indeed, Guix refuses to build anything if the given checksum does not match the computed checksum of the source code. To obtain the correct checksum of the package declaration, we need to download the source, compute the sha256 checksum and convert it to base32."
  654. msgstr ""
  655. #. type: Plain text
  656. #: guix-git/doc/guix-cookbook.texi:486
  657. msgid "Thankfully, Guix can automate this task for us; all we need is to provide the URI:"
  658. msgstr ""
  659. #. This is example shell output.
  660. #. type: example
  661. #: guix-git/doc/guix-cookbook.texi:490
  662. #, no-wrap
  663. msgid ""
  664. "$ guix download mirror://gnu/hello/hello-2.10.tar.gz\n"
  665. "\n"
  666. msgstr ""
  667. #. type: example
  668. #: guix-git/doc/guix-cookbook.texi:497
  669. #, no-wrap
  670. msgid ""
  671. "Starting download of /tmp/guix-file.JLYgL7\n"
  672. "From https://ftpmirror.gnu.org/gnu/hello/hello-2.10.tar.gz...\n"
  673. "following redirection to `https://mirror.ibcp.fr/pub/gnu/hello/hello-2.10.tar.gz'...\n"
  674. " …10.tar.gz 709KiB 2.5MiB/s 00:00 [##################] 100.0%\n"
  675. "/gnu/store/hbdalsf5lpf01x4dcknwx6xbn6n5km6k-hello-2.10.tar.gz\n"
  676. "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i\n"
  677. msgstr ""
  678. #. type: Plain text
  679. #: guix-git/doc/guix-cookbook.texi:502
  680. msgid "In this specific case the output tells us which mirror was chosen. If the result of the above command is not the same as in the above snippet, update your @code{my-hello} declaration accordingly."
  681. msgstr ""
  682. #. type: Plain text
  683. #: guix-git/doc/guix-cookbook.texi:506
  684. msgid "Note that GNU package tarballs come with an OpenPGP signature, so you should definitely check the signature of this tarball with `gpg` to authenticate it before going further:"
  685. msgstr ""
  686. #. This is example shell output.
  687. #. type: example
  688. #: guix-git/doc/guix-cookbook.texi:510
  689. #, no-wrap
  690. msgid ""
  691. "$ guix download mirror://gnu/hello/hello-2.10.tar.gz.sig\n"
  692. "\n"
  693. msgstr ""
  694. #. type: example
  695. #: guix-git/doc/guix-cookbook.texi:525
  696. #, no-wrap
  697. msgid ""
  698. "Starting download of /tmp/guix-file.03tFfb\n"
  699. "From https://ftpmirror.gnu.org/gnu/hello/hello-2.10.tar.gz.sig...\n"
  700. "following redirection to `https://ftp.igh.cnrs.fr/pub/gnu/hello/hello-2.10.tar.gz.sig'...\n"
  701. " ….tar.gz.sig 819B 1.2MiB/s 00:00 [##################] 100.0%\n"
  702. "/gnu/store/rzs8wba9ka7grrmgcpfyxvs58mly0sx6-hello-2.10.tar.gz.sig\n"
  703. "0q0v86n3y38z17rl146gdakw9xc4mcscpk8dscs412j22glrv9jf\n"
  704. "$ gpg --verify /gnu/store/rzs8wba9ka7grrmgcpfyxvs58mly0sx6-hello-2.10.tar.gz.sig /gnu/store/hbdalsf5lpf01x4dcknwx6xbn6n5km6k-hello-2.10.tar.gz\n"
  705. "gpg: Signature made Sun 16 Nov 2014 01:08:37 PM CET\n"
  706. "gpg: using RSA key A9553245FDE9B739\n"
  707. "gpg: Good signature from \"Sami Kerola <kerolasa@@iki.fi>\" [unknown]\n"
  708. "gpg: aka \"Sami Kerola (http://www.iki.fi/kerolasa/) <kerolasa@@iki.fi>\" [unknown]\n"
  709. "gpg: WARNING: This key is not certified with a trusted signature!\n"
  710. "gpg: There is no indication that the signature belongs to the owner.\n"
  711. "Primary key fingerprint: 8ED3 96E3 7E38 D471 A005 30D3 A955 3245 FDE9 B739\n"
  712. msgstr ""
  713. #. type: Plain text
  714. #: guix-git/doc/guix-cookbook.texi:528
  715. msgid "You can then happily run"
  716. msgstr ""
  717. #. Do not translate this command
  718. #. type: example
  719. #: guix-git/doc/guix-cookbook.texi:532
  720. #, no-wrap
  721. msgid "$ guix package --install-from-file=my-hello.scm\n"
  722. msgstr ""
  723. #. type: Plain text
  724. #: guix-git/doc/guix-cookbook.texi:535
  725. msgid "You should now have @code{my-hello} in your profile!"
  726. msgstr ""
  727. #. Do not translate this command
  728. #. type: example
  729. #: guix-git/doc/guix-cookbook.texi:541
  730. #, no-wrap
  731. msgid ""
  732. "$ guix package --list-installed=my-hello\n"
  733. "my-hello\t2.10\tout\n"
  734. "/gnu/store/f1db2mfm8syb8qvc357c53slbvf1g9m9-my-hello-2.10\n"
  735. msgstr ""
  736. #. type: Plain text
  737. #: guix-git/doc/guix-cookbook.texi:546
  738. msgid "We've gone as far as we could without any knowledge of Scheme. Before moving on to more complex packages, now is the right time to brush up on your Scheme knowledge. @pxref{A Scheme Crash Course} to get up to speed."
  739. msgstr ""
  740. #. type: subsection
  741. #: guix-git/doc/guix-cookbook.texi:547 guix-git/doc/guix-cookbook.texi:548
  742. #, no-wrap
  743. msgid "Setup"
  744. msgstr ""
  745. #. type: Plain text
  746. #: guix-git/doc/guix-cookbook.texi:553
  747. msgid "In the rest of this chapter we will rely on some basic Scheme programming knowledge. Now let's detail the different possible setups for working on Guix packages."
  748. msgstr ""
  749. #. type: Plain text
  750. #: guix-git/doc/guix-cookbook.texi:555
  751. msgid "There are several ways to set up a Guix packaging environment."
  752. msgstr ""
  753. #. type: Plain text
  754. #: guix-git/doc/guix-cookbook.texi:558
  755. msgid "We recommend you work directly on the Guix source checkout since it makes it easier for everyone to contribute to the project."
  756. msgstr ""
  757. #. type: Plain text
  758. #: guix-git/doc/guix-cookbook.texi:560
  759. msgid "But first, let's look at other possibilities."
  760. msgstr ""
  761. #. type: subsubsection
  762. #: guix-git/doc/guix-cookbook.texi:561 guix-git/doc/guix-cookbook.texi:562
  763. #, no-wrap
  764. msgid "Local file"
  765. msgstr ""
  766. #. type: Plain text
  767. #: guix-git/doc/guix-cookbook.texi:567
  768. msgid "This is what we previously did with @samp{my-hello}. With the Scheme basics we've covered, we are now able to explain the leading chunks. As stated in @code{guix package --help}:"
  769. msgstr ""
  770. #. type: example
  771. #: guix-git/doc/guix-cookbook.texi:572
  772. #, no-wrap
  773. msgid ""
  774. " -f, --install-from-file=FILE\n"
  775. " install the package that the code within FILE\n"
  776. " evaluates to\n"
  777. msgstr ""
  778. #. type: Plain text
  779. #: guix-git/doc/guix-cookbook.texi:576
  780. msgid "Thus the last expression @emph{must} return a package, which is the case in our earlier example."
  781. msgstr ""
  782. #. type: Plain text
  783. #: guix-git/doc/guix-cookbook.texi:580
  784. msgid "The @code{use-modules} expression tells which of the modules we need in the file. Modules are a collection of values and procedures. They are commonly called ``libraries'' or ``packages'' in other programming languages."
  785. msgstr ""
  786. #. type: node
  787. #: guix-git/doc/guix-cookbook.texi:581
  788. #, no-wrap
  789. msgid "@samp{GUIX_PACKAGE_PATH}"
  790. msgstr ""
  791. #. type: samp{#1}
  792. #: guix-git/doc/guix-cookbook.texi:582
  793. #, no-wrap
  794. msgid "GUIX_PACKAGE_PATH"
  795. msgstr ""
  796. #. type: emph{#1}
  797. #: guix-git/doc/guix-cookbook.texi:586
  798. msgid "Note: Starting from Guix 0.16, the more flexible Guix @dfn{channels} are the preferred way and supersede @samp{GUIX_PACKAGE_PATH}. See next section."
  799. msgstr ""
  800. #. type: Plain text
  801. #: guix-git/doc/guix-cookbook.texi:590
  802. msgid "It can be tedious to specify the file from the command line instead of simply calling @code{guix package --install my-hello} as you would do with the official packages."
  803. msgstr ""
  804. #. type: Plain text
  805. #: guix-git/doc/guix-cookbook.texi:593
  806. msgid "Guix makes it possible to streamline the process by adding as many ``package declaration directories'' as you want."
  807. msgstr ""
  808. #. type: Plain text
  809. #: guix-git/doc/guix-cookbook.texi:596
  810. msgid "Create a directory, say @file{~/guix-packages} and add it to the @samp{GUIX_PACKAGE_PATH} environment variable:"
  811. msgstr ""
  812. #. type: example
  813. #: guix-git/doc/guix-cookbook.texi:600
  814. #, no-wrap
  815. msgid ""
  816. "$ mkdir ~/guix-packages\n"
  817. "$ export GUIX_PACKAGE_PATH=~/guix-packages\n"
  818. msgstr ""
  819. #. type: Plain text
  820. #: guix-git/doc/guix-cookbook.texi:603
  821. msgid "To add several directories, separate them with a colon (@code{:})."
  822. msgstr ""
  823. #. type: Plain text
  824. #: guix-git/doc/guix-cookbook.texi:605
  825. msgid "Our previous @samp{my-hello} needs some adjustments though:"
  826. msgstr ""
  827. #. type: lisp
  828. #: guix-git/doc/guix-cookbook.texi:612
  829. #, no-wrap
  830. msgid ""
  831. "(define-module (my-hello)\n"
  832. " #:use-module (guix licenses)\n"
  833. " #:use-module (guix packages)\n"
  834. " #:use-module (guix build-system gnu)\n"
  835. " #:use-module (guix download))\n"
  836. "\n"
  837. msgstr ""
  838. #. type: lisp
  839. #: guix-git/doc/guix-cookbook.texi:632
  840. #, no-wrap
  841. msgid ""
  842. "(define-public my-hello\n"
  843. " (package\n"
  844. " (name \"my-hello\")\n"
  845. " (version \"2.10\")\n"
  846. " (source (origin\n"
  847. " (method url-fetch)\n"
  848. " (uri (string-append \"mirror://gnu/hello/hello-\" version\n"
  849. " \".tar.gz\"))\n"
  850. " (sha256\n"
  851. " (base32\n"
  852. " \"0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i\"))))\n"
  853. " (build-system gnu-build-system)\n"
  854. " (synopsis \"Hello, Guix world: An example custom Guix package\")\n"
  855. " (description\n"
  856. " \"GNU Hello prints the message \\\"Hello, world!\\\" and then exits. It\n"
  857. "serves as an example of standard GNU coding practices. As such, it supports\n"
  858. "command-line arguments, multiple languages, and so on.\")\n"
  859. " (home-page \"https://www.gnu.org/software/hello/\")\n"
  860. " (license gpl3+)))\n"
  861. msgstr ""
  862. #. type: Plain text
  863. #: guix-git/doc/guix-cookbook.texi:638
  864. msgid "Note that we have assigned the package value to an exported variable name with @code{define-public}. This is effectively assigning the package to the @code{my-hello} variable so that it can be referenced, among other as dependency of other packages."
  865. msgstr ""
  866. #. type: Plain text
  867. #: guix-git/doc/guix-cookbook.texi:643
  868. msgid "If you use @code{guix package --install-from-file=my-hello.scm} on the above file, it will fail because the last expression, @code{define-public}, does not return a package. If you want to use @code{define-public} in this use-case nonetheless, make sure the file ends with an evaluation of @code{my-hello}:"
  869. msgstr ""
  870. #. type: lisp
  871. #: guix-git/doc/guix-cookbook.texi:649
  872. #, no-wrap
  873. msgid ""
  874. "; ...\n"
  875. "(define-public my-hello\n"
  876. " ; ...\n"
  877. " )\n"
  878. "\n"
  879. msgstr ""
  880. #. type: lisp
  881. #: guix-git/doc/guix-cookbook.texi:651
  882. #, no-wrap
  883. msgid "my-hello\n"
  884. msgstr ""
  885. #. type: Plain text
  886. #: guix-git/doc/guix-cookbook.texi:654
  887. msgid "This last example is not very typical."
  888. msgstr ""
  889. #. type: Plain text
  890. #: guix-git/doc/guix-cookbook.texi:657
  891. msgid "Now @samp{my-hello} should be part of the package collection like all other official packages. You can verify this with:"
  892. msgstr ""
  893. #. type: example
  894. #: guix-git/doc/guix-cookbook.texi:660
  895. #, no-wrap
  896. msgid "$ guix package --show=my-hello\n"
  897. msgstr ""
  898. #. type: subsubsection
  899. #: guix-git/doc/guix-cookbook.texi:662 guix-git/doc/guix-cookbook.texi:663
  900. #, no-wrap
  901. msgid "Guix channels"
  902. msgstr ""
  903. #. type: Plain text
  904. #: guix-git/doc/guix-cookbook.texi:669
  905. msgid "Guix 0.16 features channels, which is very similar to @samp{GUIX_PACKAGE_PATH} but provides better integration and provenance tracking. Channels are not necessarily local, they can be maintained as a public Git repository for instance. Of course, several channels can be used at the same time."
  906. msgstr ""
  907. #. type: Plain text
  908. #: guix-git/doc/guix-cookbook.texi:671
  909. msgid "@xref{Channels,,, guix, GNU Guix Reference Manual} for setup details."
  910. msgstr ""
  911. #. type: subsubsection
  912. #: guix-git/doc/guix-cookbook.texi:672 guix-git/doc/guix-cookbook.texi:673
  913. #, no-wrap
  914. msgid "Direct checkout hacking"
  915. msgstr ""
  916. #. type: Plain text
  917. #: guix-git/doc/guix-cookbook.texi:678
  918. msgid "Working directly on the Guix project is recommended: it reduces the friction when the time comes to submit your changes upstream to let the community benefit from your hard work!"
  919. msgstr ""
  920. #. type: Plain text
  921. #: guix-git/doc/guix-cookbook.texi:684
  922. msgid "Unlike most software distributions, the Guix repository holds in one place both the tooling (including the package manager) and the package definitions. This choice was made so that it would give developers the flexibility to modify the API without breakage by updating all packages at the same time. This reduces development inertia."
  923. msgstr ""
  924. #. type: Plain text
  925. #: guix-git/doc/guix-cookbook.texi:686
  926. msgid "Check out the official @uref{https://git-scm.com/, Git} repository:"
  927. msgstr ""
  928. #. type: example
  929. #: guix-git/doc/guix-cookbook.texi:689
  930. #, no-wrap
  931. msgid "$ git clone https://git.savannah.gnu.org/git/guix.git\n"
  932. msgstr ""
  933. #. type: Plain text
  934. #: guix-git/doc/guix-cookbook.texi:693
  935. msgid "In the rest of this article, we use @samp{$GUIX_CHECKOUT} to refer to the location of the checkout."
  936. msgstr ""
  937. #. type: Plain text
  938. #: guix-git/doc/guix-cookbook.texi:697
  939. msgid "Follow the instructions in the manual (@pxref{Contributing,,, guix, GNU Guix Reference Manual}) to set up the repository environment."
  940. msgstr ""
  941. #. type: Plain text
  942. #: guix-git/doc/guix-cookbook.texi:700
  943. msgid "Once ready, you should be able to use the package definitions from the repository environment."
  944. msgstr ""
  945. #. type: Plain text
  946. #: guix-git/doc/guix-cookbook.texi:702
  947. msgid "Feel free to edit package definitions found in @samp{$GUIX_CHECKOUT/gnu/packages}."
  948. msgstr ""
  949. #. type: Plain text
  950. #: guix-git/doc/guix-cookbook.texi:706
  951. msgid "The @samp{$GUIX_CHECKOUT/pre-inst-env} script lets you use @samp{guix} over the package collection of the repository (@pxref{Running Guix Before It Is Installed,,, guix, GNU Guix Reference Manual})."
  952. msgstr ""
  953. #. type: itemize
  954. #: guix-git/doc/guix-cookbook.texi:710
  955. msgid "Search packages, such as Ruby:"
  956. msgstr ""
  957. #. type: example
  958. #: guix-git/doc/guix-cookbook.texi:717
  959. #, no-wrap
  960. msgid ""
  961. " $ cd $GUIX_CHECKOUT\n"
  962. " $ ./pre-inst-env guix package --list-available=ruby\n"
  963. " ruby 1.8.7-p374 out gnu/packages/ruby.scm:119:2\n"
  964. " ruby 2.1.6 out gnu/packages/ruby.scm:91:2\n"
  965. " ruby 2.2.2 out gnu/packages/ruby.scm:39:2\n"
  966. msgstr ""
  967. #. type: itemize
  968. #: guix-git/doc/guix-cookbook.texi:721
  969. msgid "Build a package, here Ruby version 2.1:"
  970. msgstr ""
  971. #. type: example
  972. #: guix-git/doc/guix-cookbook.texi:725
  973. #, no-wrap
  974. msgid ""
  975. " $ ./pre-inst-env guix build --keep-failed ruby@@2.1\n"
  976. " /gnu/store/c13v73jxmj2nir2xjqaz5259zywsa9zi-ruby-2.1.6\n"
  977. msgstr ""
  978. #. type: itemize
  979. #: guix-git/doc/guix-cookbook.texi:729
  980. msgid "Install it to your user profile:"
  981. msgstr ""
  982. #. type: example
  983. #: guix-git/doc/guix-cookbook.texi:732
  984. #, no-wrap
  985. msgid " $ ./pre-inst-env guix package --install ruby@@2.1\n"
  986. msgstr ""
  987. #. type: itemize
  988. #: guix-git/doc/guix-cookbook.texi:736
  989. msgid "Check for common mistakes:"
  990. msgstr ""
  991. #. type: example
  992. #: guix-git/doc/guix-cookbook.texi:739
  993. #, no-wrap
  994. msgid " $ ./pre-inst-env guix lint ruby@@2.1\n"
  995. msgstr ""
  996. #. type: Plain text
  997. #: guix-git/doc/guix-cookbook.texi:744
  998. msgid "Guix strives at maintaining a high packaging standard; when contributing to the Guix project, remember to"
  999. msgstr ""
  1000. #. type: itemize
  1001. #: guix-git/doc/guix-cookbook.texi:748
  1002. msgid "follow the coding style (@pxref{Coding Style,,, guix, GNU Guix Reference Manual}),"
  1003. msgstr ""
  1004. #. type: itemize
  1005. #: guix-git/doc/guix-cookbook.texi:750
  1006. msgid "and review the check list from the manual (@pxref{Submitting Patches,,, guix, GNU Guix Reference Manual})."
  1007. msgstr ""
  1008. #. type: Plain text
  1009. #: guix-git/doc/guix-cookbook.texi:754
  1010. msgid "Once you are happy with the result, you are welcome to send your contribution to make it part of Guix. This process is also detailed in the manual. (@pxref{Contributing,,, guix, GNU Guix Reference Manual})"
  1011. msgstr ""
  1012. #. type: Plain text
  1013. #: guix-git/doc/guix-cookbook.texi:757
  1014. msgid "It's a community effort so the more join in, the better Guix becomes!"
  1015. msgstr ""
  1016. #. type: subsection
  1017. #: guix-git/doc/guix-cookbook.texi:758 guix-git/doc/guix-cookbook.texi:759
  1018. #, no-wrap
  1019. msgid "Extended example"
  1020. msgstr ""
  1021. #. type: Plain text
  1022. #: guix-git/doc/guix-cookbook.texi:764
  1023. msgid "The above ``Hello World'' example is as simple as it goes. Packages can be more complex than that and Guix can handle more advanced scenarios. Let's look at another, more sophisticated package (slightly modified from the source):"
  1024. msgstr ""
  1025. #. type: lisp
  1026. #: guix-git/doc/guix-cookbook.texi:778
  1027. #, no-wrap
  1028. msgid ""
  1029. "(define-module (gnu packages version-control)\n"
  1030. " #:use-module ((guix licenses) #:prefix license:)\n"
  1031. " #:use-module (guix utils)\n"
  1032. " #:use-module (guix packages)\n"
  1033. " #:use-module (guix git-download)\n"
  1034. " #:use-module (guix build-system cmake)\n"
  1035. " #:use-module (gnu packages ssh)\n"
  1036. " #:use-module (gnu packages web)\n"
  1037. " #:use-module (gnu packages pkg-config)\n"
  1038. " #:use-module (gnu packages python)\n"
  1039. " #:use-module (gnu packages compression)\n"
  1040. " #:use-module (gnu packages tls))\n"
  1041. "\n"
  1042. msgstr ""
  1043. #. type: lisp
  1044. #: guix-git/doc/guix-cookbook.texi:838
  1045. #, no-wrap
  1046. msgid ""
  1047. "(define-public my-libgit2\n"
  1048. " (let ((commit \"e98d0a37c93574d2c6107bf7f31140b548c6a7bf\")\n"
  1049. " (revision \"1\"))\n"
  1050. " (package\n"
  1051. " (name \"my-libgit2\")\n"
  1052. " (version (git-version \"0.26.6\" revision commit))\n"
  1053. " (source (origin\n"
  1054. " (method git-fetch)\n"
  1055. " (uri (git-reference\n"
  1056. " (url \"https://github.com/libgit2/libgit2/\")\n"
  1057. " (commit commit)))\n"
  1058. " (file-name (git-file-name name version))\n"
  1059. " (sha256\n"
  1060. " (base32\n"
  1061. " \"17pjvprmdrx4h6bb1hhc98w9qi6ki7yl57f090n9kbhswxqfs7s3\"))\n"
  1062. " (patches (search-patches \"libgit2-mtime-0.patch\"))\n"
  1063. " (modules '((guix build utils)))\n"
  1064. " (snippet '(begin\n"
  1065. " ;; Remove bundled software.\n"
  1066. " (delete-file-recursively \"deps\")\n"
  1067. " #true))))\n"
  1068. " (build-system cmake-build-system)\n"
  1069. " (outputs '(\"out\" \"debug\"))\n"
  1070. " (arguments\n"
  1071. " `(#:tests? #true ; Run the test suite (this is the default)\n"
  1072. " #:configure-flags '(\"-DUSE_SHA1DC=ON\") ; SHA-1 collision detection\n"
  1073. " #:phases\n"
  1074. " (modify-phases %standard-phases\n"
  1075. " (add-after 'unpack 'fix-hardcoded-paths\n"
  1076. " (lambda _\n"
  1077. " (substitute* \"tests/repo/init.c\"\n"
  1078. " ((\"#!/bin/sh\") (string-append \"#!\" (which \"sh\"))))\n"
  1079. " (substitute* \"tests/clar/fs.h\"\n"
  1080. " ((\"/bin/cp\") (which \"cp\"))\n"
  1081. " ((\"/bin/rm\") (which \"rm\")))\n"
  1082. " #true))\n"
  1083. " ;; Run checks more verbosely.\n"
  1084. " (replace 'check\n"
  1085. " (lambda _ (invoke \"./libgit2_clar\" \"-v\" \"-Q\")))\n"
  1086. " (add-after 'unpack 'make-files-writable-for-tests\n"
  1087. " (lambda _ (for-each make-file-writable (find-files \".\" \".*\")))))))\n"
  1088. " (inputs\n"
  1089. " `((\"libssh2\" ,libssh2)\n"
  1090. " (\"http-parser\" ,http-parser)\n"
  1091. " (\"python\" ,python-wrapper)))\n"
  1092. " (native-inputs\n"
  1093. " `((\"pkg-config\" ,pkg-config)))\n"
  1094. " (propagated-inputs\n"
  1095. " ;; These two libraries are in 'Requires.private' in libgit2.pc.\n"
  1096. " `((\"openssl\" ,openssl)\n"
  1097. " (\"zlib\" ,zlib)))\n"
  1098. " (home-page \"https://libgit2.github.com/\")\n"
  1099. " (synopsis \"Library providing Git core methods\")\n"
  1100. " (description\n"
  1101. " \"Libgit2 is a portable, pure C implementation of the Git core methods\n"
  1102. "provided as a re-entrant linkable library with a solid API, allowing you to\n"
  1103. "write native speed custom Git applications in any language with bindings.\")\n"
  1104. " ;; GPLv2 with linking exception\n"
  1105. " (license license:gpl2))))\n"
  1106. msgstr ""
  1107. #. type: Plain text
  1108. #: guix-git/doc/guix-cookbook.texi:843
  1109. msgid "(In those cases were you only want to tweak a few fields from a package definition, you should rely on inheritance instead of copy-pasting everything. See below.)"
  1110. msgstr ""
  1111. #. type: Plain text
  1112. #: guix-git/doc/guix-cookbook.texi:845
  1113. msgid "Let's discuss those fields in depth."
  1114. msgstr ""
  1115. #. type: subsubsection
  1116. #: guix-git/doc/guix-cookbook.texi:846
  1117. #, no-wrap
  1118. msgid "@code{git-fetch} method"
  1119. msgstr ""
  1120. #. type: Plain text
  1121. #: guix-git/doc/guix-cookbook.texi:853
  1122. msgid "Unlike the @code{url-fetch} method, @code{git-fetch} expects a @code{git-reference} which takes a Git repository and a commit. The commit can be any Git reference such as tags, so if the @code{version} is tagged, then it can be used directly. Sometimes the tag is prefixed with a @code{v}, in which case you'd use @code{(commit (string-append \"v\" version))}."
  1123. msgstr ""
  1124. #. type: Plain text
  1125. #: guix-git/doc/guix-cookbook.texi:857
  1126. msgid "To ensure that the source code from the Git repository is stored in a directory with a descriptive name, we use @code{(file-name (git-file-name name version))}."
  1127. msgstr ""
  1128. #. type: Plain text
  1129. #: guix-git/doc/guix-cookbook.texi:862
  1130. msgid "The @code{git-version} procedure can be used to derive the version when packaging programs for a specific commit, following the Guix contributor guidelines (@pxref{Version Numbers,,, guix, GNU Guix Reference Manual})."
  1131. msgstr ""
  1132. #. type: Plain text
  1133. #: guix-git/doc/guix-cookbook.texi:866
  1134. msgid "How does one obtain the @code{sha256} hash that's in there, you ask? By invoking @command{guix hash} on a checkout of the desired commit, along these lines:"
  1135. msgstr ""
  1136. #. type: example
  1137. #: guix-git/doc/guix-cookbook.texi:872
  1138. #, no-wrap
  1139. msgid ""
  1140. "git clone https://github.com/libgit2/libgit2/\n"
  1141. "cd libgit2\n"
  1142. "git checkout v0.26.6\n"
  1143. "guix hash -rx .\n"
  1144. msgstr ""
  1145. #. type: Plain text
  1146. #: guix-git/doc/guix-cookbook.texi:877
  1147. msgid "@command{guix hash -rx} computes a SHA256 hash over the whole directory, excluding the @file{.git} sub-directory (@pxref{Invoking guix hash,,, guix, GNU Guix Reference Manual})."
  1148. msgstr ""
  1149. #. type: Plain text
  1150. #: guix-git/doc/guix-cookbook.texi:880
  1151. msgid "In the future, @command{guix download} will hopefully be able to do these steps for you, just like it does for regular downloads."
  1152. msgstr ""
  1153. #. type: subsubsection
  1154. #: guix-git/doc/guix-cookbook.texi:881
  1155. #, no-wrap
  1156. msgid "Snippets"
  1157. msgstr ""
  1158. #. type: Plain text
  1159. #: guix-git/doc/guix-cookbook.texi:887
  1160. msgid "Snippets are quoted (i.e. non-evaluated) Scheme code that are a means of patching the source. They are a Guix-y alternative to the traditional @file{.patch} files. Because of the quote, the code in only evaluated when passed to the Guix daemon for building. There can be as many snippets as needed."
  1161. msgstr ""
  1162. #. type: Plain text
  1163. #: guix-git/doc/guix-cookbook.texi:890
  1164. msgid "Snippets might need additional Guile modules which can be imported from the @code{modules} field."
  1165. msgstr ""
  1166. #. type: subsubsection
  1167. #: guix-git/doc/guix-cookbook.texi:891
  1168. #, no-wrap
  1169. msgid "Inputs"
  1170. msgstr ""
  1171. #. type: Plain text
  1172. #: guix-git/doc/guix-cookbook.texi:894
  1173. msgid "First, a syntactic comment: See the quasi-quote / comma syntax?"
  1174. msgstr ""
  1175. #. type: lisp
  1176. #: guix-git/doc/guix-cookbook.texi:898
  1177. #, no-wrap
  1178. msgid ""
  1179. " (native-inputs\n"
  1180. " `((\"pkg-config\" ,pkg-config)))\n"
  1181. msgstr ""
  1182. #. type: Plain text
  1183. #: guix-git/doc/guix-cookbook.texi:901
  1184. msgid "is equivalent to"
  1185. msgstr ""
  1186. #. type: lisp
  1187. #: guix-git/doc/guix-cookbook.texi:905
  1188. #, no-wrap
  1189. msgid ""
  1190. " (native-inputs\n"
  1191. " (list (list \"pkg-config\" pkg-config)))\n"
  1192. msgstr ""
  1193. #. type: Plain text
  1194. #: guix-git/doc/guix-cookbook.texi:908
  1195. msgid "You'll mostly see the former because it's shorter."
  1196. msgstr ""
  1197. #. type: Plain text
  1198. #: guix-git/doc/guix-cookbook.texi:910
  1199. msgid "There are 3 different input types. In short:"
  1200. msgstr ""
  1201. #. type: item
  1202. #: guix-git/doc/guix-cookbook.texi:912
  1203. #, no-wrap
  1204. msgid "native-inputs"
  1205. msgstr ""
  1206. #. type: table
  1207. #: guix-git/doc/guix-cookbook.texi:915
  1208. msgid "Required for building but not runtime -- installing a package through a substitute won't install these inputs."
  1209. msgstr ""
  1210. #. type: item
  1211. #: guix-git/doc/guix-cookbook.texi:915
  1212. #, no-wrap
  1213. msgid "inputs"
  1214. msgstr ""
  1215. #. type: table
  1216. #: guix-git/doc/guix-cookbook.texi:918
  1217. msgid "Installed in the store but not in the profile, as well as being present at build time."
  1218. msgstr ""
  1219. #. type: item
  1220. #: guix-git/doc/guix-cookbook.texi:918
  1221. #, no-wrap
  1222. msgid "propagated-inputs"
  1223. msgstr ""
  1224. #. type: table
  1225. #: guix-git/doc/guix-cookbook.texi:921
  1226. msgid "Installed in the store and in the profile, as well as being present at build time."
  1227. msgstr ""
  1228. #. type: Plain text
  1229. #: guix-git/doc/guix-cookbook.texi:924
  1230. msgid "@xref{Package Reference,,, guix, GNU Guix Reference Manual} for more details."
  1231. msgstr ""
  1232. #. type: Plain text
  1233. #: guix-git/doc/guix-cookbook.texi:928
  1234. msgid "The distinction between the various inputs is important: if a dependency can be handled as an @emph{input} instead of a @emph{propagated input}, it should be done so, or else it ``pollutes'' the user profile for no good reason."
  1235. msgstr ""
  1236. #. type: Plain text
  1237. #: guix-git/doc/guix-cookbook.texi:935
  1238. msgid "For instance, a user installing a graphical program that depends on a command line tool might only be interested in the graphical part, so there is no need to force the command line tool into the user profile. The dependency is a concern to the package, not to the user. @emph{Inputs} make it possible to handle dependencies without bugging the user by adding undesired executable files (or libraries) to their profile."
  1239. msgstr ""
  1240. #. type: Plain text
  1241. #: guix-git/doc/guix-cookbook.texi:941
  1242. msgid "Same goes for @emph{native-inputs}: once the program is installed, build-time dependencies can be safely garbage-collected. It also matters when a substitute is available, in which case only the @emph{inputs} and @emph{propagated inputs} will be fetched: the @emph{native inputs} are not required to install a package from a substitute."
  1243. msgstr ""
  1244. #. type: subsubsection
  1245. #: guix-git/doc/guix-cookbook.texi:942
  1246. #, no-wrap
  1247. msgid "Outputs"
  1248. msgstr ""
  1249. #. type: Plain text
  1250. #: guix-git/doc/guix-cookbook.texi:946
  1251. msgid "Just like how a package can have multiple inputs, it can also produce multiple outputs."
  1252. msgstr ""
  1253. #. type: Plain text
  1254. #: guix-git/doc/guix-cookbook.texi:948
  1255. msgid "Each output corresponds to a separate directory in the store."
  1256. msgstr ""
  1257. #. type: Plain text
  1258. #: guix-git/doc/guix-cookbook.texi:951
  1259. msgid "The user can choose which output to install; this is useful to save space or to avoid polluting the user profile with unwanted executables or libraries."
  1260. msgstr ""
  1261. #. type: Plain text
  1262. #: guix-git/doc/guix-cookbook.texi:954
  1263. msgid "Output separation is optional. When the @code{outputs} field is left out, the default and only output (the complete package) is referred to as @code{\"out\"}."
  1264. msgstr ""
  1265. #. type: Plain text
  1266. #: guix-git/doc/guix-cookbook.texi:956
  1267. msgid "Typical separate output names include @code{debug} and @code{doc}."
  1268. msgstr ""
  1269. #. type: Plain text
  1270. #: guix-git/doc/guix-cookbook.texi:960
  1271. msgid "It's advised to separate outputs only when you've shown it's worth it: if the output size is significant (compare with @code{guix size}) or in case the package is modular."
  1272. msgstr ""
  1273. #. type: subsubsection
  1274. #: guix-git/doc/guix-cookbook.texi:961
  1275. #, no-wrap
  1276. msgid "Build system arguments"
  1277. msgstr ""
  1278. #. type: Plain text
  1279. #: guix-git/doc/guix-cookbook.texi:964
  1280. msgid "The @code{arguments} is a keyword-value list used to configure the build process."
  1281. msgstr ""
  1282. #. type: Plain text
  1283. #: guix-git/doc/guix-cookbook.texi:969
  1284. msgid "The simplest argument @code{#:tests?} can be used to disable the test suite when building the package. This is mostly useful when the package does not feature any test suite. It's strongly recommended to keep the test suite on if there is one."
  1285. msgstr ""
  1286. #. type: Plain text
  1287. #: guix-git/doc/guix-cookbook.texi:973
  1288. msgid "Another common argument is @code{:make-flags}, which specifies a list of flags to append when running make, as you would from the command line. For instance, the following flags"
  1289. msgstr ""
  1290. #. type: lisp
  1291. #: guix-git/doc/guix-cookbook.texi:977
  1292. #, no-wrap
  1293. msgid ""
  1294. "#:make-flags (list (string-append \"prefix=\" (assoc-ref %outputs \"out\"))\n"
  1295. " \"CC=gcc\")\n"
  1296. msgstr ""
  1297. #. type: Plain text
  1298. #: guix-git/doc/guix-cookbook.texi:980
  1299. msgid "translate into"
  1300. msgstr ""
  1301. #. type: example
  1302. #: guix-git/doc/guix-cookbook.texi:983
  1303. #, no-wrap
  1304. msgid "$ make CC=gcc prefix=/gnu/store/...-<out>\n"
  1305. msgstr ""
  1306. #. type: Plain text
  1307. #: guix-git/doc/guix-cookbook.texi:989
  1308. msgid "This sets the C compiler to @code{gcc} and the @code{prefix} variable (the installation directory in Make parlance) to @code{(assoc-ref %outputs \"out\")}, which is a build-stage global variable pointing to the destination directory in the store (something like @file{/gnu/store/...-my-libgit2-20180408})."
  1309. msgstr ""
  1310. #. type: Plain text
  1311. #: guix-git/doc/guix-cookbook.texi:991
  1312. msgid "Similarly, it's possible to set the configure flags:"
  1313. msgstr ""
  1314. #. type: lisp
  1315. #: guix-git/doc/guix-cookbook.texi:994
  1316. #, no-wrap
  1317. msgid "#:configure-flags '(\"-DUSE_SHA1DC=ON\")\n"
  1318. msgstr ""
  1319. #. type: Plain text
  1320. #: guix-git/doc/guix-cookbook.texi:998
  1321. msgid "The @code{%build-inputs} variable is also generated in scope. It's an association table that maps the input names to their store directories."
  1322. msgstr ""
  1323. #. type: Plain text
  1324. #: guix-git/doc/guix-cookbook.texi:1003
  1325. msgid "The @code{phases} keyword lists the sequential steps of the build system. Typically phases include @code{unpack}, @code{configure}, @code{build}, @code{install} and @code{check}. To know more about those phases, you need to work out the appropriate build system definition in @samp{$GUIX_CHECKOUT/guix/build/gnu-build-system.scm}:"
  1326. msgstr ""
  1327. #. type: lisp
  1328. #: guix-git/doc/guix-cookbook.texi:1022
  1329. #, no-wrap
  1330. msgid ""
  1331. "(define %standard-phases\n"
  1332. " ;; Standard build phases, as a list of symbol/procedure pairs.\n"
  1333. " (let-syntax ((phases (syntax-rules ()\n"
  1334. " ((_ p ...) `((p . ,p) ...)))))\n"
  1335. " (phases set-SOURCE-DATE-EPOCH set-paths install-locale unpack\n"
  1336. " bootstrap\n"
  1337. " patch-usr-bin-file\n"
  1338. " patch-source-shebangs configure patch-generated-file-shebangs\n"
  1339. " build check install\n"
  1340. " patch-shebangs strip\n"
  1341. " validate-runpath\n"
  1342. " validate-documentation-location\n"
  1343. " delete-info-dir-file\n"
  1344. " patch-dot-desktop-files\n"
  1345. " install-license-files\n"
  1346. " reset-gzip-timestamps\n"
  1347. " compress-documentation)))\n"
  1348. msgstr ""
  1349. #. type: Plain text
  1350. #: guix-git/doc/guix-cookbook.texi:1025
  1351. msgid "Or from the REPL:"
  1352. msgstr ""
  1353. #. type: lisp
  1354. #: guix-git/doc/guix-cookbook.texi:1031
  1355. #, no-wrap
  1356. msgid ""
  1357. "(add-to-load-path \"/path/to/guix/checkout\")\n"
  1358. ",use (guix build gnu-build-system)\n"
  1359. "(map first %standard-phases)\n"
  1360. "@result{} (set-SOURCE-DATE-EPOCH set-paths install-locale unpack bootstrap patch-usr-bin-file patch-source-shebangs configure patch-generated-file-shebangs build check install patch-shebangs strip validate-runpath validate-documentation-location delete-info-dir-file patch-dot-desktop-files install-license-files reset-gzip-timestamps compress-documentation)\n"
  1361. msgstr ""
  1362. #. type: Plain text
  1363. #: guix-git/doc/guix-cookbook.texi:1035
  1364. msgid "If you want to know more about what happens during those phases, consult the associated procedures."
  1365. msgstr ""
  1366. #. type: Plain text
  1367. #: guix-git/doc/guix-cookbook.texi:1038
  1368. msgid "For instance, as of this writing the definition of @code{unpack} for the GNU build system is:"
  1369. msgstr ""
  1370. #. type: lisp
  1371. #: guix-git/doc/guix-cookbook.texi:1048
  1372. #, no-wrap
  1373. msgid ""
  1374. "(define* (unpack #:key source #:allow-other-keys)\n"
  1375. " \"Unpack SOURCE in the working directory, and change directory within the\n"
  1376. "source. When SOURCE is a directory, copy it in a sub-directory of the current\n"
  1377. "working directory.\"\n"
  1378. " (if (file-is-directory? source)\n"
  1379. " (begin\n"
  1380. " (mkdir \"source\")\n"
  1381. " (chdir \"source\")\n"
  1382. "\n"
  1383. msgstr ""
  1384. #. type: lisp
  1385. #: guix-git/doc/guix-cookbook.texi:1059
  1386. #, no-wrap
  1387. msgid ""
  1388. " ;; Preserve timestamps (set to the Epoch) on the copied tree so that\n"
  1389. " ;; things work deterministically.\n"
  1390. " (copy-recursively source \".\"\n"
  1391. " #:keep-mtime? #true))\n"
  1392. " (begin\n"
  1393. " (if (string-suffix? \".zip\" source)\n"
  1394. " (invoke \"unzip\" source)\n"
  1395. " (invoke \"tar\" \"xvf\" source))\n"
  1396. " (chdir (first-subdirectory \".\"))))\n"
  1397. " #true)\n"
  1398. msgstr ""
  1399. #. type: Plain text
  1400. #: guix-git/doc/guix-cookbook.texi:1067
  1401. msgid "Note the @code{chdir} call: it changes the working directory to where the source was unpacked. Thus every phase following the @code{unpack} will use the source as a working directory, which is why we can directly work on the source files. That is to say, unless a later phase changes the working directory to something else."
  1402. msgstr ""
  1403. #. type: Plain text
  1404. #: guix-git/doc/guix-cookbook.texi:1071
  1405. msgid "We modify the list of @code{%standard-phases} of the build system with the @code{modify-phases} macro as per the list of specified modifications, which may have the following forms:"
  1406. msgstr ""
  1407. #. type: itemize
  1408. #: guix-git/doc/guix-cookbook.texi:1075
  1409. msgid "@code{(add-before @var{phase} @var{new-phase} @var{procedure})}: Run @var{procedure} named @var{new-phase} before @var{phase}."
  1410. msgstr ""
  1411. #. type: itemize
  1412. #: guix-git/doc/guix-cookbook.texi:1077
  1413. msgid "@code{(add-after @var{phase} @var{new-phase} @var{procedure})}: Same, but afterwards."
  1414. msgstr ""
  1415. #. type: itemize
  1416. #: guix-git/doc/guix-cookbook.texi:1079
  1417. msgid "@code{(replace @var{phase} @var{procedure})}."
  1418. msgstr ""
  1419. #. type: itemize
  1420. #: guix-git/doc/guix-cookbook.texi:1081
  1421. msgid "@code{(delete @var{phase})}."
  1422. msgstr ""
  1423. #. type: Plain text
  1424. #: guix-git/doc/guix-cookbook.texi:1088
  1425. msgid "The @var{procedure} supports the keyword arguments @code{inputs} and @code{outputs}. Each input (whether @emph{native}, @emph{propagated} or not) and output directory is referenced by their name in those variables. Thus @code{(assoc-ref outputs \"out\")} is the store directory of the main output of the package. A phase procedure may look like this:"
  1426. msgstr ""
  1427. #. type: lisp
  1428. #: guix-git/doc/guix-cookbook.texi:1096
  1429. #, no-wrap
  1430. msgid ""
  1431. "(lambda* (#:key inputs outputs #:allow-other-keys)\n"
  1432. " (let ((bash-directory (assoc-ref inputs \"bash\"))\n"
  1433. " (output-directory (assoc-ref outputs \"out\"))\n"
  1434. " (doc-directory (assoc-ref outputs \"doc\")))\n"
  1435. " ;; ...\n"
  1436. " #true))\n"
  1437. msgstr ""
  1438. #. type: Plain text
  1439. #: guix-git/doc/guix-cookbook.texi:1102
  1440. msgid "The procedure must return @code{#true} on success. It's brittle to rely on the return value of the last expression used to tweak the phase because there is no guarantee it would be a @code{#true}. Hence the trailing @code{#true} to ensure the right value is returned on success."
  1441. msgstr ""
  1442. #. type: subsubsection
  1443. #: guix-git/doc/guix-cookbook.texi:1103
  1444. #, no-wrap
  1445. msgid "Code staging"
  1446. msgstr ""
  1447. #. type: Plain text
  1448. #: guix-git/doc/guix-cookbook.texi:1109
  1449. msgid "The astute reader may have noticed the quasi-quote and comma syntax in the argument field. Indeed, the build code in the package declaration should not be evaluated on the client side, but only when passed to the Guix daemon. This mechanism of passing code around two running processes is called @uref{https://arxiv.org/abs/1709.00833, code staging}."
  1450. msgstr ""
  1451. #. type: subsubsection
  1452. #: guix-git/doc/guix-cookbook.texi:1110
  1453. #, no-wrap
  1454. msgid "Utility functions"
  1455. msgstr ""
  1456. #. type: Plain text
  1457. #: guix-git/doc/guix-cookbook.texi:1115
  1458. msgid "When customizing @code{phases}, we often need to write code that mimics the equivalent system invocations (@code{make}, @code{mkdir}, @code{cp}, etc.)@: commonly used during regular ``Unix-style'' installations."
  1459. msgstr ""
  1460. #. type: Plain text
  1461. #: guix-git/doc/guix-cookbook.texi:1118
  1462. msgid "Some like @code{chmod} are native to Guile. @xref{,,, guile, Guile reference manual} for a complete list."
  1463. msgstr ""
  1464. #. type: Plain text
  1465. #: guix-git/doc/guix-cookbook.texi:1121
  1466. msgid "Guix provides additional helper functions which prove especially handy in the context of package management."
  1467. msgstr ""
  1468. #. type: Plain text
  1469. #: guix-git/doc/guix-cookbook.texi:1125
  1470. msgid "Some of those functions can be found in @samp{$GUIX_CHECKOUT/guix/guix/build/utils.scm}. Most of them mirror the behaviour of the traditional Unix system commands:"
  1471. msgstr ""
  1472. #. type: item
  1473. #: guix-git/doc/guix-cookbook.texi:1127
  1474. #, no-wrap
  1475. msgid "which"
  1476. msgstr ""
  1477. #. type: table
  1478. #: guix-git/doc/guix-cookbook.texi:1129
  1479. msgid "Like the @samp{which} system command."
  1480. msgstr ""
  1481. #. type: item
  1482. #: guix-git/doc/guix-cookbook.texi:1129
  1483. #, no-wrap
  1484. msgid "find-files"
  1485. msgstr ""
  1486. #. type: table
  1487. #: guix-git/doc/guix-cookbook.texi:1131
  1488. msgid "Akin to the @samp{find} system command."
  1489. msgstr ""
  1490. #. type: item
  1491. #: guix-git/doc/guix-cookbook.texi:1131
  1492. #, no-wrap
  1493. msgid "mkdir-p"
  1494. msgstr ""
  1495. #. type: table
  1496. #: guix-git/doc/guix-cookbook.texi:1133
  1497. msgid "Like @samp{mkdir -p}, which creates all parents as needed."
  1498. msgstr ""
  1499. #. type: item
  1500. #: guix-git/doc/guix-cookbook.texi:1133
  1501. #, no-wrap
  1502. msgid "install-file"
  1503. msgstr ""
  1504. #. type: table
  1505. #: guix-git/doc/guix-cookbook.texi:1137
  1506. msgid "Similar to @samp{install} when installing a file to a (possibly non-existing) directory. Guile has @code{copy-file} which works like @samp{cp}."
  1507. msgstr ""
  1508. #. type: item
  1509. #: guix-git/doc/guix-cookbook.texi:1137
  1510. #, no-wrap
  1511. msgid "copy-recursively"
  1512. msgstr ""
  1513. #. type: table
  1514. #: guix-git/doc/guix-cookbook.texi:1139
  1515. msgid "Like @samp{cp -r}."
  1516. msgstr ""
  1517. #. type: item
  1518. #: guix-git/doc/guix-cookbook.texi:1139
  1519. #, no-wrap
  1520. msgid "delete-file-recursively"
  1521. msgstr ""
  1522. #. type: table
  1523. #: guix-git/doc/guix-cookbook.texi:1141
  1524. msgid "Like @samp{rm -rf}."
  1525. msgstr ""
  1526. #. type: item
  1527. #: guix-git/doc/guix-cookbook.texi:1141
  1528. #, no-wrap
  1529. msgid "invoke"
  1530. msgstr ""
  1531. #. type: table
  1532. #: guix-git/doc/guix-cookbook.texi:1143
  1533. msgid "Run an executable. This should be used instead of @code{system*}."
  1534. msgstr ""
  1535. #. type: item
  1536. #: guix-git/doc/guix-cookbook.texi:1143
  1537. #, no-wrap
  1538. msgid "with-directory-excursion"
  1539. msgstr ""
  1540. #. type: table
  1541. #: guix-git/doc/guix-cookbook.texi:1146
  1542. msgid "Run the body in a different working directory, then restore the previous working directory."
  1543. msgstr ""
  1544. #. type: item
  1545. #: guix-git/doc/guix-cookbook.texi:1146
  1546. #, no-wrap
  1547. msgid "substitute*"
  1548. msgstr ""
  1549. #. type: table
  1550. #: guix-git/doc/guix-cookbook.texi:1148
  1551. msgid "A ``@command{sed}-like'' function."
  1552. msgstr ""
  1553. #. type: Plain text
  1554. #: guix-git/doc/guix-cookbook.texi:1152
  1555. msgid "@xref{Build Utilities,,, guix, GNU Guix Reference Manual}, for more information on these utilities."
  1556. msgstr ""
  1557. #. type: subsubsection
  1558. #: guix-git/doc/guix-cookbook.texi:1153
  1559. #, no-wrap
  1560. msgid "Module prefix"
  1561. msgstr ""
  1562. #. type: Plain text
  1563. #: guix-git/doc/guix-cookbook.texi:1163
  1564. msgid "The license in our last example needs a prefix: this is because of how the @code{license} module was imported in the package, as @code{#:use-module ((guix licenses) #:prefix license:)}. The Guile module import mechanism (@pxref{Using Guile Modules,,, guile, Guile reference manual}) gives the user full control over namespacing: this is needed to avoid clashes between, say, the @samp{zlib} variable from @samp{licenses.scm} (a @emph{license} value) and the @samp{zlib} variable from @samp{compression.scm} (a @emph{package} value)."
  1565. msgstr ""
  1566. #. type: subsection
  1567. #: guix-git/doc/guix-cookbook.texi:1164 guix-git/doc/guix-cookbook.texi:1165
  1568. #, no-wrap
  1569. msgid "Other build systems"
  1570. msgstr ""
  1571. #. type: Plain text
  1572. #: guix-git/doc/guix-cookbook.texi:1172
  1573. msgid "What we've seen so far covers the majority of packages using a build system other than the @code{trivial-build-system}. The latter does not automate anything and leaves you to build everything manually. This can be more demanding and we won't cover it here for now, but thankfully it is rarely necessary to fall back on this system."
  1574. msgstr ""
  1575. #. type: Plain text
  1576. #: guix-git/doc/guix-cookbook.texi:1176
  1577. msgid "For the other build systems, such as ASDF, Emacs, Perl, Ruby and many more, the process is very similar to the GNU build system except for a few specialized arguments."
  1578. msgstr ""
  1579. #. type: Plain text
  1580. #: guix-git/doc/guix-cookbook.texi:1181
  1581. msgid "@xref{Build Systems,,, guix, GNU Guix Reference Manual}, for more information on build systems, or check the source code in the @samp{$GUIX_CHECKOUT/guix/build} and @samp{$GUIX_CHECKOUT/guix/build-system} directories."
  1582. msgstr ""
  1583. #. type: subsection
  1584. #: guix-git/doc/guix-cookbook.texi:1182 guix-git/doc/guix-cookbook.texi:1183
  1585. #, no-wrap
  1586. msgid "Programmable and automated package definition"
  1587. msgstr ""
  1588. #. type: Plain text
  1589. #: guix-git/doc/guix-cookbook.texi:1187
  1590. msgid "We can't repeat it enough: having a full-fledged programming language at hand empowers us in ways that reach far beyond traditional package management."
  1591. msgstr ""
  1592. #. type: Plain text
  1593. #: guix-git/doc/guix-cookbook.texi:1189
  1594. msgid "Let's illustrate this with some awesome features of Guix!"
  1595. msgstr ""
  1596. #. type: subsubsection
  1597. #: guix-git/doc/guix-cookbook.texi:1190 guix-git/doc/guix-cookbook.texi:1191
  1598. #, no-wrap
  1599. msgid "Recursive importers"
  1600. msgstr ""
  1601. #. type: Plain text
  1602. #: guix-git/doc/guix-cookbook.texi:1198
  1603. msgid "You might find some build systems good enough that there is little to do at all to write a package, to the point that it becomes repetitive and tedious after a while. A @emph{raison d'être} of computers is to replace human beings at those boring tasks. So let's tell Guix to do this for us and create the package definition of an R package from CRAN (the output is trimmed for conciseness):"
  1604. msgstr ""
  1605. #. type: example
  1606. #: guix-git/doc/guix-cookbook.texi:1201
  1607. #, no-wrap
  1608. msgid ""
  1609. "$ guix import cran --recursive walrus\n"
  1610. "\n"
  1611. msgstr ""
  1612. #. type: example
  1613. #: guix-git/doc/guix-cookbook.texi:1205
  1614. #, no-wrap
  1615. msgid ""
  1616. "(define-public r-mc2d\n"
  1617. " ; ...\n"
  1618. " (license gpl2+)))\n"
  1619. "\n"
  1620. msgstr ""
  1621. #. type: example
  1622. #: guix-git/doc/guix-cookbook.texi:1209
  1623. #, no-wrap
  1624. msgid ""
  1625. "(define-public r-jmvcore\n"
  1626. " ; ...\n"
  1627. " (license gpl2+)))\n"
  1628. "\n"
  1629. msgstr ""
  1630. #. type: example
  1631. #: guix-git/doc/guix-cookbook.texi:1213
  1632. #, no-wrap
  1633. msgid ""
  1634. "(define-public r-wrs2\n"
  1635. " ; ...\n"
  1636. " (license gpl3)))\n"
  1637. "\n"
  1638. msgstr ""
  1639. #. type: example
  1640. #: guix-git/doc/guix-cookbook.texi:1242
  1641. #, no-wrap
  1642. msgid ""
  1643. "(define-public r-walrus\n"
  1644. " (package\n"
  1645. " (name \"r-walrus\")\n"
  1646. " (version \"1.0.3\")\n"
  1647. " (source\n"
  1648. " (origin\n"
  1649. " (method url-fetch)\n"
  1650. " (uri (cran-uri \"walrus\" version))\n"
  1651. " (sha256\n"
  1652. " (base32\n"
  1653. " \"1nk2glcvy4hyksl5ipq2mz8jy4fss90hx6cq98m3w96kzjni6jjj\"))))\n"
  1654. " (build-system r-build-system)\n"
  1655. " (propagated-inputs\n"
  1656. " `((\"r-ggplot2\" ,r-ggplot2)\n"
  1657. " (\"r-jmvcore\" ,r-jmvcore)\n"
  1658. " (\"r-r6\" ,r-r6)\n"
  1659. " (\"r-wrs2\" ,r-wrs2)))\n"
  1660. " (home-page \"https://github.com/jamovi/walrus\")\n"
  1661. " (synopsis \"Robust Statistical Methods\")\n"
  1662. " (description\n"
  1663. " \"This package provides a toolbox of common robust statistical\n"
  1664. "tests, including robust descriptives, robust t-tests, and robust ANOVA.\n"
  1665. "It is also available as a module for 'jamovi' (see\n"
  1666. "<https://www.jamovi.org> for more information). Walrus is based on the\n"
  1667. "WRS2 package by Patrick Mair, which is in turn based on the scripts and\n"
  1668. "work of Rand Wilcox. These analyses are described in depth in the book\n"
  1669. "'Introduction to Robust Estimation & Hypothesis Testing'.\")\n"
  1670. " (license gpl3)))\n"
  1671. msgstr ""
  1672. #. type: Plain text
  1673. #: guix-git/doc/guix-cookbook.texi:1246
  1674. msgid "The recursive importer won't import packages for which Guix already has package definitions, except for the very first."
  1675. msgstr ""
  1676. #. type: Plain text
  1677. #: guix-git/doc/guix-cookbook.texi:1251
  1678. msgid "Not all applications can be packaged this way, only those relying on a select number of supported systems. Read about the full list of importers in the guix import section of the manual (@pxref{Invoking guix import,,, guix, GNU Guix Reference Manual})."
  1679. msgstr ""
  1680. #. type: subsubsection
  1681. #: guix-git/doc/guix-cookbook.texi:1252 guix-git/doc/guix-cookbook.texi:1253
  1682. #, no-wrap
  1683. msgid "Automatic update"
  1684. msgstr ""
  1685. #. type: Plain text
  1686. #: guix-git/doc/guix-cookbook.texi:1257
  1687. msgid "Guix can be smart enough to check for updates on systems it knows. It can report outdated package definitions with"
  1688. msgstr ""
  1689. #. type: example
  1690. #: guix-git/doc/guix-cookbook.texi:1260
  1691. #, no-wrap
  1692. msgid "$ guix refresh hello\n"
  1693. msgstr ""
  1694. #. type: Plain text
  1695. #: guix-git/doc/guix-cookbook.texi:1265
  1696. msgid "In most cases, updating a package to a newer version requires little more than changing the version number and the checksum. Guix can do that automatically as well:"
  1697. msgstr ""
  1698. #. type: example
  1699. #: guix-git/doc/guix-cookbook.texi:1268
  1700. #, no-wrap
  1701. msgid "$ guix refresh hello --update\n"
  1702. msgstr ""
  1703. #. type: subsubsection
  1704. #: guix-git/doc/guix-cookbook.texi:1270 guix-git/doc/guix-cookbook.texi:1271
  1705. #, no-wrap
  1706. msgid "Inheritance"
  1707. msgstr ""
  1708. #. type: Plain text
  1709. #: guix-git/doc/guix-cookbook.texi:1275
  1710. msgid "If you've started browsing the existing package definitions, you might have noticed that a significant number of them have a @code{inherit} field:"
  1711. msgstr ""
  1712. #. type: lisp
  1713. #: guix-git/doc/guix-cookbook.texi:1291
  1714. #, no-wrap
  1715. msgid ""
  1716. "(define-public adwaita-icon-theme\n"
  1717. " (package (inherit gnome-icon-theme)\n"
  1718. " (name \"adwaita-icon-theme\")\n"
  1719. " (version \"3.26.1\")\n"
  1720. " (source (origin\n"
  1721. " (method url-fetch)\n"
  1722. " (uri (string-append \"mirror://gnome/sources/\" name \"/\"\n"
  1723. " (version-major+minor version) \"/\"\n"
  1724. " name \"-\" version \".tar.xz\"))\n"
  1725. " (sha256\n"
  1726. " (base32\n"
  1727. " \"17fpahgh5dyckgz7rwqvzgnhx53cx9kr2xw0szprc6bnqy977fi8\"))))\n"
  1728. " (native-inputs\n"
  1729. " `((\"gtk-encode-symbolic-svg\" ,gtk+ \"bin\")))))\n"
  1730. msgstr ""
  1731. #. type: Plain text
  1732. #: guix-git/doc/guix-cookbook.texi:1296
  1733. msgid "All unspecified fields are inherited from the parent package. This is very convenient to create alternative packages, for instance with different source, version or compilation options."
  1734. msgstr ""
  1735. #. type: subsection
  1736. #: guix-git/doc/guix-cookbook.texi:1297 guix-git/doc/guix-cookbook.texi:1298
  1737. #, no-wrap
  1738. msgid "Getting help"
  1739. msgstr ""
  1740. #. type: Plain text
  1741. #: guix-git/doc/guix-cookbook.texi:1304
  1742. msgid "Sadly, some applications can be tough to package. Sometimes they need a patch to work with the non-standard file system hierarchy enforced by the store. Sometimes the tests won't run properly. (They can be skipped but this is not recommended.) Other times the resulting package won't be reproducible."
  1743. msgstr ""
  1744. #. type: Plain text
  1745. #: guix-git/doc/guix-cookbook.texi:1307
  1746. msgid "Should you be stuck, unable to figure out how to fix any sort of packaging issue, don't hesitate to ask the community for help."
  1747. msgstr ""
  1748. #. type: Plain text
  1749. #: guix-git/doc/guix-cookbook.texi:1309
  1750. msgid "See the @uref{https://www.gnu.org/software/guix/contact/, Guix homepage} for information on the mailing lists, IRC, etc."
  1751. msgstr ""
  1752. #. type: subsection
  1753. #: guix-git/doc/guix-cookbook.texi:1310 guix-git/doc/guix-cookbook.texi:1311
  1754. #, no-wrap
  1755. msgid "Conclusion"
  1756. msgstr ""
  1757. #. type: Plain text
  1758. #: guix-git/doc/guix-cookbook.texi:1317
  1759. msgid "This tutorial was a showcase of the sophisticated package management that Guix boasts. At this point we have mostly restricted this introduction to the @code{gnu-build-system} which is a core abstraction layer on which more advanced abstractions are based."
  1760. msgstr ""
  1761. #. type: Plain text
  1762. #: guix-git/doc/guix-cookbook.texi:1322
  1763. msgid "Where do we go from here? Next we ought to dissect the innards of the build system by removing all abstractions, using the @code{trivial-build-system}: this should give us a thorough understanding of the process before investigating some more advanced packaging techniques and edge cases."
  1764. msgstr ""
  1765. #. type: Plain text
  1766. #: guix-git/doc/guix-cookbook.texi:1325
  1767. msgid "Other features worth exploring are the interactive editing and debugging capabilities of Guix provided by the Guile REPL@."
  1768. msgstr ""
  1769. #. type: Plain text
  1770. #: guix-git/doc/guix-cookbook.texi:1330
  1771. msgid "Those fancy features are completely optional and can wait; now is a good time to take a well-deserved break. With what we've introduced here you should be well armed to package lots of programs. You can get started right away and hopefully we will see your contributions soon!"
  1772. msgstr ""
  1773. #. type: subsection
  1774. #: guix-git/doc/guix-cookbook.texi:1331 guix-git/doc/guix-cookbook.texi:1332
  1775. #, no-wrap
  1776. msgid "References"
  1777. msgstr ""
  1778. #. type: itemize
  1779. #: guix-git/doc/guix-cookbook.texi:1337
  1780. msgid "The @uref{https://www.gnu.org/software/guix/manual/en/html_node/Defining-Packages.html, package reference in the manual}"
  1781. msgstr ""
  1782. #. type: itemize
  1783. #: guix-git/doc/guix-cookbook.texi:1340
  1784. msgid "@uref{https://gitlab.com/pjotrp/guix-notes/blob/master/HACKING.org, Pjotr’s hacking guide to GNU Guix}"
  1785. msgstr ""
  1786. #. type: itemize
  1787. #: guix-git/doc/guix-cookbook.texi:1343
  1788. msgid "@uref{https://www.gnu.org/software/guix/guix-ghm-andreas-20130823.pdf, ``GNU Guix: Package without a scheme!''}, by Andreas Enge"
  1789. msgstr ""
  1790. #. type: Plain text
  1791. #: guix-git/doc/guix-cookbook.texi:1352
  1792. msgid "Guix offers a flexible language for declaratively configuring your Guix System. This flexibility can at times be overwhelming. The purpose of this chapter is to demonstrate some advanced configuration concepts."
  1793. msgstr ""
  1794. #. type: Plain text
  1795. #: guix-git/doc/guix-cookbook.texi:1355
  1796. msgid "@pxref{System Configuration,,, guix, GNU Guix Reference Manual} for a complete reference."
  1797. msgstr ""
  1798. #. type: section
  1799. #: guix-git/doc/guix-cookbook.texi:1366 guix-git/doc/guix-cookbook.texi:1653
  1800. #: guix-git/doc/guix-cookbook.texi:1654
  1801. #, no-wrap
  1802. msgid "Guix System Image API"
  1803. msgstr ""
  1804. #. type: menuentry
  1805. #: guix-git/doc/guix-cookbook.texi:1366
  1806. msgid "Customizing images to target specific platforms."
  1807. msgstr ""
  1808. #. type: section
  1809. #: guix-git/doc/guix-cookbook.texi:1366 guix-git/doc/guix-cookbook.texi:1864
  1810. #: guix-git/doc/guix-cookbook.texi:1865
  1811. #, no-wrap
  1812. msgid "Connecting to Wireguard VPN"
  1813. msgstr ""
  1814. #. type: menuentry
  1815. #: guix-git/doc/guix-cookbook.texi:1366
  1816. msgid "Connecting to a Wireguard VPN."
  1817. msgstr ""
  1818. #. type: section
  1819. #: guix-git/doc/guix-cookbook.texi:1366 guix-git/doc/guix-cookbook.texi:1941
  1820. #: guix-git/doc/guix-cookbook.texi:1942
  1821. #, no-wrap
  1822. msgid "Customizing a Window Manager"
  1823. msgstr ""
  1824. #. type: menuentry
  1825. #: guix-git/doc/guix-cookbook.texi:1366
  1826. msgid "Handle customization of a Window manager on Guix System."
  1827. msgstr ""
  1828. #. type: section
  1829. #: guix-git/doc/guix-cookbook.texi:1366 guix-git/doc/guix-cookbook.texi:2032
  1830. #: guix-git/doc/guix-cookbook.texi:2033
  1831. #, no-wrap
  1832. msgid "Running Guix on a Linode Server"
  1833. msgstr ""
  1834. #. type: section
  1835. #: guix-git/doc/guix-cookbook.texi:1366 guix-git/doc/guix-cookbook.texi:2272
  1836. #: guix-git/doc/guix-cookbook.texi:2273
  1837. #, no-wrap
  1838. msgid "Setting up a bind mount"
  1839. msgstr ""
  1840. #. type: menuentry
  1841. #: guix-git/doc/guix-cookbook.texi:1366
  1842. msgid "Setting up a bind mount in the file-systems definition."
  1843. msgstr ""
  1844. #. type: section
  1845. #: guix-git/doc/guix-cookbook.texi:1366 guix-git/doc/guix-cookbook.texi:2321
  1846. #: guix-git/doc/guix-cookbook.texi:2322
  1847. #, no-wrap
  1848. msgid "Getting substitutes from Tor"
  1849. msgstr ""
  1850. #. type: menuentry
  1851. #: guix-git/doc/guix-cookbook.texi:1366
  1852. msgid "Configuring Guix daemon to get substitutes through Tor."
  1853. msgstr ""
  1854. #. type: section
  1855. #: guix-git/doc/guix-cookbook.texi:1366 guix-git/doc/guix-cookbook.texi:2383
  1856. #: guix-git/doc/guix-cookbook.texi:2384
  1857. #, no-wrap
  1858. msgid "Setting up NGINX with Lua"
  1859. msgstr ""
  1860. #. type: menuentry
  1861. #: guix-git/doc/guix-cookbook.texi:1366
  1862. msgid "Configuring NGINX web-server to load Lua modules."
  1863. msgstr ""
  1864. #. type: Plain text
  1865. #: guix-git/doc/guix-cookbook.texi:1378
  1866. msgid "While the Guix manual explains auto-login one user to @emph{all} TTYs ( @pxref{auto-login to TTY,,, guix, GNU Guix Reference Manual}), some might prefer a situation, in which one user is logged into one TTY with the other TTYs either configured to login different users or no one at all. Note that one can auto-login one user to any TTY, but it is usually advisable to avoid @code{tty1}, which, by default, is used to log warnings and errors."
  1867. msgstr ""
  1868. #. type: Plain text
  1869. #: guix-git/doc/guix-cookbook.texi:1380
  1870. msgid "Here is how one might set up auto login for one user to one tty:"
  1871. msgstr ""
  1872. #. type: lisp
  1873. #: guix-git/doc/guix-cookbook.texi:1388
  1874. #, no-wrap
  1875. msgid ""
  1876. "(define (auto-login-to-tty config tty user)\n"
  1877. " (if (string=? tty (mingetty-configuration-tty config))\n"
  1878. " (mingetty-configuration\n"
  1879. " (inherit config)\n"
  1880. " (auto-login user))\n"
  1881. " config))\n"
  1882. "\n"
  1883. msgstr ""
  1884. #. type: lisp
  1885. #: guix-git/doc/guix-cookbook.texi:1395
  1886. #, no-wrap
  1887. msgid ""
  1888. "(define %my-services\n"
  1889. " (modify-services %base-services\n"
  1890. " ;; @dots{}\n"
  1891. " (mingetty-service-type config =>\n"
  1892. " (auto-login-to-tty\n"
  1893. " config \"tty3\" \"alice\"))))\n"
  1894. "\n"
  1895. msgstr ""
  1896. #. type: lisp
  1897. #: guix-git/doc/guix-cookbook.texi:1399
  1898. #, no-wrap
  1899. msgid ""
  1900. "(operating-system\n"
  1901. " ;; @dots{}\n"
  1902. " (services %my-services))\n"
  1903. msgstr ""
  1904. #. type: Plain text
  1905. #: guix-git/doc/guix-cookbook.texi:1404
  1906. msgid "One could also @code{compose} (@pxref{Higher-Order Functions,,, guile, The Guile Reference Manual}) @code{auto-login-to-tty} to login multiple users to multiple ttys."
  1907. msgstr ""
  1908. #. type: Plain text
  1909. #: guix-git/doc/guix-cookbook.texi:1411
  1910. msgid "Finally, here is a note of caution. Setting up auto login to a TTY, means that anyone can turn on your computer and run commands as your regular user. However, if you have an encrypted root partition, and thus already need to enter a passphrase when the system boots, auto-login might be a convenient option."
  1911. msgstr ""
  1912. #. type: Plain text
  1913. #: guix-git/doc/guix-cookbook.texi:1423
  1914. msgid "Guix is, at its core, a source based distribution with substitutes (@pxref{Substitutes,,, guix, GNU Guix Reference Manual}), and as such building packages from their source code is an expected part of regular package installations and upgrades. Given this starting point, it makes sense that efforts are made to reduce the amount of time spent compiling packages, and recent changes and upgrades to the building and distribution of substitutes continues to be a topic of discussion within Guix."
  1915. msgstr ""
  1916. #. type: Plain text
  1917. #: guix-git/doc/guix-cookbook.texi:1429
  1918. msgid "The kernel, while not requiring an overabundance of RAM to build, does take a rather long time on an average machine. The official kernel configuration, as is the case with many GNU/Linux distributions, errs on the side of inclusiveness, and this is really what causes the build to take such a long time when the kernel is built from source."
  1919. msgstr ""
  1920. #. type: Plain text
  1921. #: guix-git/doc/guix-cookbook.texi:1434
  1922. msgid "The Linux kernel, however, can also just be described as a regular old package, and as such can be customized just like any other package. The procedure is a little bit different, although this is primarily due to the nature of how the package definition is written."
  1923. msgstr ""
  1924. #. type: Plain text
  1925. #: guix-git/doc/guix-cookbook.texi:1437
  1926. msgid "The @code{linux-libre} kernel package definition is actually a procedure which creates a package."
  1927. msgstr ""
  1928. #. type: lisp
  1929. #: guix-git/doc/guix-cookbook.texi:1449
  1930. #, no-wrap
  1931. msgid ""
  1932. "(define* (make-linux-libre version hash supported-systems\n"
  1933. " #:key\n"
  1934. " ;; A function that takes an arch and a variant.\n"
  1935. " ;; See kernel-config for an example.\n"
  1936. " (extra-version #false)\n"
  1937. " (configuration-file #false)\n"
  1938. " (defconfig \"defconfig\")\n"
  1939. " (extra-options %default-extra-linux-options)\n"
  1940. " (patches (list %boot-logo-patch)))\n"
  1941. " ...)\n"
  1942. msgstr ""
  1943. #. type: Plain text
  1944. #: guix-git/doc/guix-cookbook.texi:1453
  1945. msgid "The current @code{linux-libre} package is for the 5.1.x series, and is declared like this:"
  1946. msgstr ""
  1947. #. type: lisp
  1948. #: guix-git/doc/guix-cookbook.texi:1461
  1949. #, no-wrap
  1950. msgid ""
  1951. "(define-public linux-libre\n"
  1952. " (make-linux-libre %linux-libre-version\n"
  1953. " %linux-libre-hash\n"
  1954. " '(\"x86_64-linux\" \"i686-linux\" \"armhf-linux\" \"aarch64-linux\")\n"
  1955. " #:patches %linux-libre-5.1-patches\n"
  1956. " #:configuration-file kernel-config))\n"
  1957. msgstr ""
  1958. #. type: Plain text
  1959. #: guix-git/doc/guix-cookbook.texi:1470
  1960. msgid "Any keys which are not assigned values inherit their default value from the @code{make-linux-libre} definition. When comparing the two snippets above, you may notice that the code comment in the first doesn't actually refer to the @code{#:extra-version} keyword; it is actually for @code{#:configuration-file}. Because of this, it is not actually easy to include a custom kernel configuration from the definition, but don't worry, there are other ways to work with what we do have."
  1961. msgstr ""
  1962. #. type: Plain text
  1963. #: guix-git/doc/guix-cookbook.texi:1476
  1964. msgid "There are two ways to create a kernel with a custom kernel configuration. The first is to provide a standard @file{.config} file during the build process by including an actual @file{.config} file as a native input to our custom kernel. The following is a snippet from the custom @code{'configure} phase of the @code{make-linux-libre} package definition:"
  1965. msgstr ""
  1966. #. type: lisp
  1967. #: guix-git/doc/guix-cookbook.texi:1480
  1968. #, no-wrap
  1969. msgid ""
  1970. "(let ((build (assoc-ref %standard-phases 'build))\n"
  1971. " (config (assoc-ref (or native-inputs inputs) \"kconfig\")))\n"
  1972. "\n"
  1973. msgstr ""
  1974. #. type: lisp
  1975. #: guix-git/doc/guix-cookbook.texi:1488
  1976. #, no-wrap
  1977. msgid ""
  1978. " ;; Use a custom kernel configuration file or a default\n"
  1979. " ;; configuration file.\n"
  1980. " (if config\n"
  1981. " (begin\n"
  1982. " (copy-file config \".config\")\n"
  1983. " (chmod \".config\" #o666))\n"
  1984. " (invoke \"make\" ,defconfig)))\n"
  1985. msgstr ""
  1986. #. type: Plain text
  1987. #: guix-git/doc/guix-cookbook.texi:1493
  1988. msgid "Below is a sample kernel package. The @code{linux-libre} package is nothing special and can be inherited from and have its fields overridden like any other package:"
  1989. msgstr ""
  1990. #. type: lisp
  1991. #: guix-git/doc/guix-cookbook.texi:1502
  1992. #, no-wrap
  1993. msgid ""
  1994. "(define-public linux-libre/E2140\n"
  1995. " (package\n"
  1996. " (inherit linux-libre)\n"
  1997. " (native-inputs\n"
  1998. " `((\"kconfig\" ,(local-file \"E2140.config\"))\n"
  1999. " ,@@(alist-delete \"kconfig\"\n"
  2000. " (package-native-inputs linux-libre))))))\n"
  2001. msgstr ""
  2002. #. type: Plain text
  2003. #: guix-git/doc/guix-cookbook.texi:1509
  2004. msgid "In the same directory as the file defining @code{linux-libre-E2140} is a file named @file{E2140.config}, which is an actual kernel configuration file. The @code{defconfig} keyword of @code{make-linux-libre} is left blank here, so the only kernel configuration in the package is the one which was included in the @code{native-inputs} field."
  2005. msgstr ""
  2006. #. type: Plain text
  2007. #: guix-git/doc/guix-cookbook.texi:1514
  2008. msgid "The second way to create a custom kernel is to pass a new value to the @code{extra-options} keyword of the @code{make-linux-libre} procedure. The @code{extra-options} keyword works with another function defined right below it:"
  2009. msgstr ""
  2010. #. type: lisp
  2011. #: guix-git/doc/guix-cookbook.texi:1530
  2012. #, no-wrap
  2013. msgid ""
  2014. "(define %default-extra-linux-options\n"
  2015. " `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html\n"
  2016. " (\"CONFIG_DEVPTS_MULTIPLE_INSTANCES\" . #true)\n"
  2017. " ;; Modules required for initrd:\n"
  2018. " (\"CONFIG_NET_9P\" . m)\n"
  2019. " (\"CONFIG_NET_9P_VIRTIO\" . m)\n"
  2020. " (\"CONFIG_VIRTIO_BLK\" . m)\n"
  2021. " (\"CONFIG_VIRTIO_NET\" . m)\n"
  2022. " (\"CONFIG_VIRTIO_PCI\" . m)\n"
  2023. " (\"CONFIG_VIRTIO_BALLOON\" . m)\n"
  2024. " (\"CONFIG_VIRTIO_MMIO\" . m)\n"
  2025. " (\"CONFIG_FUSE_FS\" . m)\n"
  2026. " (\"CONFIG_CIFS\" . m)\n"
  2027. " (\"CONFIG_9P_FS\" . m)))\n"
  2028. "\n"
  2029. msgstr ""
  2030. #. type: lisp
  2031. #: guix-git/doc/guix-cookbook.texi:1541
  2032. #, no-wrap
  2033. msgid ""
  2034. "(define (config->string options)\n"
  2035. " (string-join (map (match-lambda\n"
  2036. " ((option . 'm)\n"
  2037. " (string-append option \"=m\"))\n"
  2038. " ((option . #true)\n"
  2039. " (string-append option \"=y\"))\n"
  2040. " ((option . #false)\n"
  2041. " (string-append option \"=n\")))\n"
  2042. " options)\n"
  2043. " \"\\n\"))\n"
  2044. msgstr ""
  2045. #. type: Plain text
  2046. #: guix-git/doc/guix-cookbook.texi:1544
  2047. msgid "And in the custom configure script from the `make-linux-libre` package:"
  2048. msgstr ""
  2049. #. type: lisp
  2050. #: guix-git/doc/guix-cookbook.texi:1552
  2051. #, no-wrap
  2052. msgid ""
  2053. ";; Appending works even when the option wasn't in the\n"
  2054. ";; file. The last one prevails if duplicated.\n"
  2055. "(let ((port (open-file \".config\" \"a\"))\n"
  2056. " (extra-configuration ,(config->string extra-options)))\n"
  2057. " (display extra-configuration port)\n"
  2058. " (close-port port))\n"
  2059. "\n"
  2060. msgstr ""
  2061. #. type: lisp
  2062. #: guix-git/doc/guix-cookbook.texi:1554
  2063. #, no-wrap
  2064. msgid "(invoke \"make\" \"oldconfig\")\n"
  2065. msgstr ""
  2066. #. type: Plain text
  2067. #: guix-git/doc/guix-cookbook.texi:1559
  2068. msgid "So by not providing a configuration-file the @file{.config} starts blank, and then we write into it the collection of flags that we want. Here's another custom kernel:"
  2069. msgstr ""
  2070. #. type: lisp
  2071. #: guix-git/doc/guix-cookbook.texi:1567
  2072. #, no-wrap
  2073. msgid ""
  2074. "(define %macbook41-full-config\n"
  2075. " (append %macbook41-config-options\n"
  2076. " %file-systems\n"
  2077. " %efi-support\n"
  2078. " %emulation\n"
  2079. " (@@@@ (gnu packages linux) %default-extra-linux-options)))\n"
  2080. "\n"
  2081. msgstr ""
  2082. #. type: lisp
  2083. #: guix-git/doc/guix-cookbook.texi:1577
  2084. #, no-wrap
  2085. msgid ""
  2086. "(define-public linux-libre-macbook41\n"
  2087. " ;; XXX: Access the internal 'make-linux-libre' procedure, which is\n"
  2088. " ;; private and unexported, and is liable to change in the future.\n"
  2089. " ((@@@@ (gnu packages linux) make-linux-libre) (@@@@ (gnu packages linux) %linux-libre-version)\n"
  2090. " (@@@@ (gnu packages linux) %linux-libre-hash)\n"
  2091. " '(\"x86_64-linux\")\n"
  2092. " #:extra-version \"macbook41\"\n"
  2093. " #:patches (@@@@ (gnu packages linux) %linux-libre-5.1-patches)\n"
  2094. " #:extra-options %macbook41-config-options))\n"
  2095. msgstr ""
  2096. #. type: Plain text
  2097. #: guix-git/doc/guix-cookbook.texi:1584
  2098. msgid "In the above example @code{%file-systems} is a collection of flags enabling different file system support, @code{%efi-support} enables EFI support and @code{%emulation} enables a x86_64-linux machine to act in 32-bit mode also. @code{%default-extra-linux-options} are the ones quoted above, which had to be added in since they were replaced in the @code{extra-options} keyword."
  2099. msgstr ""
  2100. #. type: Plain text
  2101. #: guix-git/doc/guix-cookbook.texi:1593
  2102. msgid "This all sounds like it should be doable, but how does one even know which modules are required for a particular system? Two places that can be helpful in trying to answer this question is the @uref{https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel, Gentoo Handbook} and the @uref{https://www.kernel.org/doc/html/latest/admin-guide/README.html?highlight=localmodconfig, documentation from the kernel itself}. From the kernel documentation, it seems that @code{make localmodconfig} is the command we want."
  2103. msgstr ""
  2104. #. type: Plain text
  2105. #: guix-git/doc/guix-cookbook.texi:1596
  2106. msgid "In order to actually run @code{make localmodconfig} we first need to get and unpack the kernel source code:"
  2107. msgstr ""
  2108. #. type: example
  2109. #: guix-git/doc/guix-cookbook.texi:1599
  2110. #, no-wrap
  2111. msgid "tar xf $(guix build linux-libre --source)\n"
  2112. msgstr ""
  2113. #. type: Plain text
  2114. #: guix-git/doc/guix-cookbook.texi:1606
  2115. msgid "Once inside the directory containing the source code run @code{touch .config} to create an initial, empty @file{.config} to start with. @code{make localmodconfig} works by seeing what you already have in @file{.config} and letting you know what you're missing. If the file is blank then you're missing everything. The next step is to run:"
  2116. msgstr ""
  2117. #. type: example
  2118. #: guix-git/doc/guix-cookbook.texi:1609
  2119. #, no-wrap
  2120. msgid "guix environment linux-libre -- make localmodconfig\n"
  2121. msgstr ""
  2122. #. type: Plain text
  2123. #: guix-git/doc/guix-cookbook.texi:1614
  2124. msgid "and note the output. Do note that the @file{.config} file is still empty. The output generally contains two types of warnings. The first start with \"WARNING\" and can actually be ignored in our case. The second read:"
  2125. msgstr ""
  2126. #. type: example
  2127. #: guix-git/doc/guix-cookbook.texi:1617
  2128. #, no-wrap
  2129. msgid "module pcspkr did not have configs CONFIG_INPUT_PCSPKR\n"
  2130. msgstr ""
  2131. #. type: Plain text
  2132. #: guix-git/doc/guix-cookbook.texi:1622
  2133. msgid "For each of these lines, copy the @code{CONFIG_XXXX_XXXX} portion into the @file{.config} in the directory, and append @code{=m}, so in the end it looks like this:"
  2134. msgstr ""
  2135. #. type: example
  2136. #: guix-git/doc/guix-cookbook.texi:1626
  2137. #, no-wrap
  2138. msgid ""
  2139. "CONFIG_INPUT_PCSPKR=m\n"
  2140. "CONFIG_VIRTIO=m\n"
  2141. msgstr ""
  2142. #. type: Plain text
  2143. #: guix-git/doc/guix-cookbook.texi:1635
  2144. msgid "After copying all the configuration options, run @code{make localmodconfig} again to make sure that you don't have any output starting with ``module''. After all of these machine specific modules there are a couple more left that are also needed. @code{CONFIG_MODULES} is necessary so that you can build and load modules separately and not have everything built into the kernel. @code{CONFIG_BLK_DEV_SD} is required for reading from hard drives. It is possible that there are other modules which you will need."
  2145. msgstr ""
  2146. #. type: Plain text
  2147. #: guix-git/doc/guix-cookbook.texi:1639
  2148. msgid "This post does not aim to be a guide to configuring your own kernel however, so if you do decide to build a custom kernel you'll have to seek out other guides to create a kernel which is just right for your needs."
  2149. msgstr ""
  2150. #. type: Plain text
  2151. #: guix-git/doc/guix-cookbook.texi:1647
  2152. msgid "The second way to setup the kernel configuration makes more use of Guix's features and allows you to share configuration segments between different kernels. For example, all machines using EFI to boot have a number of EFI configuration flags that they need. It is likely that all the kernels will share a list of file systems to support. By using variables it is easier to see at a glance what features are enabled and to make sure you don't have features in one kernel but missing in another."
  2153. msgstr ""
  2154. #. type: Plain text
  2155. #: guix-git/doc/guix-cookbook.texi:1652
  2156. msgid "Left undiscussed however, is Guix's initrd and its customization. It is likely that you'll need to modify the initrd on a machine using a custom kernel, since certain modules which are expected to be built may not be available for inclusion into the initrd."
  2157. msgstr ""
  2158. #. type: Plain text
  2159. #: guix-git/doc/guix-cookbook.texi:1659
  2160. msgid "Historically, Guix System is centered around an @code{operating-system} structure. This structure contains various fields ranging from the bootloader and kernel declaration to the services to install."
  2161. msgstr ""
  2162. #. type: Plain text
  2163. #: guix-git/doc/guix-cookbook.texi:1665
  2164. msgid "Depending on the target machine, that can go from a standard @code{x86_64} machine to a small ARM single board computer such as the Pine64, the image constraints can vary a lot. The hardware manufacturers will impose different image formats with various partition sizes and offsets."
  2165. msgstr ""
  2166. #. type: Plain text
  2167. #: guix-git/doc/guix-cookbook.texi:1670
  2168. msgid "To create images suitable for all those machines, a new abstraction is necessary: that's the goal of the @code{image} record. This record contains all the required information to be transformed into a standalone image, that can be directly booted on any target machine."
  2169. msgstr ""
  2170. #. type: lisp
  2171. #: guix-git/doc/guix-cookbook.texi:1692
  2172. #, no-wrap
  2173. msgid ""
  2174. "(define-record-type* <image>\n"
  2175. " image make-image\n"
  2176. " image?\n"
  2177. " (name image-name ;symbol\n"
  2178. " (default #f))\n"
  2179. " (format image-format) ;symbol\n"
  2180. " (target image-target\n"
  2181. " (default #f))\n"
  2182. " (size image-size ;size in bytes as integer\n"
  2183. " (default 'guess))\n"
  2184. " (operating-system image-operating-system ;<operating-system>\n"
  2185. " (default #f))\n"
  2186. " (partitions image-partitions ;list of <partition>\n"
  2187. " (default '()))\n"
  2188. " (compression? image-compression? ;boolean\n"
  2189. " (default #t))\n"
  2190. " (volatile-root? image-volatile-root? ;boolean\n"
  2191. " (default #t))\n"
  2192. " (substitutable? image-substitutable? ;boolean\n"
  2193. " (default #t)))\n"
  2194. msgstr ""
  2195. #. type: Plain text
  2196. #: guix-git/doc/guix-cookbook.texi:1698
  2197. msgid "This record contains the operating-system to instantiate. The @code{format} field defines the image type and can be @code{efi-raw}, @code{qcow2} or @code{iso9660} for instance. In the future, it could be extended to @code{docker} or other image types."
  2198. msgstr ""
  2199. #. type: Plain text
  2200. #: guix-git/doc/guix-cookbook.texi:1701
  2201. msgid "A new directory in the Guix sources is dedicated to images definition. For now there are four files:"
  2202. msgstr ""
  2203. #. type: file{#1}
  2204. #: guix-git/doc/guix-cookbook.texi:1703
  2205. #, no-wrap
  2206. msgid "gnu/system/images/hurd.scm"
  2207. msgstr ""
  2208. #. type: file{#1}
  2209. #: guix-git/doc/guix-cookbook.texi:1704
  2210. #, no-wrap
  2211. msgid "gnu/system/images/pine64.scm"
  2212. msgstr ""
  2213. #. type: file{#1}
  2214. #: guix-git/doc/guix-cookbook.texi:1705
  2215. #, no-wrap
  2216. msgid "gnu/system/images/novena.scm"
  2217. msgstr ""
  2218. #. type: file{#1}
  2219. #: guix-git/doc/guix-cookbook.texi:1706
  2220. #, no-wrap
  2221. msgid "gnu/system/images/pinebook-pro.scm"
  2222. msgstr ""
  2223. #. type: Plain text
  2224. #: guix-git/doc/guix-cookbook.texi:1712
  2225. msgid "Let's have a look to @file{pine64.scm}. It contains the @code{pine64-barebones-os} variable which is a minimal definition of an operating-system dedicated to the @b{Pine A64 LTS} board."
  2226. msgstr ""
  2227. #. type: lisp
  2228. #: guix-git/doc/guix-cookbook.texi:1736
  2229. #, no-wrap
  2230. msgid ""
  2231. "(define pine64-barebones-os\n"
  2232. " (operating-system\n"
  2233. " (host-name \"vignemale\")\n"
  2234. " (timezone \"Europe/Paris\")\n"
  2235. " (locale \"en_US.utf8\")\n"
  2236. " (bootloader (bootloader-configuration\n"
  2237. " (bootloader u-boot-pine64-lts-bootloader)\n"
  2238. " (target \"/dev/vda\")))\n"
  2239. " (initrd-modules '())\n"
  2240. " (kernel linux-libre-arm64-generic)\n"
  2241. " (file-systems (cons (file-system\n"
  2242. " (device (file-system-label \"my-root\"))\n"
  2243. " (mount-point \"/\")\n"
  2244. " (type \"ext4\"))\n"
  2245. " %base-file-systems))\n"
  2246. " (services (cons (service agetty-service-type\n"
  2247. " (agetty-configuration\n"
  2248. " (extra-options '(\"-L\")) ; no carrier detect\n"
  2249. " (baud-rate \"115200\")\n"
  2250. " (term \"vt100\")\n"
  2251. " (tty \"ttyS0\")))\n"
  2252. " %base-services))))\n"
  2253. msgstr ""
  2254. #. type: Plain text
  2255. #: guix-git/doc/guix-cookbook.texi:1740
  2256. msgid "The @code{kernel} and @code{bootloader} fields are pointing to packages dedicated to this board."
  2257. msgstr ""
  2258. #. type: Plain text
  2259. #: guix-git/doc/guix-cookbook.texi:1742
  2260. msgid "Right below, the @code{pine64-image-type} variable is also defined."
  2261. msgstr ""
  2262. #. type: lisp
  2263. #: guix-git/doc/guix-cookbook.texi:1748
  2264. #, no-wrap
  2265. msgid ""
  2266. "(define pine64-image-type\n"
  2267. " (image-type\n"
  2268. " (name 'pine64-raw)\n"
  2269. " (constructor (cut image-with-os arm64-disk-image <>))))\n"
  2270. msgstr ""
  2271. #. type: Plain text
  2272. #: guix-git/doc/guix-cookbook.texi:1752
  2273. msgid "It's using a record we haven't talked about yet, the @code{image-type} record, defined this way:"
  2274. msgstr ""
  2275. #. type: lisp
  2276. #: guix-git/doc/guix-cookbook.texi:1759
  2277. #, no-wrap
  2278. msgid ""
  2279. "(define-record-type* <image-type>\n"
  2280. " image-type make-image-type\n"
  2281. " image-type?\n"
  2282. " (name image-type-name) ;symbol\n"
  2283. " (constructor image-type-constructor)) ;<operating-system> -> <image>\n"
  2284. msgstr ""
  2285. #. type: Plain text
  2286. #: guix-git/doc/guix-cookbook.texi:1765
  2287. msgid "The main purpose of this record is to associate a name to a procedure transforming an @code{operating-system} to an image. To understand why it is necessary, let's have a look to the command producing an image from an @code{operating-system} configuration file:"
  2288. msgstr ""
  2289. #. type: example
  2290. #: guix-git/doc/guix-cookbook.texi:1768
  2291. #, no-wrap
  2292. msgid "guix system image my-os.scm\n"
  2293. msgstr ""
  2294. #. type: Plain text
  2295. #: guix-git/doc/guix-cookbook.texi:1774
  2296. msgid "This command expects an @code{operating-system} configuration but how should we indicate that we want an image targeting a Pine64 board? We need to provide an extra information, the @code{image-type}, by passing the @code{--image-type} or @code{-t} flag, this way:"
  2297. msgstr ""
  2298. #. type: example
  2299. #: guix-git/doc/guix-cookbook.texi:1777
  2300. #, no-wrap
  2301. msgid "guix system image --image-type=pine64-raw my-os.scm\n"
  2302. msgstr ""
  2303. #. type: Plain text
  2304. #: guix-git/doc/guix-cookbook.texi:1783
  2305. msgid "This @code{image-type} parameter points to the @code{pine64-image-type} defined above. Hence, the @code{operating-system} declared in @code{my-os.scm} will be applied the @code{(cut image-with-os arm64-disk-image <>)} procedure to turn it into an image."
  2306. msgstr ""
  2307. #. type: Plain text
  2308. #: guix-git/doc/guix-cookbook.texi:1785
  2309. msgid "The resulting image looks like:"
  2310. msgstr ""
  2311. #. type: lisp
  2312. #: guix-git/doc/guix-cookbook.texi:1795
  2313. #, no-wrap
  2314. msgid ""
  2315. "(image\n"
  2316. " (format 'disk-image)\n"
  2317. " (target \"aarch64-linux-gnu\")\n"
  2318. " (operating-system my-os)\n"
  2319. " (partitions\n"
  2320. " (list (partition\n"
  2321. " (inherit root-partition)\n"
  2322. " (offset root-offset)))))\n"
  2323. msgstr ""
  2324. #. type: Plain text
  2325. #: guix-git/doc/guix-cookbook.texi:1799
  2326. msgid "which is the aggregation of the @code{operating-system} defined in @code{my-os.scm} to the @code{arm64-disk-image} record."
  2327. msgstr ""
  2328. #. type: Plain text
  2329. #: guix-git/doc/guix-cookbook.texi:1801
  2330. msgid "But enough Scheme madness. What does this image API bring to the Guix user?"
  2331. msgstr ""
  2332. #. type: Plain text
  2333. #: guix-git/doc/guix-cookbook.texi:1803
  2334. msgid "One can run:"
  2335. msgstr ""
  2336. #. type: example
  2337. #: guix-git/doc/guix-cookbook.texi:1807
  2338. #, no-wrap
  2339. msgid ""
  2340. "mathieu@@cervin:~$ guix system --list-image-types\n"
  2341. "The available image types are:\n"
  2342. "\n"
  2343. msgstr ""
  2344. #. type: example
  2345. #: guix-git/doc/guix-cookbook.texi:1819
  2346. #, no-wrap
  2347. msgid ""
  2348. " - pinebook-pro-raw\n"
  2349. " - pine64-raw\n"
  2350. " - novena-raw\n"
  2351. " - hurd-raw\n"
  2352. " - hurd-qcow2\n"
  2353. " - qcow2\n"
  2354. " - uncompressed-iso9660\n"
  2355. " - efi-raw\n"
  2356. " - arm64-raw\n"
  2357. " - arm32-raw\n"
  2358. " - iso9660\n"
  2359. msgstr ""
  2360. #. type: Plain text
  2361. #: guix-git/doc/guix-cookbook.texi:1824
  2362. msgid "and by writing an @code{operating-system} file based on @code{pine64-barebones-os}, you can customize your image to your preferences in a file (@file{my-pine-os.scm}) like this:"
  2363. msgstr ""
  2364. #. type: lisp
  2365. #: guix-git/doc/guix-cookbook.texi:1828
  2366. #, no-wrap
  2367. msgid ""
  2368. "(use-modules (gnu services linux)\n"
  2369. " (gnu system images pine64))\n"
  2370. "\n"
  2371. msgstr ""
  2372. #. type: lisp
  2373. #: guix-git/doc/guix-cookbook.texi:1839
  2374. #, no-wrap
  2375. msgid ""
  2376. "(let ((base-os pine64-barebones-os))\n"
  2377. " (operating-system\n"
  2378. " (inherit base-os)\n"
  2379. " (timezone \"America/Indiana/Indianapolis\")\n"
  2380. " (services\n"
  2381. " (cons\n"
  2382. " (service earlyoom-service-type\n"
  2383. " (earlyoom-configuration\n"
  2384. " (prefer-regexp \"icecat|chromium\")))\n"
  2385. " (operating-system-user-services base-os)))))\n"
  2386. msgstr ""
  2387. #. type: Plain text
  2388. #: guix-git/doc/guix-cookbook.texi:1842
  2389. msgid "run:"
  2390. msgstr ""
  2391. #. type: example
  2392. #: guix-git/doc/guix-cookbook.texi:1845
  2393. #, no-wrap
  2394. msgid "guix system image --image-type=pine64-raw my-pine-os.scm\n"
  2395. msgstr ""
  2396. #. type: Plain text
  2397. #: guix-git/doc/guix-cookbook.texi:1848
  2398. msgid "or,"
  2399. msgstr ""
  2400. #. type: example
  2401. #: guix-git/doc/guix-cookbook.texi:1851
  2402. #, no-wrap
  2403. msgid "guix system image --image-type=hurd-raw my-hurd-os.scm\n"
  2404. msgstr ""
  2405. #. type: Plain text
  2406. #: guix-git/doc/guix-cookbook.texi:1855
  2407. msgid "to get an image that can be written directly to a hard drive and booted from."
  2408. msgstr ""
  2409. #. type: Plain text
  2410. #: guix-git/doc/guix-cookbook.texi:1857
  2411. msgid "Without changing anything to @code{my-hurd-os.scm}, calling:"
  2412. msgstr ""
  2413. #. type: example
  2414. #: guix-git/doc/guix-cookbook.texi:1860
  2415. #, no-wrap
  2416. msgid "guix system image --image-type=hurd-qcow2 my-hurd-os.scm\n"
  2417. msgstr ""
  2418. #. type: Plain text
  2419. #: guix-git/doc/guix-cookbook.texi:1863
  2420. msgid "will instead produce a Hurd QEMU image."
  2421. msgstr ""
  2422. #. type: Plain text
  2423. #: guix-git/doc/guix-cookbook.texi:1870
  2424. msgid "To connect to a Wireguard VPN server you need the kernel module to be loaded in memory and a package providing networking tools that support it (e.g. @code{wireguard-tools} or @code{network-manager})."
  2425. msgstr ""
  2426. #. type: Plain text
  2427. #: guix-git/doc/guix-cookbook.texi:1874
  2428. msgid "Here is a configuration example for Linux-Libre < 5.6, where the module is out of tree and need to be loaded manually---following revisions of the kernel have it built-in and so don't need such configuration:"
  2429. msgstr ""
  2430. #. type: lisp
  2431. #: guix-git/doc/guix-cookbook.texi:1879
  2432. #, no-wrap
  2433. msgid ""
  2434. "(use-modules (gnu))\n"
  2435. "(use-service-modules desktop)\n"
  2436. "(use-package-modules vpn)\n"
  2437. "\n"
  2438. msgstr ""
  2439. #. type: lisp
  2440. #: guix-git/doc/guix-cookbook.texi:1888
  2441. #, no-wrap
  2442. msgid ""
  2443. "(operating-system\n"
  2444. " ;; …\n"
  2445. " (services (cons (simple-service 'wireguard-module\n"
  2446. " kernel-module-loader-service-type\n"
  2447. " '(\"wireguard\"))\n"
  2448. " %desktop-services))\n"
  2449. " (packages (cons wireguard-tools %base-packages))\n"
  2450. " (kernel-loadable-modules (list wireguard-linux-compat)))\n"
  2451. msgstr ""
  2452. #. type: Plain text
  2453. #: guix-git/doc/guix-cookbook.texi:1892
  2454. msgid "After reconfiguring and restarting your system you can either use Wireguard tools or NetworkManager to connect to a VPN server."
  2455. msgstr ""
  2456. #. type: subsection
  2457. #: guix-git/doc/guix-cookbook.texi:1893
  2458. #, no-wrap
  2459. msgid "Using Wireguard tools"
  2460. msgstr ""
  2461. #. type: Plain text
  2462. #: guix-git/doc/guix-cookbook.texi:1899
  2463. msgid "To test your Wireguard setup it is convenient to use @command{wg-quick}. Just give it a configuration file @command{wg-quick up ./wg0.conf}; or put that file in @file{/etc/wireguard} and run @command{wg-quick up wg0} instead."
  2464. msgstr ""
  2465. #. type: quotation
  2466. #: guix-git/doc/guix-cookbook.texi:1900
  2467. #, no-wrap
  2468. msgid "Note"
  2469. msgstr ""
  2470. #. type: quotation
  2471. #: guix-git/doc/guix-cookbook.texi:1903
  2472. msgid "Be warned that the author described this command as a: “[…] very quick and dirty bash script […]”."
  2473. msgstr ""
  2474. #. type: subsection
  2475. #: guix-git/doc/guix-cookbook.texi:1905
  2476. #, no-wrap
  2477. msgid "Using NetworkManager"
  2478. msgstr ""
  2479. #. type: Plain text
  2480. #: guix-git/doc/guix-cookbook.texi:1913
  2481. msgid "Thanks to NetworkManager support for Wireguard we can connect to our VPN using @command{nmcli} command. Up to this point this guide assumes that you're using Network Manager service provided by @code{%desktop-services}. Ortherwise you need to adjust your services list to load @code{network-manager-service-type} and reconfigure your Guix system."
  2482. msgstr ""
  2483. #. type: Plain text
  2484. #: guix-git/doc/guix-cookbook.texi:1915
  2485. msgid "To import your VPN configuration execute nmcli import command:"
  2486. msgstr ""
  2487. #. type: example
  2488. #: guix-git/doc/guix-cookbook.texi:1919
  2489. #, no-wrap
  2490. msgid ""
  2491. "# nmcli connection import type wireguard file wg0.conf\n"
  2492. "Connection 'wg0' (edbee261-aa5a-42db-b032-6c7757c60fde) successfully added\n"
  2493. msgstr ""
  2494. #. type: Plain text
  2495. #: guix-git/doc/guix-cookbook.texi:1924
  2496. msgid "This will create a configuration file in @file{/etc/NetworkManager/wg0.nmconnection}. Next connect to the Wireguard server:"
  2497. msgstr ""
  2498. #. type: example
  2499. #: guix-git/doc/guix-cookbook.texi:1928
  2500. #, no-wrap
  2501. msgid ""
  2502. "$ nmcli connection up wg0\n"
  2503. "Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6)\n"
  2504. msgstr ""
  2505. #. type: Plain text
  2506. #: guix-git/doc/guix-cookbook.texi:1932
  2507. msgid "By default NetworkManager will connect automatically on system boot. To change that behaviour you need to edit your config:"
  2508. msgstr ""
  2509. #. type: example
  2510. #: guix-git/doc/guix-cookbook.texi:1935
  2511. #, no-wrap
  2512. msgid "# nmcli connection modify wg0 connection.autoconnect no\n"
  2513. msgstr ""
  2514. #. type: Plain text
  2515. #: guix-git/doc/guix-cookbook.texi:1940
  2516. msgid "For more specific information about NetworkManager and wireguard @uref{https://blogs.gnome.org/thaller/2019/03/15/wireguard-in-networkmanager/,see this post by thaller}."
  2517. msgstr ""
  2518. #. type: cindex
  2519. #: guix-git/doc/guix-cookbook.texi:1943
  2520. #, no-wrap
  2521. msgid "wm"
  2522. msgstr ""
  2523. #. type: subsection
  2524. #: guix-git/doc/guix-cookbook.texi:1945 guix-git/doc/guix-cookbook.texi:1946
  2525. #, no-wrap
  2526. msgid "StumpWM"
  2527. msgstr ""
  2528. #. type: cindex
  2529. #: guix-git/doc/guix-cookbook.texi:1947
  2530. #, no-wrap
  2531. msgid "stumpwm"
  2532. msgstr ""
  2533. #. type: Plain text
  2534. #: guix-git/doc/guix-cookbook.texi:1952
  2535. msgid "You could install StumpWM with a Guix system by adding @code{stumpwm} and optionally @code{`(,stumpwm \"lib\")} packages to a system configuration file, e.g.@: @file{/etc/config.scm}."
  2536. msgstr ""
  2537. #. type: Plain text
  2538. #: guix-git/doc/guix-cookbook.texi:1954
  2539. msgid "An example configuration can look like this:"
  2540. msgstr ""
  2541. #. type: lisp
  2542. #: guix-git/doc/guix-cookbook.texi:1958
  2543. #, no-wrap
  2544. msgid ""
  2545. "(use-modules (gnu))\n"
  2546. "(use-package-modules wm)\n"
  2547. "\n"
  2548. msgstr ""
  2549. #. type: lisp
  2550. #: guix-git/doc/guix-cookbook.texi:1963
  2551. #, no-wrap
  2552. msgid ""
  2553. "(operating-system\n"
  2554. " ;; …\n"
  2555. " (packages (append (list sbcl stumpwm `(,stumpwm \"lib\"))\n"
  2556. " %base-packages)))\n"
  2557. msgstr ""
  2558. #. type: cindex
  2559. #: guix-git/doc/guix-cookbook.texi:1965
  2560. #, no-wrap
  2561. msgid "stumpwm fonts"
  2562. msgstr ""
  2563. #. type: Plain text
  2564. #: guix-git/doc/guix-cookbook.texi:1969
  2565. msgid "By default StumpWM uses X11 fonts, which could be small or pixelated on your system. You could fix this by installing StumpWM contrib Lisp module @code{sbcl-ttf-fonts}, adding it to Guix system packages:"
  2566. msgstr ""
  2567. #. type: lisp
  2568. #: guix-git/doc/guix-cookbook.texi:1973
  2569. #, no-wrap
  2570. msgid ""
  2571. "(use-modules (gnu))\n"
  2572. "(use-package-modules fonts wm)\n"
  2573. "\n"
  2574. msgstr ""
  2575. #. type: lisp
  2576. #: guix-git/doc/guix-cookbook.texi:1978
  2577. #, no-wrap
  2578. msgid ""
  2579. "(operating-system\n"
  2580. " ;; …\n"
  2581. " (packages (append (list sbcl stumpwm `(,stumpwm \"lib\"))\n"
  2582. " sbcl-ttf-fonts font-dejavu %base-packages)))\n"
  2583. msgstr ""
  2584. #. type: Plain text
  2585. #: guix-git/doc/guix-cookbook.texi:1982
  2586. msgid "Then you need to add the following code to a StumpWM configuration file @file{~/.stumpwm.d/init.lisp}:"
  2587. msgstr ""
  2588. #. type: lisp
  2589. #: guix-git/doc/guix-cookbook.texi:1989
  2590. #, no-wrap
  2591. msgid ""
  2592. "(require :ttf-fonts)\n"
  2593. "(setf xft:*font-dirs* '(\"/run/current-system/profile/share/fonts/\"))\n"
  2594. "(setf clx-truetype:+font-cache-filename+ (concat (getenv \"HOME\") \"/.fonts/font-cache.sexp\"))\n"
  2595. "(xft:cache-fonts)\n"
  2596. "(set-font (make-instance 'xft:font :family \"DejaVu Sans Mono\" :subfamily \"Book\" :size 11))\n"
  2597. msgstr ""
  2598. #. type: subsection
  2599. #: guix-git/doc/guix-cookbook.texi:1991 guix-git/doc/guix-cookbook.texi:1992
  2600. #, no-wrap
  2601. msgid "Session lock"
  2602. msgstr ""
  2603. #. type: cindex
  2604. #: guix-git/doc/guix-cookbook.texi:1993
  2605. #, no-wrap
  2606. msgid "sessionlock"
  2607. msgstr ""
  2608. #. type: Plain text
  2609. #: guix-git/doc/guix-cookbook.texi:1999
  2610. msgid "Depending on your environment, locking the screen of your session might come built in or it might be something you have to set up yourself. If you use a desktop environment like GNOME or KDE, it's usually built in. If you use a plain window manager like StumpWM or EXWM, you might have to set it up yourself."
  2611. msgstr ""
  2612. #. type: subsubsection
  2613. #: guix-git/doc/guix-cookbook.texi:2000 guix-git/doc/guix-cookbook.texi:2001
  2614. #, no-wrap
  2615. msgid "Xorg"
  2616. msgstr ""
  2617. #. type: Plain text
  2618. #: guix-git/doc/guix-cookbook.texi:2007
  2619. msgid "If you use Xorg, you can use the utility @uref{https://www.mankier.com/1/xss-lock, xss-lock} to lock the screen of your session. xss-lock is triggered by DPMS which since Xorg 1.8 is auto-detected and enabled if ACPI is also enabled at kernel runtime."
  2620. msgstr ""
  2621. #. type: Plain text
  2622. #: guix-git/doc/guix-cookbook.texi:2010
  2623. msgid "To use xss-lock, you can simple execute it and put it into the background before you start your window manager from e.g. your @file{~/.xsession}:"
  2624. msgstr ""
  2625. #. type: example
  2626. #: guix-git/doc/guix-cookbook.texi:2014
  2627. #, no-wrap
  2628. msgid ""
  2629. "xss-lock -- slock &\n"
  2630. "exec stumpwm\n"
  2631. msgstr ""
  2632. #. type: Plain text
  2633. #: guix-git/doc/guix-cookbook.texi:2018
  2634. msgid "In this example, xss-lock uses @code{slock} to do the actual locking of the screen when it determines it's appropriate, like when you suspend your device."
  2635. msgstr ""
  2636. #. type: Plain text
  2637. #: guix-git/doc/guix-cookbook.texi:2022
  2638. msgid "For slock to be allowed to be a screen locker for the graphical session, it needs to be made setuid-root so it can authenticate users, and it needs a PAM service. This can be achieved by adding the following service to your @file{config.scm}:"
  2639. msgstr ""
  2640. #. type: lisp
  2641. #: guix-git/doc/guix-cookbook.texi:2025
  2642. #, no-wrap
  2643. msgid "(screen-locker-service slock)\n"
  2644. msgstr ""
  2645. #. type: Plain text
  2646. #: guix-git/doc/guix-cookbook.texi:2031
  2647. msgid "If you manually lock your screen, e.g. by directly calling slock when you want to lock your screen but not suspend it, it's a good idea to notify xss-lock about this so no confusion occurs. This can be done by executing @code{xset s activate} immediately before you execute slock."
  2648. msgstr ""
  2649. #. type: cindex
  2650. #: guix-git/doc/guix-cookbook.texi:2034
  2651. #, no-wrap
  2652. msgid "linode, Linode"
  2653. msgstr ""
  2654. #. type: Plain text
  2655. #: guix-git/doc/guix-cookbook.texi:2039
  2656. msgid "To run Guix on a server hosted by @uref{https://www.linode.com, Linode}, start with a recommended Debian server. We recommend using the default distro as a way to bootstrap Guix. Create your SSH keys."
  2657. msgstr ""
  2658. #. type: example
  2659. #: guix-git/doc/guix-cookbook.texi:2042
  2660. #, no-wrap
  2661. msgid "ssh-keygen\n"
  2662. msgstr ""
  2663. #. type: Plain text
  2664. #: guix-git/doc/guix-cookbook.texi:2048
  2665. msgid "Be sure to add your SSH key for easy login to the remote server. This is trivially done via Linode's graphical interface for adding SSH keys. Go to your profile and click add SSH Key. Copy into it the output of:"
  2666. msgstr ""
  2667. #. type: example
  2668. #: guix-git/doc/guix-cookbook.texi:2051
  2669. #, no-wrap
  2670. msgid "cat ~/.ssh/<username>_rsa.pub\n"
  2671. msgstr ""
  2672. #. type: Plain text
  2673. #: guix-git/doc/guix-cookbook.texi:2055
  2674. msgid "Power the Linode down. In the Linode's Disks/Configurations tab, resize the Debian disk to be smaller. 30 GB is recommended."
  2675. msgstr ""
  2676. #. type: Plain text
  2677. #: guix-git/doc/guix-cookbook.texi:2057
  2678. msgid "In the Linode settings, \"Add a disk\", with the following:"
  2679. msgstr ""
  2680. #. type: itemize
  2681. #: guix-git/doc/guix-cookbook.texi:2060
  2682. msgid "Label: \"Guix\""
  2683. msgstr ""
  2684. #. type: itemize
  2685. #: guix-git/doc/guix-cookbook.texi:2063
  2686. msgid "Filesystem: ext4"
  2687. msgstr ""
  2688. #. type: itemize
  2689. #: guix-git/doc/guix-cookbook.texi:2066
  2690. msgid "Set it to the remaining size"
  2691. msgstr ""
  2692. #. type: Plain text
  2693. #: guix-git/doc/guix-cookbook.texi:2071
  2694. msgid "On the \"configuration\" field that comes with the default image, press \"...\" and select \"Edit\", then on that menu add to @file{/dev/sdc} the \"Guix\" label."
  2695. msgstr ""
  2696. #. type: Plain text
  2697. #: guix-git/doc/guix-cookbook.texi:2073
  2698. msgid "Now \"Add a Configuration\", with the following:"
  2699. msgstr ""
  2700. #. type: itemize
  2701. #: guix-git/doc/guix-cookbook.texi:2076
  2702. msgid "Label: Guix"
  2703. msgstr ""
  2704. #. type: itemize
  2705. #: guix-git/doc/guix-cookbook.texi:2079
  2706. msgid "Kernel:GRUB 2 (it's at the bottom! This step is @b{IMPORTANT!})"
  2707. msgstr ""
  2708. #. type: itemize
  2709. #: guix-git/doc/guix-cookbook.texi:2082
  2710. msgid "Block device assignment:"
  2711. msgstr ""
  2712. #. type: itemize
  2713. #: guix-git/doc/guix-cookbook.texi:2085
  2714. msgid "@file{/dev/sda}: Guix"
  2715. msgstr ""
  2716. #. type: itemize
  2717. #: guix-git/doc/guix-cookbook.texi:2088
  2718. msgid "@file{/dev/sdb}: swap"
  2719. msgstr ""
  2720. #. type: itemize
  2721. #: guix-git/doc/guix-cookbook.texi:2091
  2722. msgid "Root device: @file{/dev/sda}"
  2723. msgstr ""
  2724. #. type: itemize
  2725. #: guix-git/doc/guix-cookbook.texi:2094
  2726. msgid "Turn off all the filesystem/boot helpers"
  2727. msgstr ""
  2728. #. type: Plain text
  2729. #: guix-git/doc/guix-cookbook.texi:2101
  2730. msgid "Now power it back up, picking the Debian configuration. Once it's booted up, ssh in your server via @code{ssh root@@@var{<your-server-IP-here>}}. (You can find your server IP address in your Linode Summary section.) Now you can run the \"install guix from @pxref{Binary Installation,,, guix, GNU Guix}\" steps:"
  2731. msgstr ""
  2732. #. type: example
  2733. #: guix-git/doc/guix-cookbook.texi:2109
  2734. #, no-wrap
  2735. msgid ""
  2736. "sudo apt-get install gpg\n"
  2737. "wget https://sv.gnu.org/people/viewgpg.php?user_id=15145 -qO - | gpg --import -\n"
  2738. "wget https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh\n"
  2739. "chmod +x guix-install.sh\n"
  2740. "./guix-install.sh\n"
  2741. "guix pull\n"
  2742. msgstr ""
  2743. #. type: Plain text
  2744. #: guix-git/doc/guix-cookbook.texi:2113
  2745. msgid "Now it's time to write out a config for the server. The key information is below. Save the resulting file as @file{guix-config.scm}."
  2746. msgstr ""
  2747. #. type: lisp
  2748. #: guix-git/doc/guix-cookbook.texi:2124
  2749. #, no-wrap
  2750. msgid ""
  2751. "(use-modules (gnu)\n"
  2752. " (guix modules))\n"
  2753. "(use-service-modules networking\n"
  2754. " ssh)\n"
  2755. "(use-package-modules admin\n"
  2756. " certs\n"
  2757. " package-management\n"
  2758. " ssh\n"
  2759. " tls)\n"
  2760. "\n"
  2761. msgstr ""
  2762. #. type: lisp
  2763. #: guix-git/doc/guix-cookbook.texi:2141
  2764. #, no-wrap
  2765. msgid ""
  2766. "(operating-system\n"
  2767. " (host-name \"my-server\")\n"
  2768. " (timezone \"America/New_York\")\n"
  2769. " (locale \"en_US.UTF-8\")\n"
  2770. " ;; This goofy code will generate the grub.cfg\n"
  2771. " ;; without installing the grub bootloader on disk.\n"
  2772. " (bootloader (bootloader-configuration\n"
  2773. " (bootloader\n"
  2774. " (bootloader\n"
  2775. " (inherit grub-bootloader)\n"
  2776. " (installer #~(const #true))))))\n"
  2777. " (file-systems (cons (file-system\n"
  2778. " (device \"/dev/sda\")\n"
  2779. " (mount-point \"/\")\n"
  2780. " (type \"ext4\"))\n"
  2781. " %base-file-systems))\n"
  2782. "\n"
  2783. msgstr ""
  2784. #. type: lisp
  2785. #: guix-git/doc/guix-cookbook.texi:2144
  2786. #, no-wrap
  2787. msgid ""
  2788. " (swap-devices (list \"/dev/sdb\"))\n"
  2789. "\n"
  2790. msgstr ""
  2791. #. type: lisp
  2792. #: guix-git/doc/guix-cookbook.texi:2148
  2793. #, no-wrap
  2794. msgid ""
  2795. " (initrd-modules (cons \"virtio_scsi\" ; Needed to find the disk\n"
  2796. " %base-initrd-modules))\n"
  2797. "\n"
  2798. msgstr ""
  2799. #. type: lisp
  2800. #: guix-git/doc/guix-cookbook.texi:2157
  2801. #, no-wrap
  2802. msgid ""
  2803. " (users (cons (user-account\n"
  2804. " (name \"janedoe\")\n"
  2805. " (group \"users\")\n"
  2806. " ;; Adding the account to the \"wheel\" group\n"
  2807. " ;; makes it a sudoer.\n"
  2808. " (supplementary-groups '(\"wheel\"))\n"
  2809. " (home-directory \"/home/janedoe\"))\n"
  2810. " %base-user-accounts))\n"
  2811. "\n"
  2812. msgstr ""
  2813. #. type: lisp
  2814. #: guix-git/doc/guix-cookbook.texi:2161
  2815. #, no-wrap
  2816. msgid ""
  2817. " (packages (cons* nss-certs ;for HTTPS access\n"
  2818. " openssh-sans-x\n"
  2819. " %base-packages))\n"
  2820. "\n"
  2821. msgstr ""
  2822. #. type: lisp
  2823. #: guix-git/doc/guix-cookbook.texi:2172
  2824. #, no-wrap
  2825. msgid ""
  2826. " (services (cons*\n"
  2827. " (service dhcp-client-service-type)\n"
  2828. " (service openssh-service-type\n"
  2829. " (openssh-configuration\n"
  2830. " (openssh openssh-sans-x)\n"
  2831. " (password-authentication? #false)\n"
  2832. " (authorized-keys\n"
  2833. " `((\"janedoe\" ,(local-file \"janedoe_rsa.pub\"))\n"
  2834. " (\"root\" ,(local-file \"janedoe_rsa.pub\"))))))\n"
  2835. " %base-services)))\n"
  2836. msgstr ""
  2837. #. type: Plain text
  2838. #: guix-git/doc/guix-cookbook.texi:2175
  2839. msgid "Replace the following fields in the above configuration:"
  2840. msgstr ""
  2841. #. type: lisp
  2842. #: guix-git/doc/guix-cookbook.texi:2183
  2843. #, no-wrap
  2844. msgid ""
  2845. "(host-name \"my-server\") ; replace with your server name\n"
  2846. "; if you chose a linode server outside the U.S., then\n"
  2847. "; use tzselect to find a correct timezone string\n"
  2848. "(timezone \"America/New_York\") ; if needed replace timezone\n"
  2849. "(name \"janedoe\") ; replace with your username\n"
  2850. "(\"janedoe\" ,(local-file \"janedoe_rsa.pub\")) ; replace with your ssh key\n"
  2851. "(\"root\" ,(local-file \"janedoe_rsa.pub\")) ; replace with your ssh key\n"
  2852. msgstr ""
  2853. #. type: Plain text
  2854. #: guix-git/doc/guix-cookbook.texi:2189
  2855. msgid "The last line in the above example lets you log into the server as root and set the initial root password. After you have done this, you may delete that line from your configuration and reconfigure to prevent root login."
  2856. msgstr ""
  2857. #. type: Plain text
  2858. #: guix-git/doc/guix-cookbook.texi:2194
  2859. msgid "Save your ssh public key (eg: @file{~/.ssh/id_rsa.pub}) as @file{@var{<your-username-here>}_rsa.pub} and your @file{guix-config.scm} in the same directory. In a new terminal run these commands."
  2860. msgstr ""
  2861. #. type: example
  2862. #: guix-git/doc/guix-cookbook.texi:2199
  2863. #, no-wrap
  2864. msgid ""
  2865. "sftp root@@<remote server ip address>\n"
  2866. "put /home/<username>/ssh/id_rsa.pub .\n"
  2867. "put /path/to/linode/guix-config.scm .\n"
  2868. msgstr ""
  2869. #. type: Plain text
  2870. #: guix-git/doc/guix-cookbook.texi:2202
  2871. msgid "In your first terminal, mount the guix drive:"
  2872. msgstr ""
  2873. #. type: example
  2874. #: guix-git/doc/guix-cookbook.texi:2206
  2875. #, no-wrap
  2876. msgid ""
  2877. "mkdir /mnt/guix\n"
  2878. "mount /dev/sdc /mnt/guix\n"
  2879. msgstr ""
  2880. #. type: Plain text
  2881. #: guix-git/doc/guix-cookbook.texi:2211
  2882. msgid "Due to the way we set things up above, we do not install GRUB completely. Instead we install only our grub configuration file. So we need to copy over some of the other GRUB stuff that is already there:"
  2883. msgstr ""
  2884. #. type: example
  2885. #: guix-git/doc/guix-cookbook.texi:2215
  2886. #, no-wrap
  2887. msgid ""
  2888. "mkdir -p /mnt/guix/boot/grub\n"
  2889. "cp -r /boot/grub/* /mnt/guix/boot/grub/\n"
  2890. msgstr ""
  2891. #. type: Plain text
  2892. #: guix-git/doc/guix-cookbook.texi:2218
  2893. msgid "Now initialize the Guix installation:"
  2894. msgstr ""
  2895. #. type: example
  2896. #: guix-git/doc/guix-cookbook.texi:2221
  2897. #, no-wrap
  2898. msgid "guix system init guix-config.scm /mnt/guix\n"
  2899. msgstr ""
  2900. #. type: Plain text
  2901. #: guix-git/doc/guix-cookbook.texi:2225
  2902. msgid "Ok, power it down! Now from the Linode console, select boot and select \"Guix\"."
  2903. msgstr ""
  2904. #. type: Plain text
  2905. #: guix-git/doc/guix-cookbook.texi:2228
  2906. msgid "Once it boots, you should be able to log in via SSH! (The server config will have changed though.) You may encounter an error like:"
  2907. msgstr ""
  2908. #. type: example
  2909. #: guix-git/doc/guix-cookbook.texi:2244
  2910. #, no-wrap
  2911. msgid ""
  2912. "$ ssh root@@<server ip address>\n"
  2913. "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
  2914. "@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n"
  2915. "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
  2916. "IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"
  2917. "Someone could be eavesdropping on you right now (man-in-the-middle attack)!\n"
  2918. "It is also possible that a host key has just been changed.\n"
  2919. "The fingerprint for the ECDSA key sent by the remote host is\n"
  2920. "SHA256:0B+wp33w57AnKQuHCvQP0+ZdKaqYrI/kyU7CfVbS7R4.\n"
  2921. "Please contact your system administrator.\n"
  2922. "Add correct host key in /home/joshua/.ssh/known_hosts to get rid of this message.\n"
  2923. "Offending ECDSA key in /home/joshua/.ssh/known_hosts:3\n"
  2924. "ECDSA host key for 198.58.98.76 has changed and you have requested strict checking.\n"
  2925. "Host key verification failed.\n"
  2926. msgstr ""
  2927. #. type: Plain text
  2928. #: guix-git/doc/guix-cookbook.texi:2248
  2929. msgid "Either delete @file{~/.ssh/known_hosts} file, or delete the offending line starting with your server IP address."
  2930. msgstr ""
  2931. #. type: Plain text
  2932. #: guix-git/doc/guix-cookbook.texi:2250
  2933. msgid "Be sure to set your password and root's password."
  2934. msgstr ""
  2935. #. type: example
  2936. #: guix-git/doc/guix-cookbook.texi:2255
  2937. #, no-wrap
  2938. msgid ""
  2939. "ssh root@@<remote ip address>\n"
  2940. "passwd ; for the root password\n"
  2941. "passwd <username> ; for the user password\n"
  2942. msgstr ""
  2943. #. type: Plain text
  2944. #: guix-git/doc/guix-cookbook.texi:2262
  2945. msgid "You may not be able to run the above commands at this point. If you have issues remotely logging into your linode box via SSH, then you may still need to set your root and user password initially by clicking on the ``Launch Console'' option in your linode. Choose the ``Glish'' instead of ``Weblish''. Now you should be able to ssh into the machine."
  2946. msgstr ""
  2947. #. type: Plain text
  2948. #: guix-git/doc/guix-cookbook.texi:2266
  2949. msgid "Horray! At this point you can shut down the server, delete the Debian disk, and resize the Guix to the rest of the size. Congratulations!"
  2950. msgstr ""
  2951. #. type: Plain text
  2952. #: guix-git/doc/guix-cookbook.texi:2271
  2953. msgid "By the way, if you save it as a disk image right at this point, you'll have an easy time spinning up new Guix images! You may need to down-size the Guix image to 6144MB, to save it as an image. Then you can resize it again to the max size."
  2954. msgstr ""
  2955. #. type: Plain text
  2956. #: guix-git/doc/guix-cookbook.texi:2280
  2957. msgid "To bind mount a file system, one must first set up some definitions before the @code{operating-system} section of the system definition. In this example we will bind mount a folder from a spinning disk drive to @file{/tmp}, to save wear and tear on the primary SSD, without dedicating an entire partition to be mounted as @file{/tmp}."
  2958. msgstr ""
  2959. #. type: Plain text
  2960. #: guix-git/doc/guix-cookbook.texi:2283
  2961. msgid "First, the source drive that hosts the folder we wish to bind mount should be defined, so that the bind mount can depend on it."
  2962. msgstr ""
  2963. #. type: lisp
  2964. #: guix-git/doc/guix-cookbook.texi:2290
  2965. #, no-wrap
  2966. msgid ""
  2967. "(define source-drive ;; \"source-drive\" can be named anything you want.\n"
  2968. " (file-system\n"
  2969. " (device (uuid \"UUID goes here\"))\n"
  2970. " (mount-point \"/path-to-spinning-disk-goes-here\")\n"
  2971. " (type \"ext4\"))) ;; Make sure to set this to the appropriate type for your drive.\n"
  2972. msgstr ""
  2973. #. type: Plain text
  2974. #: guix-git/doc/guix-cookbook.texi:2294
  2975. msgid "The source folder must also be defined, so that guix will know it's not a regular block device, but a folder."
  2976. msgstr ""
  2977. #. type: lisp
  2978. #: guix-git/doc/guix-cookbook.texi:2296
  2979. #, no-wrap
  2980. msgid "(define (%source-directory) \"/path-to-spinning-disk-goes-here/tmp\") ;; \"source-directory\" can be named any valid variable name.\n"
  2981. msgstr ""
  2982. #. type: Plain text
  2983. #: guix-git/doc/guix-cookbook.texi:2300
  2984. msgid "Finally, inside the @code{file-systems} definition, we must add the mount itself."
  2985. msgstr ""
  2986. #. type: lisp
  2987. #: guix-git/doc/guix-cookbook.texi:2303
  2988. #, no-wrap
  2989. msgid ""
  2990. "(file-systems (cons*\n"
  2991. "\n"
  2992. msgstr ""
  2993. #. type: lisp
  2994. #: guix-git/doc/guix-cookbook.texi:2305
  2995. #, no-wrap
  2996. msgid ""
  2997. " ...<other drives omitted for clarity>...\n"
  2998. "\n"
  2999. msgstr ""
  3000. #. type: lisp
  3001. #: guix-git/doc/guix-cookbook.texi:2307
  3002. #, no-wrap
  3003. msgid ""
  3004. " source-drive ;; Must match the name you gave the source drive in the earlier definition.\n"
  3005. "\n"
  3006. msgstr ""
  3007. #. type: lisp
  3008. #: guix-git/doc/guix-cookbook.texi:2315
  3009. #, no-wrap
  3010. msgid ""
  3011. " (file-system\n"
  3012. " (device (%source-directory)) ;; Make sure \"source-directory\" matches your earlier definition.\n"
  3013. " (mount-point \"/tmp\")\n"
  3014. " (type \"none\") ;; We are mounting a folder, not a partition, so this type needs to be \"none\"\n"
  3015. " (flags '(bind-mount))\n"
  3016. " (dependencies (list source-drive)) ;; Ensure \"source-drive\" matches what you've named the variable for the drive.\n"
  3017. " )\n"
  3018. "\n"
  3019. msgstr ""
  3020. #. type: lisp
  3021. #: guix-git/doc/guix-cookbook.texi:2317
  3022. #, no-wrap
  3023. msgid ""
  3024. " ...<other drives omitted for clarity>...\n"
  3025. "\n"
  3026. msgstr ""
  3027. #. type: lisp
  3028. #: guix-git/doc/guix-cookbook.texi:2319
  3029. #, no-wrap
  3030. msgid " ))\n"
  3031. msgstr ""
  3032. #. type: Plain text
  3033. #: guix-git/doc/guix-cookbook.texi:2326
  3034. msgid "Guix daemon can use a HTTP proxy to get substitutes, here we are configuring it to get them via Tor."
  3035. msgstr ""
  3036. #. type: quotation
  3037. #: guix-git/doc/guix-cookbook.texi:2327
  3038. #, no-wrap
  3039. msgid "Warning"
  3040. msgstr ""
  3041. #. type: quotation
  3042. #: guix-git/doc/guix-cookbook.texi:2333
  3043. msgid "@emph{Not all} Guix daemon's traffic will go through Tor! Only HTTP/HTTPS will get proxied; FTP, Git protocol, SSH, etc connections will still go through the clearnet. Again, this configuration isn't foolproof some of your traffic won't get routed by Tor at all. Use it at your own risk."
  3044. msgstr ""
  3045. #. type: quotation
  3046. #: guix-git/doc/guix-cookbook.texi:2339
  3047. msgid "Also note that the procedure described here applies only to package substitution. When you update your guix distribution with @command{guix pull}, you still need to use @command{torsocks} if you want to route the connection to guix's git repository servers through Tor."
  3048. msgstr ""
  3049. #. type: Plain text
  3050. #: guix-git/doc/guix-cookbook.texi:2344
  3051. msgid "Guix's substitute server is available as a Onion service, if you want to use it to get your substitutes through Tor configure your system as follow:"
  3052. msgstr ""
  3053. #. type: lisp
  3054. #: guix-git/doc/guix-cookbook.texi:2348
  3055. #, no-wrap
  3056. msgid ""
  3057. "(use-modules (gnu))\n"
  3058. "(use-service-module base networking)\n"
  3059. "\n"
  3060. msgstr ""
  3061. #. type: lisp
  3062. #: guix-git/doc/guix-cookbook.texi:2364
  3063. #, no-wrap
  3064. msgid ""
  3065. "(operating-system\n"
  3066. " …\n"
  3067. " (services\n"
  3068. " (cons\n"
  3069. " (service tor-service-type\n"
  3070. " (tor-configuration\n"
  3071. " (config-file (plain-file \"tor-config\"\n"
  3072. " \"HTTPTunnelPort 127.0.0.1:9250\"))))\n"
  3073. " (modify-services %base-services\n"
  3074. " (guix-service-type\n"
  3075. " config => (guix-configuration\n"
  3076. " (inherit config)\n"
  3077. " ;; ci.guix.gnu.org's Onion service\n"
  3078. " (substitute-urls \"https://bp7o7ckwlewr4slm.onion\")\n"
  3079. " (http-proxy \"http://localhost:9250\")))))))\n"
  3080. msgstr ""
  3081. #. type: Plain text
  3082. #: guix-git/doc/guix-cookbook.texi:2373
  3083. msgid "This will keep a tor process running that provides a HTTP CONNECT tunnel which will be used by @command{guix-daemon}. The daemon can use other protocols than HTTP(S) to get remote resources, request using those protocols won't go through Tor since we are only setting a HTTP tunnel here. Note that @code{substitutes-urls} is using HTTPS and not HTTP or it won't work, that's a limitation of Tor's tunnel; you may want to use @command{privoxy} instead to avoid such limitations."
  3084. msgstr ""
  3085. #. type: Plain text
  3086. #: guix-git/doc/guix-cookbook.texi:2377
  3087. msgid "If you don't want to always get substitutes through Tor but using it just some of the times, then skip the @code{guix-configuration}. When you want to get a substitute from the Tor tunnel run:"
  3088. msgstr ""
  3089. #. type: example
  3090. #: guix-git/doc/guix-cookbook.texi:2381
  3091. #, no-wrap
  3092. msgid ""
  3093. "sudo herd set-http-proxy guix-daemon http://localhost:9250\n"
  3094. "guix build --substitute-urls=https://bp7o7ckwlewr4slm.onion …\n"
  3095. msgstr ""
  3096. #. type: cindex
  3097. #: guix-git/doc/guix-cookbook.texi:2385
  3098. #, no-wrap
  3099. msgid "nginx, lua, openresty, resty"
  3100. msgstr ""
  3101. #. type: Plain text
  3102. #: guix-git/doc/guix-cookbook.texi:2388
  3103. msgid "NGINX could be extended with Lua scripts."
  3104. msgstr ""
  3105. #. type: Plain text
  3106. #: guix-git/doc/guix-cookbook.texi:2391
  3107. msgid "Guix provides NGINX service with ability to load Lua module and specific Lua packages, and reply to requests by evaluating Lua scripts."
  3108. msgstr ""
  3109. #. type: Plain text
  3110. #: guix-git/doc/guix-cookbook.texi:2395
  3111. msgid "The following example demonstrates system definition with configuration to evaluate @file{index.lua} Lua script on HTTP request to @uref{http://localhost/hello} endpoint:"
  3112. msgstr ""
  3113. #. type: example
  3114. #: guix-git/doc/guix-cookbook.texi:2398
  3115. #, no-wrap
  3116. msgid ""
  3117. "local shell = require \"resty.shell\"\n"
  3118. "\n"
  3119. msgstr ""
  3120. #. type: example
  3121. #: guix-git/doc/guix-cookbook.texi:2402
  3122. #, no-wrap
  3123. msgid ""
  3124. "local stdin = \"\"\n"
  3125. "local timeout = 1000 -- ms\n"
  3126. "local max_size = 4096 -- byte\n"
  3127. "\n"
  3128. msgstr ""
  3129. #. type: example
  3130. #: guix-git/doc/guix-cookbook.texi:2405
  3131. #, no-wrap
  3132. msgid ""
  3133. "local ok, stdout, stderr, reason, status =\n"
  3134. " shell.run([[/run/current-system/profile/bin/ls /tmp]], stdin, timeout, max_size)\n"
  3135. "\n"
  3136. msgstr ""
  3137. #. type: example
  3138. #: guix-git/doc/guix-cookbook.texi:2407
  3139. #, no-wrap
  3140. msgid "ngx.say(stdout)\n"
  3141. msgstr ""
  3142. #. type: lisp
  3143. #: guix-git/doc/guix-cookbook.texi:2438
  3144. #, no-wrap
  3145. msgid ""
  3146. "(use-modules (gnu))\n"
  3147. "(use-service-modules #;… web)\n"
  3148. "(use-package-modules #;… lua)\n"
  3149. "(operating-system\n"
  3150. " ;; …\n"
  3151. " (services\n"
  3152. " ;; …\n"
  3153. " (service nginx-service-type\n"
  3154. " (nginx-configuration\n"
  3155. " (modules\n"
  3156. " (list\n"
  3157. " (file-append nginx-lua-module \"/etc/nginx/modules/ngx_http_lua_module.so\")))\n"
  3158. " (lua-package-path (list lua-resty-core\n"
  3159. " lua-resty-lrucache\n"
  3160. " lua-resty-signal\n"
  3161. " lua-tablepool\n"
  3162. " lua-resty-shell))\n"
  3163. " (lua-package-cpath (list lua-resty-signal))\n"
  3164. " (server-blocks\n"
  3165. " (list (nginx-server-configuration\n"
  3166. " (server-name '(\"localhost\"))\n"
  3167. " (listen '(\"80\"))\n"
  3168. " (root \"/etc\")\n"
  3169. " (locations (list\n"
  3170. " (nginx-location-configuration\n"
  3171. " (uri \"/hello\")\n"
  3172. " (body (list #~(format #f \"content_by_lua_file ~s;\"\n"
  3173. " #$(local-file \"index.lua\"))))))))))))))\n"
  3174. msgstr ""
  3175. #. type: Plain text
  3176. #: guix-git/doc/guix-cookbook.texi:2449
  3177. msgid "Guix is a functional package manager that offers many features beyond what more traditional package managers can do. To the uninitiated, those features might not have obvious use cases at first. The purpose of this chapter is to demonstrate some advanced package management concepts."
  3178. msgstr ""
  3179. #. type: Plain text
  3180. #: guix-git/doc/guix-cookbook.texi:2452
  3181. msgid "@pxref{Package Management,,, guix, GNU Guix Reference Manual} for a complete reference."
  3182. msgstr ""
  3183. #. type: section
  3184. #: guix-git/doc/guix-cookbook.texi:2455 guix-git/doc/guix-cookbook.texi:2457
  3185. #: guix-git/doc/guix-cookbook.texi:2458
  3186. #, no-wrap
  3187. msgid "Guix Profiles in Practice"
  3188. msgstr ""
  3189. #. type: menuentry
  3190. #: guix-git/doc/guix-cookbook.texi:2455
  3191. msgid "Strategies for multiple profiles and manifests."
  3192. msgstr ""
  3193. #. type: Plain text
  3194. #: guix-git/doc/guix-cookbook.texi:2463
  3195. msgid "Guix provides a very useful feature that may be quite foreign to newcomers: @emph{profiles}. They are a way to group package installations together and all users on the same system are free to use as many profiles as they want."
  3196. msgstr ""
  3197. #. type: Plain text
  3198. #: guix-git/doc/guix-cookbook.texi:2468
  3199. msgid "Whether you're a developer or not, you may find that multiple profiles bring you great power and flexibility. While they shift the paradigm somewhat compared to @emph{traditional package managers}, they are very convenient to use once you've understood how to set them up."
  3200. msgstr ""
  3201. #. type: Plain text
  3202. #: guix-git/doc/guix-cookbook.texi:2474
  3203. msgid "If you are familiar with Python's @samp{virtualenv}, you can think of a profile as a kind of universal @samp{virtualenv} that can hold any kind of software whatsoever, not just Python software. Furthermore, profiles are self-sufficient: they capture all the runtime dependencies which guarantees that all programs within a profile will always work at any point in time."
  3204. msgstr ""
  3205. #. type: Plain text
  3206. #: guix-git/doc/guix-cookbook.texi:2476
  3207. msgid "Multiple profiles have many benefits:"
  3208. msgstr ""
  3209. #. type: itemize
  3210. #: guix-git/doc/guix-cookbook.texi:2480
  3211. msgid "Clean semantic separation of the various packages a user needs for different contexts."
  3212. msgstr ""
  3213. #. type: itemize
  3214. #: guix-git/doc/guix-cookbook.texi:2484
  3215. msgid "Multiple profiles can be made available into the environment either on login or within a dedicated shell."
  3216. msgstr ""
  3217. #. type: itemize
  3218. #: guix-git/doc/guix-cookbook.texi:2488
  3219. msgid "Profiles can be loaded on demand. For instance, the user can use multiple shells, each of them running different profiles."
  3220. msgstr ""
  3221. #. type: itemize
  3222. #: guix-git/doc/guix-cookbook.texi:2493
  3223. msgid "Isolation: Programs from one profile will not use programs from the other, and the user can even install different versions of the same programs to the two profiles without conflict."
  3224. msgstr ""
  3225. #. type: itemize
  3226. #: guix-git/doc/guix-cookbook.texi:2497
  3227. msgid "Deduplication: Profiles share dependencies that happens to be the exact same. This makes multiple profiles storage-efficient."
  3228. msgstr ""
  3229. #. type: itemize
  3230. #: guix-git/doc/guix-cookbook.texi:2505
  3231. msgid "Reproducible: when used with declarative manifests, a profile can be fully specified by the Guix commit that was active when it was set up. This means that the exact same profile can be @uref{https://guix.gnu.org/blog/2018/multi-dimensional-transactions-and-rollbacks-oh-my/, set up anywhere and anytime}, with just the commit information. See the section on @ref{Reproducible profiles}."
  3232. msgstr ""
  3233. #. type: itemize
  3234. #: guix-git/doc/guix-cookbook.texi:2509
  3235. msgid "Easier upgrades and maintenance: Multiple profiles make it easy to keep package listings at hand and make upgrades completely frictionless."
  3236. msgstr ""
  3237. #. type: Plain text
  3238. #: guix-git/doc/guix-cookbook.texi:2512
  3239. msgid "Concretely, here follows some typical profiles:"
  3240. msgstr ""
  3241. #. type: itemize
  3242. #: guix-git/doc/guix-cookbook.texi:2516
  3243. msgid "The dependencies of a project you are working on."
  3244. msgstr ""
  3245. #. type: itemize
  3246. #: guix-git/doc/guix-cookbook.texi:2519
  3247. msgid "Your favourite programming language libraries."
  3248. msgstr ""
  3249. #. type: itemize
  3250. #: guix-git/doc/guix-cookbook.texi:2522
  3251. msgid "Laptop-specific programs (like @samp{powertop}) that you don't need on a desktop."
  3252. msgstr ""
  3253. #. type: itemize
  3254. #: guix-git/doc/guix-cookbook.texi:2526
  3255. msgid "@TeX{}live (this one can be really useful when you need to install just one package for this one document you've just received over email)."
  3256. msgstr ""
  3257. #. type: itemize
  3258. #: guix-git/doc/guix-cookbook.texi:2529
  3259. msgid "Games."
  3260. msgstr ""
  3261. #. type: Plain text
  3262. #: guix-git/doc/guix-cookbook.texi:2532
  3263. msgid "Let's dive in the set up!"
  3264. msgstr ""
  3265. #. type: subsection
  3266. #: guix-git/doc/guix-cookbook.texi:2533 guix-git/doc/guix-cookbook.texi:2534
  3267. #, no-wrap
  3268. msgid "Basic setup with manifests"
  3269. msgstr ""
  3270. #. type: Plain text
  3271. #: guix-git/doc/guix-cookbook.texi:2538
  3272. msgid "A Guix profile can be set up @emph{via} a so-called @emph{manifest specification} that looks like this:"
  3273. msgstr ""
  3274. #. type: lisp
  3275. #: guix-git/doc/guix-cookbook.texi:2548
  3276. #, no-wrap
  3277. msgid ""
  3278. "(specifications->manifest\n"
  3279. " '(\"package-1\"\n"
  3280. " ;; Version 1.3 of package-2.\n"
  3281. " \"package-2@@1.3\"\n"
  3282. " ;; The \"lib\" output of package-3.\n"
  3283. " \"package-3:lib\"\n"
  3284. " ; ...\n"
  3285. " \"package-N\"))\n"
  3286. msgstr ""
  3287. #. type: Plain text
  3288. #: guix-git/doc/guix-cookbook.texi:2552
  3289. msgid "@pxref{Invoking guix package,,, guix, GNU Guix Reference Manual}, for the syntax details."
  3290. msgstr ""
  3291. #. type: Plain text
  3292. #: guix-git/doc/guix-cookbook.texi:2554
  3293. msgid "We can create a manifest specification per profile and install them this way:"
  3294. msgstr ""
  3295. #. type: example
  3296. #: guix-git/doc/guix-cookbook.texi:2559
  3297. #, no-wrap
  3298. msgid ""
  3299. "GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles\n"
  3300. "mkdir -p \"$GUIX_EXTRA_PROFILES\"/my-project # if it does not exist yet\n"
  3301. "guix package --manifest=/path/to/guix-my-project-manifest.scm --profile=\"$GUIX_EXTRA_PROFILES\"/my-project/my-project\n"
  3302. msgstr ""
  3303. #. type: Plain text
  3304. #: guix-git/doc/guix-cookbook.texi:2563
  3305. msgid "Here we set an arbitrary variable @samp{GUIX_EXTRA_PROFILES} to point to the directory where we will store our profiles in the rest of this article."
  3306. msgstr ""
  3307. #. type: Plain text
  3308. #: guix-git/doc/guix-cookbook.texi:2569
  3309. msgid "Placing all your profiles in a single directory, with each profile getting its own sub-directory, is somewhat cleaner. This way, each sub-directory will contain all the symlinks for precisely one profile. Besides, ``looping over profiles'' becomes obvious from any programming language (e.g.@: a shell script) by simply looping over the sub-directories of @samp{$GUIX_EXTRA_PROFILES}."
  3310. msgstr ""
  3311. #. type: Plain text
  3312. #: guix-git/doc/guix-cookbook.texi:2571
  3313. msgid "Note that it's also possible to loop over the output of"
  3314. msgstr ""
  3315. #. type: example
  3316. #: guix-git/doc/guix-cookbook.texi:2574
  3317. #, no-wrap
  3318. msgid "guix package --list-profiles\n"
  3319. msgstr ""
  3320. #. type: Plain text
  3321. #: guix-git/doc/guix-cookbook.texi:2577
  3322. msgid "although you'll probably have to filter out @file{~/.config/guix/current}."
  3323. msgstr ""
  3324. #. type: Plain text
  3325. #: guix-git/doc/guix-cookbook.texi:2579
  3326. msgid "To enable all profiles on login, add this to your @file{~/.bash_profile} (or similar):"
  3327. msgstr ""
  3328. #. type: example
  3329. #: guix-git/doc/guix-cookbook.texi:2589
  3330. #, no-wrap
  3331. msgid ""
  3332. "for i in $GUIX_EXTRA_PROFILES/*; do\n"
  3333. " profile=$i/$(basename \"$i\")\n"
  3334. " if [ -f \"$profile\"/etc/profile ]; then\n"
  3335. " GUIX_PROFILE=\"$profile\"\n"
  3336. " . \"$GUIX_PROFILE\"/etc/profile\n"
  3337. " fi\n"
  3338. " unset profile\n"
  3339. "done\n"
  3340. msgstr ""
  3341. #. type: Plain text
  3342. #: guix-git/doc/guix-cookbook.texi:2594
  3343. msgid "Note to Guix System users: the above reflects how your default profile @file{~/.guix-profile} is activated from @file{/etc/profile}, that latter being loaded by @file{~/.bashrc} by default."
  3344. msgstr ""
  3345. #. type: Plain text
  3346. #: guix-git/doc/guix-cookbook.texi:2596
  3347. msgid "You can obviously choose to only enable a subset of them:"
  3348. msgstr ""
  3349. #. type: example
  3350. #: guix-git/doc/guix-cookbook.texi:2606
  3351. #, no-wrap
  3352. msgid ""
  3353. "for i in \"$GUIX_EXTRA_PROFILES\"/my-project-1 \"$GUIX_EXTRA_PROFILES\"/my-project-2; do\n"
  3354. " profile=$i/$(basename \"$i\")\n"
  3355. " if [ -f \"$profile\"/etc/profile ]; then\n"
  3356. " GUIX_PROFILE=\"$profile\"\n"
  3357. " . \"$GUIX_PROFILE\"/etc/profile\n"
  3358. " fi\n"
  3359. " unset profile\n"
  3360. "done\n"
  3361. msgstr ""
  3362. #. type: Plain text
  3363. #: guix-git/doc/guix-cookbook.texi:2610
  3364. msgid "When a profile is off, it's straightforward to enable it for an individual shell without \"polluting\" the rest of the user session:"
  3365. msgstr ""
  3366. #. type: example
  3367. #: guix-git/doc/guix-cookbook.texi:2613
  3368. #, no-wrap
  3369. msgid "GUIX_PROFILE=\"path/to/my-project\" ; . \"$GUIX_PROFILE\"/etc/profile\n"
  3370. msgstr ""
  3371. #. type: Plain text
  3372. #: guix-git/doc/guix-cookbook.texi:2620
  3373. msgid "The key to enabling a profile is to @emph{source} its @samp{etc/profile} file. This file contains shell code that exports the right environment variables necessary to activate the software contained in the profile. It is built automatically by Guix and meant to be sourced. It contains the same variables you would get if you ran:"
  3374. msgstr ""
  3375. #. type: example
  3376. #: guix-git/doc/guix-cookbook.texi:2623
  3377. #, no-wrap
  3378. msgid "guix package --search-paths=prefix --profile=$my_profile\"\n"
  3379. msgstr ""
  3380. #. type: Plain text
  3381. #: guix-git/doc/guix-cookbook.texi:2627
  3382. msgid "Once again, see (@pxref{Invoking guix package,,, guix, GNU Guix Reference Manual}) for the command line options."
  3383. msgstr ""
  3384. #. type: Plain text
  3385. #: guix-git/doc/guix-cookbook.texi:2629
  3386. msgid "To upgrade a profile, simply install the manifest again:"
  3387. msgstr ""
  3388. #. type: example
  3389. #: guix-git/doc/guix-cookbook.texi:2632
  3390. #, no-wrap
  3391. msgid "guix package -m /path/to/guix-my-project-manifest.scm -p \"$GUIX_EXTRA_PROFILES\"/my-project/my-project\n"
  3392. msgstr ""
  3393. #. type: Plain text
  3394. #: guix-git/doc/guix-cookbook.texi:2638
  3395. msgid "To upgrade all profiles, it's easy enough to loop over them. For instance, assuming your manifest specifications are stored in @file{~/.guix-manifests/guix-$profile-manifest.scm}, with @samp{$profile} being the name of the profile (e.g.@: \"project1\"), you could do the following in Bourne shell:"
  3396. msgstr ""
  3397. #. type: example
  3398. #: guix-git/doc/guix-cookbook.texi:2643
  3399. #, no-wrap
  3400. msgid ""
  3401. "for profile in \"$GUIX_EXTRA_PROFILES\"/*; do\n"
  3402. " guix package --profile=\"$profile\" --manifest=\"$HOME/.guix-manifests/guix-$profile-manifest.scm\"\n"
  3403. "done\n"
  3404. msgstr ""
  3405. #. type: Plain text
  3406. #: guix-git/doc/guix-cookbook.texi:2646
  3407. msgid "Each profile has its own generations:"
  3408. msgstr ""
  3409. #. type: example
  3410. #: guix-git/doc/guix-cookbook.texi:2649
  3411. #, no-wrap
  3412. msgid "guix package -p \"$GUIX_EXTRA_PROFILES\"/my-project/my-project --list-generations\n"
  3413. msgstr ""
  3414. #. type: Plain text
  3415. #: guix-git/doc/guix-cookbook.texi:2652
  3416. msgid "You can roll-back to any generation of a given profile:"
  3417. msgstr ""
  3418. #. type: example
  3419. #: guix-git/doc/guix-cookbook.texi:2655
  3420. #, no-wrap
  3421. msgid "guix package -p \"$GUIX_EXTRA_PROFILES\"/my-project/my-project --switch-generations=17\n"
  3422. msgstr ""
  3423. #. type: Plain text
  3424. #: guix-git/doc/guix-cookbook.texi:2659
  3425. msgid "Finally, if you want to switch to a profile without inheriting from the current environment, you can activate it from an empty shell:"
  3426. msgstr ""
  3427. #. type: example
  3428. #: guix-git/doc/guix-cookbook.texi:2663
  3429. #, no-wrap
  3430. msgid ""
  3431. "env -i $(which bash) --login --noprofile --norc\n"
  3432. ". my-project/etc/profile\n"
  3433. msgstr ""
  3434. #. type: subsection
  3435. #: guix-git/doc/guix-cookbook.texi:2665 guix-git/doc/guix-cookbook.texi:2666
  3436. #, no-wrap
  3437. msgid "Required packages"
  3438. msgstr ""
  3439. #. type: Plain text
  3440. #: guix-git/doc/guix-cookbook.texi:2671
  3441. msgid "Activating a profile essentially boils down to exporting a bunch of environmental variables. This is the role of the @samp{etc/profile} within the profile."
  3442. msgstr ""
  3443. #. type: emph{#1}
  3444. #: guix-git/doc/guix-cookbook.texi:2674
  3445. msgid "Note: Only the environmental variables of the packages that consume them will be set."
  3446. msgstr ""
  3447. #. type: Plain text
  3448. #: guix-git/doc/guix-cookbook.texi:2678
  3449. msgid "For instance, @samp{MANPATH} won't be set if there is no consumer application for man pages within the profile. So if you need to transparently access man pages once the profile is loaded, you've got two options:"
  3450. msgstr ""
  3451. #. type: itemize
  3452. #: guix-git/doc/guix-cookbook.texi:2682
  3453. msgid "Either export the variable manually, e.g."
  3454. msgstr ""
  3455. #. type: example
  3456. #: guix-git/doc/guix-cookbook.texi:2684
  3457. #, no-wrap
  3458. msgid "export MANPATH=/path/to/profile$@{MANPATH:+:@}$MANPATH\n"
  3459. msgstr ""
  3460. #. type: itemize
  3461. #: guix-git/doc/guix-cookbook.texi:2688
  3462. msgid "Or include @samp{man-db} to the profile manifest."
  3463. msgstr ""
  3464. #. type: Plain text
  3465. #: guix-git/doc/guix-cookbook.texi:2692
  3466. msgid "The same is true for @samp{INFOPATH} (you can install @samp{info-reader}), @samp{PKG_CONFIG_PATH} (install @samp{pkg-config}), etc."
  3467. msgstr ""
  3468. #. type: subsection
  3469. #: guix-git/doc/guix-cookbook.texi:2693 guix-git/doc/guix-cookbook.texi:2694
  3470. #, no-wrap
  3471. msgid "Default profile"
  3472. msgstr ""
  3473. #. type: Plain text
  3474. #: guix-git/doc/guix-cookbook.texi:2697
  3475. msgid "What about the default profile that Guix keeps in @file{~/.guix-profile}?"
  3476. msgstr ""
  3477. #. type: Plain text
  3478. #: guix-git/doc/guix-cookbook.texi:2700
  3479. msgid "You can assign it the role you want. Typically you would install the manifest of the packages you want to use all the time."
  3480. msgstr ""
  3481. #. type: Plain text
  3482. #: guix-git/doc/guix-cookbook.texi:2704
  3483. msgid "Alternatively, you could keep it ``manifest-less'' for throw-away packages that you would just use for a couple of days. This way makes it convenient to run"
  3484. msgstr ""
  3485. #. type: example
  3486. #: guix-git/doc/guix-cookbook.texi:2708
  3487. #, no-wrap
  3488. msgid ""
  3489. "guix install package-foo\n"
  3490. "guix upgrade package-bar\n"
  3491. msgstr ""
  3492. #. type: Plain text
  3493. #: guix-git/doc/guix-cookbook.texi:2711
  3494. msgid "without having to specify the path to a profile."
  3495. msgstr ""
  3496. #. type: subsection
  3497. #: guix-git/doc/guix-cookbook.texi:2712 guix-git/doc/guix-cookbook.texi:2713
  3498. #, no-wrap
  3499. msgid "The benefits of manifests"
  3500. msgstr ""
  3501. #. type: Plain text
  3502. #: guix-git/doc/guix-cookbook.texi:2717
  3503. msgid "Manifests are a convenient way to keep your package lists around and, say, to synchronize them across multiple machines using a version control system."
  3504. msgstr ""
  3505. #. type: Plain text
  3506. #: guix-git/doc/guix-cookbook.texi:2721
  3507. msgid "A common complaint about manifests is that they can be slow to install when they contain large number of packages. This is especially cumbersome when you just want get an upgrade for one package within a big manifest."
  3508. msgstr ""
  3509. #. type: Plain text
  3510. #: guix-git/doc/guix-cookbook.texi:2726
  3511. msgid "This is one more reason to use multiple profiles, which happen to be just perfect to break down manifests into multiple sets of semantically connected packages. Using multiple, small profiles provides more flexibility and usability."
  3512. msgstr ""
  3513. #. type: Plain text
  3514. #: guix-git/doc/guix-cookbook.texi:2728
  3515. msgid "Manifests come with multiple benefits. In particular, they ease maintenance:"
  3516. msgstr ""
  3517. #. type: itemize
  3518. #: guix-git/doc/guix-cookbook.texi:2736
  3519. msgid "When a profile is set up from a manifest, the manifest itself is self-sufficient to keep a ``package listing'' around and reinstall the profile later or on a different system. For ad-hoc profiles, we would need to generate a manifest specification manually and maintain the package versions for the packages that don't use the default version."
  3520. msgstr ""
  3521. #. type: itemize
  3522. #: guix-git/doc/guix-cookbook.texi:2741
  3523. msgid "@code{guix package --upgrade} always tries to update the packages that have propagated inputs, even if there is nothing to do. Guix manifests remove this problem."
  3524. msgstr ""
  3525. #. type: itemize
  3526. #: guix-git/doc/guix-cookbook.texi:2747
  3527. msgid "When partially upgrading a profile, conflicts may arise (due to diverging dependencies between the updated and the non-updated packages) and they can be annoying to resolve manually. Manifests remove this problem altogether since all packages are always upgraded at once."
  3528. msgstr ""
  3529. #. type: itemize
  3530. #: guix-git/doc/guix-cookbook.texi:2753
  3531. msgid "As mentioned above, manifests allow for reproducible profiles, while the imperative @code{guix install}, @code{guix upgrade}, etc. do not, since they produce different profiles every time even when they hold the same packages. See @uref{https://issues.guix.gnu.org/issue/33285, the related discussion on the matter}."
  3532. msgstr ""
  3533. #. type: itemize
  3534. #: guix-git/doc/guix-cookbook.texi:2761
  3535. msgid "Manifest specifications are usable by other @samp{guix} commands. For example, you can run @code{guix weather -m manifest.scm} to see how many substitutes are available, which can help you decide whether you want to try upgrading today or wait a while. Another example: you can run @code{guix pack -m manifest.scm} to create a pack containing all the packages in the manifest (and their transitive references)."
  3536. msgstr ""
  3537. #. type: itemize
  3538. #: guix-git/doc/guix-cookbook.texi:2765
  3539. msgid "Finally, manifests have a Scheme representation, the @samp{<manifest>} record type. They can be manipulated in Scheme and passed to the various Guix @uref{https://en.wikipedia.org/wiki/Api, APIs}."
  3540. msgstr ""
  3541. #. type: Plain text
  3542. #: guix-git/doc/guix-cookbook.texi:2773
  3543. msgid "It's important to understand that while manifests can be used to declare profiles, they are not strictly equivalent: profiles have the side effect that they ``pin'' packages in the store, which prevents them from being garbage-collected (@pxref{Invoking guix gc,,, guix, GNU Guix Reference Manual}) and ensures that they will still be available at any point in the future."
  3544. msgstr ""
  3545. #. type: Plain text
  3546. #: guix-git/doc/guix-cookbook.texi:2775
  3547. msgid "Let's take an example:"
  3548. msgstr ""
  3549. #. type: enumerate
  3550. #: guix-git/doc/guix-cookbook.texi:2781
  3551. msgid "We have an environment for hacking on a project for which there isn't a Guix package yet. We build the environment using a manifest, and then run @code{guix environment -m manifest.scm}. So far so good."
  3552. msgstr ""
  3553. #. type: enumerate
  3554. #: guix-git/doc/guix-cookbook.texi:2787
  3555. msgid "Many weeks pass and we have run a couple of @code{guix pull} in the mean time. Maybe a dependency from our manifest has been updated; or we may have run @code{guix gc} and some packages needed by our manifest have been garbage-collected."
  3556. msgstr ""
  3557. #. type: enumerate
  3558. #: guix-git/doc/guix-cookbook.texi:2792
  3559. msgid "Eventually, we set to work on that project again, so we run @code{guix environment -m manifest.scm}. But now we have to wait for Guix to build and install stuff!"
  3560. msgstr ""
  3561. #. type: Plain text
  3562. #: guix-git/doc/guix-cookbook.texi:2798
  3563. msgid "Ideally, we could spare the rebuild time. And indeed we can, all we need is to install the manifest to a profile and use @code{GUIX_PROFILE=/the/profile; . \"$GUIX_PROFILE\"/etc/profile} as explained above: this guarantees that our hacking environment will be available at all times."
  3564. msgstr ""
  3565. #. type: Plain text
  3566. #: guix-git/doc/guix-cookbook.texi:2801
  3567. msgid "@emph{Security warning:} While keeping old profiles around can be convenient, keep in mind that outdated packages may not have received the latest security fixes."
  3568. msgstr ""
  3569. #. type: subsection
  3570. #: guix-git/doc/guix-cookbook.texi:2802 guix-git/doc/guix-cookbook.texi:2803
  3571. #, no-wrap
  3572. msgid "Reproducible profiles"
  3573. msgstr ""
  3574. #. type: Plain text
  3575. #: guix-git/doc/guix-cookbook.texi:2806
  3576. msgid "To reproduce a profile bit-for-bit, we need two pieces of information:"
  3577. msgstr ""
  3578. #. type: itemize
  3579. #: guix-git/doc/guix-cookbook.texi:2810
  3580. msgid "a manifest,"
  3581. msgstr ""
  3582. #. type: itemize
  3583. #: guix-git/doc/guix-cookbook.texi:2812
  3584. msgid "a Guix channel specification."
  3585. msgstr ""
  3586. #. type: Plain text
  3587. #: guix-git/doc/guix-cookbook.texi:2816
  3588. msgid "Indeed, manifests alone might not be enough: different Guix versions (or different channels) can produce different outputs for a given manifest."
  3589. msgstr ""
  3590. #. type: Plain text
  3591. #: guix-git/doc/guix-cookbook.texi:2820
  3592. msgid "You can output the Guix channel specification with @samp{guix describe --format=channels}. Save this to a file, say @samp{channel-specs.scm}."
  3593. msgstr ""
  3594. #. type: Plain text
  3595. #: guix-git/doc/guix-cookbook.texi:2823
  3596. msgid "On another computer, you can use the channel specification file and the manifest to reproduce the exact same profile:"
  3597. msgstr ""
  3598. #. type: example
  3599. #: guix-git/doc/guix-cookbook.texi:2827
  3600. #, no-wrap
  3601. msgid ""
  3602. "GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles\n"
  3603. "GUIX_EXTRA=$HOME/.guix-extra\n"
  3604. "\n"
  3605. msgstr ""
  3606. #. type: example
  3607. #: guix-git/doc/guix-cookbook.texi:2830
  3608. #, no-wrap
  3609. msgid ""
  3610. "mkdir \"$GUIX_EXTRA\"/my-project\n"
  3611. "guix pull --channels=channel-specs.scm --profile \"$GUIX_EXTRA/my-project/guix\"\n"
  3612. "\n"
  3613. msgstr ""
  3614. #. type: example
  3615. #: guix-git/doc/guix-cookbook.texi:2833
  3616. #, no-wrap
  3617. msgid ""
  3618. "mkdir -p \"$GUIX_EXTRA_PROFILES/my-project\"\n"
  3619. "\"$GUIX_EXTRA\"/my-project/guix/bin/guix package --manifest=/path/to/guix-my-project-manifest.scm --profile=\"$GUIX_EXTRA_PROFILES\"/my-project/my-project\n"
  3620. msgstr ""
  3621. #. type: Plain text
  3622. #: guix-git/doc/guix-cookbook.texi:2837
  3623. msgid "It's safe to delete the Guix channel profile you've just installed with the channel specification, the project profile does not depend on it."
  3624. msgstr ""
  3625. #. type: Plain text
  3626. #: guix-git/doc/guix-cookbook.texi:2844
  3627. msgid "Guix provides multiple tools to manage environment. This chapter demonstrate such utilities."
  3628. msgstr ""
  3629. #. type: section
  3630. #: guix-git/doc/guix-cookbook.texi:2847 guix-git/doc/guix-cookbook.texi:2849
  3631. #: guix-git/doc/guix-cookbook.texi:2850
  3632. #, no-wrap
  3633. msgid "Guix environment via direnv"
  3634. msgstr ""
  3635. #. type: menuentry
  3636. #: guix-git/doc/guix-cookbook.texi:2847
  3637. msgid "Setup Guix environment with direnv"
  3638. msgstr ""
  3639. #. type: Plain text
  3640. #: guix-git/doc/guix-cookbook.texi:2855
  3641. msgid "Guix provides a @samp{direnv} package, which could extend shell after directory change. This tool could be used to prepare a pure Guix environment."
  3642. msgstr ""
  3643. #. type: Plain text
  3644. #: guix-git/doc/guix-cookbook.texi:2861
  3645. msgid "The following example provides a shell function for @file{~/.direnvrc} file, which could be used from Guix Git repository in @file{~/src/guix/.envrc} file to setup a build environment similar to described in @pxref{Building from Git,,, guix, GNU Guix Reference Manual}."
  3646. msgstr ""
  3647. #. type: Plain text
  3648. #: guix-git/doc/guix-cookbook.texi:2863
  3649. msgid "Create a @file{~/.direnvrc} with a Bash code:"
  3650. msgstr ""
  3651. #. type: example
  3652. #: guix-git/doc/guix-cookbook.texi:2881
  3653. #, no-wrap
  3654. msgid ""
  3655. "# Thanks <https://github.com/direnv/direnv/issues/73#issuecomment-152284914>\n"
  3656. "export_function()\n"
  3657. "@{\n"
  3658. " local name=$1\n"
  3659. " local alias_dir=$PWD/.direnv/aliases\n"
  3660. " mkdir -p \"$alias_dir\"\n"
  3661. " PATH_add \"$alias_dir\"\n"
  3662. " local target=\"$alias_dir/$name\"\n"
  3663. " if declare -f \"$name\" >/dev/null; then\n"
  3664. " echo \"#!$SHELL\" > \"$target\"\n"
  3665. " declare -f \"$name\" >> \"$target\" 2>/dev/null\n"
  3666. " # Notice that we add shell variables to the function trigger.\n"
  3667. " echo \"$name \\$*\" >> \"$target\"\n"
  3668. " chmod +x \"$target\"\n"
  3669. " fi\n"
  3670. "@}\n"
  3671. "\n"
  3672. msgstr ""
  3673. #. type: example
  3674. #: guix-git/doc/guix-cookbook.texi:2886
  3675. #, no-wrap
  3676. msgid ""
  3677. "use_guix()\n"
  3678. "@{\n"
  3679. " # Set GitHub token.\n"
  3680. " export GUIX_GITHUB_TOKEN=\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n"
  3681. "\n"
  3682. msgstr ""
  3683. #. type: example
  3684. #: guix-git/doc/guix-cookbook.texi:2889
  3685. #, no-wrap
  3686. msgid ""
  3687. " # Unset 'GUIX_PACKAGE_PATH'.\n"
  3688. " export GUIX_PACKAGE_PATH=\"\"\n"
  3689. "\n"
  3690. msgstr ""
  3691. #. type: example
  3692. #: guix-git/doc/guix-cookbook.texi:2898
  3693. #, no-wrap
  3694. msgid ""
  3695. " # Recreate a garbage collector root.\n"
  3696. " gcroots=\"$HOME/.config/guix/gcroots\"\n"
  3697. " mkdir -p \"$gcroots\"\n"
  3698. " gcroot=\"$gcroots/guix\"\n"
  3699. " if [ -L \"$gcroot\" ]\n"
  3700. " then\n"
  3701. " rm -v \"$gcroot\"\n"
  3702. " fi\n"
  3703. "\n"
  3704. msgstr ""
  3705. #. type: example
  3706. #: guix-git/doc/guix-cookbook.texi:2913
  3707. #, no-wrap
  3708. msgid ""
  3709. " # Miscellaneous packages.\n"
  3710. " PACKAGES_MAINTENANCE=(\n"
  3711. " direnv\n"
  3712. " git\n"
  3713. " git:send-email\n"
  3714. " git-cal\n"
  3715. " gnupg\n"
  3716. " guile-colorized\n"
  3717. " guile-readline\n"
  3718. " less\n"
  3719. " ncurses\n"
  3720. " openssh\n"
  3721. " xdot\n"
  3722. " )\n"
  3723. "\n"
  3724. msgstr ""
  3725. #. type: example
  3726. #: guix-git/doc/guix-cookbook.texi:2916
  3727. #, no-wrap
  3728. msgid ""
  3729. " # Environment packages.\n"
  3730. " PACKAGES=(help2man guile-sqlite3 guile-gcrypt)\n"
  3731. "\n"
  3732. msgstr ""
  3733. #. type: example
  3734. #: guix-git/doc/guix-cookbook.texi:2919
  3735. #, no-wrap
  3736. msgid ""
  3737. " # Thanks <https://lists.gnu.org/archive/html/guix-devel/2016-09/msg00859.html>\n"
  3738. " eval \"$(guix environment --search-paths --root=\"$gcroot\" --pure guix --ad-hoc $@{PACKAGES[@@]@} $@{PACKAGES_MAINTENANCE[@@]@} \"$@@\")\"\n"
  3739. "\n"
  3740. msgstr ""
  3741. #. type: example
  3742. #: guix-git/doc/guix-cookbook.texi:2926
  3743. #, no-wrap
  3744. msgid ""
  3745. " # Predefine configure flags.\n"
  3746. " configure()\n"
  3747. " @{\n"
  3748. " ./configure --localstatedir=/var --prefix=\n"
  3749. " @}\n"
  3750. " export_function configure\n"
  3751. "\n"
  3752. msgstr ""
  3753. #. type: example
  3754. #: guix-git/doc/guix-cookbook.texi:2937
  3755. #, no-wrap
  3756. msgid ""
  3757. " # Run make and optionally build something.\n"
  3758. " build()\n"
  3759. " @{\n"
  3760. " make -j 2\n"
  3761. " if [ $# -gt 0 ]\n"
  3762. " then\n"
  3763. " ./pre-inst-env guix build \"$@@\"\n"
  3764. " fi\n"
  3765. " @}\n"
  3766. " export_function build\n"
  3767. "\n"
  3768. msgstr ""
  3769. #. type: example
  3770. #: guix-git/doc/guix-cookbook.texi:2944
  3771. #, no-wrap
  3772. msgid ""
  3773. " # Predefine push Git command.\n"
  3774. " push()\n"
  3775. " @{\n"
  3776. " git push --set-upstream origin\n"
  3777. " @}\n"
  3778. " export_function push\n"
  3779. "\n"
  3780. msgstr ""
  3781. #. type: example
  3782. #: guix-git/doc/guix-cookbook.texi:2947
  3783. #, no-wrap
  3784. msgid ""
  3785. " clear # Clean up the screen.\n"
  3786. " git-cal --author='Your Name' # Show contributions calendar.\n"
  3787. "\n"
  3788. msgstr ""
  3789. #. type: example
  3790. #: guix-git/doc/guix-cookbook.texi:2955
  3791. #, no-wrap
  3792. msgid ""
  3793. " # Show commands help.\n"
  3794. " echo \"\n"
  3795. "build build a package or just a project if no argument provided\n"
  3796. "configure run ./configure with predefined parameters\n"
  3797. "push push to upstream Git repository\n"
  3798. "\"\n"
  3799. "@}\n"
  3800. msgstr ""
  3801. #. type: Plain text
  3802. #: guix-git/doc/guix-cookbook.texi:2959
  3803. msgid "Every project containing @file{.envrc} with a string @code{use guix} will have predefined environment variables and procedures."
  3804. msgstr ""
  3805. #. type: Plain text
  3806. #: guix-git/doc/guix-cookbook.texi:2961
  3807. msgid "Run @command{direnv allow} to setup the environment for the first time."
  3808. msgstr ""
  3809. #. type: Plain text
  3810. #: guix-git/doc/guix-cookbook.texi:2973
  3811. msgid "Guix is based on the @uref{https://nixos.org/nix/, Nix package manager}, which was designed and implemented by Eelco Dolstra, with contributions from other people (see the @file{nix/AUTHORS} file in Guix.) Nix pioneered functional package management, and promoted unprecedented features, such as transactional package upgrades and rollbacks, per-user profiles, and referentially transparent build processes. Without this work, Guix would not exist."
  3812. msgstr ""
  3813. #. type: Plain text
  3814. #: guix-git/doc/guix-cookbook.texi:2976
  3815. msgid "The Nix-based software distributions, Nixpkgs and NixOS, have also been an inspiration for Guix."
  3816. msgstr ""
  3817. #. type: Plain text
  3818. #: guix-git/doc/guix-cookbook.texi:2982
  3819. msgid "GNU@tie{}Guix itself is a collective work with contributions from a number of people. See the @file{AUTHORS} file in Guix for more information on these fine people. The @file{THANKS} file lists people who have helped by reporting bugs, taking care of the infrastructure, providing artwork and themes, making suggestions, and more---thank you!"
  3820. msgstr ""
  3821. #. type: Plain text
  3822. #: guix-git/doc/guix-cookbook.texi:2985
  3823. msgid "This document includes adapted sections from articles that have previously been published on the Guix blog at @uref{https://guix.gnu.org/blog}."
  3824. msgstr ""
  3825. #. type: cindex
  3826. #: guix-git/doc/guix-cookbook.texi:2990
  3827. #, no-wrap
  3828. msgid "license, GNU Free Documentation License"
  3829. msgstr ""
  3830. #. type: include
  3831. #: guix-git/doc/guix-cookbook.texi:2991
  3832. #, no-wrap
  3833. msgid "fdl-1.3.texi"
  3834. msgstr ""