guix-cookbook.zh_Hans.po 159 KB

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